mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8711
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8625
Author: @SpicyMarinara
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/preset-tokens-8583📝 Commits (1)
082bda3feat(presets): show each section's estimated tokens, and the static preset's total📊 Changes
5 files changed (+184 additions, -0 deletions)
View changed files
📝
packages/client/src/components/presets/PresetEditor.tsx(+46 -0)➕
packages/client/src/lib/preset-section-tokens.ts(+45 -0)📝
packages/client/src/localization/locales/en.json(+4 -0)➕
scripts/regressions/preset-section-tokens.regression.ts(+88 -0)📝
scripts/regressions/tsconfig.client-lanes.json(+1 -0)📄 Description
Closes #8583
Why this change
The Preset Editor showed a token estimate only inside an expanded section's text editor. The collapsed rows had no count and the Sections panel had no total, so the static cost of a modular preset could only be understood by opening every section and adding estimates up by hand. This shows the cost where the sections are: one number per row, one always-visible total.
What changed
One estimator for everything (
packages/client/src/lib/preset-section-tokens.ts)estimateTextTokens), so a collapsed row and its expanded editor can never disagree, and no model call or tokenizer is involved.The total is the enabled static preset (header chip next to Add Section and Groups)
Localization: four new keys in the canonical English catalog (
dynamic,dynamicSectionDescription,enabledStaticPresetValue1Tokens,enabledStaticPresetValue1TokensDescription). No other locale is touched; they fall back to English.Validation
scripts/regressions/preset-section-tokens.regression.ts(added totsconfig.client-lanes.json): pins the marker rule for every marker kind, both storage spellings ofenabled/isMarker(a string"false"is not truthy), the empty and not-yet-fetched cases, and that the total is a pure sum — duplicating adds exactly its own estimate, editing recalculates without a cached total, reordering cannot change it, disabling drops exactly that section's share.prettier --checkpasses on all changed files.Test plan
~N tokenswithout expanding it.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.