Skip to content

refactor(desktop): modularize desktop main process#365

Merged
Whiteks1 merged 1 commit intomainfrom
codex/issue-353-modularize-main-process
Apr 10, 2026
Merged

refactor(desktop): modularize desktop main process#365
Whiteks1 merged 1 commit intomainfrom
codex/issue-353-modularize-main-process

Conversation

@Whiteks1
Copy link
Copy Markdown
Owner

Summary

  • Split desktop/main.js into responsibility-based modules for config, local stores, workspace state, research_ui lifecycle, Stepbit chat, smoke support, window creation, and IPC registration.
  • Keep desktop runtime behavior unchanged while reducing main.js to app lifecycle wiring and service composition.

Issue

Why

  • The TypeScript base is already in place, so the next structural boundary is the Electron main process itself.
  • This makes the upcoming typed preload work and later renderer migration safer by removing the current monolithic main-process coupling.

Scope

This PR does not:

  • Add unrelated feature work.
  • Expand scope beyond the slice.
  • Introduce a second source of truth for the same content or behavior.

Validation

Validated with:

  • npm run typecheck
  • node --check main.js
  • Get-ChildItem desktop/main/*.js | ForEach-Object { node --check $_.FullName }
  • node --check preload.js
  • node --check renderer/app.js
  • npm run smoke:fallback
  • npm run smoke:real-path

Duplication Check

  • I searched for existing docs, surfaces, or contracts covering the same idea.
  • I removed or replaced stale copies instead of keeping both versions.
  • I did not introduce alternate lockfiles, package managers, or build paths.

Compatibility / Risk

  • No visible desktop behavior change is intended; this is a main-process structure slice only.
  • Main risk is lifecycle drift across extracted services, contained here by keeping the current JS runtime and validating both smoke modes.

Notes

  • This PR does not introduce React, Vite, preload bridge changes, or renderer work.
  • smoke:fallback failed once locally with a transient Unexpected end of JSON input, then passed on rerun; the final validated run is green.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Whiteks1, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Whiteks1 Whiteks1 merged commit ac16dc5 into main Apr 10, 2026
3 checks passed
@Whiteks1 Whiteks1 deleted the codex/issue-353-modularize-main-process branch April 10, 2026 14:50
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.

desktop(architecture): modularize desktop main process after TypeScript base

1 participant