Skip to content

feat(chat): collapse the turn change card to one line and list files in compact rows - #253

Merged
GoDiao merged 2 commits into
mainfrom
feat/turn-change-card
Nov 15, 2026
Merged

GoDiao merged 2 commits into
mainfrom
feat/turn-change-card

Conversation

@GoDiao

@GoDiao GoDiao commented Nov 15, 2026

Copy link
Copy Markdown
Owner

What changed

The card that lists a turn's changed files in the conversation (CurrentTurnChangeCard):

  • It starts collapsed to one line: the number of files, the lines added and removed, and the undo button. The undo button works while the card is collapsed. Clicking the line lists the files.
  • File rows are the compact rows the Changes tab uses (row-sm): the file name first, then its folder in the subtle text color. That label is now a shared component, FilePathLabel, used by both places; getPathParts moved from WorkspacePanel.tsx to lib/pathParts.ts and keeps the leading slash of a folder outside the workspace.
  • The frame is rounded-lg border border-border, like the other cards in the conversation column.
  • The subtitle ("Current turn checkpoint" / "Saved turn checkpoint") is removed, with its two i18n keys in both locales.
  • At phone width the undo button shows only its icon and keeps its accessible name.
  • A file's diff no longer shows the diff component's own file header, which repeated the file name already shown in the row above it. Both callers of WorkspaceDiffSurface now hide the header, so its hideFileHeaders option is removed; PierreDiffSurface's hideFileHeader had no caller passing false and is removed too. The header is always off.

Why

For a turn that touched several files the card took most of the screen: it was always expanded and each file was a 44px row with its full path in a mono font. The line under its title used border-b without a color and took the text color. Its frame (rounded-xl with a ring) differed from the other cards beside it.

Not included

The per-file added and removed line counts that the diff's own header showed are no longer visible in the card. The checkpoint only carries the list of paths and the totals, so per-file counts in the rows would need an API change.

How it was tested

  • desktop/src/components/chat/CurrentTurnChangeCard.test.tsx: 10 tests. Eight of them fail on the old component. The test for the file header fails on the commit before the header was removed (run against an export of that commit).
  • desktop/src/lib/pathParts.test.ts: new.
  • desktop/src/components/chat/MessageList.test.tsx: eight existing tests adapted to expand the card before looking for file rows.
  • In desktop: bun run lint passes; bun run test -- --run gives 229 files, 2863 passed, 4 skipped, 0 failed.
  • No server or CLI code changed; bun test was not run on this branch.
  • The maintainer looked at the collapsed card, the expanded list and a file's diff in the dev app on 2026-11-15.
  • Not confirmed in the running app: the dark themes, the Chinese locale and the phone-width (H5) layout. The Chinese labels and the icon-only undo button are covered by tests only.

…in compact rows

The card with a turn's changed files took most of the screen for a turn that
touched several files: it was always expanded, each file was a 44px row with
its full path in a mono font, and its frame differed from the other cards in
the conversation. The line under its title had no border color and took the
text color.

The card is now a Collapsible like the ShowUI card: one line with the number
of files, the lines added and removed and the undo button, which stays usable
while collapsed. Opening it lists the files in the compact rows the Changes
tab uses, with the file name first and its folder in the subtle text color.
That label is now a shared component, FilePathLabel, used by both places, and
getPathParts moved to lib/pathParts. The subtitle is gone, and on a phone the
undo button shows only its icon. The diff of a file opens under its row as
before.
…peated in the turn change card

The row above a diff already names the file. With both callers of WorkspaceDiffSurface hiding the header, the hideFileHeaders option and PierreDiffSurface's hideFileHeader are removed and the header is always off.
@GoDiao
GoDiao merged commit f89ad52 into main Nov 15, 2026
4 checks passed
@GoDiao
GoDiao deleted the feat/turn-change-card branch November 15, 2026 10:42
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