Skip to content

Add scoped find navigation to file previews - #173

Merged
redxzeta merged 1 commit into
built-from-scratchfrom
codex/issue-153-file-preview-find
Sep 1, 2026
Merged

Add scoped find navigation to file previews#173
redxzeta merged 1 commit into
built-from-scratchfrom
codex/issue-153-file-preview-find

Conversation

@redxzeta

Copy link
Copy Markdown
Owner

Problem

Long code and Markdown previews had no in-file navigation, while the application already owned Cmd/Ctrl+F for other focused surfaces.

Implementation

  • add a preview-scoped Cmd+F on macOS / Ctrl+F elsewhere without stealing shortcuts from composer, browser, terminal, or other focused surfaces
  • search already-loaded source contents client-side with deferred matching
  • show total/current match counts, yellow match highlights, an orange active match, Enter/Shift+Enter navigation, and active-match scrolling
  • reset query/index on close and recompute/clamp the active index when loaded file contents change
  • share the compact accessible find controls with thread find and make the existing HTML highlight wrapper linear across text runs for large-file responsiveness

Architectural choices

  • reuse the existing thread-find range, HTML-marking, and active-match primitives instead of adding a second highlighting engine
  • keep shortcut ownership in a small preview-specific pure helper
  • use the existing shared disclosure motion for the compact find panel
  • preserve source/Markdown preview architecture; image, PDF, editable textarea, repository search, regex, replace, and OCR remain out of scope

Tests performed

  • NODE_OPTIONS=--max-old-space-size=4096 bun run test in apps/web: 369 files / 4,287 tests passed
  • focused logic tests: 20 passed
  • real Chromium component tests for the new find flow: 4 passed
  • real Chromium preview/thread regressions: 9 passed
  • bun run fmt:check: passed
  • bun run lint: 0 errors (existing workspace warnings remain)
  • bun run typecheck: 7/7 packages passed
  • NODE_OPTIONS=--max-old-space-size=4096 bun run build in apps/web: passed

Manual / browser validation

  • exercised shortcut scope, click-to-focus, source highlighting, Markdown highlighting, match navigation, no-match feedback, close/reset focus restoration, and live query-cache file updates in Chromium
  • started an isolated Forkara instance and confirmed both services plus HTTP 200; the shared T3 preview client could not navigate to the isolated port in this environment, so no full-app screenshot was captured

Known limitations

  • intentionally searches only the currently loaded code/Markdown preview; it does not add repository search, replace, regex, or image/PDF OCR

Closes #153

@github-actions github-actions Bot added the size:XL 500-999 effective changed lines (test files excluded in mixed PRs). label Aug 31, 2026
@redxzeta
redxzeta merged commit 10f3a77 into built-from-scratch Sep 1, 2026
5 checks passed
@redxzeta
redxzeta deleted the codex/issue-153-file-preview-find branch September 1, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 effective changed lines (test files excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in-file find navigation to the active preview

1 participant