Skip to content

Fix: Token count UI doesn't re-render if it's open.#4822

Merged
katzdave merged 5 commits intomainfrom
dkatz/token-ui
Sep 26, 2025
Merged

Fix: Token count UI doesn't re-render if it's open.#4822
katzdave merged 5 commits intomainfrom
dkatz/token-ui

Conversation

@katzdave
Copy link
Copy Markdown
Contributor

Tracking the key forces re-renders every time the key changes (based on numTokens/limit).

This now works even if you constantly mouse over the UI.

},
compactIcon: <ScrollText size={12} />,
autoCompactThreshold: autoCompactThreshold,
key: `context-${numTokens}-${tokenLimit}`, // Force re-render on token count change
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't strike me as the correct solution, at most a work around? why are we not rerendering this when the numTokens changes? it is in the alert properties. do we do a shallow compare somewhere?

!prevAlert ||
prevAlert.type !== alert.type ||
prevAlert.message !== alert.message ||
prevAlert.key !== alert.key
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I see, the problem is that we don't detect changes in the right way. this should just do a deep compare I think

* 'main' of github.com:block/goose:
  Docs: Add link to Plug & Play video for Reddit MCP (#4852)
  remove only-pr-labels (#4842)
  Update video link in README.md to lowercase goose (#4846)
  chore: fix all warnings in test compilation (#4827)
  fix: linux builds: use gcc 10 in Linux builds (#4841)
  fix: keep one goosed client per BrowswerWindow (#4805)
  add automation for marking and closing stale PRs (#4826)
  chore: turn clippy on for test code (#4817)
  fix: pricing integration test (#4837)
  blog post on subagents vs subrecipes (#4829)
  fix chat button alignment and spacing for attachments (#4794)
  fix: remove nested double quotes in windows automation_script tool description (#4824)
  fix: a few things with the mcp snapshot test (#4818)
  Revert "fix(compaction): try to catch more context limit exceeded erors and compact" (#4820)
@katzdave katzdave merged commit 7451761 into main Sep 26, 2025
11 checks passed
@katzdave katzdave deleted the dkatz/token-ui branch September 26, 2025 18:02
@katzdave katzdave mentioned this pull request Sep 29, 2025
HikaruEgashira pushed a commit to HikaruEgashira/goose that referenced this pull request Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants