Skip to content

In-place edits never refresh sidebar titles, tags, or search (modify events skip the rescan) #19

Description

@anbturki

Summary

Modify events on workspace files deliberately skip the rescan and only refresh git status. But sidebar titles (Recent lens), the tags lens, and quick-open/search all come from scan-time extraction, so a frontmatter title or tag changed by an in-place write stays stale indefinitely while the workspace is otherwise quiet. MCP update_doc writes in place, so agent edits hit this constantly.

Reproduction (release build of f485396, macOS)

  1. Open a workspace containing research/getting-started.md with title: Getting Started; switch the sidebar to the Recent lens. It shows "Getting Started" (first screenshot).
  2. Overwrite the file in place, changing the frontmatter to title: Renamed By Agent (same shape as MCP update_doc).
  3. Wait several seconds: the sidebar still shows "Getting Started" (second screenshot). It stays stale indefinitely.
  4. Create an unrelated file to force a rescan: the title flips to "Renamed By Agent" (third screenshot).

Root cause

  • kind === "modify" only schedules a git-status refresh, never a rescan: src/hooks/useLibrary.ts:399-405.
  • Titles and tags are extracted at scan time (src-tauri/core/src/scan.rs:81-86) and rendered from the scan result (e.g. file.title || file.name in src/components/explorer/RecentList.tsx).

Proposed fix

On modify events for non-skipped paths, either schedule the existing debounced rescan (already rate limited to one per 2 s) or re-extract metadata for just the modified paths and patch the scan result in place.

Screenshots

Baseline, stale after in-place title change, updated only after an unrelated file forces a rescan:

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions