Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5e1cc21. Configure here.
WalkthroughAdds note-local Find support backed by ProseMirror search, including visible-text matching, editor APIs, provider-managed sessions, UI controls, keyboard and native-menu commands, focused-note routing, highlighting, and associated tests. ChangesNote-local Find
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant NoteFindBar
participant NoteFindProvider
participant NoteEditor
User->>NoteFindBar: Enter query
NoteFindBar->>NoteFindProvider: updateQuery
NoteFindProvider->>NoteEditor: updateFindQuery
NoteEditor->>NoteFindProvider: publish match snapshot
NoteFindProvider->>NoteFindBar: render match status
sequenceDiagram
participant User
participant NativeMenu
participant FocusedWebview
participant NoteFindProvider
User->>NativeMenu: Select Find command
NativeMenu->>FocusedWebview: emit focused-note command
FocusedWebview->>NoteFindProvider: deliver validated command
NoteFindProvider->>FocusedWebview: open or navigate Find
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/desktop/src/lib/native-menu/dispatch.ts`:
- Around line 40-52: Update dispatchToFocusedWindow so failures from an
individual window.isFocused() check are isolated rather than rejecting the
shared Promise.all result. Preserve successfully detected focused windows and
continue selecting the first focused window, while retaining the existing outer
lookup error handling for failures from getAllWebviewWindows or the overall
detection flow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d122b94b-3078-4319-93de-b8d9b1b3dff6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (36)
apps/desktop/package.jsonapps/desktop/src/components/command-palette/command-palette.test.tsxapps/desktop/src/components/daily-stream.focus.test.tsxapps/desktop/src/components/graph-workspace.tsxapps/desktop/src/components/note-find-bar.test.tsxapps/desktop/src/components/note-find-bar.tsxapps/desktop/src/components/note-window-content.tsxapps/desktop/src/components/route-content.test.tsxapps/desktop/src/components/sidebar/sidebar.test.tsxapps/desktop/src/components/workspace-content.test.tsxapps/desktop/src/components/workspace-content.tsxapps/desktop/src/editor/editor-handle-registry.tsapps/desktop/src/editor/note-editor.test.tsxapps/desktop/src/editor/note-editor.tsxapps/desktop/src/editor/note-find-query.test.tsapps/desktop/src/editor/note-find-query.tsapps/desktop/src/editor/note-find.test.tsapps/desktop/src/editor/note-find.tsxapps/desktop/src/editor/use-note-document.test.tsxapps/desktop/src/editor/use-template-slash-items.test.tsapps/desktop/src/lib/attach-files.test.tsapps/desktop/src/lib/commands/app-commands.test.tsapps/desktop/src/lib/commands/app-commands.tsapps/desktop/src/lib/commands/registry.test.tsapps/desktop/src/lib/commands/types.tsapps/desktop/src/lib/native-menu/dispatch.tsapps/desktop/src/lib/native-menu/menu.test.tsapps/desktop/src/lib/native-menu/menu.tsapps/desktop/src/mobile/mobile-screen.test.tsxapps/desktop/src/mobile/screens/tasks.test.tsxapps/desktop/src/providers/note-find-provider.tsxapps/desktop/src/routing/app-shortcuts.test.tsxapps/desktop/src/routing/app-shortcuts.tsapps/desktop/src/routing/route.test.tsapps/desktop/src/routing/route.tsapps/desktop/src/styles/index.css
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/desktop/src/lib/native-menu/dispatch.ts (1)
89-114: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the exported focused-note routing APIs.
listenForFocusedNoteMenuCommandsis a new public API with important lifecycle and validation behavior, but it has no JSDoc. Document its validated payload contract and returned unlisten handle; also documentdispatchMenuCommandwhile its focused-window routing semantics are being exposed.As per coding guidelines, public APIs must always be documented.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/desktop/src/lib/native-menu/dispatch.ts` around lines 89 - 114, Add JSDoc to the exported APIs dispatchMenuCommand and listenForFocusedNoteMenuCommands. Document that dispatchMenuCommand routes valid focused-note commands to the focused window and otherwise uses the current handler; document that listenForFocusedNoteMenuCommands validates incoming event payloads against FocusedNoteMenuCommandSchema, dispatches only valid commands, and returns an UnlistenFn for removing the listener.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/desktop/src/lib/native-menu/dispatch.ts`:
- Around line 89-114: Add JSDoc to the exported APIs dispatchMenuCommand and
listenForFocusedNoteMenuCommands. Document that dispatchMenuCommand routes valid
focused-note commands to the focused window and otherwise uses the current
handler; document that listenForFocusedNoteMenuCommands validates incoming event
payloads against FocusedNoteMenuCommandSchema, dispatches only valid commands,
and returns an UnlistenFn for removing the listener.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 487c287a-40fa-4f45-be0b-e8af68407bc5
📒 Files selected for processing (2)
apps/desktop/src/lib/native-menu/dispatch.tsapps/desktop/src/lib/native-menu/menu.test.ts
|
implemented in #955 |

Problem
Reflect had no note-local text search. Users accustomed to browser Find could not locate a phrase in a long note without leaving the editor, and Tauri/Wry does not provide one stable cross-platform page-find API that preserves Meowdown rendered-text semantics.
This PR adds Find for the active note only. Graph-wide search remains unchanged.
Before → After
Cmd/Ctrl+Fopens a compact Find bar with live counts and highlightsEnterorCmd/Ctrl+Gmoves forward; Shift reverses; navigation wrapsChanges
NoteFindQuery, which projects rendered Meowdown text back to document positions. Literal matching is case-insensitive, Unicode-safe, and uses cached indexed lookup for high match counts. Active queries reproject when Markdown syntax visibility changes.Cmd/Ctrl+Gcontinuation, safe selection collapse, and focus restoration owned by the Find bar rather than the window fallback.Tests
Verification
pnpm --filter @reflect/desktop test --run src/components/note-find-bar.test.tsx src/editor/note-find.test.ts src/editor/note-find-query.test.ts— 23 tests passed.master.pnpm check— passed; only the two existing max-lines warnings remain.pnpm build— passed; expected missing Sentry-token and chunk-size warnings remain.Risk / Rollout
No data migration, settings change, external service, or network call is introduced. Search remains entirely local to the mounted editor, including private notes. Roll out with the normal desktop release.
Note
Medium Risk
Large editor/routing integration with new ProseMirror search and cross-window menu dispatch; behavior is well-tested but touches daily-stream focus targeting and secondary windows.
Overview
Adds Find in note for the active editor: a compact overlay bar, live match counts, highlights, and browser-style navigation (
Mod-F,Enter/Mod-G, wrap, resume after close).Search runs on rendered Meowdown text via
prosemirror-searchand a customNoteFindQuery(visible prose and atom labels; hidden link destinations and most syntax unless show mode). The note editor exposes find APIs onNoteEditorHandle; a per-windowNoteFindProviderbinds to the focused daily-stream day or routed note throughfocusedNotePathForRoute, waits for lazy-mounted editors, and tears down on route change or virtualization unmount.Commands and menus:
note.find/note.findNext/note.findPreviousonCommandContext; macOS Edit menu entries route Find to the focused Tauri webview (detached note windows listen via event), not always main.Reviewed by Cursor Bugbot for commit 9ea6153. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit