Skip to content

Show the session message count in the header - #785

Open
uvforce wants to merge 1 commit into
agegr:mainfrom
uvforce:pr/header-message-count
Open

Show the session message count in the header#785
uvforce wants to merge 1 commit into
agegr:mainfrom
uvforce:pr/header-message-count

Conversation

@uvforce

@uvforce uvforce commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

renderSessionStatsButton gains 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.
  • Full npm test (952), tsc --noEmit, eslint, and next build pass.
  • Verified in a production build with a real browser: after one exchange the header shows the count beside the token and context readouts, and the tooltip reads messages: 2 | in: 7,511 | ....

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T04:45:07.404433Z ec8813f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant