Lutra/docs/ui-parity.md
danny a8daf269fb M3.6: integrated terminal with PTY sessions and xterm.js sub-tabs
- crates/terminal: portable-pty sessions (ConPTY on Windows) with reader,
  writer and waiter threads, UTF-8 chunking, a 1 MiB output buffer with
  backpressure, a non-blocking input queue, resize, kill and exit codes;
  default shell pwsh -> powershell -> cmd on Windows, $SHELL or /bin/sh.
- Engine: terminal.create/input/resize/close, terminalOutput (capped per
  terminal and per pump, round-robin) and terminalExited through the pump;
  terminals close with the project and on app.quit.
- UI: Terminal tab in the bottom panel (tabs next to Find), xterm.js with
  the fit addon, sub-tabs, copy/paste, a focus rule that leaves plain Ctrl
  keys to the shell, terminal.open (Mod+Shift+T), --lt-terminal-* ANSI
  tokens in both themes (text colours AA) and a 4.5:1 minimum contrast.
- Tests: real-shell crate tests (UTF-8, backpressure), engine and TCP
  control tests, Vitest with a mocked xterm; live check on port 7936;
  docs and parity rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 21:10:37 +02:00

14 KiB
Raw Blame History

UI parity checklist

Status: main window layout (M1.5), project tree running against the engine (M1.4), editor tabs with a CodeMirror editor (M1.6), light and dark themes (M1.10), restore dialog for unsaved changes (M1.7), notification toasts (M1.12), command palette and global keymap (M1.8), settings dialog with search (M1.9b), syntax highlighting and editor.reveal (M2.2), Find tool window in the bottom panel (M2.4), go-to popup (M2.6), left stripe and Structure tool window (M2.7), app menu (M3.9), Terminal tool window and bottom panel tabs (M3.6) · Last updated: 2026-10-20

  • Main window: tool window stripes, editor area, status bar, navigation bar
    • M2.7 (2026-10-17): a left stripe with one tab per left tool window (Project, Structure); the shown one is marked, clicking it again hides the window. Still missing: right docking, several bottom tool windows, drag to rearrange, navigation bar, layout persistence.
    • M1.5 (2026-10-14): left tool window with header, hide button, collapsed stripe with a show button, resizable by pointer and keyboard; editor area placeholder; status bar. Missing: stripes with several tool windows, bottom/right docking, navigation bar, layout persistence. Not checked in the running app yet (needs M1.4).
  • Main menu
    • M3.9 (2026-10-19): a slim header bar with a menu button (Lucide menu) top left; its dropdown lists every command with a menuPath (engine and UI), grouped File, Edit, View, Go, Help in Lutra's own order, with shortcuts; disabled entries dimmed and not runnable. Keyboard: Alt+M (menu.open, also over uiCommand), arrows, Home/End, Enter/Space, Escape/Tab, type-ahead. An exclusive modal and launcher (one-modal rule). Vitest; live check on Windows 11 (port 7939). Missing: a display-mode option (always visible menu bar), native macOS menu bar, submenus and separators, an Edit group (no edit commands yet), an About window. Behaviour notes: plan/phpstorm/14-main-menu.md.
  • Project tool window (tree, scroll from source, file operations)
    • M1.5 (2026-10-14): tree of the open folder with lazy project.children listings, folders and PHP files with Lucide icons, ignored/excluded entries dimmed, keyboard navigation (WAI-ARIA tree: arrows, Home/End, Enter), double-click opens, refresh on TreeChanged, listing errors shown in the tree, empty state with Open Folder…. Vitest only, against a mocked engine.
    • M1.4 (2026-10-15): runs against the real engine in the app: projects open from the folder picker or the command line, the tree updates live when files change on disk; checked with ui.screenshot on Windows 11. M1.13 (2026-10-16): a partly listed folder ends with a "Listing truncated" note; opening a file that is already open (tree, control channel) switches to its tab (Vitest; live check pending (gaming mode)). Missing: scroll from source (Select Opened File), expand/collapse all, views list, sort options, speed search, file colours, file operations. Behaviour notes: plan/phpstorm/02-project-view.md.
  • Editor tabs (pin, split, reorder, close others)
    • M1.6 (2026-10-15): tab bar above a CodeMirror 6 editor; files open from the project tree (Enter, double click) next to the active tab, or from engine events (control channel, page reload); click and Left/Right activate, the close button, a middle click and Mod+W close; a dot marks unsaved changes; closing a dirty tab asks Save / Don't Save / Cancel; Mod+S saves, Mod+Alt+S saves all (shortcuts read from the engine's command specs); a non-blocking notice when a dirty file changes or disappears on disk. Checked with ui.screenshot on Windows 11 and Vitest. Missing: preview tab, pin, split, reorder by drag, close others/all, reopen closed tab, tab limit, tab context menu, recent-files switcher, duplicate-name disambiguation. Behaviour notes: plan/phpstorm/03-editor-tabs.md.
  • Editor syntax highlighting (Lutra's own colours, no copied scheme)
    • M2.2 (2026-10-16): the language is picked from the file extension when a tab opens: PHP (with the HTML, CSS and JavaScript around <?php blocks), HTML, CSS, JS/TS, JSON, YAML, Markdown; other files stay plain. Eleven syntax tokens (--lt-syntax-keyword/string/number/comment/variable/function/type/constant/tag/attribute/operator) in both themes, each ≥ 4.5:1 on the editor background and the active line. editor.reveal {path, line, column} (UI command, palette, control channel) opens the file, activates the tab, places the cursor and centres it. Checked in the app on Windows 11 (bundled UI, control channel): PHP with embedded HTML in dark and light, editor.reveal into a closed CRLF file (last line, then line 302 centred). Vitest; keystroke to highlight on a 1 MB PHP file 3.0–11.4 ms median (jsdom, JavaScript work only, measured, not yet in the WebView). Missing: semantic highlighting (from the language server), a colour scheme editor, more languages (XML, SQL, Twig, Blade, .env), font styles (bold/italic) per token.
  • Restore dialog for unsaved changes after a crash
    • M1.7 (2026-10-16): modal dialog after a project opens when the recovery journal holds unsaved texts: files with the time they were journaled and a hint when the file changed on disk since; Restore All, Restore Selected (the others stay listed), Discard; Escape keeps the journal for the next open; restore failures listed. Catalog strings, --lt-* tokens, Vitest (10 tests). Live check pending (gaming mode). Missing: a diff against the disk version, local history. M1.15: a restore or discard from elsewhere (control channel) removes the settled files and closes the dialog when none are left; the dialog waits behind the palette and the settings dialog. Behaviour notes: plan/phpstorm/04-recovery.md.
  • Command palette / search everywhere
    • M1.8 (2026-10-16): command palette (Mod+Shift+P) over every user-facing command, engine and UI (commands with a menu path or default shortcut, plus UI commands): fuzzy ranking on the label and the id (prefix, word prefix, word starts, substring, in-order characters), recently run commands first, shortcuts shown, disabled commands dimmed and not runnable, arrow keys, Enter, Escape, focus returned on close; a failing command raises an error toast. One global keymap (ui/src/commands/) matches every command's default shortcut by key code; UI commands palette.open, settings.open (Mod+,, opens the settings dialog since M1.9b) and view.toggleProjectTree (Mod+1). Vitest (keymap, ranking, store, palette, App); live check pending (gaming mode). Missing: files, classes, symbols and text tabs (search everywhere), settings in the results, synonyms and abbreviations, inline toggles, assigning a shortcut from the palette, recent commands across restarts. M1.15: one modal at a time; running any command (also as a uiCommand) closes the palette, opening the palette closes the settings dialog and the close question. Behaviour notes: plan/phpstorm/05-palette.md.
  • Settings dialog with search
    • M1.9b (2026-10-16): dialog (Mod+,, palette, control channel) built from settings.list: sections on the left, controls by type (select, number with min/max, switch), labels and descriptions from the catalog, search over label, description, key and section with matches grouped by section, Reset to default per setting, changes applied at once with inline errors, live updates on settingsChanged, theme picker (appearance.theme, switches at once), editor font size applied to the editor; Escape closes, focus trapped, every control reachable by Tab. Vitest (14 tests); live check pending (gaming mode). Missing: a tree of nested categories, project-level settings and their marker, modified markers, highlighting matches, export/import, more settings (keymap, code style, inspections). Behaviour notes: plan/phpstorm/06-settings.md.
  • Keymap editor (Lutra's own default keymap; no copied keymaps)
    • M1.8 (2026-10-16): the global keymap built from the default shortcuts of engine and UI commands; no user keymap and no editor yet.
  • Light and dark themes from theme tokens
    • M1.10 (2026-10-16): Lutra Dark and Lutra Light from Rust tokens, switched live through appearance.theme (no reload), system follows the OS preference, the first frame uses the stored theme; the editor (selection, active line, cursor, gutter, matches), tabs and notices have their own tokens; WCAG AA contrast checked by Vitest for every text pair in both themes. Covered by Vitest DOM and control-channel tests; live check pending (gaming mode). M1.9b: theme picker in the settings dialog, editor font size from editor.fontSize. Missing: a theme command in the palette, the native title bar following the theme, colour scheme editor, high-contrast theme, design review of the values.
  • Notifications and background task indicator
    • M1.12 (2026-10-16): toasts at the bottom right for engine and host notifications (corrupt settings and journal entries at startup, folder that cannot be opened, unsaved_changes when switching projects, file watching stopped, failed commands without their own UI): info dismissed after 5 s, warnings and errors stay until closed, close button and Escape, at most 5 visible with "+n more", role="status"/role="alert"; startup notifications are replayed when the page starts listening. Vitest (19 store and component tests); live check pending (gaming mode). Missing: a notification log / Notifications tool window, actions inside a toast, balloon grouping, "don't show again", background task indicator with progress.
  • Structure tool window
    • M2.7 (2026-10-17): in the left tool window, chosen from the new stripe (Project | Structure); the active tab's declarations (namespaces, class-likes, functions, methods, properties, constants, enum cases) as a WAI-ARIA tree with Lucide kind icons in syntax colours and the short signature; follows the active tab and edits; click or Enter jumps to the name (editor.reveal), arrows walk and fold, collapsed nodes kept per file; empty states for no file, no declarations, still reading, too large. view.toggleStructure Mod+2. Checked in the app on Windows 11 over the control channel (tree, jump to a method, tree updated after an edit; no clicks, the control channel cannot send input). Missing: speed search, sorting and filters, visibility markers, inherited members, autoscroll from the caret, the File Structure popup, VCS colours, running tests from an entry.
  • Problems tool window
  • Go to file / class / symbol popup
    • M2.6 (2026-10-17): one popup with Files / Classes / Symbols tabs (Tab / Shift+Tab or a click; the text stays), opened by goto.fileOpen Mod+P, goto.classOpen Mod+Alt+C, goto.symbolOpen Mod+T (Lutra's own keys) or by an agent with {query}; live fuzzy results (60 ms debounce, stale answers dropped) with matched characters marked, a Lucide icon per kind, the directory, namespace or container beside the name, library (vendor) rows dimmed with a label; an indexing hint with progress, re-queried on indexReady; arrows / Page keys move, Enter or a click opens through editor.reveal, Escape or a click outside closes; an exclusive modal. Checked in the running app. Missing: recent files on an empty query, a non-project toggle, file-type filter, :line suffixes, preview, more tabs (actions, text), sending results to Find.
  • Find tool window
    • M2.4 (2026-10-17): docked in the new bottom panel (resizable by pointer and keyboard, collapses to its header, closes; results kept while closed). Query field with case / whole word / regex toggles (aria-pressed), include and exclude globs, status line with counts and time, cancel, truncated hint, refused query as an alert; results grouped by file with the match highlighted, a listbox with keyboard navigation; Enter or click reveals the match. find.open Mod+Alt+F. Missing: tabs per search, grouping options, a preview pane, expand/collapse per file, rerun and next/previous occurrence buttons, context menu, export, history.
  • Terminal tool window
    • M3.6 (2026-10-18): a Terminal tab in the bottom panel (the panel shows Find and Terminal as tabs while both are open; Left/Right switch); xterm.js with the fit addon follows the panel size; several terminals as sub-tabs (Local, Local (2)…) with a close button each and a new-terminal button, Left/Right/Home/End/Delete on a sub-tab, an ended shell dims its tab and prints its exit code; output survives collapsing the panel; copy with Mod+Shift+C or Ctrl+C on a selection, paste with Mod+Shift+V or Ctrl+V; while a terminal has the focus plain Ctrl keys go to the shell and only Mod+Shift / Mod+Alt shortcuts reach Lutra; Lutra's own ANSI palette in both themes (text colours ≥ 4.5:1). terminal.open Mod+Shift+T. Missing: renaming and splitting tabs, a context menu, search, clickable links and paths, drag and drop, a key back to the editor, a confirmation before killing a running process, terminal settings.
  • Git tool window

Revision history

Date Change Summary
2026-10-19 minor Main menu partial (M3.9)
2026-10-18 minor Terminal tool window partial, bottom panel tabs (M3.6)
2026-10-17 minor Go-to popup partial (M2.6)
2026-10-17 minor Structure tool window partial, left stripe (M2.7)
2026-10-17 minor Find tool window partial, bottom panel (M2.4)
2026-10-16 minor Editor syntax highlighting partial; editor.reveal (M2.2)
2026-10-16 patch Palette and restore dialog: modal rule, restore dialog follows outside restores (M1.15)
2026-10-16 minor Settings dialog partial; theme picker and editor font size (M1.9b)
2026-10-16 minor Command palette and global keymap partial (M1.8)
2026-10-16 minor Notifications partial (M1.12)
2026-10-16 minor Truncated listing note, re-open switches tab (M1.13)
2026-10-16 minor Restore dialog (M1.7)
2026-10-16 minor Themes partial (M1.10)
2026-10-15 minor Editor tabs partial (M1.6)
2026-10-15 minor Project tool window runs against the engine (M1.4)
2026-10-14 minor Notes on main window and project tool window (M1.5)
2026-10-13 major Baseline