Commit graph

24 commits

Author SHA1 Message Date
danny
6c75c08d70 M2.2: PHP highlighting, syntax colour tokens and editor.reveal
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:17:17 +02:00
danny
f13a49064d PM: merge M2.3 find in files backend
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/architecture.md
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-17 12:05:56 +02:00
danny
a5236acd7e M2.1: tree-sitter PHP in crates/syntax
Parser (parse, incremental reparse from lutra_text edits), outline with
UTF-16 ranges and short signatures, folding ranges, 8 MiB parse cap.
Snapshot tests for five PHP 8.3 fixtures, proptests (random bytes,
reparse equals fresh parse, undo round trip), ignored release timing
test. Docs: architecture Syntax section, parity evidence, G4 note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:06:21 +02:00
danny
172693c8dd M2.3: find in files backend
crates/search: parallel ignore walk + grep-searcher with the project's
ignore rules (vendor searched as library, node_modules and .git skipped),
literal or regex, case, whole word, include/exclude globs, binary and
> 8 MiB skips, match cap, cancel token, buffer overlay.

Engine: search.find returns {searchId} at once and runs off the lock;
pump_vfs drains results into searchResults (one per file, at most 500
per pump) and searchDone; search.cancel. Testkit: generated search tree.
Tests: library unit and property tests, engine tests, TCP control test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 22:04:28 +02:00
danny
523d7f684f M1.9b: settings dialog with search
settings.open (Mod+,) opens a dialog built from settings.list: sections,
controls by type (select, number with min/max, switch), catalog labels
and descriptions, search over label, description, key and section, Reset
to default, inline errors, live updates on settingsChanged. The theme
picker switches at once; editor.fontSize drives --lt-font-size-editor
through a token override that survives theme switches. Focus trap,
Escape closes. Finishes M1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:13:04 +02:00
danny
184b8a3468 M1.8: command palette, global keymap, UI commands
- Engine: ui.registerCommands (validated, replaces the previous set),
  UI commands in listCommands with ui: true and labelKey, running one
  through the engine emits uiCommand {id, params}.
- Frontend: ui/src/commands/ (keymap by key code, fuzzy ranking, Pinia
  commands store with handlers, recents and error toasts), the command
  palette (Mod+Shift+P), UI commands palette.open, settings.open (Mod+,,
  disabled until M1.9b) and view.toggleProjectTree (Mod+1). The editor's
  shortcuts.ts moved into the global keymap.
- Tests: engine and control-channel tests for registration and
  uiCommand, Vitest for keymap, ranking, store, palette and App wiring.
- Docs: architecture, ui-parity, target-app-parity, gaps, roadmap,
  ROADMAP, README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:59:43 +02:00
danny
2f8fef876b PM: merge M1.12 notifications
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/architecture.md
#	docs/gaps.md
#	docs/roadmap.md
#	docs/target-app-parity.md
#	docs/ui-parity.md
2026-10-16 16:22:22 +02:00
danny
f41df518b5 M1.12: notifications as toasts
The host publishes picker, command-line and pump errors as notification
events (Engine::notify, same id sequence) instead of stderr, keeps
notifications and watchFailed published before engine_ready and replays
them after the state replay, so startup warnings (corrupt settings,
journal entries) reach the UI. ipc.ts announces engine_ready once all
subscriptions started together are registered.

Frontend: notifications store and NotificationStack (bottom right, info
auto-dismissed after 5 s, warnings/errors stay, close button and Escape,
at most 5 visible with "+n more", role status/alert); watchFailed maps to
a warning toast; failed commands without their own UI raise an error
toast. Catalog keys notification.settings.*, project.*, vfs.*, watch.*,
command.* plus the runtime allow-list. Docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:20:45 +02:00
danny
8a71f7bd08 M1.13: watch open buffers' folders, bufferFocused, truncated tree row
- The parent directory of every open buffer is pinned in the project
  watcher (workspace::sync_buffer_dirs after every command): it counts
  against the cap but is never evicted while a buffer in it is open, so
  reloads and fileChangedOnDisk arrive for never-expanded folders.
- file.open on an already-open buffer emits the new bufferFocused {id};
  the editor activates that tab and it outranks pending adoptions.
- The project tree shows a "Listing truncated" note row
  (project.tree.truncated) after a partly listed directory.
- Tests: engine (pinning, eviction, focus), control channel
  (bufferFocused), Vitest (tab switch, race, truncated row).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 16:20:11 +02:00
danny
0b40eb90f8 M1.7: crash-recovery journal and restore dialog
Dirty buffers are written atomically to <data_dir>/recovery/<project-id>/
about 1 s after the last edit (at most 2 s while typing), from pump_vfs,
never per keystroke. Entries are removed on save, close (also force),
forced project close/open and recovery.discard. project.open emits
recoveryAvailable; recovery.list/restore/discard; restored buffers are
dirty and keep line ending and BOM. Corrupt entries are moved aside and
reported as warning notifications.

UI: restore dialog in ui/src/components/recovery (Restore all, Restore
selected, Discard, time, changed-on-disk hint), catalog keys and runtime
allow-list. Tests: crash/restore with CRLF + BOM, corrupt entries, removal
paths, property test of random edits, headless control-channel test,
Vitest for the dialog. Docs: architecture, parity, gaps, ROADMAP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:56:41 +02:00
danny
cde6e119c6 M1.10: light theme, live theme switching, editor tokens
- theme::LIGHT next to DARK with the 10 new tokens (editor selection,
  active line, cursor, gutter, match, font size, tab active/modified,
  notice); light fg-muted, accent and error darkened for WCAG AA
- theme.list, theme.systemPreference, themeChanged event when the
  resolved theme changes (settings.set/reset appearance.theme, or the
  OS preference in system mode)
- desktop init script and window background from the stored setting;
  system mode uses a prefers-color-scheme media query for the first frame
- ui/src/theme.ts applies tokens to :root and color-scheme live; editor,
  tabs and notice drop their var() fallbacks
- Vitest WCAG AA contrast check against a Rust-maintained snapshot,
  DOM tests, headless control-channel test
- docs: architecture Themes, parity rows, ui-parity, gaps, roadmaps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:49:23 +02:00
danny
f9357ee4b5 M1.9a: engine dirs and settings backend
EngineConfig and Engine::with_config; the desktop resolves Tauri's app
config and data dirs. Settings model (appearance.theme, editor.fontSize,
ui.language) with typed validation, persistence in settings.json via
write_atomic (1 MiB cap, unknown keys kept, corrupt file backed up with a
warning notification), settings.list/get/set/reset, settingsChanged and
notification events. Property test over random settings.json content,
control-channel test for persistence and corrupt-file recovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:23:43 +02:00
danny
851d438e2a PM: review cycle 1
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run
Stage line, feature breadth estimate, M1-M3 hours recalibrated x0.1
after cycle C1 (2.5 h agent time for 37 h estimated).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 18:38:39 +02:00
danny
9fa6028335 M1.6: tabs and CodeMirror editor
- Editor area with tab bar, CodeMirror 6 view, close question and notices
  (ui/src/components/editor/, ui/src/stores/editor.ts), mounted in App.vue;
  the project tree opens files through the editor store.
- BufferSync: local edits to buffer.edit against the confirmed version,
  one call in flight, resync on stale_version or newer bufferChanged with
  rebase of unsent changes; EngineText maps CodeMirror positions to engine
  UTF-16 offsets for CRLF text.
- Save, save all and close from engine default shortcuts via listCommands.
- Dirty marker, Save / Don't Save / Cancel, non-blocking notice when a
  dirty file changes or disappears on disk.
- Vitest: keystroke bursts with stale versions and remote edits (LF and
  CRLF), mapping, store and component tests against a fake engine.
- Progress docs: Editor core 8% (est.), depth ~1.4%, G2, ui-parity tabs,
  M1 row, architecture, README status.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 18:26:32 +02:00
danny
dd98636de4 M1.4: desktop bridge: engine events to the window, folder picker, live project tree
The desktop host publishes every engine event, from commands and from a
pump thread that calls Engine::pump_vfs every 100 ms, to control channel
subscribers and to the window as the Tauri event engine://event, in engine
order. ui/src/ipc.ts gets a typed onEngineEvent; its first subscription
calls engine_ready, and the host replays the current project and buffers,
so a project opened from the command line (lutra-desktop --control PORT
PATH) reaches the UI. project.openDialog returns Effect::PickFolder; the
host shows the native folder picker (tauri-plugin-dialog, licence checked)
and opens the choice, one picker at a time, cancel is not an error.
Capabilities shrink to event listen/unlisten.

Contract fix: the M1.5 project UI assumed shapes the engine does not use.
engineEvents.ts now translates engine events ({kind: projectOpened, ...})
and project.children results ({dir, entries, truncated}) into the UI types,
keeping role and truncated; the store maps listings through
toTreeEntries() and the project tests use the real engine shapes.

Verified in the running app on Windows 11: tree of a project given on the
command line, expanding src, a file created on disk appearing live, the
folder picker opening one dialog and opening the chosen folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 06:41:49 +02:00
danny
f1976c7d67 M1.3: engine workspace, file and buffer commands, event stream
State holds the open project (VFS project, watcher, watched directories)
and versioned buffers. New commands: project.open/close/children,
file.open/save/saveAll, buffer.get/edit/close. buffer.edit takes UTF-16
change sets based on a version and fails with the new stale_version code;
closing dirty buffers or projects without force fails with
unsaved_changes. Commands queue events (projectOpened, treeChanged,
bufferChanged, dirtyChanged, fileChangedOnDisk, ...) that the engine
returns in Outcome.events; Engine::pump_vfs maps changes on disk to
events and reloads clean buffers. project.children watches listed
directories, capped at 256 native / 32 polling, least recently listed
dropped first.

Control channel: events.subscribe streams {"event": ...} lines, with
bounded per-subscriber queues (lutra_control::Subscribers) and method docs
in methods.rs. testkit's EngineBackend and the desktop Host implement the
new Backend::subscribe. Verified with 14 engine integration tests, a TCP
events test and the running app over the control channel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 20:24:44 +02:00
danny
a63ab4ac45 PM: merge M1.5 UI shell and project tree
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-14 20:03:34 +02:00
danny
b11c688c71 PM: merge M1.2 vfs with notify watching
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	Cargo.toml
#	docs/gaps.md
#	docs/target-app-parity.md
2026-10-14 20:03:25 +02:00
danny
3f190a635e M1.2: native file watching via notify
- notify 8.2.0 (CC0-1.0) behind the existing Watcher API, allowed by a
  crate-scoped [[licenses.exceptions]] entry in deny.toml (owner
  decision 2026-10-14, noted in AGENTS.md and NOTICE).
- Native notifications only mark directories dirty; after 100 ms of
  quiet (at most 10 intervals) dirty dirs are rescanned and diffed, so
  events, debouncing and rename pairing match the polling backend.
- Polling stays as fallback when the native watcher cannot start, and
  per directory when a native watch is refused. Lost events or watcher
  errors trigger a full rescan; root loss is checked on every tick.
- Additive API: WatchOptions::backend (Auto, Polling) and
  Watcher::is_native.
- Watch tests run on both backends (34 vfs tests on Windows).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:43:15 +02:00
danny
003b7970e6 M1.5: main window layout and project tree against mocked engine events
Left Project tool window (hide/show stripe, pointer and keyboard resize),
editor area placeholder and status bar. Project tree with lazy
project.children listings, WAI-ARIA keyboard navigation, Lucide icons,
dimmed ignored/excluded entries and refresh on TreeChanged. Empty state
runs project.openDialog. Pinia store fed only by engine events and
command results; events come through a local onEngineEvent adapter until
the desktop bridge (M1.4) lands. Lucide via @lucide/vue (the renamed
lucide-vue-next, ISC).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:24:23 +02:00
danny
5d49b57b9c M1.2: vfs with ignore rules, polling watcher and safe file IO
- Project::open canonicalises the root (no \?\ prefix on Windows where
  safe); typed errors for missing and non-directory paths.
- Lazy children(dir): dirs first, case-insensitive; kind, ignored flag
  and role (vendor/ library, node_modules/ excluded, .git hidden).
- Ignore rules via the ignore crate: .gitignore, .ignore,
  .git/info/exclude, global git excludes, with git precedence.
- Watcher: std-only polling (100 ms, watched dirs only) with
  create/modify/remove/rename events and a Failed event on root loss.
  notify is CC0-1.0 and fails cargo deny; owner decision pending.
- read_text with a 32 MiB cap, UTF-8 + BOM, typed InvalidUtf8 and
  UnsupportedEncoding; write_atomic via temp file + rename, keeping
  permissions and refusing read-only files.
- 28 tests on temp dirs (30 on Unix: permission and symlink write tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:24:02 +02:00
danny
5dac918b14 M1.1: text buffer with UTF-16 positions, edit batches and line endings
lutra-text gets Buffer on a ropey rope: byte/char/UTF-16/line counts,
byte offset <-> (line, column) in UTF-16 code units or chars, absolute
UTF-16 offsets, atomic Edit batches in LSP TextEdit[] semantics, and
\n / \r\n / \r detection with a keep-the-file's-ending save policy.
All conversions return TextError instead of panicking.

ropey 1.6.1 (MIT) without unicode_lines, so only the LSP/CodeMirror
line breaks split lines. proptest moves into workspace deps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:20:18 +02:00
danny
b2bf769188 M0.9: first estimates for M1-M3 and full parity
MVP (M1-M3) about 190 agent hours, full parity about 3,300 hours (range
2,000-5,000), all marked estimated. M0 measured at about 2 hours of active
agent time. Hours per area in target-app-parity, per gap in gaps.md and
per milestone in roadmap.md; ROADMAP and README status updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:41:49 +02:00
danny
1fc46daa8e M0: import starter package (rules, roadmap, progress docs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:22:22 +02:00