Skip to content

feat(desktop): open t3code://threads links in the desktop app - #1

Open
bogorman wants to merge 1 commit into
mainfrom
desktop-thread-links
Open

bogorman wants to merge 1 commit into
mainfrom
desktop-thread-links

Conversation

@bogorman

@bogorman bogorman commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Problem

The mobile app opens t3code://threads/<environmentId>/<threadId>, and agent awareness emits that shape, but the
desktop app only raises its window (pingdotgg#9745). Other tools can only link to a thread through the local
server's web address, which opens a browser tab instead of the app.

Change

Thread links ride the existing web-link path instead of a new one:

  • Main process: the open-url handler recognises thread links. DesktopWebLinks keeps the newest one until the
    renderer says it is listening (cold start, reload, crash), then sends it and reveals the window.
  • No window open (macOS): when a link arrives with no window open, one opens the way a Dock click does
    (DesktopWindow.activate), and the link waits for it.
  • Renderer: DesktopWebLinkCoordinator navigates to /$environmentId/$threadId.
  • Index route: it no longer starts a draft over a thread link that already navigated away (this fix is from feat(desktop): open thread deep links via t3code:// pingdotgg/t3code#8246).
  • Strict parsing: the scheme, the threads host, a UUID environment id and one URI-encoded thread segment.
    Anything else is ignored, so the scheme can only open a thread. Sign-in links are untouched.
  • Docs: docs/user/thread-links.md.

105 lines of app code plus tests. This is a smaller take on pingdotgg#8246, which covers the same links with its
own subscribe/acknowledge handshake. It reuses the web-link delivery the app already has, and it also opens a window
when none is open, which pingdotgg#8246 doesn't.

Not covered: Windows and Linux (links arrive as process arguments there), and the t3code://app/... alias.

Testing

  • DesktopWebLinks.test.ts: parsing (valid, encoded, wrong scheme or host, extra segments, query, fragment, bad
    encoding), and holding the newest link until the renderer listens, delivered once.
  • DesktopClerk.test.ts: a thread link is handled and opens a window; non-thread links are left alone.
  • Desktop suite: 1,447 tests pass. Web suite: 6,599 tests pass. Type checks and format are clean.
  • Manual check on a packaged macOS build is still to do: cold start, app running, window closed, minimised.

🤖 Generated with Claude Code

Closes #4

The mobile app opens t3code://threads/<environmentId>/<threadId>, and agent awareness emits that
shape, but the desktop app only raised its window. Thread links now ride the existing web-link
path: DesktopWebLinks keeps the newest one until the renderer listens (cold start, reload), then
the renderer navigates to the thread. On macOS a link that arrives with no window open opens one,
the way a Dock click does.

- strict parse: scheme, threads host, UUID environment, one encoded thread segment, nothing else
- the index route no longer starts a draft over a thread link that already navigated away
  (from pingdotgg#8246)
- docs/user/thread-links.md

A smaller take on pingdotgg#8246, which covers the same links with its own delivery handshake.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 opens t3code://threads links

1 participant