Skip to content

Render native terminal results with shared scrolling and original directory links - #705

Draft
Kuddev wants to merge 6 commits into
feat/native-output-surfaces-20261021from
feat/native-result-workspace-20261021
Draft

Kuddev wants to merge 6 commits into
feat/native-output-surfaces-20261021from
feat/native-result-workspace-20261021

Conversation

@Kuddev

@Kuddev Kuddev commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Result / 用户结果

Recognized completed Markdown, JSON and Git commands can display native results in the terminal with one shared vertical viewport. Markdown keeps selectable text, compact headings, code blocks and tables; JSON supports filtering/sorting. Ordinary directory output keeps its original terminal colors, links and selection, with only the middle folded when it exceeds 20 rows: the first and last ten remain visible and can be expanded.

The explicit pebrel view --type markdown|table|git entry supports native-capability negotiation and plain redirected output. Its Git capture preserves separate stdout/stderr streams and displays progress while the child runs. Ordinary Git command capture applies only after eligible successful completion. Windows packages include a console pebrel.com entry for correct pipeline/wait/exit behavior.

原生结果共用终端滚动和坐标映射。Markdown、JSON 与 Git 输出贴合内容显示,操作在悬停或键盘焦点时出现;普通目录输出保留原始颜色、链接与选区,只折叠中间行,前后各保留十行并支持展开。

This PR is stacked on #704. Structured Git diff headers/paired line numbers follow in a separate PR. The right-click behavior correction is independently tracked by #703.

Design / 设计边界

  • A single source-to-visual projection governs rendering, pointer coordinates, links, selections, search highlights, scrollbar and following-prompt placement. Natural result height does not insert/delete VT rows or resize the PTY.
  • Result-owned tasks and retained entities preserve parsing, code-language selection, filtering and copy feedback across scrolling. Eviction releases them. Stale results cannot overwrite newer query state.
  • Table parsing/materialization is bounded; invalid or oversized data retains its source. Captured ordinary output is VT display text, while explicit native payloads retain the supplied text.
  • Commands are not re-executed to produce views. Output previews do not fetch remote images or load arbitrary HTML/local media. Directory folding reuses real terminal links rather than reconstructing paths.
  • Protocol storage is in Retain bounded command output at stable terminal surface anchors #704. This PR contains the complete renderer, its public CLI entry and packaging adaptation, with existing ownership notes under architecture/notes/.

Evidence / 验证依据

  • JSON rows have stable source-row element identities. The cached-parent regression failed before the fix and passes afterward; the maintainer confirmed the hover background follows the pointer in the actual preview on 2026-10-21.
  • Native output retains its measured fractional-row height. The default PowerShell prompt now inserts a leading newline only when the prior output has left the cursor partway through a line, so completed lines do not gain another blank line before the path. Both Powerline modes retain separation after output without a final newline; custom prompts keep their own layout.
  • Six real-console cursor/spacing cases covered first prompt, completed-line output and partial-line output with Powerline on/off. The previous script failed both completed-line cases; the corrected script passed all six. Fifteen existing PowerShell integration tests also passed, including custom prompts, Conda/venv, exit status and completion ownership.
  • The integrated source passed 30 reading tests, three projection tests and 15 pointer tests for real hover/copy/filter/sort controls, natural height, retained identity, prompt placement, original links and selections. The version-checked optimized dev product includes the prompt-spacing correction; final spacing acceptance remains pending. No numeric latency/FPS claim is made.
  • Architecture, Rust formatting, platform budgets and diff checks passed without increases. Shell completions include pebrel view; Windows build-selection/package and CLI branding checks passed in the feature validation.
  • Exact-head native CI for 0fe0ee2e is running. The preceding hover-fix head passed Linux, Windows x64 and macOS Intel; Windows ARM failed the existing Git Bash wrapped-input erase case (3,172 passed / one failed). That failure remains unresolved; successful report checks are not treated as additional native executions. Full release packaging and cross-platform desktop acceptance are separate.

Review size

Counted source changes: 4,869, below the absolute 5,000-line ceiling. The default 1,500-line limit requires an individually approved size-exempt label. The maintainer approved a one-time size-exempt exception for this PR on 2026-10-21; it does not waive native CI, visual acceptance, or the absolute ceiling. The shared viewport and its rendering/input consumers are kept together so reviewers can verify one coordinate authority; the terminal storage and structured diff feature have separate review boundaries.

Required Review / 必须确认

  • Followed contribution, architecture and project constraints.
  • Kept one shared viewport/selection authority and cohesive feature boundaries.
  • Architecture, formatting and platform budgets pass without increases.
  • Stated actual tests, physical acceptance limits and pending exact-branch CI.
  • New UI text uses typed messages with explicit language fallback.
  • Maintainer approved this PR's one-time default size-limit exception.

@github-actions github-actions Bot added the size/XL >1500 行,需拆分 / must be split label Oct 21, 2026
@github-actions

Copy link
Copy Markdown

This pull request changes 4574 source lines (default limit 1500, hard limit 5000; docs, lockfiles and assets excluded). Organize each PR around a complete, independently verifiable module. Split along cohesive boundaries when needed.

本 PR 改动 4574 行源码(默认门槛 1500,硬上限 5000,不计文档、lockfile、资源)。每个 PR 应以完整、可独立验证的功能模块为主;需要拆分时按职责边界拆分。

Maintainers may approve individual PRs up to 5000 lines with size-exempt. The hard ceiling and all other checks still apply. / 维护者可用 size-exempt 批准不超过 5000 行的个别 PR;硬上限及其他检查仍须满足。

@Kuddev Kuddev added the size-exempt 维护者批准 1501–5000 行完整模块 PR / Reviewed size exception; max 5000 lines, other checks apply label Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL >1500 行,需拆分 / must be split size-exempt 维护者批准 1501–5000 行完整模块 PR / Reviewed size exception; max 5000 lines, other checks apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant