From ef34104cf06c6cce0977db880c02dc3070ae3cae Mon Sep 17 00:00:00 2001 From: Jokin Date: Tue, 14 Jul 2026 09:17:31 +0200 Subject: [PATCH] Fix white/inverted flash when windows open Three layers: windows are created hidden and revealed on the webview's first dom-ready (800ms fallback); the bun preload bakes the persisted theme data-attributes so the first paint is already themed; and index.html carries an inline background style covering the pre-stylesheet paint (values mirrored from styles.css tokens). Co-Authored-By: Claude Fable 5 --- docs/gotchas.md | 7 ++++++ src/bun/editor-windows.ts | Bin 5734 -> 5896 bytes src/bun/index.ts | 19 +++++++++++--- src/bun/manager-window.ts | 3 +++ src/bun/windows.ts | 51 +++++++++++++++++++++++++++++++++++--- ui/src/index.html | 15 +++++++++++ 6 files changed, 88 insertions(+), 7 deletions(-) diff --git a/docs/gotchas.md b/docs/gotchas.md index 13e28a4..fc873be 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -49,6 +49,13 @@ touching the adjacent code. treatment is lost and the icon renders black on dark menu bars. - `ApplicationMenu` is macOS-only in our usage; accelerators on Windows are single-character only. ContextMenu exists on macOS+Windows, not Linux. +- **Window-open flash prevention is three-layer** — remove any one and the + white/inverted blink returns: (1) windows are created `hidden: true` and + revealed by `showWhenReady` on the webview's first `dom-ready` (800 ms + fallback), (2) the bun preload bakes the persisted `data-theme`/tone/accent + attributes before first paint (`buildPreload`), (3) `ui/src/index.html` + carries an inline `