Commit Graph
8 Commits
Author SHA1 Message Date
Eric Traut 57567b8d9e Use shared, keymap-aware tips in the fullscreen composer (#46931)
## Why

Fullscreen composer hints used a small, fixed rotation, while catalog shortcut tips hard-coded default bindings. Tips should reflect the user's configured shortcuts and expose the shared catalog with working links.

## What changed

- Select complete, single-row catalog tips that fit the composer gap, keeping selection stable across redraws and varying it across sessions and turns.
- Prefer eligible startup announcements until a user turn begins, without restoring them after history is cleared. Cache parsed announcements while reevaluating eligibility.
- Resolve `{key:context.action}` placeholders using current primary shortcuts and chords; skip tips with invalid or unbound actions.
- Expand the tip catalog and share Markdown rendering between composer and session tips, preserving hyperlinks and supporting Ctrl/Super-click in the composer gap.
- Keep usage notices and interaction controls ahead of tips, and respect `show_tooltips` and idle, empty input.

## Testing

Add tests and snapshots for remapped shortcuts, unbound actions, stable tip selection, announcement dismissal, narrow layouts, styled links, and removal of stale link targets.

GitOrigin-RevId: 64751293d9f91e4444b112361540a73234f1d51d
2026-09-21 03:02:45 +00:00
Eric Traut 551844b3ef Add compact transcript browsing and prompt navigation to the TUI (#46739)
## What changed

- Make double `Esc` enter compact prompt browsing in the owned transcript view and inline overlay. Use left/right arrows to select prompts, up/down arrows to scroll, `Ctrl+T` to toggle details, and `Enter` to rewind and edit. `Esc` cancels browsing and restores the original reading position and presentation.
- Add a responsive browsing footer, a pinned prompt header for answer context, and contextual composer tips that respect `show_tooltips` and configured shortcuts.
- Load older history as prompt navigation needs it, preserve the selected prompt across pagination, and resolve rewind requests by cell identity. Reject remote prompt restoration when it contains local image paths or command syntax.
- Bound initial owned-transcript history loading to a budget of three screenfuls plus an item scan limit, independently of terminal scrollback settings.

## Testing

Add regression tests and snapshots for browsing, rewind, cancellation after resize and pagination, custom key bindings, search and selection precedence, offline input, prompt headers, composer tips, and history hydration.

GitOrigin-RevId: 1d9ef7b627f47c3def43e7aee7148b5909f6d357
2026-09-20 00:34:38 +00:00
Eric Traut df7f717c85 Add transcript search and per-activity detail controls (#46734)
## What changed

- Add incremental, case-insensitive literal search across transcript details, loading older history as needed. Use `F3` to start Find, or `/` in the transcript pager, and navigate matches in either direction. Closing Find restores the previous presentation and reading position.
- Add clickable activity detail controls and `F4` keyboard focus for inspecting individual activity groups in the owned transcript. Preserve expansion state as live activity becomes history.
- Expose configurable `global.find_transcript`, `global.focus_activity`, and `pager.find` bindings under `tui.keymap`. Let new defaults yield to existing custom bindings and show available completions for pending chords.

## Testing

Add regression coverage for Unicode matching, bounded scanning, paginated and changing history, selection during search, composer input isolation, activity controls, and custom shortcut conflicts.

GitOrigin-RevId: 5bcbcdfbca7c5c296c635ec9b079ccd7a908e336
2026-09-20 00:06:25 +00:00
Eric Traut f1feda2299 Integrate the interactive transcript into the alternate-screen TUI (#46733)
## What changed

- Render transcript history and live output above the composer when `features.transcript_v2` is enabled and alternate-screen rendering is available. Handle scrolling, selection, copying, links, and older-history pagination in the main view.
- Add a clickable return-to-latest control with new-activity hints and temporary clipboard status. Let plain Enter return to latest when the composer is empty.
- Reflow retained transcript content during drawing and preserve the launch-selected screen mode across configuration reloads and session transitions, including `--no-alt-screen` restrictions.
- Enter the alternate screen with its first synchronized frame, and box CLI startup futures to reduce stack usage during session transitions.

## Testing

Add regression coverage for transcript layout, input routing, follow controls, clipboard status, and screen-mode persistence. Add a PTY test for the first alternate-screen frame and clean exit, and extend session-transition coverage through the CLI dispatcher.

GitOrigin-RevId: 1daf077826c7744b0f57399d10d159923dc87a97
2026-09-20 00:06:00 +00:00
Eric Traut d7d9f2b9b5 Add selection and copying to the transcript viewer (#46732)
## What changed

- Add mouse selection, word and line selection, drag autoscrolling, and keyboard selection with `Ctrl+Space`. Support copying selected text and opening links with a modified click.
- Anchor reading positions and selections to source text so resizing, streaming completion, and history pagination preserve the displayed content. Preserve hard line breaks, indentation, tabs, and graphemes when copying, while excluding display gutters and soft wraps.
- Rejoin activity groups split across history pages while retaining the reader's displayed revision.
- Distinguish confirmed clipboard writes from unconfirmed terminal requests, and retain native clipboard ownership after the transcript overlay closes.
- Manage mouse capture and keyboard modes across overlay transitions, editor handoffs, and suspend/resume.

## Testing

Add regression tests for selection during live updates and pagination, source-text copying across resize, clipboard confirmation and lifetime, and terminal mode restoration.

GitOrigin-RevId: 6b2438f576567cbba755b2405915a25acf009b8d
2026-09-20 00:04:04 +00:00
Eric Traut 392f56a611 Cancel pending transcript Home jumps on subsequent navigation (#46722)
## Why

Pressing `Home` while older transcript history is loading leaves a pending jump to the beginning. Subsequent navigation should supersede that jump so arriving history does not override the user's new reading position.

## What changed

Cancel the pending jump when scrolling, jumping to the latest entry, or navigating prompts in the read-only transcript viewer. Keep the in-flight history page by switching from `LoadingBeginning` to `LoadingOlder`. Handle navigation before the first draw as well as after rendering, while preserving pending jumps during passive highlight restoration.

## Testing

Add regression coverage for navigation after `Home` before and after the first draw, checking that arriving older history preserves the expected viewport. Extend prompt backtracking tests to verify that navigation clears the pending jump.

GitOrigin-RevId: 438c3289afee2719655b11dbc43a3ccb006a5fa3
2026-09-19 21:44:00 +00:00
Eric Traut a63ae005d4 Anchor transcript scrolling to entries and bound viewport rendering (#46721)
## Why

Transcript-wide row offsets depend on content that can change during pagination, streaming, and resizing. Computing an exact scroll percentage also requires laying out offscreen history.

## What changed

- Replace the transcript overlay's generic pager with `TranscriptView`, tracking entry identity and a display-row offset through history updates and stream consolidation. Clamp offsets within the entry on resize or replacement.
- Render through bounded layout caches and show `100%` only when following the latest output with no unloaded history.
- Keep the reading position while `Home` loads older pages, then jump to the beginning when loading completes.
- Refresh animations whenever live output is visible, including while scrolled up.
- Reveal selected prompts when backtracking and highlight their text without reversing gutters or padding.

## Testing

Add regression coverage for reading anchors across pagination and live-output completion, resize and consolidation, prompt visibility and highlighting, navigation before the first draw, and avoiding offscreen formatting for the percentage indicator.

GitOrigin-RevId: 105cb66f93c742ee537152419060a87f55896b44
2026-09-19 21:43:37 +00:00
Eric Traut 30ab0ee65b Cache transcript layouts across measurement and rendering (#46720)
## Why

The transcript overlay separately generated cell content for height measurement and rendering. Active cells backed by external state could also leave the live tail stale when their revision key did not change.

## What changed

- Share retained text layouts between measurement and painting, and render only visible rows while preserving wrapping, styles, and hyperlinks.
- Reuse stable layouts across frames, invalidating them when width, animation, syntax theme, or terminal colors change. Bound retention by entry count and text size, allowing a single oversized entry.
- Refresh externally mutable cells each frame and bypass live-tail reuse when any active source is not cacheable.

## Testing

Add coverage for layout reuse, eviction, invalidation, and live-tail refresh without a revision change. Expand the transcript snapshot to cover styled text, wide glyphs, wrapping, and hyperlinks.

GitOrigin-RevId: 7dfb737e762f7f056a38774d956f618090809a62
2026-09-19 21:43:15 +00:00