Show the session message count in the header - #785
Open
uvforce wants to merge 1 commit into
Open
Conversation
The header reports tokens, cost, and context usage, but not the message count, which is the number that predicts when a session becomes slow to open and switch to: the session file grows with it. Until now it was only visible on the sidebar row, not while reading the conversation. Render it next to the existing readouts with the same compact formatting and tooltip, reusing the context gauge's thresholds and colours: amber past 2,000 messages, red past 5,000. An empty session shows nothing, so a new chat keeps its current header, and the mobile toolbar is untouched.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Problem
The header reports tokens, cost, and context usage, but not how many messages the session holds. That number is the one that predicts a specific problem: the session file grows with it, and past a few thousand messages opening or switching to that session is visibly slower. Today the only way to see it is the sidebar row, which is not visible while reading the conversation.
Change
renderSessionStatsButtongains a message count next to the existing token and context readouts, using the same compact formatting (1.2k,3.4M) and the tooltip already assembled there.It reuses the thresholds and colours of the context gauge: muted by default, amber past 2,000 messages, red past 5,000. Nothing is shown for an empty session, so a new chat keeps exactly the header it has today. The mobile toolbar is unchanged.
Tests
components/AppShell.session-stats.test.mjs— the count renders only for a non-empty session, joins the tooltip, and shares the warning thresholds with the context gauge.npm test(952),tsc --noEmit,eslint, andnext buildpass.messages: 2 | in: 7,511 | ....