Skip to content

Render selectable Git patches with paired line numbers and file collapse - #706

Draft
Kuddev wants to merge 8 commits into
feat/native-result-workspace-20261021from
feat/native-git-diff-20261021
Draft

Kuddev wants to merge 8 commits into
feat/native-result-workspace-20261021from
feat/native-git-diff-20261021

Conversation

@Kuddev

@Kuddev Kuddev commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Result / 用户结果

Native Git patches now show file headers, addition/deletion counts, paired old/new line numbers and individual file collapse. Bodies retain text selection and horizontal scrolling for long lines; copying the result preserves the original patch, including file headers and signs. Unsupported combined/binary patches, incomplete hunks and display limits fall back to retained raw output.

Git 差异增加文件头、增删计数、双列行号和逐文件折叠,保留文本选择、长行横向滚动与完整原文复制。无法可靠解释的格式回到原文显示。

This PR is stacked on #705. Counted source changes: 1,023.

Design / 设计边界

The bounded pure parser interprets captured output without running Git or accessing paths. Parsing uses the existing result-owned background task, with revision/eviction checks. Shared bodies and retained code entities keep parsing and text measurement off the stable hover path; gutters and backgrounds stay outside copied text.

Mouse activation moves focus away from the PTY, while keyboard activation retains the file button for repeated toggling. Floating tools leave the collapse hit area clear at the top of the viewport. The existing terminal remains the vertical-scroll owner.

Evidence / 验证依据

  • The shared hover/height and PowerShell prompt-spacing corrections from Render native terminal results with shared scrolling and original directory links #705 are synchronized at 1e28847c. Exact-head CI is running; the preceding 848991c9 head passed its selected Linux native suite (run). Windows and macOS were not selected for that diff-only run, so their report checks do not represent native executions.
  • Three parser tests passed for paired line numbers/source ranges, quoted UTF-8 paths, metadata, blank context/no-newline handling, invalid/incomplete/unsupported patches and limits.
  • All 30 reading interaction tests passed, including collapse hit padding, toolbar separation, Tab/Enter, repeated keyboard toggling, complete patch copying and raw fallback. All 15 pointer tests passed; controls do not send Tab/Enter to the PTY. Three shared projection tests passed.
  • Four existing native-result internal tests passed. Translation contracts passed 24 tests with one existing manual benchmark ignored. Architecture, formatting and diff checks passed.
  • An optimized integrated dev product was built and version-checked with the latest prompt-spacing correction. The maintainer accepted the JSON hover behavior in the actual preview. Prompt/output spacing and structured-diff visual acceptance remain separate; no quantified latency/FPS improvement is claimed.

Required Review / 必须确认

  • Followed contribution, architecture and project constraints.
  • Reused the existing selectable-text, copy-feedback and scroll owners.
  • Architecture and default PR-size budgets pass without exceptions.
  • Covered interaction/error paths and stated validation limits.
  • New control labels use typed messages and explicit fallback.

@github-actions github-actions Bot added the size/L 501–1500 行 label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L 501–1500 行

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant