diff --git a/work-items/open/20260529-010200-tui-composer-cursor-scroll/artifacts/.gitkeep b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/artifacts/.gitkeep similarity index 100% rename from work-items/open/20260529-010200-tui-composer-cursor-scroll/artifacts/.gitkeep rename to work-items/closed/20260529-010200-tui-composer-cursor-scroll/artifacts/.gitkeep diff --git a/work-items/open/20260529-010200-tui-composer-cursor-scroll/item.md b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/item.md similarity index 98% rename from work-items/open/20260529-010200-tui-composer-cursor-scroll/item.md rename to work-items/closed/20260529-010200-tui-composer-cursor-scroll/item.md index 410c7bc4..a1ba1d9b 100644 --- a/work-items/open/20260529-010200-tui-composer-cursor-scroll/item.md +++ b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/item.md @@ -2,12 +2,12 @@ id: 20260529-010200-tui-composer-cursor-scroll slug: tui-composer-cursor-scroll title: Scroll TUI composer around cursor -status: open +status: closed kind: task priority: P2 labels: [tui, input, ux] created_at: 2026-05-29T01:02:00Z -updated_at: 2026-05-29T01:02:00Z +updated_at: 2026-05-29T02:08:04Z assignee: null legacy_ticket: null --- diff --git a/work-items/closed/20260529-010200-tui-composer-cursor-scroll/resolution.md b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/resolution.md new file mode 100644 index 00000000..de5b4037 --- /dev/null +++ b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/resolution.md @@ -0,0 +1,55 @@ +--- +id: 20260529-010200-tui-composer-cursor-scroll +slug: tui-composer-cursor-scroll +title: Scroll TUI composer around cursor +status: closed +kind: task +priority: P2 +labels: [tui, input, ux] +created_at: 2026-05-29T01:02:00Z +updated_at: 2026-05-29T02:08:03Z +assignee: null +legacy_ticket: null +--- + +## Background + +The TUI composer/input area has a fixed visible height. When the input buffer grows beyond the visible area (for example 10+ lines), the rendered text is clipped instead of scrolling to keep the cursor visible. + +This makes editing long messages unreliable: the user can continue typing or moving the cursor, but the relevant lines may be outside the visible area. + +## Requirements + +- Implement cursor-based vertical scrolling for the normal composer input area. +- The visible viewport should follow the cursor line when the input has more lines than the allocated input height. + - Moving the cursor above the viewport scrolls up. + - Moving the cursor below the viewport scrolls down. + - Typing new lines at the bottom keeps the cursor visible. + - Deleting lines clamps the scroll offset to valid bounds. +- Preserve existing input behavior: + - editing operations. + - cursor movement. + - selection/completion behavior for file refs if applicable. + - queued input behavior. + - command mode behavior unless command input shares the same rendering path and needs the same fix. +- The cursor's terminal position should correspond to the visible cursor location after scrolling. +- The implementation should not simply increase composer height or hide conversation content indefinitely. +- Keep visual separators/borders consistent with the existing TUI layout. + +## Acceptance criteria + +- A composer buffer longer than the visible input area renders a window around the cursor instead of clipping from a fixed origin. +- Cursor up/down/page movement updates the composer viewport correctly. +- Inserting/deleting lines keeps viewport bounds valid. +- Existing short single-line and small multi-line input rendering remains unchanged. +- Focused tests cover viewport calculation around cursor position and clamping. +- `cargo fmt --check` +- Relevant TUI focused tests, e.g. `cargo test -p tui input --no-default-features` or equivalent. +- `cargo check -p tui` + +## Out of scope + +- Resizable composer UX redesign. +- Mouse scrolling inside composer. +- Horizontal scrolling/wrapping redesign beyond what is needed to keep current behavior correct. +- Changing command completion behavior; see `20260529-010200-tui-command-completion-apply`. diff --git a/work-items/closed/20260529-010200-tui-composer-cursor-scroll/thread.md b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/thread.md new file mode 100644 index 00000000..01008933 --- /dev/null +++ b/work-items/closed/20260529-010200-tui-composer-cursor-scroll/thread.md @@ -0,0 +1,70 @@ + + +## Created + +Created by tickets.sh create. + +--- + + + +## Closed + +--- +id: 20260529-010200-tui-composer-cursor-scroll +slug: tui-composer-cursor-scroll +title: Scroll TUI composer around cursor +status: closed +kind: task +priority: P2 +labels: [tui, input, ux] +created_at: 2026-05-29T01:02:00Z +updated_at: 2026-05-29T02:08:03Z +assignee: null +legacy_ticket: null +--- + +## Background + +The TUI composer/input area has a fixed visible height. When the input buffer grows beyond the visible area (for example 10+ lines), the rendered text is clipped instead of scrolling to keep the cursor visible. + +This makes editing long messages unreliable: the user can continue typing or moving the cursor, but the relevant lines may be outside the visible area. + +## Requirements + +- Implement cursor-based vertical scrolling for the normal composer input area. +- The visible viewport should follow the cursor line when the input has more lines than the allocated input height. + - Moving the cursor above the viewport scrolls up. + - Moving the cursor below the viewport scrolls down. + - Typing new lines at the bottom keeps the cursor visible. + - Deleting lines clamps the scroll offset to valid bounds. +- Preserve existing input behavior: + - editing operations. + - cursor movement. + - selection/completion behavior for file refs if applicable. + - queued input behavior. + - command mode behavior unless command input shares the same rendering path and needs the same fix. +- The cursor's terminal position should correspond to the visible cursor location after scrolling. +- The implementation should not simply increase composer height or hide conversation content indefinitely. +- Keep visual separators/borders consistent with the existing TUI layout. + +## Acceptance criteria + +- A composer buffer longer than the visible input area renders a window around the cursor instead of clipping from a fixed origin. +- Cursor up/down/page movement updates the composer viewport correctly. +- Inserting/deleting lines keeps viewport bounds valid. +- Existing short single-line and small multi-line input rendering remains unchanged. +- Focused tests cover viewport calculation around cursor position and clamping. +- `cargo fmt --check` +- Relevant TUI focused tests, e.g. `cargo test -p tui input --no-default-features` or equivalent. +- `cargo check -p tui` + +## Out of scope + +- Resizable composer UX redesign. +- Mouse scrolling inside composer. +- Horizontal scrolling/wrapping redesign beyond what is needed to keep current behavior correct. +- Changing command completion behavior; see `20260529-010200-tui-command-completion-apply`. + + +--- diff --git a/work-items/open/20260529-010200-tui-composer-cursor-scroll/thread.md b/work-items/open/20260529-010200-tui-composer-cursor-scroll/thread.md deleted file mode 100644 index a6c179fc..00000000 --- a/work-items/open/20260529-010200-tui-composer-cursor-scroll/thread.md +++ /dev/null @@ -1,7 +0,0 @@ - - -## Created - -Created by tickets.sh create. - ----