hermes-agent/ui-tui/src/app
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
..
slash feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
createGatewayEventHandler.ts fix(tui): auto-recover session on unexpected gateway death (+ persist lifecycle breadcrumbs) (#35893) 2026-05-31 10:36:57 -05:00
createSlashHandler.ts feat(undo): /undo [N] backs up N user turns with prefill + soft-delete 2026-06-01 01:22:38 -07:00
delegationStore.ts feat(tui): subagent spawn observability overlay 2026-04-22 10:38:17 -05:00
gatewayContext.tsx feat: add inline token count etc and fix venv 2026-04-15 10:20:56 -05:00
gatewayRecovery.ts fix(tui): auto-recover session on unexpected gateway death (+ persist lifecycle breadcrumbs) (#35893) 2026-05-31 10:36:57 -05:00
inputSelectionStore.ts fix(tui): mouse + keyboard text selection in the composer (#16732) 2026-04-27 16:43:48 -07:00
interfaces.ts feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
overlayStore.ts feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
scroll.ts fix(tui): refresh scroll height at cached bottom 2026-05-07 05:48:19 -07:00
setupHandoff.ts feat(tui): /model and /setup slash commands with in-place CLI handoff 2026-04-17 10:58:18 -05:00
spawnHistoryStore.ts fix(tui): handle timeout/error subagent statuses in /agents (#26687) 2026-05-15 20:19:02 -05:00
turnController.ts feat: add TUI session orchestrator 2026-05-26 20:51:59 -07:00
turnStore.ts chore(tui): remove dead branch cleanup code 2026-04-26 21:54:24 -05:00
uiStore.ts feat: add TUI session orchestrator 2026-05-26 20:51:59 -07:00
useComposerState.ts fix(cli): restore fallback paste collapse + handle long single-line pastes (#32447) 2026-05-25 23:49:01 -07:00
useConfigSync.ts fix(cli): restore fallback paste collapse + handle long single-line pastes (#32447) 2026-05-25 23:49:01 -07:00
useInputHandlers.ts feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
useLongRunToolCharms.ts chore(tui): clean live progress lint 2026-04-26 15:42:07 -05:00
useMainApp.ts fix(tui): clear selection on right-click copy + group transcript blocks 2026-06-02 22:03:38 -05:00
useSessionLifecycle.ts feat(tui): single /model command + unified Sessions overlay (#37112) 2026-06-01 22:28:36 -04:00
useSubmission.ts fix(tui): always call input.detect_drop for reliable image attachment 2026-04-30 20:25:52 -07:00