Skip to content

fix(tui): render the home prompt before plugins settle - #48575

Closed
rekram1-node wants to merge 1 commit into
palette-fast-bootfrom
prompt-first-boot
Closed

fix(tui): render the home prompt before plugins settle#48575
rekram1-node wants to merge 1 commit into
palette-fast-bootfrom
prompt-first-boot

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #48570.

Mount the real production Home prompt as soon as the built-in theme is ready instead of waiting for plugin reconciliation. Responsive skeleton space reserves the logo and built-in footer geometry; plugin chrome fills in without remounting or moving the focused prompt. Initial session and continue launches remain gated so they never flash a Home prompt.

Terminal-title output also waits until after frame one so it cannot serialize ahead of useful terminal output.

Performance

20 warm interleaved exact Bun 1.4.2 compiled runs:

metric baseline prompt-first
prompt bytes, median / p95 215.5 / 227ms 168 / 180ms
first accepted input, median / p95 124 / 172ms 76 / 88ms
visible input echo, median / p95 157 / 187ms 151 / 166ms
full chrome settled 228 / 240ms 243 / 258ms

Tradeoff: the prompt appears alone for roughly 70-80ms before logo/footer/plugin chrome fills in; complete chrome settles about 15ms later.

A forced 500ms plugin delay preserved immediate input, focus, textarea identity, and exact prompt position through the upgrade.

Verification

  • TUI typecheck
  • App lifecycle: 35 passed
  • Home/responsive: 21 passed
  • Theme/logo/footer focused: 18 passed
  • Added wide/narrow prompt preservation, immediate input, session/continue gating, built-in theme readiness, and responsive reserve tests

External plugins may intentionally replace the Home footer with nonstandard height; that can still reflow after activation. The reserve exactly matches built-in chrome.

Mount the production Home prompt as soon as the built-in theme is ready instead
of waiting for plugin reconciliation. Reserve the responsive logo and footer
geometry while plugins load, then fill that chrome without remounting or moving
the focused prompt. Session and continue launches remain gated.

Delay terminal-title output until after the first frame so it does not serialize
ahead of useful terminal output.

In compiled interleaved runs, prompt bytes improve from 215.5ms to 168ms and
first accepted input from 124ms to 76ms. Full chrome settles roughly 15ms later.
@rekram1-node

Copy link
Copy Markdown
Collaborator Author

Closing after correcting the benchmark harness. terminal-control 0.3.0 drained a bounded 1 KiB output queue one chunk per daemon loop, so the earlier prompt-byte result overstated the benefit of changing initial frame contents. With a non-backpressured PTY reader over 30 randomized interleaved compiled runs, this patch improves prompt bytes by only ~10-12ms and visible echo by ~9ms while stable chrome regresses ~8-10ms. That does not justify the progressive-render UX and maintenance cost. The underlying palette optimization in #48570 remains a real ~331ms win under the corrected harness.

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.

1 participant