11 KiB
Port Hex's Desktop UI From GPUI To Rune
Status: Done on rune-ui: Rune is Hex's only UI toolkit and GPUI is
deleted. Every surface runs on Rune: the Linux single-process window and HUD,
the Windows tray app and HUD, the macOS menu-bar app with its meeting capsules,
every pane (Settings, Modes, Voice Action, History, Commands, Meetings, Fun,
Activity, HUD Lab), the onboarding tour, and the transcription picker. The
macOS dictation HUD stays a native Metal NSPanel (dictation_indicator.rs,
with spring.rs for its springs). Rune, rune-kit, and
rune-theme-opencode are pinned to a commit on Rune's public MIT main
(https://github.com/anomalyco/rune.git; see
rune-dependency.md and
single-process.md). Do not merge to main until a
person has checked the real-window list on each OS:
Linux ran in a real session, macOS was compiled, tested, and launched headless
over SSH, and Windows was cross-compiled.
Design Direction
The Rune front end uses OpenCode's design language through Rune's component
library (../design-system.md):
- Controls come from
rune-kit(Button,IconButton,Switch,SegmentedControl,Select,Menu,Popover,TextInput,TextArea,Badge,Progress, …). - Every colour, elevation, radius, type style, and motion token comes from
rune_theme_opencode::kit(dark). - The window follows OpenCode Desktop's layout: a deep-background sidebar and a raised, rounded content panel, following the system light/dark appearance.
desktop_i18n::tests::every_translated_string_has_every_languagescanssrc/rune_ui.rsand every pane and host module so all user-facing copy ships in every supported language.
Module Structure
src/rune_ui.rs app spec, shared state, host bridge, poll,
drafts, shell (sidebar + panel), --snap scenes
src/rune_ui/controls.rs cards, rows, switches, segmented, selects,
buttons, keycaps, notes, text fields, Highlight
src/rune_ui/lists.rs split list/detail, rows, group labels, tags,
permission control, small_button, slider
src/rune_ui/platform.rs Capabilities, PlatformState, PlatformRequest,
NativeHost / Fixture seam
src/rune_ui/platform_settings.rs macOS and Windows Settings sections and rows
src/rune_ui/settings.rs Settings pane and shortcut recorder
src/rune_ui/modes.rs Modes pane (rules, corrections, OpenCode, transformations)
src/rune_ui/voice_action.rs Voice Action pane
src/rune_ui/models.rs OpenCode catalog, model and thinking pickers
src/rune_ui/history.rs History pane
src/rune_ui/picker.rs Transcription language/model picker modal
src/rune_ui/onboarding.rs First-run setup tour across all platforms
src/rune_ui/commands.rs Commands pane (macOS)
src/rune_ui/meetings.rs Meetings pane (macOS)
src/rune_ui/meeting_capsules.rs Offer, call-ended, recording, and ready capsules (macOS)
src/rune_ui/fun.rs Experimental Hex Microphone / Fun pane (macOS)
src/rune_ui/hud_lab.rs Developer HUD Lab pane (macOS debug)
src/rune_ui/activity.rs Developer Activity pane (debug)
src/rune_ui/linux_host.rs In-process Linux host bridge
src/rune_ui/windows_host.rs In-process Windows host bridge and keyboard-poll capture
src/rune_ui/macos_host.rs In-process macOS host bridge, NativeHost, and chord monitor
src/rune_ui/tests.rs Headless Linux UI tests and goldens
src/rune_ui/tests/panes.rs macOS and Windows surface tests and goldens
Surfaces And Goldens
| Surface | Status | Goldens (tests/golden/rune-*.png) |
|---|---|---|
| Shell & Settings (Linux) | Sidebar navigation, status card, desktop shortcuts (X11 / portal / commands), dictation, behavior, application rows, Quit Hex, Update button when ready | rune-portal-{light,dark}, rune-commands-dark, rune-disabled-light, rune-capturing-dark, rune-chinese-dark, rune-menus-light |
| Voice Action | Opt-in with shortcut conflict check, recorder, searchable OpenCode model and thinking pickers, missing/unavailable OpenCode notice | rune-voice-action-{light,dark}, rune-voice-action-off-light, rune-voice-action-unavailable-{light,dark}, rune-voice-action-models-dark |
| History | Search, retention select, two-step Clear all, detail with Copy and Delete, latency and processing facts | rune-history-{light,dark}, rune-history-empty-light |
| Modes | Global + custom modes, searchable application picker, FileChooser portal ("Choose a file…"), website rules, corrections, OpenCode rewriting, drag-reordered transformations, two-step delete | rune-modes-{light,dark}, rune-modes-global-light, rune-modes-picker-{light,dark} |
| Transcription picker | Modal over scrim: languages, model cards with recommendation and Streams tags, Use/Download/Cancel/Delete (two-step), live progress |
rune-picker-{light,dark}, rune-picker-downloading-{light,dark} |
| Onboarding tour | onboarding::Flow: Linux/Windows Welcome → Model setup → Done; macOS adds Microphone/Input Monitoring/Accessibility rows, System Settings guides, Give it a try practice field, and relaunch recovery |
rune-onboarding-dark, rune-onboarding-setup-{light,dark}, rune-mac-onboarding* (10 states) |
| Settings (macOS & Windows) | macOS permissions, command model notice, Meetings section, Launch at login, Show Dock icon, Check now, Experimental Hex microphone, shortcut sides; Windows listener card, Launch at login, Enable on launch | rune-mac-settings-{light,dark}, rune-mac-settings-permissions-dark, rune-mac-settings-sides-dark, rune-windows-settings-light |
| Commands (macOS) | Task-grouped catalog, search, detail, Create/Edit config, Copy agent prompt, opt-in with microphone-policy confirmation, command model retry/disable notice | rune-mac-commands-{light,dark}, rune-mac-commands-confirm-light |
| Meetings (macOS) | Day-grouped list, search, detail with summary and You/Them turns, Copy transcript, inline Rename, overflow menu (Copy summary, Reveal, Summarize/Regenerate, Delete…), two-step trash, Start/Stop recording |
rune-meetings-{light,dark}, rune-meetings-recording-{light,dark}, rune-meetings-actions-dark, rune-meetings-delete-light, rune-meetings-rename-dark, rune-meetings-failed-dark, rune-meetings-empty-light |
| Fun (macOS) | Driver status and install/update/uninstall, nine voice-filter modes, live sliders, Try it 5 s recorder and dual rune::Shape bar waveforms |
rune-mac-fun-{light,dark}, rune-mac-fun-muted-dark, rune-mac-fun-driver-missing-light |
| HUD Lab & Activity (debug) | HUD Lab state/queue/style/slider controls and preset copy; Activity live event list and raw JSON inspector | rune-mac-hud-lab-{light,dark}, rune-mac-activity-light |
Run headlessly on any OS:
cargo run -- app -- --list-scenes
cargo run -- app -- --snap /tmp/hex-modes.png --scene modes --theme light
cargo test rune_ui
HEX_UPDATE_GOLDENS=1 rewrites the 53 goldens in tests/golden/. On a host
without a GPU, render on lavapipe with
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.json.
Observed Verification
- Linux (apollo, niri Wayland, 2026-10-22):
- Real window in Dax's session (
app_id: hex, no CSD under niri'sprefer-no-csd, crisp at scale 2 and fractional scale 1.5 (1.5), responsive row wrapping down to 640 px (after)). - Single-process lifecycle: launching
hexopens the window in the running instance, closing the window leaves the same PID answering, relaunching reopens the window, andhex quitexits cleanly. - Headless Sway (
scripts/test-wayland-paste.shandlinux_rune_hud):hex dictation startshows the top-edge recording pill andstophides it after transcription; virtual-pointer clicks pass through the overlay. - CJK fallback (
Noto Sans SC/JP) renders Chinese UI without tofu (Chinese).
- Real window in Dax's session (
- macOS (hailmary, Command Line Tools stub, 2026-10-22):
- Compiles with
cargo clippy --all-targets -- -D warnings, passes the macOS unit tests and Metal golden renders, and a debughex appwith an isolated data root started, created its 980×760 window, answeredhex dev status|show|hud, and exited cleanly on Ctrl-C.
- Compiles with
- Windows (apollo cross-check, 2026-10-22):
cargo xwin clippy --all-targets -- -D warningspasses for bothx86_64-pc-windows-msvcandaarch64-pc-windows-msvc.
Needs A Person To Look
Before cutting a release from rune-ui:
- Linux: pointer hover/press states and I-beam cursor over text fields;
dragging a transformation with a real pointer; opening the FileChooser portal
dialog ("Choose a file…"); Wayland
wayland-data-controlcopy/paste; IME and search-popover auto-focus; recording a physical F-key or Super shortcut; X11 floating window geometry and override-redirect HUD. - macOS: visual inspection of the window, traffic-light inset, and
El::window_dragon a real display; menu-bar status item, Dock reopen, and Sparkle update dialog; AppKit modifier-only/Fn shortcut capture; native Metal dictation HUD (dictation_indicator.rs) and interactive Rune meeting capsules (meeting_capsules.rs);NSOpenPanelfolder picker. - Windows (x64 and ARM64): first real launch of
windows_rune.rs; tray icon and menu; relaunch focus handoff; keyboard-polling shortcut capture;windows_rune_hud.rslayered click-through overlay above the taskbar; Launch at login and self-update restart.
Remaining Rune And Parity Gaps
- Application icons in Modes: Rune has no raster image element yet, so Modes shows monograms; restore the per-OS icon loaders from git history once Rune lands raster images.
- Native file dialogs on macOS and Windows: Linux uses
linux_file_chooser.rs(OpenFileportal); macOS (NSOpenPanelfor Modes applications) and Windows (IFileDialog) remain to wire. - Looping animations: looping tracks for the shortcut-recorder pulse and
the indeterminate model-loading bar. Timed state already runs on
Tx::wake_after, re-checked every 250 ms while the window shows. - Rune rough edges still worked around in Hex:
Pixels::setdoesn't wake its overlay (the Windows HUD sends an empty update), no rounded child clip (the picker hand-rounds its left column), no modifier-only key events (the macOS host keeps an NSEvent monitor), and the event loop panics without a display (Linux catches that unwind). Queued in Rune behind the current core work. - Focus trap and menu keyboard navigation: modal focus trap for the
transcription picker scrim and arrow-key navigation in
rune-kitselects and menus (model and application search popovers already support Up/Down/Enter viacontrols::Highlight). - Meeting capsule extras (macOS): Copy new / Copy all, hover expansion, and corner dragging on the floating recording capsule.
- Windows custom caption: uses the native Win32 title bar for now.