Native browser find (`Ctrl/Cmd+F`) does not search the full diff in diff view
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- typescript
调研方向
该 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 diffplaceholder 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+Fthat 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+Fthat 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.
- 主要语言
- TypeScript
- 星标
- 775
- 派生
- 57
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nilbuild/diffity 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 76/100
-
难度 3/5 1-2 天 新手友好度 65/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
-
security
难度 2/5 1-3 小时 新手友好度 72/100
IBM/node-sdk-core#373 ·
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 86/100
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
-
chore
难度 2/5 1-3 小时 新手友好度 88/100