Lutra/docs/ui-parity.md
danny c68932c39c M2.7: Structure tool window and syntax.outline
Engine: every open PHP buffer keeps a tree-sitter tree, reparsed
incrementally on a worker thread off the engine lock (200 ms debounce,
edit batches recorded by buffer.edit, full parse when the chain breaks).
syntax.outline {id} returns {items, truncated, version}; outlineChanged
{id} at most every 200 ms per buffer. Replaced trees and outlines are
freed on the worker.

UI: left stripe with Project | Structure in MainLayout, the Structure
tool window (WAI-ARIA tree, Lucide kind icons, signatures, jumps via
editor.reveal), view.toggleStructure on Mod+2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:04:12 +02:00

52 lines
11 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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), left stripe and Structure tool window (M2.7) · **Last updated:** 2026-10-17
- [ ] 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).
- [ ] 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
- [ ] 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
- [ ] Git tool window
## Revision history
| Date | Change | Summary |
|---|---|---|
| 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 |