Skip to content

feat(tui): add last turn source to diff viewer - #48998

Open
nexxeln wants to merge 1 commit into
v2from
tui-last-turn
Open

nexxeln wants to merge 1 commit into
v2from
tui-last-turn

Conversation

@nexxeln

@nexxeln nexxeln commented Sep 14, 2026

Copy link
Copy Markdown
Member

What

Adds a Last turn source to the TUI diff viewer, backed by the session.diff route from #47821. It shows the files changed since the last prompt (everything between idle markers), alongside the existing All / Committed / Uncommitted VCS sources.

How

  • packages/tui/src/config/index.tsx: diffs.source accepts turn (new DiffSource union over Vcs.Mode).
  • packages/tui/src/feature-plugins/system/diff-viewer.tsx: the source picker offers Last turn only when the viewer was opened from a session. Selecting it calls client.session.diff({ sessionID, context: 12 }) and feeds the result through the same normalizeDiffs path, so empty results and errors reuse the existing states. Turn skips base resolution (needsBase). A remembered or configured turn source outside a session falls back to branch.
  • Docs: services/www/src/docs/content/cli/config.mdx lists the new value.

Tests

packages/tui: test/cli/tui/diff-viewer.test.tsx gains three cases (session.diff request shape, empty/error states, option absent and fallback outside a session); test/config-v2.test.tsx accepts the new value. 113 pass. bun typecheck and prettier clean.

Not live-tested against a model; verified via tests only.

This branch has not been deployed

No deployments
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