Skip to content

refactor(desktop): centralize preload bridge contract - #1204

Merged
Astro-Han merged 3 commits into
apache:mainfrom
Nyvo-io:codex/refactor-1084-preload-bridge
Jul 18, 2026
Merged

Astro-Han merged 3 commits into
apache:mainfrom
Nyvo-io:codex/refactor-1084-preload-bridge

Conversation

@Nyvo-io

@Nyvo-io Nyvo-io commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • move the renderer-visible window.maka shape into a preload-owned MakaBridge contract
  • make the exposed preload object satisfy the shared contract and keep global.d.ts as a small global augmentation
  • move attachment blob encoding out of src/main and preserve the existing byte wire format and IPC channels
  • add dedicated preload typechecking and bridge contract coverage
  • preserve the closed PermissionActionResult failure union across the preload contract and runtime bridge

Scope

This is behavior- and visually-neutral. It does not rename IPC channels, expand renderer capabilities, or change the exposed bridge surface. The contract is aligned with the existing runtime, including memory proposal methods and permission result shapes.

Part of #1084

Verification

  • npx tsc -p apps/desktop/tsconfig.preload.json --noEmit
  • npm --workspace @maka/desktop run build:preload
  • focused bridge and attachment tests: 6 passed
  • focused Desktop contract tests: 111 passed, with one pre-existing attachment rendering failure caused by the current LocaleProvider API mismatch
  • npx biome lint on all changed source/test files
  • git diff --check

The full Desktop typecheck remains blocked by pre-existing mainline issues: the current LocaleProvider prop migration, stale mcp navigation union values, and unavailable local @maka/mcp build declarations.

@Astro-Han Astro-Han left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Superseded by the approved review below.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Closes #1084 will close the whole tracking issue when this PR merges, but #1084 still has many unchecked slices. Please change it to Part of #1084 or name the preload slice so the umbrella stays open.

Comment thread apps/desktop/src/preload/bridge-contract.d.ts Outdated
@Astro-Han

Copy link
Copy Markdown
Contributor

LGTM now. Merging!

@Astro-Han
Astro-Han merged commit 9b2632c into apache:main Jul 18, 2026
3 checks passed
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.

2 participants