The TUI sidebar should show a compact, current-session summary of files changed by successful file mutation tool calls. Users should be able to see which files the agent touched and the accumulated addition/deletion counts without scrolling back through the transcript.
The sidebar should also let users collapse the modified-files and API sections independently so long-running sessions can reclaim vertical space.
- The modified-file summary is a live TUI projection derived from
tool_call_result.payload.result.display. - Only safe
file_diffdisplay payloads are counted. The TUI must not parse model-visible tool result text, inspect tool internals, call git, or read the filesystem to produce this summary. - File paths are formatted with the same workspace-relative display helper used by tool transcript paths.
- Counts are accumulated per display path for the current TUI session.
- If a session reset or resume result clears the session projection, the modified-file summary and duplicate tool-call guard are cleared too.
- Duplicate result events for the same
toolCallIdmust not double count a file change.
- The sidebar includes a
Modified Filessection afterRun. - Section titles are still sourced from localized copy. In Chinese UI the
modified-files title remains
变更文件; only the marker changes. - When expanded, each row shows a truncated path plus
+Nadditions and-Ndeletions aligned to the right. - Additions use the existing accent color. Deletions use the existing danger color. Paths use muted text.
- Empty expanded state renders a short muted placeholder.
- The list is bounded; if more files were modified than fit the sidebar slice,
a muted
morerow shows the remaining count. - The existing
APIssection keeps its current rows when expanded. - Collapsed sections render only their header.
- Collapsible section headers use a filled triangle marker:
▼when expanded and▶when collapsed. - The header label uses the normal sidebar text color and bold weight so it reads as an interactive row rather than a diagnostic counter.
Ctrl+Xkeeps the sidebar leader behavior.Ctrl+X Btoggles the whole sidebar.Ctrl+X Mtoggles theModified Filessection.Ctrl+X Atoggles theAPIssection.- Section expansion state is local TUI presentation state. It is not persisted and does not affect runtime, session, tool, ZCode app-server, storage, permission, or provider contracts.
- Clicking the
Modified Filessection header toggles only that section. - Clicking the developer-mode
APIssection header toggles only that section. - Sidebar section clicks stop event propagation so they do not trigger the app shell mouse handler that returns focus to the prompt input.
- TUI event tests cover aggregation from
file_diffdisplay payloads, workspace-relative paths, and duplicatetoolCallIdsuppression. - Sidebar component tests cover expanded and collapsed modified-file/API
rendering, count colors, empty state, and bounded
morerows. - Sidebar component tests cover section header click handlers.
- Shortcut tests cover
Ctrl+X MandCtrl+X Ain addition to the existing sidebar toggle path.