Skip to content

Add a file-tree navigation pane to the desktop UI - #11

Merged
samkeen merged 1 commit into
mainfrom
claude/desktop-file-tree-view-ifuqee
Jul 6, 2026
Merged

Add a file-tree navigation pane to the desktop UI#11
samkeen merged 1 commit into
mainfrom
claude/desktop-file-tree-view-ifuqee

Conversation

@samkeen

@samkeen samkeen commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The desktop app was navigable only by search; add a left-most file-tree
pane so the vault is browsable — navigate, open a folder, click a file to
read it.

Core gains one new façade op, Vault::list_notes() -> Vec<NoteSummary>
(b2id/path/title, no body; a pure model-free read, path-ordered), backed
by db::all_notes. The desktop host exposes it as a thin list_notes
command (deserialize -> one façade call -> serialize), staying a dumb
adapter. The tree is folded from the flat list in ui/, keeping
presentation logic out of the host.

Index-first like search: the tree shows exactly the notes the index
knows, so every entry is read-resolvable and a click always opens.
Opening a note from search or a wikilink auto-expands its ancestor
folders and highlights it. The tree refreshes after reindex.

Tests: 3 list_notes integration tests (tests/list.rs) + a command-layer
test; clippy/fmt clean; frontend type-checks and builds. Docs updated
(tasks.md, desktop-ui-mvp.md §4).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NFfZfhuWBCkc58mQCNcsDo

Summary by CodeRabbit

  • New Features

    • Added a file-tree navigation pane for browsing notes by folder.
    • Notes are now listed in the desktop app with titles and paths, and you can expand/collapse folders.
    • Opening a note now reveals its location in the tree and keeps the current note highlighted.
  • Bug Fixes

    • Reindexing now refreshes the file tree view.
    • Improved empty-state messaging when no notes are available or no vault is open.

The desktop app was navigable only by search; add a left-most file-tree
pane so the vault is browsable — navigate, open a folder, click a file to
read it.

Core gains one new façade op, `Vault::list_notes() -> Vec<NoteSummary>`
(b2id/path/title, no body; a pure model-free read, path-ordered), backed
by `db::all_notes`. The desktop host exposes it as a thin `list_notes`
command (deserialize -> one façade call -> serialize), staying a dumb
adapter. The tree is folded from the flat list in `ui/`, keeping
presentation logic out of the host.

Index-first like `search`: the tree shows exactly the notes the index
knows, so every entry is `read`-resolvable and a click always opens.
Opening a note from search or a wikilink auto-expands its ancestor
folders and highlights it. The tree refreshes after reindex.

Tests: 3 `list_notes` integration tests (tests/list.rs) + a command-layer
test; clippy/fmt clean; frontend type-checks and builds. Docs updated
(tasks.md, desktop-ui-mvp.md §4).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NFfZfhuWBCkc58mQCNcsDo
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bbbbef4a-e4fc-423c-a5c2-a89bf9890b4a

📥 Commits

Reviewing files that changed from the base of the PR and between 0393579 and 6590cfd.

📒 Files selected for processing (13)
  • crates/b2-core/src/db.rs
  • crates/b2-core/src/vault.rs
  • crates/b2-core/tests/list.rs
  • crates/b2-desktop/src/commands.rs
  • crates/b2-desktop/src/main.rs
  • planning/specs/desktop-ui-mvp.md
  • planning/tasks.md
  • ui/src/api.ts
  • ui/src/main.ts
  • ui/src/render.ts
  • ui/src/state.ts
  • ui/src/types.ts
  • ui/style.css

📝 Walkthrough

Walkthrough

Adds a Vault::list_notes() API backed by a new all_notes database query, exposes it through a Tauri list_notes command, and updates the desktop UI to fetch and render notes as a collapsible file-tree pane with expand/collapse and active-note highlighting.

Changes

File-tree listing feature

Layer / File(s) Summary
DB query and Vault façade for note listing
crates/b2-core/src/db.rs, crates/b2-core/src/vault.rs, crates/b2-core/tests/list.rs
Adds all_notes query returning path-ordered notes, NoteSummary type, Vault::list_notes() method, and integration tests covering ordering, readability, and un-reindexed behavior.
Tauri list_notes command
crates/b2-desktop/src/commands.rs, crates/b2-desktop/src/main.rs, planning/specs/desktop-ui-mvp.md, planning/tasks.md
Adds list_notes/list_notes_impl command handler, registers it in the invoke handler, adds a unit test, and updates planning docs.
Frontend types, state, and API wiring
ui/src/types.ts, ui/src/api.ts, ui/src/state.ts
Adds NoteSummary interface, api.listNotes() IPC call, and notes/expandedDirs fields on AppState.
Tree pane rendering and UI interactions
ui/src/render.ts, ui/src/main.ts, ui/style.css
Implements treePaneHtml tree builder, wires loadNotes/toggleDir/expandAncestors and shell markup, updates empty-state copy, and adds tree-pane layout/styling with responsive breakpoints.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MainTS as main.ts
  participant Api
  participant TauriCmd as list_notes command
  participant Vault
  participant Db

  User->>MainTS: boot()
  MainTS->>Api: listNotes()
  Api->>TauriCmd: invoke("list_notes")
  TauriCmd->>Vault: list_notes()
  Vault->>Db: all_notes(conn)
  Db-->>Vault: Vec<(b2id, path, title)>
  Vault-->>TauriCmd: Vec<NoteSummary>
  TauriCmd-->>Api: Vec<NoteSummary>
  Api-->>MainTS: notes
  MainTS->>MainTS: treePaneHtml(state)
  MainTS-->>User: render file tree
Loading

Poem

A rabbit hops through folders deep,
Notes once scattered, now they keep
A tidy tree, both branch and leaf,
Click to open, quick and brief! 🌳
Thump-thump — the vault feels neat and true. 🐇

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/desktop-file-tree-view-ifuqee

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants