Uh oh!
There was an error while loading. Please reload this page.
chore(main): extract startup/lifecycle into app-lifecycle.ts (arch R6) - #1251
Merged
Conversation
…ch R6) Pure move of the post-registerIpc() startup/lifecycle tail out of main.ts into a new app-lifecycle.ts exporting wireAppLifecycle(deps): the app.whenReady() startup flow (dock icon, visual-smoke seeding, credential startup, window creation, background startup), runCredentialStartup / runBackgroundStartup / ensureBootstrapConnection / recoverInterruptedSessionsOnStartup, the window-all-closed and before-quit handlers, and runBeforeQuitCleanup. Startup ORDER and teardown ORDER are the product, so bodies are byte-identical to their originals; every process-scoped collaborator is injected. The single-instance lock and registerIpc() anchor stay in main.ts. The module-let seams follow the R5 accessor precedent: setLookupPricing reassigns the pricing lookup (read live by the session streamer + usage IPC) and getSettingsIpc reads the handle assigned inside registerIpc(); configWatcher + beforeQuitCleanup flags become app-lifecycle closure state. main.ts 1372 -> 1175 (-197).
… R6) Add app-lifecycle.ts to the main-process-contract-source-helpers aggregator so every combined-source consumer auto-covers the moved startup/lifecycle symbols. Switch the direct-main.ts readers of the moved slices to the combined source, keeping every assertion: - session-startup-recovery-contract: runBackgroundStartup block + recoverInterruptedSessionsOnStartup + whenReady ordering (block-closer regex relaxed for the now in-function indentation, per the R4 precedent) - runtime-resume-routing-contract: recoverInterruptedSessionsOnStartup block (same indentation relaxation) - subscription-shared-credential-store: safeStorage-never-invoked pin, the one-shot legacy OAuth import, and the credential-migration ordering - single-instance-lock-contract: the second-instance/activate wiring case only (the lock + focusOrCreateMainWindow-definition assertions stay on main.ts) Allowlist the moved startup/shutdown console sites at app-lifecycle.ts in check-console.mjs. registerIpc/main-process-wiring-contract anchor untouched.
Uh oh!
There was an error while loading. Please reload this page.
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.
Round 6 of notes/frontend-architecture-map-2026-07-19.md: main.ts 1372 → 1175 (−197); campaign total 1903 → 1175 (−728 across R4-R6).
Gates (merged tree): desktop 2744 · ui 196 · typecheck · check-dead-css · knip ×2 = 0 · auditor all 11 fixtures clean (each boots AND tears down). Implemented by an opus worktree agent.