Skip to content

perf(ui): avoid full pane mode reads for scrollbars - #2554

Merged
ogulcancelik merged 1 commit into
masterfrom
akbash/2550-fast-scrollbar-state-read
Aug 9, 2026
Merged

perf(ui): avoid full pane mode reads for scrollbars#2554
ogulcancelik merged 1 commit into
masterfrom
akbash/2550-fast-scrollbar-state-read

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Summary

  • query only authoritative alternate-screen state when computing scrollbar gutters
  • avoid collecting unrelated terminal input modes for every background pane during full renders
  • preserve primary/alternate-screen gutter and background resize behavior

Checks

  • cargo test alternate_screen_reclaims_scrollbar_gutter_and_restores_it_on_exit
  • live 120x40 PTY profile: one workspace 6.17–6.45 ms; 15 workspaces 6.61–7.43 ms steady full_render.render_virtual averages
  • cargo fmt --check and cargo clippy --all-targets --locked -- -D warnings
  • local just check nextest run reached 963 passing tests, then hit the unrelated live_server_holds_one_pty_master_fd_per_pane helper assumption that the binary lives below checkout target/debug; Kennel uses an external isolated CARGO_TARGET_DIR

refs #2550

@kangal-bot kangal-bot added the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 40886739-ed2c-4f8f-8a00-1624a358171d

📥 Commits

Reviewing files that changed from the base of the PR and between d277d2f and 6a5ad18.

📒 Files selected for processing (4)
  • src/pane.rs
  • src/pane/terminal.rs
  • src/terminal/runtime.rs
  • src/ui/panes.rs

📝 Walkthrough

Walkthrough

The change adds alternate-screen state accessors across terminal runtime layers. terminal_inner_rect now uses the runtime state instead of input state when reserving the scrollbar column.

Changes

Alternate screen state

Layer / File(s) Summary
Terminal state accessor
src/pane/terminal.rs
PaneTerminal and GhosttyPaneTerminal expose alternate_screen_active(). The lower-level accessor returns false when state access fails.
Runtime and layout integration
src/pane.rs, src/terminal/runtime.rs, src/ui/panes.rs
Runtime layers delegate alternate-screen queries. terminal_inner_rect uses the runtime query for scrollbar-gutter behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • herdrdev/herdr#2086: Uses alternate-screen detection for scrollback-preservation logic.
  • herdrdev/herdr#2538: Also changes scrollbar-gutter behavior in src/ui/panes.rs based on alternate-screen state.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main performance change: avoiding full pane mode reads during scrollbar computation.
Description check ✅ Passed The description directly explains the scrollbar optimization, preserved behavior, performance checks, and test results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2550-fast-scrollbar-state-read

Comment @coderabbitai help to get the list of available commands.

@ogulcancelik
ogulcancelik merged commit e7c38ab into master Aug 9, 2026
7 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants