Skip to content

Add Command-F search within journal entries - #3

Merged
imann24 merged 1 commit into
mainfrom
codex/find-in-entry
Nov 7, 2026
Merged

imann24 merged 1 commit into
mainfrom
codex/find-in-entry

Conversation

@imann24

@imann24 imann24 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Cmd+F / Ctrl+F and a reader toolbar button for literal, case-insensitive search within the open entry.
  • Highlight matches with a count, next/previous controls, Enter / Shift+Enter navigation, wrapping, and Escape to close.
  • Support rendered Markdown and original-text views, including phrases across inline formatting and live entry updates. Keep Cmd+K archive search unchanged.
  • Add unit, rendering, and browser regression tests, and document the shortcut.

Validation

macOS CI passed for f6f516d:

  • Formatting and frontend typecheck/build
  • 41 unit and rendering tests
  • 35 browser interaction tests, including 13 new find-in-entry tests
  • 13 Rust tests passed; 1 existing local-archive test ignored

Local DOM smoke checks also passed for shortcuts, literal matching, wrapping, focus, original-text mode, entry navigation, Escape/IME handling, and highlight cleanup. Native macOS interaction has not been manually tested.

@eve-code-review-imann24

Copy link
Copy Markdown

starting review...

@imann24
imann24 marked this pull request as ready for review November 7, 2026 02:40
@eve-code-review-imann24

Copy link
Copy Markdown

starting review...

@eve-code-review-imann24 eve-code-review-imann24 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds Cmd/Ctrl+F find-in-entry with highlighting, match navigation, and rendered and raw view support, leaving Cmd+K unchanged.

Findings: 0 blockers, 0 should-fix, 1 nit.

I read the app wiring, the find bar, the highlighting component, the rehype plugin (entry-search.ts), the rendering tests, and the Vitest config. I found no correctness problems. The literal-match escaping is valid under the u flag. Matches don't join across block, image, or <br> boundaries. Raw HTML is shown as text, not parsed. Focus is restored on close.

I did not review tests/entry-find.spec.ts or src/lib/entry-search.test.ts, because their diffs were truncated in my context. That is why this is a comment, not an approval. I also haven't run anything, since the sandbox wasn't available.

Docs checked: the docs lookup found no ticket, spec, or team conventions (no wiki is configured for this instance). The PR description and the README shortcut entry were the only references. The README addition matches the implemented behavior.

groups.set(id, [...(groups.get(id) ?? []), mark]);
});
setMatches([...groups.values()]);
setIndex(0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: revision includes entry.content, so every live-update refresh of the open entry resets the active match to 1. A user who has stepped to match 7 will jump back to the start if the file changes on disk. Consider keeping the current index (clamped to the new match count) when only the content changes, and resetting only when the query, entry, or view changes.

@imann24
imann24 merged commit 0ffff9a into main Nov 7, 2026
2 checks passed
@imann24
imann24 deleted the codex/find-in-entry branch November 7, 2026 02:42
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