Skip to content

feat(templates): show windows after their initial render - #4463

Open
a5768549 wants to merge 1 commit into
electron:mainfrom
a5768549:feat/template-initial-visibility
Open

a5768549 wants to merge 1 commit into
electron:mainfrom
a5768549:feat/template-initial-visibility

Conversation

@a5768549

@a5768549 a5768549 commented Nov 2, 2026

Copy link
Copy Markdown
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable). See validation limits below; the fast suite passes, but the full packaging suite was not completed.

Summary

Closes #4436.

Set show: false in the base, Vite, and webpack templates, and register a one-time ready-to-show listener before loading the renderer. The window is shown after its initial render rather than immediately at construction. Existing preload configuration, development/production load paths, DevTools, and activation handling are preserved.

The template comments link to Electron's graceful-display documentation and explain that this does not wait for application-specific initialization, requires the default paintWhenInitiallyHidden behavior, and can be replaced with immediate display plus backgroundColor. This changes newly generated example applications, not Forge runtime behavior or existing projects.

Add regression tests that generate the JavaScript/TypeScript variants through the template APIs and execute their main-process code with controlled Electron events. They cover hidden initial state, one-time display, load targets, and window recreation on activation.

Validation

Commands used the repository-pinned Yarn CLI (node .yarn/releases/yarn-4.18.0.cjs) on Windows.

  • Template fast tests: 136 passed across 5 files, including a fresh pre-submission rerun.
  • Regression verification: the 14 new tests fail with the original template behavior and pass with the change.
  • Full fast suite: 726 passed, 6 todo in the final run. An earlier run had two init-test timeout/EBUSY failures; an isolated original-template rerun passed, so the cause remains unclassified.
  • build, lint:js, constraints, knip, template formatting, and git diff --check passed. Existing unrelated no-explicit-any warnings remain.
  • Real Windows Electron smoke checks for all three templates observed hidden creation, no display before ready-to-show, and visibility afterward. Vite/webpack used data-URL renderer fixtures, not bundled or packaged applications; base used its template HTML. Base/webpack emitted GPU exit-code diagnostics, while the assertions and processes passed.

Not validated: macOS/Linux or complete slow/Verdaccio packaging tests. test:verdaccio packages/template failed during local publication with ECONNREFUSED 127.0.0.1:4873 before tests ran. No public registry publication occurred. Full markdown/link lint was not run.

AI assistance

Hermes Agent assisted with the implementation, tests, and this description. The human contributor reviewed the complete four-file diff and explicitly approved submission. AI assistance is also disclosed in the commit trailer.

@a5768549
a5768549 requested a review from a team as a code owner November 2, 2026 02:24
@a5768549
a5768549 force-pushed the feat/template-initial-visibility branch from 3f0b2f8 to 62ccfbb Compare November 3, 2026 04:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set show: false and show windows once on ready-to-show in first-party templates

1 participant