nilbuild / nilbuild/diffity

Native browser find (`Ctrl/Cmd+F`) does not search the full diff in diff view

Open
#12 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
775
Forks
57
PR merge metrics
No merged PRs in 30d

Description

Problem

In diff view, native browser find only searches content that is currently mounted in the DOM. Today that means Ctrl/Cmd+F can miss valid matches because parts of the diff are intentionally hidden or not rendered:

  • Virtualized file blocks outside the viewport are not mounted.
  • Auto-collapsed files hide their diff content.
  • Rendered previews replace source diff text for renderable files.
  • Large diffs may show a Load diff placeholder instead of line content.
  • Omitted context is not present until expanded.

This makes browser find unreliable for reviewing large or mixed-content diffs.

Proposals

  • Add a temporary “browser find mode” on Ctrl/Cmd+F that fully renders the diff, expands hidden sections, and forces source view so native browser find can search the whole diff.
  • Make the normal diff mode always fully searchable by keeping all source diff text mounted in the DOM, even when sections are collapsed or previewed.
  • Build an app-level search experience instead of relying on native browser find.

Recommendation

Use a hybrid approach:

  • For small diffs, keep the normal mode fully searchable without a separate mode.
  • For large diffs, enter a temporary browser-find mode on Ctrl/Cmd+F that fully renders the diff and forces source text visible.

This keeps the common case simple while avoiding the steady-state performance and UI cost of fully rendering large diffs all the time.

Notes

  • Native browser find cannot tell us which hidden section matched, so lazy “expand only the matching file” behavior is not practical.
  • The hybrid approach preserves current performance characteristics for large diffs while improving searchability for most day-to-day reviews.
Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files or tests, so start by tracing the diff view implementation and its virtualization, collapsed-section, preview, and Load diff paths. Compare the proposed hybrid behavior and define tests for native find across hidden and rendered sections; done means matches are searchable without removing the large-diff performance characteristics.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.