Skip to content

Prevent terminal loading flash - #5432

Merged
juliusmarminge merged 1 commit into
mainfrom
smooth-terminal-loading-state
Aug 5, 2026
Merged

Prevent terminal loading flash#5432
juliusmarminge merged 1 commit into
mainfrom
smooth-terminal-loading-state

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 5, 2026

Copy link
Copy Markdown
Member

What Changed

Paint the terminal canvas with the configured theme background immediately after creating its 2D context, before font and WASM initialization completes.

Why

Opaque canvas backing stores start black, causing a visible black box during terminal setup. Initializing the canvas with the theme background prevents the loading flash while the terminal finishes mounting.

UI Changes

The terminal no longer flashes black during initialization. Before/after screenshots are not included.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Single early paint in terminal mount path; no auth, data, or behavioral logic changes.

Overview
Fixes a black flash while the Ghostty terminal canvas is still setting up (fonts, WASM, first render).

Right after creating the opaque 2D context in GhosttyTerminalSurface.create, the canvas is filled once with options.theme.background so the mount shows the theme color instead of the default black backing store until initialization finishes.

Reviewed by Cursor Bugbot for commit 4dc2b90. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Prevent black canvas flash during terminal initialization

Fills the canvas with the theme background color immediately after the 2D context is created in GhosttyTerminalSurface, before async font loading begins. This eliminates a transient black frame visible during terminal startup.

Macroscope summarized 4dc2b90.

- Paint the themed canvas background before font and WASM initialization
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e359dba7-f352-4ba9-918f-cc7134a8a773

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Aug 5, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 4dc2b90

Simple visual fix that paints the terminal canvas with the theme background color to prevent a black flash during initialization. Uses existing theme configuration and standard canvas APIs with no runtime behavior changes beyond the cosmetic improvement.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge
juliusmarminge merged commit 7251f1a into main Aug 5, 2026
17 checks passed
@juliusmarminge
juliusmarminge deleted the smooth-terminal-loading-state branch August 5, 2026 21:09
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 5, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
cursor Bot pushed a commit to aaditagrawal/t3code that referenced this pull request Aug 6, 2026
omegent-app Bot added a commit to patroza/t3code that referenced this pull request Aug 6, 2026
Imports the tree delta from the fork/candidates tree recorded in the
fork-dev/2026-08-06.1 checkpoint to a rebuilt fork/candidates carrying upstream
main a2ca89a. Five upstream commits enter the product:

  a2ca89a feat: native subagent & workflow observability (pingdotgg#5219)
  990bb0b fix: reconnect faster after remote server updates (pingdotgg#5404)
  7251f1a Prevent terminal loading flash (pingdotgg#5432)
  30e4715 fix(web): preserve terminal font size when splitting (pingdotgg#5444)
  de592a0 Enrich terminal font previews (pingdotgg#5428)

  importedCandidatesCommit: 9655a9ba955197361044ef6f8f97e35841ff779e
  importedCandidatesTree:   50f9bfab717c30a8ea90d52060349e209502d116
  importedUpstreamCommit:   a2ca89a
  previousCandidatesTree:   9b4cd3e

Seven files conflicted against the fork/dev product tree. Most are independent
additions on both sides and resolve as unions: upstream's backgroundLiveness
alongside identity's originSource/participantSummaries, upstream's agent-spawn
CTA rows alongside the imported user-input Q&A timeline.

Two needed more than a union.

apps/mobile threadActivity.ts: upstream's isAgentInternalActivity skip guard
must run before identity's resolved-user-input enrichment. Concatenating the
sides in the other order would enrich and push agent-internal rows that
upstream intends to drop.

apps/web Sidebar.logic.ts: the 3-way merge welded upstream's hasPlanReadyPrompt
condition onto the "Wake Required" return body, so a plan-ready thread would
have rendered as Wake Required and no thread could ever reach Plan Ready. Both
branches are restored with their own bodies. The status rank map is merged onto
upstream's new scale with Wake Required kept at the Working/Connecting tier,
matching its relative position before the import.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
omegent-app Bot added a commit to patroza/t3code that referenced this pull request Aug 6, 2026
Imports the tree delta from the fork/candidates tree recorded in the
fork-dev/2026-08-06.1 checkpoint to a rebuilt fork/candidates carrying upstream
main a2ca89a. Five upstream commits enter the product:

  a2ca89a feat: native subagent & workflow observability (pingdotgg#5219)
  990bb0b fix: reconnect faster after remote server updates (pingdotgg#5404)
  7251f1a Prevent terminal loading flash (pingdotgg#5432)
  30e4715 fix(web): preserve terminal font size when splitting (pingdotgg#5444)
  de592a0 Enrich terminal font previews (pingdotgg#5428)

  importedCandidatesCommit: 9655a9b
  importedCandidatesTree:   50f9bfa
  importedUpstreamCommit:   a2ca89a
  previousCandidatesTree:   9b4cd3e

Seven files conflicted against the fork/dev product tree. Most are independent
additions on both sides and resolve as unions: upstream's backgroundLiveness
alongside identity's originSource/participantSummaries, upstream's agent-spawn
CTA rows alongside the imported user-input Q&A timeline.

Two needed more than a union.

apps/mobile threadActivity.ts: upstream's isAgentInternalActivity skip guard
must run before identity's resolved-user-input enrichment. Concatenating the
sides in the other order would enrich and push agent-internal rows that
upstream intends to drop.

apps/web Sidebar.logic.ts: the 3-way merge welded upstream's hasPlanReadyPrompt
condition onto the "Wake Required" return body, so a plan-ready thread would
have rendered as Wake Required and no thread could ever reach Plan Ready. Both
branches are restored with their own bodies. The status rank map is merged onto
upstream's new scale with Wake Required kept at the Working/Connecting tier,
matching its relative position before the import.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
omegent-app Bot added a commit to patroza/t3code that referenced this pull request Aug 6, 2026
Imports the tree delta from the fork/candidates tree recorded in the
fork-dev/2026-08-06.1 checkpoint to a rebuilt fork/candidates carrying upstream
main a2ca89a. Five upstream commits enter the product:

  a2ca89a feat: native subagent & workflow observability (pingdotgg#5219)
  990bb0b fix: reconnect faster after remote server updates (pingdotgg#5404)
  7251f1a Prevent terminal loading flash (pingdotgg#5432)
  30e4715 fix(web): preserve terminal font size when splitting (pingdotgg#5444)
  de592a0 Enrich terminal font previews (pingdotgg#5428)

  importedCandidatesCommit: 9655a9b
  importedCandidatesTree:   50f9bfa
  importedUpstreamCommit:   a2ca89a
  previousCandidatesTree:   9b4cd3e

Seven files conflicted against the fork/dev product tree. Most are independent
additions on both sides and resolve as unions: upstream's backgroundLiveness
alongside identity's originSource/participantSummaries, upstream's agent-spawn
CTA rows alongside the imported user-input Q&A timeline.

Two needed more than a union.

apps/mobile threadActivity.ts: upstream's isAgentInternalActivity skip guard
must run before identity's resolved-user-input enrichment. Concatenating the
sides in the other order would enrich and push agent-internal rows that
upstream intends to drop.

apps/web Sidebar.logic.ts: the 3-way merge welded upstream's hasPlanReadyPrompt
condition onto the "Wake Required" return body, so a plan-ready thread would
have rendered as Wake Required and no thread could ever reach Plan Ready. Both
branches are restored with their own bodies. The status rank map is merged onto
upstream's new scale with Wake Required kept at the Working/Connecting tier,
matching its relative position before the import.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
patroza added a commit to patroza/t3code that referenced this pull request Aug 6, 2026
First run of the provenance synchronization from
[#342](#342) — and the answer to
"get the latest upstream onto
`fork/dev`". Five upstream commits enter the product:

| | |
| --- | --- |
| `a2ca89aa` | feat: native subagent & workflow observability (pingdotgg#5219) |
| `990bb0b6` | fix: reconnect faster after remote server updates (pingdotgg#5404)
|
| `7251f1a1` | Prevent terminal loading flash (pingdotgg#5432) |
| `30e47153` | fix(web): preserve terminal font size when splitting
(pingdotgg#5444) |
| `de592a00` | Enrich terminal font previews (pingdotgg#5428) |

54 files, +7,055 / −175.

## Checkpoint

```json
{
  "importedCandidatesCommit": "9655a9ba955197361044ef6f8f97e35841ff779e",
  "importedCandidatesTree":   "50f9bfab717c30a8ea90d52060349e209502d116",
  "importedUpstreamCommit":   "a2ca89aa10f13a2222e08afd98c66285121d5ba2",
  "previousCandidatesTree":   "9b4cd3e1c774c3c436e43305c151edf596b2936a"
}
```

`previousCandidatesTree` is C1 from tag `fork-dev/2026-08-06.1`. Tag the
merge commit
`fork-dev/2026-08-06.2` with the values above once this lands.

## Two resolutions worth reviewing

Most of the 7 conflicted files are independent additions on both sides
and resolve as unions —
upstream's `backgroundLiveness` beside identity's
`originSource`/`participantSummaries`, upstream's
agent-spawn CTA rows beside the imported user-input Q&A timeline. Two
were not unions:

**`apps/web/src/components/Sidebar.logic.ts`** — the 3-way merge welded
upstream's
`hasPlanReadyPrompt` condition onto the `"Wake Required"` return body.
Left alone, a plan-ready
thread would render as **Wake Required** and no thread could ever reach
**Plan Ready**. Both
branches are restored with their own bodies. The status rank map is
merged onto upstream's new scale
with `Wake Required` at the `Working`/`Connecting` tier — its relative
position before the import.
**That tier placement is a judgement call; say if you want it ranked
differently.**

**`apps/mobile/src/lib/threadActivity.ts`** — upstream's
`isAgentInternalActivity` skip guard must
run *before* identity's resolved-user-input enrichment. The other order
enriches and pushes exactly
the agent-internal rows upstream means to drop.

## Validation

- All 12 `fork/candidates` commits replayed onto the rebuilt `fork/tim`;
`a2ca89aa1` confirmed an
  ancestor of the new candidates tip.
- No residual conflict markers; brace balance checked on the hand-edited
files.
- **Typecheck and tests have not run locally** — the rebase workspace
has no `node_modules`. Fork CI
on this PR is the first real verification. Do not merge on the strength
of this description.

## Provenance branches not yet pushed

`fork/base` → `4a73589` and `fork/tim` → `b1c5fa5` are rebased and
`fork/candidates` → `9655a9ba`
is rebuilt, but all three are **local only**. The ruleset *Protect
fork/tim, candidates, integration*
sets `non_fast_forward` with no bypass actor and the app token has no
`administration` scope, so I
cannot force-push them. Until they are pushed,
`importedCandidatesCommit` refers to a commit that
exists nowhere on the remote. The tree is what the delta depends on, but
the checkpoint is not fully
honest until that push happens.

Co-authored by [@patroza](https://github.com/patroza)

opened by [Patrick Roza](https://discord.com/users/95218063095377920) in
chat thread **Discord** ·
[Discord](https://discord.com/channels/1083767712431480922/1534783738322485399/1534783738322485399)
· [T3](https://t3vm/?thread=584a9ad3-243e-4308-8a13-49acdd758b17)

Co-authored-by: omegent-app[bot] <306514130+omegent-app[bot]@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant