Skip to content

fix(clients): collapsed turns show one context-compacted divider - #34177

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
binjamshid:fix/collapsed-turn-compaction-dividers
Nov 11, 2026
Merged

juliusmarminge merged 1 commit into
pingdotgg:mainfrom
binjamshid:fix/collapsed-turn-compaction-dividers

Conversation

@binjamshid

Copy link
Copy Markdown
Contributor

Problem

When a finished turn that compacted context more than once is collapsed, every "Context compacted" divider stays visible, stacked directly under "Worked for". They look like one line shown twice, while expanded they sit far apart among the tool calls.

Change

A collapsed turn keeps only its most recent compaction divider visible, so it still shows that context was compacted (the reason 2797dbb kept dividers out of the fold). Earlier dividers fold with the rest of the turn's work and reappear in place when it is expanded. Turns with one compaction are unchanged.

Mobile has its own copy of the fold logic (threadActivity.ts) with the same skip, so it gets the same change. packages/client-runtime has no turn-fold logic.

Scope and approval

Bug fix for #33825. Logic-only change in the two fold functions.

Verification

  • Web: new case next to "keeps a completed compaction divider visible while other settled work folds" in MessagesTimeline.logic.test.ts. Two compactions in one turn: collapsed shows one fold row and only the second divider; expanded shows both in order. It failed on main (both dividers visible) and passes now (96 tests).
  • Mobile: matching case in threadActivity.test.ts; failed on main with [100000, 90000], passes now (49 tests). The two clients have separate fold implementations, so each has its own case.
  • vp run check:changed origin/main: format, lint, knip, typecheck, tests and React compiler checks pass.
  • Not yet checked: a real web or mobile client. Before/after captures to follow.

Fixes #33825

A finished turn that compacted more than once kept every compaction divider visible when folded, stacked under the Worked for row and reading as one duplicated line. A folded turn now keeps only its latest divider; earlier ones fold with the turn's other work and reappear in place when expanded. Single-compaction turns are unchanged.

Fixes pingdotgg#33825
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 11, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at cfd1c95

Macroscope's review found this PR approvable — Collapsed turns on web and mobile retain the latest context-compaction divider while folding earlier ones into existing hidden activity. The change is presentation-only and leaves conversation data and compaction behavior unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Collapsed mobile and web turns now keep the latest compaction divider visible and fold earlier dividers. Regression tests check that collapsed turns show only the latest divider and expanded turns show both.

Changes: Compaction folding

Layer / File(s) Summary
Preserve the latest compaction
apps/mobile/src/lib/threadActivity.ts, apps/mobile/src/lib/threadActivity.test.ts, apps/web/src/components/chat/MessagesTimeline.logic.ts, apps/web/src/components/chat/MessagesTimeline.logic.test.ts
Mobile and web folding logic leaves the latest compaction visible and allows earlier compactions to fold. Tests cover collapsed and expanded turns.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#21597: Establishes compaction folding behavior that this change updates for collapsed turns.
  • pingdotgg/t3code#24692: Changes fold structure for activity and checkpoint entries, including compaction presentation.

Suggested labels: bugfix, size:XS

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to cfd1c

No actionable issue is established for the collapsed-turn behavior. The change is mergeable after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: collapsed turns now show one context-compacted divider.
Description check Passed The description includes Problem, Change, Scope and approval, and Verification sections. It explains the expected behavior, linked issue, implementation scope, regression tests, reported results, and …
Linked Issues check Passed Issue #33825 requires the collapsed view of a completed turn with two compactions to avoid stacking both dividers. The web and mobile fold functions now keep only the latest compaction visible and fol…
Out of Scope Changes check Passed The changes stay within the issue scope. They modify only the web and mobile turn-fold logic and add regression tests for the reported behavior. The mobile change addresses its separate implementation…
Full details: Description check

Explanation

The description includes Problem, Change, Scope and approval, and Verification sections. It explains the expected behavior, linked issue, implementation scope, regression tests, reported results, and unchecked real-client validation. Before/after captures are still pending, but the description is otherwise complete and focused.

Full details: Linked Issues check

Explanation

Issue #33825 requires the collapsed view of a completed turn with two compactions to avoid stacking both dividers. The web and mobile fold functions now keep only the latest compaction visible and fold earlier compactions. The new web and mobile tests verify one visible divider when collapsed and both dividers in order when expanded. The tests also verify that settled work remains folded.

Full details: Out of Scope Changes check

Explanation

The changes stay within the issue scope. They modify only the web and mobile turn-fold logic and add regression tests for the reported behavior. The mobile change addresses its separate implementation of the same fold behavior. No unrelated product behavior or files changed.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 631ea1b and cfd1c95.

Files selected for processing: 4

  • apps/mobile/src/lib/threadActivity.test.ts
  • apps/mobile/src/lib/threadActivity.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.test.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Run the same synthetic turn on both commits: three reads with two completed context compactions interleaved. Once finished, expand Worked for and collapse it again. Base shows two stacked dividers while collapsed; head shows one. Expansion restores both dividers between reads 1/2 and 2/3 on all four clients.

Environments: Chromium web 1280×800 CSS; Linux Electron 1100×780; iPhone 18 Pro / iOS 27.2 native client (402×874 captures); Pixel 9 / Android API 36 native client (1080×2424 captures). Light theme, separate fresh databases, identical replay fixture; each native client loads its commit’s Metro bundle. All stills passed a pixel-identical second capture at least 500 ms later.

State Before After
Commit ed52af3a47 cfd1c9544c
Web collapsed Before: Web collapsed After: Web collapsed
Web expanded Before: Web expanded After: Web expanded
Electron collapsed Before: Electron collapsed After: Electron collapsed
Electron expanded Before: Electron expanded After: Electron expanded
iOS collapsed Before: iOS collapsed After: iOS collapsed
iOS expanded Before: iOS expanded After: iOS expanded
Android collapsed Before: Android collapsed After: Android collapsed
Android expanded Before: Android expanded After: Android expanded

Recordings show collapsed → expanded → collapsed:

Client Before After
Web Before recording After recording
Electron Before recording After recording
iOS Before recording After recording
Android Before recording After recording

Drivers: synthetic seed, native thread opener, native recording driver, attempted scenario, scenario replay fixture. The scenario runner did not produce a successful paired proof; the evidence above is the manual comparison.

Sanitized runtime logs.

AI-assisted; verified with the tests and tools listed above.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Verified in a real dev environment

Head cfd1c95, web client on Linux (Chrome via Playwright), real Claude provider (claude-haiku-5-5), no fixtures.

  • Set Claude's "Auto-compact after" to 100,000 in Settings > Providers, added a local git repo as a project, and ran real turns that read large files in chunks.
  • Turn 1 compacted once. Turn 2 compacted four times (69.4K, 69.7K, 68.6K, 68.1K) and finished.
  • Same database on both builds: created on main, then copied into the PR worktree's dev state.

main: the collapsed turn shows all four "Context compacted" dividers stacked under "Worked for 2m 41s".

main: collapsed turn shows four stacked Context compacted dividers

main: expanding and collapsing the turn, four dividers stay stacked while collapsed

PR: the collapsed turn shows only the latest divider (68.1K -> 7.50K). Expanding restores all four in place between the reads. Collapsing again goes back to one.

PR: collapsed turn shows only the latest Context compacted divider

PR: expanded turn shows each divider in its original place among the reads

PR: collapse, expand, collapse the four-compaction turn

Nearby behavior on the PR build:

  • The single-compaction turn still shows its divider while collapsed (73.9K -> 21.2K), same as main.
  • A new real Claude turn (one Bash call) on the PR server ran, finished, and folded normally; the earlier turns kept their folds.

PR: single-compaction turn keeps its divider while collapsed

CI on cfd1c95: 23 checks pass, 9 skipped.

Not verified

  • Mobile (apps/mobile/src/lib/threadActivity.ts): no iOS or Android client on this Linux VM, so the native fold was not exercised. Only covered by the PR's unit test.
  • Desktop (Electron) was not launched; it renders the same web timeline.
  • Compaction from providers other than Claude was not run.

@juliusmarminge
juliusmarminge merged commit ddc3cef into pingdotgg:main Nov 11, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapsed "Worked for" turn stacks its "Context compacted" dividers out of place

3 participants