Skip to content

refactor(desktop): remove consumer-less IPC bridge surface #1978

Description

@Astro-Han

Summary

Audit follow-up: remove IPC bridge surface with zero consumers in the renderer/overlay/e2e. All three items are safe deletions verified against current main (HEAD d20c9fc).

Findings

1. window:openSettings push has no sender since #390

  • apps/desktop/src/preload/preload.ts:1017-1018 still exposes appWindow.subscribeOpenSettings; apps/desktop/src/renderer/app-shell-effects.ts:326 subscribes (unsubscribed at :336).
  • The only sender (app-menu item 设置… / CommandOrControl+, in main-window.ts) was deleted in chore(ui): track Storybook-driven UI polish after file-boundary governance #390 (git show 5d696e463). No sender exists anywhere in main/ or the built dist/main.
  • ⌘, is already handled by the renderer keydown handler (app-shell-effects.ts:279-281), so no functional loss.

2. dailyReview.list/get/delete duplicate the live *Archive variants

  • preload/preload.ts:968-984: list/listArchives → same daily-review:list channel; get/getArchive and delete/deleteArchive likewise.
  • Renderer only calls listArchives/getArchive (apps/desktop/src/renderer/app-shell-daily-review-bridge.ts:18,23). delete has no consumer in either spelling — the whole daily-review:delete channel is renderer-dead (archive-store retention cleanup calls store.deleteArchive directly).

3. cursor-subscription:logout is not gated by the experimental flag

  • apps/desktop/src/main/subscription-ipc-main.ts:408-411 registers cursor-subscription:logout unconditionally, unlike the other 7 cursor-subscription:* channels gated by MAKA_CURSOR_SUBSCRIPTION_EXPERIMENTAL !== '0' (oauth/cursor-subscription-helpers.ts:79-80).

Proposed fix

  • Delete subscribeOpenSettings from preload + the subscribeOpenSettings/handleOpenSettings wiring in app-shell-effects.ts (keep the keydown handler).
  • Delete dailyReview.list/get/delete aliases from preload (and bridge-contract.d.ts if listed); optionally remove the daily-review:delete channel end-to-end.
  • Gate cursor-subscription:logout with the same experimental flag, or remove it with the rest of the cursor surface (see the decision issue for the cursor subscription surface).

Owner

main process / preload (IPC boundary).

Acceptance

  • Preload + renderer typecheck clean.
  • ⌘/Ctrl+, still opens settings (keydown path).
  • Daily Review archive journey unaffected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions