Skip to content

refactor(desktop): thread links ride upstream's desktop web link transport - #305

Merged
pandec merged 8 commits into
devfrom
chore/audit2-desktop-thread-links
Nov 25, 2026
Merged

pandec merged 8 commits into
devfrom
chore/audit2-desktop-thread-links

Conversation

@pandec

@pandec pandec commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Fork desktop thread links (t3code://app/<environmentId>/<threadId>) had their own transport: an inbox in main.ts, a queue, an IPC channel, a preload bridge and a second renderer-ready handshake. Upstream's DesktopWebLinks / DesktopWebLinkCoordinator already deliver t3code://threads/… links, so the fork transport was duplicated.

T10: thread links ride upstream's transport

  • DesktopClerk.openAppLink rewrites the documented app/ alias to upstream's threads/ link (appThreadLinkAsThreadsLink). The existing same-scheme check still applies, and pair links stay scheme-agnostic. Clerk registers its open-url listener synchronously, in the same turn as its scheme registration, and buffers until configure. This covers the macOS cold start that the fork inbox existed for.
  • Previewed pages: DesktopThreadLinkReceiver now comes from DesktopClerk.openThreadLink, which accepts this build's app/ links only.
  • DesktopWebLinks (fork lines): when no window exists after a renderer has listened once (macOS after the last window closes), a link opens a window again. This does not happen during startup.
  • Web: DesktopWebLinkCoordinator.openAppPath resolves every thread link through resolveLinkedThread before opening it in the active split pane. That covers primary, the catalog and the live thread list, archived threads, and the short error. primary is rewritten to the resolved environment in the route.
  • Removed: the inbox, queue, DesktopThreadLinks service, threadLinks IPC method, channels, preload bridge, the DesktopThreadLink contract and DesktopThreadLinkCoordinator.
  • Behavior changes: pending links are now serialized by upstream's queue instead of latest-link-wins. Upstream threads/ and hosted thread links now get the same existence checks (README updated).
  • Fork diff vs main (desktop, shared, web, contracts): +52134/−5013 → +51717/−5019. Branch: +232/−655.

Tests: parser tests ported to DesktopThreadLinks.test.ts. Clerk tests now cover the alias (cold-start open-url, own scheme, preview receiver, before configure). A DesktopWebLinks case covers reopening a window. Tests that only covered removed plumbing are deleted.

Skipped: voice-usage A5 (relaunch filter); it is out of scope for this batch.

Implemented by Claude Opus 5.5 in Claude Code (T3 Code); reviewed by Astra and Opus.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ffa2ecb and 33b0cba.

Files selected for processing: 20

  • README.md
  • apps/desktop/src/app/DesktopApp.test.ts
  • apps/desktop/src/app/DesktopApp.ts
  • apps/desktop/src/app/DesktopClerk.test.ts
  • apps/desktop/src/app/DesktopClerk.ts
  • apps/desktop/src/app/DesktopThreadLinks.test.ts
  • apps/desktop/src/app/DesktopThreadLinks.ts
  • apps/desktop/src/app/DesktopWebLinks.test.ts
  • apps/desktop/src/app/DesktopWebLinks.ts
  • apps/desktop/src/ipc/DesktopIpcHandlers.ts
  • apps/desktop/src/ipc/channels.ts
  • apps/desktop/src/ipc/methods/threadLinks.ts
  • apps/desktop/src/main.ts
  • apps/desktop/src/preload.ts
  • apps/web/src/components/desktop/DesktopThreadLinkCoordinator.tsx
  • apps/web/src/components/desktop/DesktopWebLinkCoordinator.tsx
  • apps/web/src/components/desktop/resolveLinkedThread.ts
  • apps/web/src/desktopThreadLink.ts
  • apps/web/src/routes/__root.tsx
  • packages/contracts/src/ipc.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@pandec
pandec merged commit ad5d218 into dev Nov 25, 2026
3 checks passed
@pandec
pandec deleted the chore/audit2-desktop-thread-links branch November 25, 2026 09:11
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.

1 participant