Skip to content

fix: isolate hidden pane render cadence - #2892

Merged
ogulcancelik merged 1 commit into
masterfrom
akbash/2890-hidden-pane-latency
Aug 18, 2026
Merged

fix: isolate hidden pane render cadence#2892
ogulcancelik merged 1 commit into
masterfrom
akbash/2890-hidden-pane-latency

Conversation

@akbash-bot

Copy link
Copy Markdown
Collaborator

Summary

  • separate hidden-only render attempts from the presentation cadence
  • wake the server when visible PTY or terminal-title work joins pending hidden output
  • preserve bounded hidden-output coalescing and pre-index render targets before source classification
  • add cadence, mixed-source, and title-wake regression coverage

Checks

  • release A/B/A, 100 samples: idle total/output p50 6.49/5.51 ms; hidden tab at 400 lines/s 6.17/5.38 ms; idle again 6.01/5.20 ms (before: hidden 14.61/13.42 ms vs idle 6.65/5.53 ms)
  • cargo nextest run --locked -E 'all() - test(live_server_holds_one_pty_master_fd_per_pane)' --no-fail-fast (3468 passed; excluded test also fails on clean origin/master in this VPS environment)
  • focused cadence, mixed-source, title-wake, hidden reveal, static visibility, and direct-observer tests
  • cargo clippy --all-targets --locked -- -D warnings
  • just windows-lint
  • just ui-hot-path-architecture-test
  • integration asset, plugin marketplace, and maintenance script suites
  • just bench-render-scale (1/15/50 ratios unchanged within noise; final background 1.00/1.12/1.12, active 1.00/1.24/1.43)

refs #2890

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

coderabbitai Bot commented Aug 17, 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: 53cb37cf-51f5-49c1-8522-0062271506b4

📥 Commits

Reviewing files that changed from the base of the PR and between 2427163 and 9322859.

📒 Files selected for processing (4)
  • docs/next/CHANGELOG.md
  • src/app/mod.rs
  • src/app/runtime.rs
  • src/server/headless.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/next/CHANGELOG.md
  • src/app/mod.rs
  • src/server/headless.rs

Included review availability: Your plan includes up to 10 reviews per rolling hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The render system now tracks render attempts separately from presentation attempts. Source-aware signals and render-target visibility allow visible PTY, graphics, title, and full-render work to bypass hidden-tab render cadence.

Changes

Presentation cadence and visibility

Layer / File(s) Summary
Separate render and presentation cadence
src/app/mod.rs, src/app/runtime.rs
App stores separate render and presentation timestamps. Runtime methods record every render attempt and update presentation timing only for presented frames.
Source-aware render wakeups
src/render_signal.rs
PTY and terminal-title requests report newly added sources while preserving duplicate-request coalescing. Tests cover the updated wakeup behavior.
Visible presentation selection
src/server/headless.rs, docs/next/CHANGELOG.md
Headless rendering identifies visible presentation work, includes direct terminal targets, reuses render plans, and records presentation status. A changelog entry documents the behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 93228

This change isolates hidden-pane rendering while preserving visible updates and wake-up behavior, with focused regression coverage and reported checks passing; no actionable merge-blocking risk remains beyond normal review.

Possibly related PRs

  • herdrdev/herdr#2523: Both changes update graphics-driven rendering and visibility-aware presentation handling in src/server/headless.rs.
  • herdrdev/herdr#2627: Both changes update render-signal and headless-rendering logic for terminal-title and PTY presentation cadence.

Sequence Diagram(s)

sequenceDiagram
  participant RenderSignal
  participant HeadlessRenderLoop
  participant AppRuntime
  participant VisibleTerminal
  RenderSignal->>HeadlessRenderLoop: report pending visible work
  HeadlessRenderLoop->>AppRuntime: check presentation cadence
  AppRuntime-->>HeadlessRenderLoop: allow or defer presentation
  HeadlessRenderLoop->>VisibleTerminal: render visible frame
  HeadlessRenderLoop->>AppRuntime: record render attempt and presentation status
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the render-cadence changes, wake-up behavior, regression coverage, and validation results.
Title check ✅ Passed The title concisely and accurately summarizes the main change: isolating hidden-pane render cadence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch akbash/2890-hidden-pane-latency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ogulcancelik
ogulcancelik force-pushed the akbash/2890-hidden-pane-latency branch from 2427163 to 9322859 Compare August 18, 2026 01:28
@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown

Greptile Summary

The PR separates hidden-only PTY render attempts from presentation cadence so hidden panes cannot delay visible terminal work.

  • Adds independent render-attempt and presentation timestamps.
  • Wakes pending coalesced work when a newly added PTY or terminal-title source may be visible.
  • Pre-classifies pending render sources against full-app and direct-terminal targets.
  • Adds regression coverage for hidden cadence, mixed-source wakeups, and terminal-title work.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified.

The new cadence split preserves bounded hidden-output processing while allowing visible PTY, title, generic, graphics, and full-render work to use the independent presentation cadence.

Important Files Changed

Filename Overview
src/app/mod.rs Adds and initializes the presentation timestamp and records ordinary app renders as presentation attempts.
src/app/runtime.rs Introduces independent presentation-cadence checks and centralized render-attempt accounting, with focused cadence coverage.
src/render_signal.rs Makes newly coalesced PTY and terminal-title sources wake the consumer and adds allocation-free pending-source predicates.
src/server/headless.rs Classifies pending work against connected render targets and permits presentation work to bypass hidden-only render cadence.
docs/next/CHANGELOG.md Documents the foreground-input latency fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  R[Pending render request] --> C{Normal render cadence due?}
  C -->|Yes| T[Take coalesced request]
  C -->|No| P{Presentation cadence due?}
  P -->|No| W[Wait for deadline or notification]
  P -->|Yes| V{Pending presentation work?}
  V -->|No: hidden PTY only| W
  V -->|Yes: visible PTY, title, generic, graphics, or full| T
  T --> L{Retained render plan}
  L -->|Hidden PTY| H[Record render attempt only]
  L -->|Presentation-capable plan| S[Render or stream]
  S --> A[Record render and presentation attempt]
Loading

Reviews (1): Last reviewed commit: "fix: isolate hidden pane render cadence" | Re-trigger Greptile

@ogulcancelik
ogulcancelik merged commit 2d24950 into master Aug 18, 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 18, 2026
joonhwan pushed a commit to joonhwan/herdr that referenced this pull request Aug 19, 2026
refs herdrdev#2890

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
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