219 files, 2.0 MB, untracked in souveraine/docs and existing nowhere else. The volume is at 100% with no snapshots.
2.3 KiB
| title | status | priority | created | owner |
|---|---|---|---|---|
| TUI message interactions — click-to-copy, click-to-cockpit | scoped | medium | 2026-05-12 | next-instance |
Artifact
When the user clicks (mouse) on a chat message or a tool card, the TUI:
- Copies the message text to the system clipboard (visual confirmation flash on the message).
- If the message has a paired N+1 / reasoning / surfacing entry, scrolls the cockpit panel to that entry and briefly highlights it.
Keyboard parity: y while a message is "hovered" by index does the same copy; Tab + j/k cycles cockpit linkage.
Why now
Already raised in the broad-stroke session (2026-05-12). Casey said: "request to be able to click on a message, copy button / or when click on message that the thinking / subconscious cockpit sections track."
Scope
Three small pieces:
A. Click hit-testing
src/ui/chat.rs::draw_messages already builds lines linearly. To make click work we need to annotate each visible message with a Rect it occupies after scroll. Build a Vec<(MessageId, Rect)> while emitting lines and stash it on ChatState::message_hitboxes. Update on every draw_messages call. ChatMessage gains a stable id: u64 (monotonic).
B. Mouse event plumbing
src/main.rs event loop currently reads crossterm::event::Event::Key. Enable mouse capture (crossterm::execute!(stdout, EnableMouseCapture)) and route Event::Mouse to ChatState::handle_mouse(x, y, kind). On MouseEventKind::Down(Left), look up the hitbox, set selected_message, and trigger the copy.
C. Clipboard + cockpit jump
- Add
arboard = "3"toCargo.toml. The lazy-init pattern: hold anOption<Arboard>onChatState, log-warn on failure (Wayland may needwl-clipboardfallback). - On copy: flash the bubble border for ~600ms (set
flash_until: Instanton the message, fade indraw_messages). - On cockpit jump: every
ChatMessage::Tool,Surfacing, etc. carries an optionalcockpit_anchor: Option<usize>(index intocockpit_log). Clicking scrollscockpit_scrollto that anchor.
Out of scope
- Selection across multiple messages — first cut copies one message at a time.
- Rich clipboard formats (HTML/RTF). Plain text only.
Token plan
Opus to scope the hitbox-as-side-channel design. Sonnet to wire arboard, mouse capture, and the flash animation — all mechanical once the shape is decided.