Fix GPUI inline code pills and enable drag selection in Changelog and Transcript
Summary
Context: In the GPUI desktop app, inline code spans in the Changelog view rendered with wide empty gaps around tokens such as stt-rt-v6 and managed_settings.json and no pill background because monospace font overrides were applied across the surrounding thin-space padding without painting a code background. In addition, neither the Changelog view nor the reading-mode Transcript view wired up mouse-drag text selection or copy shortcuts, leaving their content unselectable.
Intention: Inline code in both Changelog and Chat markdown should render as compact, legible pills in light and dark themes without monospaced padding voids, and users should be able to drag-select and copy text across blocks in Changelog, Chat, and Transcript without breaking link clicks, transcript audio word-seek, speaker pickers, or segment multi-selection.
Direction:
- Extracted a shared
ui::selectable_textmodule with an explicitSelectionStatemachine (Idle,Dragging,Selected) supporting cross-element drag selection, double-click word selection, triple-click block selection,Cmd/Ctrl+Ccopy (stripping synthetic inline-code padding),Cmd/Ctrl+Aselect-all,Escapeclear, I-beam/pointer cursors, and drag-aware click suppression. - Updated inline code rendering in both
workspace::changelogandchat::markdownto use a single proportional-font thin-space pad (\u{2009}, never overridden with monospace) and paint rounded4pxmuted pills with a1pxborder behind text incanvasbefore selection highlights and glyphs, with theme-aware contrast in light and dark modes. - Wired
TextSelectionintoChangelogView(headings, paragraphs, lists, quotes, fenced code blocks, tables, and banners while keeping plain link clicks and the close button working),TranscriptView(cross-word and cross-segment copy in reading mode while preserving single-click audio seek,Shift/Cmd/Ctrlsegment multi-selection, speaker picker clicks,Spaceplayback, and edit mode), andChatView.
Demo
N/A — visual rendering and pointer/keyboard interactions verified with GPUI headless window regression tests; no desktop screen recording attached from this headless implementation pass.
Verification
Local checks run:
cd apps/desktop-gpui && cargo fmt --check— passedcd apps/desktop-gpui && cargo test --locked -p desktop-gpui --lib -- workspace::changelog editor::transcript chat::— passed (57 passed, 0 failed, including new GPUI regression tests for changelog inline-code pill/padding/copy, changelog cross-block drag selection vs. link clicks, and transcript cross-segment drag selection vs. word seek and modifier segment selection)cd apps/desktop-gpui && cargo clippy --locked --workspace --all-targets --no-deps -- -D warnings— passeddprint check --allow-no-files <changed-files>— passedpython3 .github/scripts/test_check_license_boundary.py && python3 .github/scripts/check_license_boundary.py && python3 -m unittest discover -s apps/desktop-gpui/packaging— passed (9/9 + 17/17)node --test ...(ci.yamlsuite) — 88/90 passed; 2 Windows Storedesktop-release-provenance.test.mjscases failed locally due tospawnSync pwsh ENOENT(PowerShell unavailable on macOS host, unrelated to this change)
CI checks are pending on the newly opened PR.
Summary by cubic
Fixes inline code pills in the GPUI Changelog and Chat markdown views, where code spans rendered with wide empty gaps and no pill background, and makes Changelog, Chat, and reading-mode Transcript selectable by mouse drag and keyboard copy.
- Renders code spans with a proportional thin-space pad (instead of a monospace-overridden one) and paints rounded, bordered pill backgrounds with theme-aware contrast; copying strips the synthetic padding.
- Extracts a shared
ui::selectable_textmodule with a selection state machine supporting cross-element drag, double-click word, triple-click block selection,Cmd/Ctrl+C,Cmd/Ctrl+A,Escape, and I-beam/pointer cursors. - Wires selection into all three views without breaking link clicks, transcript audio word-seek, speaker pickers, segment multi-selection, or edit mode.
- Hardens edge cases from review: clears stale painted layouts, scopes fullscreen chat table selection, gates hit-testing to visible bounds, defers single-click activation across the platform's double-click interval, clamps drags below the final block, and preserves literal thin spaces on copy.
- Exposes plain readable changelog text (without synthetic padding) via
Accessible::a11y_textfor screen readers.