Skip to content

Delay hook output preview rendering#2140

Merged
j178 merged 1 commit into
masterfrom
delay-hook-output-preview
Jun 2, 2026
Merged

Delay hook output preview rendering#2140
j178 merged 1 commit into
masterfrom
delay-hook-output-preview

Conversation

@j178
Copy link
Copy Markdown
Owner

@j178 j178 commented Jun 2, 2026

No description provided.

@j178 j178 added the enhancement New feature or request label Jun 2, 2026
@j178 j178 marked this pull request as ready for review June 2, 2026 06:59
Copilot AI review requested due to automatic review settings June 2, 2026 06:59
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.39%. Comparing base (a54fdf0) to head (27428bc).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2140      +/-   ##
==========================================
+ Coverage   92.38%   92.39%   +0.01%     
==========================================
  Files         122      122              
  Lines       25770    25815      +45     
==========================================
+ Hits        23808    23853      +45     
  Misses       1962     1962              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a 500ms grace period before the per-hook output preview rows are rendered, so that fast hooks don't briefly flash preview lines on screen before disappearing. Output is still buffered in OutputPreview during the delay; once the threshold passes, the next chunk renders the accumulated lines.

Changes:

  • Track each hook's started_at: Instant in HookBar.
  • In push_output, short‑circuit before creating any preview ProgressBar while elapsed time is below HOOK_OUTPUT_PREVIEW_DELAY (500ms) and no preview bars exist yet.
  • Add unit tests covering the pre‑delay buffering and post‑delay flush behavior.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27428bc2d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +71 to +72
if self.output_bars.is_empty() && self.started_at.elapsed() < HOOK_OUTPUT_PREVIEW_DELAY {
return None;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Flush buffered preview output after the delay elapses

When a hook writes output during the first 500 ms and then stays running without producing another chunk, this early return leaves the preview buffered indefinitely because push_output is only called from on_run_output; there is no timer or completion path that re-renders once HOOK_OUTPUT_PREVIEW_DELAY has elapsed. A long-running hook that prints an initial status line and then hangs or performs a slow step will therefore show no preview until it emits more output, which defeats the delayed-rendering behavior for exactly the case where users need live feedback.

Useful? React with 👍 / 👎.

@j178 j178 merged commit 00b2520 into master Jun 2, 2026
34 checks passed
@j178 j178 deleted the delay-hook-output-preview branch June 2, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants