Uh oh!
There was an error while loading. Please reload this page.
feat(desktop): headless visual-smoke capture, no foreground window - #161
Merged
Conversation
Visual-smoke captures launched a real Electron window that took foreground focus on every (scenario × variant), so the harness was intrusive to run during interactive work — and it could not run from a git worktree at all. - main: under MAKA_VISUAL_SMOKE_FIXTURE, create the window with `show: false` and hide the macOS dock icon, so the capture process never shows a window or steals focus. `capturePage()` still returns a painted frame on a hidden window (paintWhenInitiallyHidden defaults to true). Verified across empty / modal / settings scenarios. - main: resolve the fixture defensively. An unknown scenario (a stale build whose scenario set lags the capture script, or a typo'd env) previously threw during top-level module evaluation, which surfaced a blocking native error dialog and made the driver wait out its full ~60s marker timeout. It now logs a parseable line and exits fast with no dialog. - scripts/capture-screenshots: resolve the electron binary via Node's upward module resolution instead of hard-requiring REPO_ROOT/node_modules/electron, so a git worktree (whose node_modules holds only the workspace's own @maka/* packages) finds electron in the parent checkout. Real (non-capture) runs are unchanged — every branch is gated behind MAKA_VISUAL_SMOKE_FIXTURE.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make the visual-smoke screenshot harness headless, worktree-runnable, and crash-fast.
Why
Captures launched a real Electron window that grabbed foreground focus on every (scenario × variant), so the harness was intrusive to run during interactive work — and it could not run from a git worktree at all. A stale build also crashed each capture with a blocking native error dialog and a ~60s marker timeout.
Changes
apps/desktop/src/main/main.ts): underMAKA_VISUAL_SMOKE_FIXTURE, the window is created withshow: falseand the macOS dock icon is hidden, so the capture process never shows a window or steals focus.capturePage()still returns a painted frame on a hidden window (paintWhenInitiallyHiddendefaults to true).main.ts): an unknown scenario (stale build whose scenario set lags the capture script, or a typo'd env) now logs[visual-smoke] fatal: …and exits immediately, instead of throwing during top-level module evaluation → blocking native error dialog → ~60s marker timeout.scripts/capture-screenshots.mjs): resolve the electron binary via Node's upward module resolution instead of hard-requiringREPO_ROOT/node_modules/electron, so a git worktree (whose node_modules holds only the workspace's own@maka/*packages) finds electron in the parent checkout.All branches are gated behind
MAKA_VISUAL_SMOKE_FIXTURE; real (non-capture) runs are unchanged.Verification
[visual-smoke] fatal …and no dialog (previously 60s + native dialog).npm -w @maka/desktop run typecheckclean; desktop suite 1466 pass / 0 fail.