hermes-agent/ui-tui/src/components
Brooklyn Nicholson dfba3f3e51 fix(tui): clear selection on right-click copy + group transcript blocks
Two TUI polish fixes.

(1) Right-click copy now clears the highlight.
The right-click handler copied an active selection via onCopySelectionNoClear
(the copy-on-select variant that keeps the highlight during a drag) and never
cleared it, so after right-click-to-copy the selection stayed lit with no
confirmation and a follow-up right-click re-copied the stale range instead of
pasting. A successful right-click copy now clears the selection and notifies;
if the copy fails (no clipboard path) the highlight survives and we fall back
to the right-click paste handler, exactly as before.

(2) Group transcript blocks so boundaries read clearly.
Model replies, reasoning/tool trails, and system/error notes rendered with no
vertical separation, so distinct block types butted together and were hard to
scan. Group adjacent blocks by kind: one blank line opens only where the visual
group changes (model prose <-> reasoning/tool trails <-> notes), while a run of
same-kind blocks renders flush. The rule lives in domain/blockLayout.ts
(messageGroup + hasLeadGap) and is applied intrinsically in MessageLine via a
`prev` prop, which fixes the things ad-hoc per-block margins kept breaking:

  - Streaming stability: the gap is derived from the stable predecessor, never
    the live block's own changing text, so the actively-streaming reply computes
    the same gap while it streams as the settled segment does once it flushes.
    No reflow/jump.
  - Transparent empty trails: a trail hidden by /details, or one carrying only a
    token tally (the finalDetails segment message.complete appends), renders
    nothing and is transparent to grouping (prevRenderedMsg skips it), so there
    are no floating gaps, no doubled gap after a prompt, and no padded space
    above the final reply. In the default/collapsed modes content-bearing trails
    always render, so the grouping is a no-op there.

The virtual-height estimator counts the group-boundary line so scroll math
stays accurate before Yoga remeasures.

ui-tui/src/domain/blockLayout.ts (new), components/messageLine.tsx,
components/streamingAssistant.tsx, components/appLayout.tsx,
lib/virtualHeights.ts, app/useMainApp.ts.

Tests: blockLayout.test.ts (grouping + hidden/empty-trail visibility),
virtualHeights leadGap, app-mouse.test.ts copy behavior. Full ui-tui suite
green apart from 3 pre-existing local/env failures (cursorDrift, ink-resize,
virtualHeights user-prompt-width) unchanged from main.
2026-06-02 22:03:38 -05:00
..
activeSessionSwitcher.tsx feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
agentsOverlay.tsx fix(tui): handle timeout/error subagent statuses in /agents (#26687) 2026-05-15 20:19:02 -05:00
appChrome.tsx fix(tui): pass indicatorStyle into FaceTicker so render matches reservation 2026-06-01 21:02:32 -05:00
appLayout.tsx fix(tui): clear selection on right-click copy + group transcript blocks 2026-06-02 22:03:38 -05:00
appOverlays.tsx feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
branding.tsx feat(tui): responsive banner tiers 2026-05-23 17:37:51 -05:00
fpsOverlay.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
helpHint.tsx feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
markdown.tsx fix(tui): preserve dunder identifiers in markdown 2026-05-19 00:06:08 -07:00
maskedPrompt.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
messageLine.tsx fix(tui): clear selection on right-click copy + group transcript blocks 2026-06-02 22:03:38 -05:00
modelPicker.tsx feat: fuzzy search for the model picker (WebUI + TUI) 2026-06-01 16:58:58 -07:00
overlayControls.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
prompts.tsx fix(tui): allow transcript scroll + Esc during approval/clarify/confirm prompts (#26414) 2026-05-15 21:59:28 -05:00
queuedMessages.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
skillsHub.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00
streamingAssistant.tsx fix(tui): clear selection on right-click copy + group transcript blocks 2026-06-02 22:03:38 -05:00
streamingMarkdown.tsx fix(tui): width-aware markdown table rendering with vertical fallback (#26195) 2026-05-15 20:25:56 -05:00
textInput.tsx fix: preserve Ctrl+J newlines in Ghostty 2026-05-28 23:30:39 -07:00
themed.tsx refactor(tui): /clean pass across ui-tui — 49 files, −217 LOC 2026-04-16 22:32:53 -05:00
thinking.tsx fix: surface /agents nudge while delegate_task is in-flight (TUI + CLI) 2026-05-30 13:22:45 +05:30
todoPanel.tsx fix(tui): restore macOS copy behavior and theme polish (#17131) 2026-04-28 18:47:14 -05:00