LearnNewsExamplesServices
Frontmatter
id16092
titleTear-out popup flashes white between route admission and theme bootstrap
stateClosed
labels
bugaitestingcore
assigneesneo-gpt-emmy
createdAtJul 28, 2026, 4:46 PM
updatedAtJul 28, 2026, 9:53 PM
githubUrlhttps://github.com/neomjs/neo/issues/16092
authorneo-gpt-emmy
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 28, 2026, 9:53 PM

Tear-out popup flashes white between route admission and theme bootstrap

Closed Backlog/active-chunk-10 bugaitestingcore
neo-gpt-emmy
neo-gpt-emmy commented on Jul 28, 2026, 4:46 PM

Context

The full #15252 Take 17 native corpus closes #15955's previously untested popup-birth surface. A visible white flash occurs while a tear-out popup is created mid-gesture.

The frame sequence and source falsify the obvious diagnosis: the staged about:blank window is not the white frame. The flash belongs to the final document's pre-theme bootstrap interval.

Measured Failure

A 50 ms probe series over native media SHA-256 8771781bca0cd33d8c836804d023c37214132d362074c35d195959358a3a9667 shows:

Time Popup URL / state Visible content
6.15s about:blank dark neutral canvas
6.20s about:blank / navigation beginning white canvas
6.25s final Workstation URL visible white canvas
6.30s final Workstation URL visible white canvas
6.35s final Workstation URL themed live pane

The interval is approximately 150–200 ms in this take and is visible inside the continuous product gesture.

Authority Correction

The first proposed repair—a fixed <meta name="color-scheme" content="dark">—was falsified before review.

It removes the white excursion for Workstation's dark state, but it is not theme-correct: Workstation can explicitly run neo-theme-neo-light, while a fixed dark declaration forces the opposite bootstrap canvas. content="dark light" is not a repair either; CSS Color Adjustment lets the user agent choose from that list using host preference, which is not Neo's active runtime theme.

The exact authority already exists before popup URL construction: apps/workstation/view/Workspace.mjs#openTearOutVessel() owns me.theme. That exact selected Neo theme must cross the popup boundary and govern both:

  1. the final document's color scheme synchronously before MicroLoader.mjs; and
  2. the child viewport's initial Neo theme before its first VDOM paint.

The existing setWorkspaceTheme() same-app fan-out remains the authority for toggles after the popup is open.

Mechanism

src/Main.mjs#windowOpen() intentionally:

  1. opens same-origin children at about:blank;
  2. writes a one-use native-route token into the blank realm's sessionStorage;
  3. calls location.replace(stagedUrl).

That ordering was introduced by #15396 / PR #15573 because direct-opening the final URL can let a warm shared-worker child call getWindowData() before route authority exists.

The final apps/workstation/index.html begins MicroLoader.mjs; the loader imports neo-config.json, boots Main, and only then does the Stylesheet addon apply the configured boot theme and append asynchronous CSS links. A child born while the workspace is light therefore cannot infer its correct initial theme from Workstation's dark-first config or from prefers-color-scheme.

This is a #15955 navigation/bootstrap canvas gap, compounded by a cross-window initial-theme carrier gap. It is neither style-delta frame splitting nor dock add/remove churn.

Proposed Fix

  1. Add the validated current me.theme to the tear-out URL before Neo.Main.windowOpen().
  2. In Workstation's final document, synchronously map only neo-theme-neo-darkdark and neo-theme-neo-lightlight before MicroLoader.mjs; direct main-window boot keeps the configured dark-first default.
  3. Seed the child Workstation viewport with that same validated theme before its first VDOM paint.
  4. Keep the existing post-open same-app theme fan-out for later toggles.
  5. Preserve the #15573 route-token ordering and all failure paths.

Architectural Requirements

  • Workspace.me.theme is the popup theme authority. OS/browser preference is only a falsifier and must not choose the Neo theme.
  • One carried value governs pre-paint canvas polarity and initial viewport theme; two independently inferred values are not acceptable.
  • Only the two configured Workstation theme identifiers are admitted. Arbitrary query values must not become DOM classes or config.
  • Preserve the staged same-origin route-token sequence. Direct-opening the final URL is not an acceptable visual shortcut.
  • Keep the repair Workstation-local unless a separately justified framework contract is proven necessary.
  • Do not create a parallel skin or copy the SCSS palette into HTML.

Acceptance Criteria

  • openTearOutVessel() carries the exact validated me.theme into the child URL before windowOpen().
  • Workstation's final document establishes the matching dark or light color scheme synchronously in <head> before MicroLoader.mjs.
  • The child viewport's initial Neo theme equals the carried theme before its first VDOM paint.
  • Discriminating matrix: Neo dark + host prefers light remains dark from final-document bootstrap through first themed pane.
  • Discriminating matrix: Neo light + host prefers dark remains light from final-document bootstrap through first themed pane.
  • The witness distinguishes staged about:blank, final-document pre-theme, and first themed viewport frames.
  • Mutation control: removing or corrupting the theme carrier restores a detectable mismatch or safe configured-default fallback; it never admits an arbitrary theme class.
  • Negative control: styling only staged about:blank does not satisfy the final-document or initial-viewport assertions.
  • content="dark light" fails the contract because it delegates the choice to host preference.
  • The same-origin native-route token is written before navigation and consumed once by the correct child; every #15573 authority-ordering and failure-path test remains green.
  • An open popup follows a later Workstation dark↔light toggle and lands on the new palette, not merely a different class.
  • The full five-beat Workstation journey remains green, including popup birth, conversion, docking, and reintegration.
  • #15955 records this as a confirmed class with the native frame timestamps and repaired carrier.

Avoided Traps

  • Fixed content="dark": correct for only one Workstation state and wrong for explicit light.
  • content="dark light": selects from host preference, not Neo's active theme.
  • prefers-color-scheme as authority: OS preference and Workstation runtime theme are independent axes.
  • Styling only about:blank: the measured white frames continue after the final URL appears.
  • Retheming only after child connection: permits an opposite-theme viewport frame before correction.
  • Removing route staging or direct-opening the final URL: reopens the authority-less-popup race fixed by #15573.
  • document.write, a synthetic boot document, or duplicated palette CSS: unnecessarily takes ownership of navigation, CSP, base URL, caching, or skin authority.
  • <meta name="theme-color">: addresses browser UI, not the document canvas.
  • Calling the flash a recorder artifact: it is a physical popup surface inside the live product gesture and is source-correlated.

Prior Art / Duplicate Sweep

  • #15955 owns enumeration and explicitly left the full Take 17 popup path untested; this ticket is its confirmed-class repair leaf.
  • #15396 / PR #15573 own staged route admission and must not regress.
  • #15923 / PR #15928 moved the token bridge to the vessel viewport and added same-app post-open theme fan-out; that establishes the later-toggle authority but not the child birth carrier.
  • Live title/body, latest-open, Memory Core, Knowledge Base, and A2A sweeps found no exact open duplicate.

Related: #15252, #15396, #15573, #15923, #15928, #15955.

Origin Session ID: 019f9e1e-2ef1-72c3-a04d-6bc67a531a8b

Implementation Session ID: 019fa906-0873-7e63-aa2b-2728755b3357

Retrieval hint: query_raw_memories("popup first paint carried Neo theme opposing OS preference")

Correction 2026-07-28: The fixed-dark proposal and dark-only AC were withdrawn after exact-head native evidence exposed the missing light-theme parity axis. The ticket now names Workspace.me.theme as authority and requires an opposing Neo-theme/OS-preference matrix.

tobiu referenced in commit e981b57 - "fix(workstation): eliminate popup bootstrap white flash (#16092) (#16107) on Jul 28, 2026, 8:37 PM
tobiu closed this issue on Jul 28, 2026, 8:37 PM