feat(ui): add frontend-only live prompt token counter - #9477
Open
AkhileshDasari wants to merge 5 commits into
Open
feat(ui): add frontend-only live prompt token counter#9477AkhileshDasari wants to merge 5 commits into
AkhileshDasari wants to merge 5 commits into
Conversation
…pecial token counts, and threshold limit flags.
AkhileshDasari
requested review from
JPPhoto,
Pfannkuchensack,
blessedcoolant,
dunkeroni and
lstein
as code owners
August 7, 2026 15:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a live, frontend-only prompt token counter for the positive and negative prompt inputs in the linear UI.
Mapand executed asynchronously with 300ms debouncing.shouldShowTokenCounter) with state migration, accessible via a user toggle in Settings -> Prompt.<PromptTokenCounter />overlay component inParamPositivePrompt.tsxandParamNegativePrompt.tsxdisplayingTokens: X / Ywith visual warning states (yellow when approaching limit, red when exceeding).Related Issues / Discussions
Closes #9247
QA Instructions
Tokens: X / Ydisplay in the top right of the prompt box updating live with a ~300ms debounce.Merge Plan
Standard merge. All 1,718 unit tests passed cleanly with 0 TypeScript compiler errors and 0 ESLint warnings.
Checklist
feat(frontend): add live frontend-only prompt token counter)features/prompt/tokenCounter/tokenizers.test.ts)systemSlice.tsstate migration check forshouldShowTokenCounter)What's Newcopy (if doing a release after this PR)