Skip to content

fix(web): the Compact chip no longer shows after /clear - #6

Closed
viktorce wants to merge 1 commit into
mainfrom
fix/compact-chip-after-clear
Closed

viktorce wants to merge 1 commit into
mainfrom
fix/compact-chip-after-clear

Conversation

@viktorce

@viktorce viktorce commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Problem

On a Claude thread with at least 200k tokens of context, left idle past its prompt cache, the composer offers to compact before sending. It shows a Compact chip, and Send's tooltip offers to summarize the history first. After /clear, the offer stays, though the next message starts a fresh session that never compacts.

Steps: on a cold Claude thread that shows the chip, type /clear and press Enter. The chip stays.

Change

ChatView.tsx drops resumeCompactionTokens while /clear is armed, as it already does while a handoff is pending. The chip and Send's compaction label and tooltip go away, and dismissing the notice brings them back. Mobile already hides its chip in this state.

Before After
Before: the Compact chip stays next to Send after /clear After: the chip is gone once /clear is armed

The fake test environment now advertises freshContext, as the real server does, so browser tests can arm /clear.

At phone width. Below 640px, an unfocused composer collapses to one row, and its round button expands the composer first when the next send would compact. That button reads resumeCompactionTokens too, so with /clear armed and a message typed, one tap now sends instead of offering a compaction that would never run. Its icon stays the same, and its accessible name changes from "Open composer to compact and send" to "Send message".

Before: one tap After: one tap
Before: with /clear armed, the tap opens the composer and shows the 250k Compact chip After: with /clear armed, the tap sends the prompt

The captures are browser-test renders of the app in dark mode on a fake 250k-token thread, made on 8cf97b5f0. The compaction offer and collapsed-button code they show is unchanged on 475ae52ac. The clips are recordings at 390x844, cropped to the composer, with a marker where the tap lands.

Scope

The chip half of pingdotgg/t3code#31092. pingdotgg/t3code#30325 fixed its compaction half. This covers the armed state, on web and desktop. The armed state lasts while the next message is written, which is when the chip misleads. A typed /clear that hasn't been sent still shows the chip on web and mobile until Enter. Enter there compacts nothing. Hiding it would mean reading the draft text in both composers.

Verification

  • ChatView.handoffCompaction.browser.test.tsx gets a test that arms /clear on a cold Claude thread. It checks that the chip and Send's "Compact and send" name go away, that Send is "Submit message", and that dismissing the notice brings both back. With ChatView.tsx from 475ae52ac, it fails at line 160, with the chip still in the document.
  • The other five browser test files that use the fake environment give 19 passing and one failing test, a ChatView.browser shortcut test that also fails on untouched 475ae52ac when the whole file runs on this Mac, and passes alone and in upstream CI on 475ae52ac. vp run check:changed fails only on that test.
  • Before the rebase, in the dev app on a copy of my data, a Claude thread with 270k tokens idle for a week lost the chip once /clear was armed and got it back once the notice was dismissed.
  • There's no scenario proof, because the replay provider never offers the chip. At 390x844, the capture render also asserted the collapsed button's accessible name, before and after the fix.

Built with Claude Opus 5.5 in Claude Code, running inside T3 Code. Reviewed by Claude Opus 5.5 and GPT-6.1 Sol.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S labels Nov 18, 2026
@viktorce
viktorce force-pushed the fix/compact-chip-after-clear branch 5 times, most recently from 42b8ce8 to c9d7e0a Compare November 19, 2026 00:08
On a Claude thread left idle past its prompt cache, the composer shows a
Compact chip and gives Send the accessible name "Compact and send".
After /clear, the next message starts a fresh session, which never
compacts, yet the chip and that name stayed.

Mobile already hides its chip in this state, and web now does too. The
offer hides until the next message is sent, and comes back if the user
keeps the current session. At phone width, the collapsed composer's
button now sends in this state instead of opening the composer to offer
a compaction. The web fake environment advertises freshContext, as the
real server does, so browser tests can use /clear.
@viktorce

Copy link
Copy Markdown
Owner Author

Opened upstream as pingdotgg#39133, from this same branch.

@viktorce viktorce closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant