Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#12 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript
领域
frontend, web-dev

调研方向

该 issue 未指定文件或测试,因此请先追踪 diff 视图的实现,以及其中的 virtualization、collapsed-section、preview 和 Load diff 路径。比较提议的 hybrid 行为,并为覆盖隐藏和已渲染 section 的 native find 定义测试;完成的标准是:无需移除大 diff 的性能特性即可搜索到匹配项。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
TypeScript
星标
775
派生
57
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nilbuild/diffity 的其他 Issue

查看 nilbuild/diffity 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。