Skip to content

feat(native): go-to-file, content search, projects, navigation, multi-select and drag - #23

Merged
rynfar merged 3 commits into
nativefrom
nw/w3-nav
Nov 2, 2026
Merged

rynfar merged 3 commits into
nativefrom
nw/w3-nav

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Problem

The native client had no go-to-file, no project content search, no way to add projects, no navigation history, no multi-select or drag in the sidebar, and no hover card or project icons (ledger PN-FILEPICK, PN-SEARCH, AP-PROJECTS, SB-HEADER, SB-SELECT, SB-DRAG, SB-HOVER).

Approach (landing in order; this PR grows)

1. Go-to-file (cmd-p) and content search (cmd-shift-f) — done

  • Palette modes, as the web's overlayModeForCommand: the same key again closes, another switches, Escape goes back to the command list (installCommandPaletteCommands).
  • core/src/project_search.rs: projects.searchEntries (files, trimmed query, empty lists files, limit 200) and projects.searchContents (query as typed, limit 500, match case / whole word / regex) payloads with 120ms debounce, getProjectFilePickerMatches (server order, folded query, subsequence highlights), groupMatches/splitPath, the "N+ results in M files" status, and the preferred editor in EDITORS order with the path:line target the launcher parses.
  • Files: project-name group, file name bolded where matched, path beside it, virtualized. Content: segmented Aa / ab / .* toggles in the input row, a status line (Searching…, Invalid regular expression, errors, counts), results grouped by file with line numbers and highlighted matches in a virtualized list, keyboard selection scrolled into view.
  • Selecting: Enter opens the file at the line in the server's preferred editor (shell.openInEditor, availableEditors now decoded in the server config). Cmd+Enter, or Enter when the server offers no editor, calls AppState::request_composer_mention — a bounded queue (composer_mentions) plus AppEvent::ComposerMention for W2's @ mentions to drain — and copies @path meanwhile. The web opens a right-panel file preview instead; that needs a native file preview.
  • Footer hints: navigate, the Enter action (Open in ‹editor› / Mention), Cmd+Enter, Esc Back/Close.

Verification

  • cargo test --workspace and cargo clippy --workspace --all-targets -- -D warnings pass; core tests cover requests, matching and highlights, grouping and summary, editor preference and targets.
  • Headless example cargo run -p t3-client --example project_search against the isolated dev server:
searchEntries "rs": 200 files (truncated=true)
  cli-entitlements.plist (resources/cli-entitlements.plist) highlights=[]
  cursor_output.ts (src/orchestration-v2/testkit/fixtures/proposed_plan/cursor_output.ts) highlights=[2, 3]
  cursorReplayRecordingWorkspace.ts (scripts/cursorReplayRecordingWorkspace.ts) highlights=[2, 3]
  record-cursor-agent-sdk-replay-fixture.ts (scripts/record-cursor-agent-sdk-replay-fixture.ts) highlights=[0, 10]
  record-muse-msp-replay-fixture.ts (scripts/record-muse-msp-replay-fixture.ts) highlights=[0, 9]
searchContents "fn ": 500+ results in 117 files
  src/provider/Drivers/ClaudeHome.ts:15 export const resolveClaudeHomePath = Effect.fn("resolveClaudeHomePath")(function* (
  src/provider/Drivers/ClaudeHome.ts:18 ): Effect.fn.Return<string, never, Path.Path> {
  src/provider/Drivers/ClaudeHome.ts:33 export const makeClaudeEnvironment = Effect.fn("makeClaudeEnvironment")(function* (

Gaps (so far)

  • No file preview panel: Enter opens the editor or mentions instead of previewing.
  • The web remembers the last-used editor; native picks the first available.

Refs #10

Model: Claude Opus 5.5 (Claude Code, autonomous worker W3)

@rynfar

rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto native (terminal drawer #25, find in thread #24, transcript repaint fix). Conflicts in app_state.rs, main.rs, workspace.rs and LEDGER.md resolved keeping both sides: the terminal drawer's keymap routing and the right panel/terminal workspace layout are intact, and the palette modes and project rows sit beside them. Gates green: cargo test --workspace, cargo clippy --workspace --all-targets -- -D warnings, gen-theme --check, parity/sync.test.ts, conformance --check, pre-commit fmt/lint. Ready to merge.

cmd-p lists the active project's files from projects.searchEntries with
matched letters bolded; cmd-shift-f searches contents through
projects.searchContents with match case, whole word and regex, results
grouped by file with highlighted matches and the web's status line.
Escape goes back to the command list. Enter opens the file (at the line)
in the server's preferred editor via shell.openInEditor; Cmd+Enter, or
Enter when no editor is available, queues a composer mention through a
small AppState hook and copies @path.
…t menu

The palette gains Add project, which browses the host's folders through
filesystem.browse (Enter enters a folder or adds the typed path, Cmd+Enter
adds a folder, Tab completes) and creates the project with
projects.mutate, and New project, which names a folder for
projects.createNew; both open a draft in the new project. The sidebar
header gets Filter by project (pinned groups first, multi-select scope,
All projects) and Add project. Right-clicking a project offers New
thread, Copy path and Pin/Unpin project where the server supports
project organization.
cmd-[ and cmd-] (navigation.back / navigation.forward) walk the threads
opened in this window like the web router's history, skipping threads
that are gone; the sidebar header has the desktop's Go back and Go
forward buttons, disabled at either end.
@rynfar

rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Rebased again onto native after settings (#30) and composer follow-ups (#28): main.rs, icons.rs, server_config.rs and LEDGER.md conflicts resolved keeping both sides (new provider_icon/settings modules and shell_* capabilities kept beside project_files/projects and available_editors). All gates green again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant