[GH-ISSUE #4538] [Issue]: NovelAI style plate blanks the connection editor on file-dialog open, and the image is never saved (v2.4.0, packaged launcher) #2473

Closed
opened 2026-10-21 05:48:32 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @jswen4-tech on GitHub (Aug 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4538

Originally assigned to: @SpicyMarinara on GitHub.

Follow-up to #3757 (closed but not fixed; still reproduces on v2.4.0).

There are two linked failures. Both are reproducible; the second is the real blocker.

  1. The editor blanks the moment the OS file dialog opens

Steps: Connections → open a NovelAI image-generation connection → NovelAI generation setup → NovelAI V4.5 style plate → Choose image.

The connection editor content goes dark immediately — even on Cancel with no file selected. The app shell (sidebars, toolbar) stays; only the editor region goes dark. A window resize does not restore it, but forcing a repaint another way (e.g. selecting a node in DevTools) does. That points to a compositor/paint problem on focus loss rather than a layout change.

  1. The picked image is never persisted (packaged launcher)

After choosing an image, the style plate is empty after (a) switching to another connection and back, and (b) a full refresh. The image never survives. Save can't be reached normally because the editor is blanked at the moment of selection; even when forced back and saved, it hasn't reliably persisted on the launcher.

Key clue — source vs. packaged build differ

Packaged launcher (MarinaraLauncher.exe, served at 127.0.0.1:7860 in Chrome): image does not persist. While the editor is blank, React DevTools shows no ConnectionEditor in the component tree — suggesting the editor unmounts/closes on file-dialog blur rather than merely failing to paint. This would explain why the image can't be saved.
From source (pnpm dev, localhost:5173): the editor stays mounted and the image does survive a refresh.

So the behavior is packaged-build-specific, which seems like the most important lead.

Ruled out (from source reading + live DevTools):

Not the style-plate render/upload code — handleNovelAiStylePlateUpload and the render block are clean.
Not a thrown error — with "pause on caught exceptions" enabled, nothing throws on repro.
Not the marinaraEffectsPaused CSS — those rules only target the logo and RGB toggle.
Not the app background-paint effect (App.tsx ~L577) — no focus/blur dependency; the dark is just the default getDefaultAppBackgroundColor showing through an empty appBackgroundColor (
#0b0b0f).
Not backdrop-filter; not a height collapse (panel elements retain height; elementsFromPoint at center hits only the bare app shell).

Likely suspect

Console logs [Violation] 'blur' handler took ~200ms on click. usePageActivity() (hooks/use-page-activity.ts) returns isPageActive = document.visibilityState === "visible" && document.hasFocus() and listens on window blur. Opening an OS file dialog blurs the window → isPageActive flips false. A transient focus loss to a file dialog isn't the tab being hidden, but several render paths consume isPageActive.

Suggested direction

Check what unmounts/dismisses the connection editor on window blur in the packaged build — the editor leaving the React tree on file-dialog open is the core bug and explains why the image can't be saved.
Consider basing isPageActive on visibilitychange only (drop the window blur/hasFocus() term), or ensure only decorative/animation paths consume it — never the editor's mount/visibility.

Environment: Marinara Engine v2.4.0, Windows, stock install. Reproduced via packaged launcher and pnpm dev. Chrome, Brave, Firefox.

I can build from source and test any patch within a minute.

Originally created by @jswen4-tech on GitHub (Aug 3, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4538 Originally assigned to: @SpicyMarinara on GitHub. Follow-up to #3757 (closed but not fixed; still reproduces on v2.4.0). There are two linked failures. Both are reproducible; the second is the real blocker. 1. The editor blanks the moment the OS file dialog opens Steps: Connections → open a NovelAI image-generation connection → NovelAI generation setup → NovelAI V4.5 style plate → Choose image. The connection editor content goes dark immediately — even on Cancel with no file selected. The app shell (sidebars, toolbar) stays; only the editor region goes dark. A window resize does not restore it, but forcing a repaint another way (e.g. selecting a node in DevTools) does. That points to a compositor/paint problem on focus loss rather than a layout change. 2. The picked image is never persisted (packaged launcher) After choosing an image, the style plate is empty after (a) switching to another connection and back, and (b) a full refresh. The image never survives. Save can't be reached normally because the editor is blanked at the moment of selection; even when forced back and saved, it hasn't reliably persisted on the launcher. Key clue — source vs. packaged build differ Packaged launcher (MarinaraLauncher.exe, served at 127.0.0.1:7860 in Chrome): image does not persist. While the editor is blank, React DevTools shows no ConnectionEditor in the component tree — suggesting the editor unmounts/closes on file-dialog blur rather than merely failing to paint. This would explain why the image can't be saved. From source (pnpm dev, localhost:5173): the editor stays mounted and the image does survive a refresh. So the behavior is packaged-build-specific, which seems like the most important lead. Ruled out (from source reading + live DevTools): Not the style-plate render/upload code — handleNovelAiStylePlateUpload and the render block are clean. Not a thrown error — with "pause on caught exceptions" enabled, nothing throws on repro. Not the marinaraEffectsPaused CSS — those rules only target the logo and RGB toggle. Not the app background-paint effect (App.tsx ~L577) — no focus/blur dependency; the dark is just the default getDefaultAppBackgroundColor showing through an empty appBackgroundColor ( #0b0b0f). Not backdrop-filter; not a height collapse (panel elements retain height; elementsFromPoint at center hits only the bare app shell). Likely suspect Console logs [Violation] 'blur' handler took ~200ms on click. usePageActivity() (hooks/use-page-activity.ts) returns isPageActive = document.visibilityState === "visible" && document.hasFocus() and listens on window blur. Opening an OS file dialog blurs the window → isPageActive flips false. A transient focus loss to a file dialog isn't the tab being hidden, but several render paths consume isPageActive. Suggested direction Check what unmounts/dismisses the connection editor on window blur in the packaged build — the editor leaving the React tree on file-dialog open is the core bug and explains why the image can't be saved. Consider basing isPageActive on visibilitychange only (drop the window blur/hasFocus() term), or ensure only decorative/animation paths consume it — never the editor's mount/visibility. Environment: Marinara Engine v2.4.0, Windows, stock install. Reproduced via packaged launcher and pnpm dev. Chrome, Brave, Firefox. I can build from source and test any patch within a minute.
bsakaguchi 2026-10-21 05:48:32 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 4, 2026):

Implementation has started in draft PR #4553. Owner: @SpicyMarinara.

<!-- gh-comment-id:5175454770 --> @SpicyMarinara commented on GitHub (Aug 4, 2026): Implementation has started in draft PR #4553. Owner: @SpicyMarinara.
Author
Owner

@SpicyMarinara commented on GitHub (Aug 4, 2026):

Delivered to staging via #4553 (merge commit 7708b7f0b2).

<!-- gh-comment-id:5175920536 --> @SpicyMarinara commented on GitHub (Aug 4, 2026): Delivered to staging via #4553 (merge commit 7708b7f0b2581b90ae4fdc9e2eba787796005fab).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2473
No description provided.