Skip to content

solenta:// deep links to threads and projects (#186) - #1573

Merged
currentbits merged 2 commits into
mainfrom
coder/solenta-deep-links-186
Oct 10, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/solenta-deep-links-186

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #186.

What

  • Packaged builds register solenta://. solenta://thread/<id> opens the thread: it switches to the thread view and highlights the sidebar row. solenta://project/<id> sets the sidebar's project filter.
  • Copy link actions: thread header overflow menu, sidebar thread right-click menu, and a link icon in each project row of the project filter menu.
  • Notification clicks now go through the same path, so they also switch away from kanban and other views (before, they only changed the selection).

How

  • electron/deepLinks.js parses links. It accepts only thread/project with an [A-Za-z0-9_-] id, and main checks the id exists in the store before pushing thread:select or project:select.
  • macOS: links arrive via open-url. scripts/package-app.sh adds CFBundleURLTypes so LaunchServices routes the scheme to the app.
  • Windows/Linux packaged builds now take the single-instance lock. A second launch passes its link through second-instance and exits with app.exit(0), so it never starts a second store writer.
  • Cold launch: a link waits until boot:ready. The preload also holds the last select push until the renderer subscribes, because ipcRenderer drops pushes that have no listener.
  • New push channel project:select is added to ipcChannels, preload, ipc types, the wire list, devCoder and fakeCoder.

Behaviour changes / limits

  • Windows/Linux: a second packaged launch now focuses the running app and exits, instead of booting a second copy.
  • Nightly and prod both claim solenta://. On macOS, whichever was launched last gets the links.
  • Linux ships no .desktop file yet, so the scheme can't be registered there. That's a follow-up.

Tests

  • electron/test/deepLinks.test.js: link parsing and finding the link in argv.
  • test/appWiring.test.tsx: thread:select opens the thread from kanban, and project:select scopes the sidebar.
  • Local results: npm run typecheck, vite build, and test:electron with a CI-like env all pass (4474 pass / 0 fail).

🤖 Generated with Claude Code

Register the solenta:// scheme in packaged builds. macOS links arrive via
open-url. On Windows/Linux the app now holds the single-instance lock and
forwards argv links from second-instance. solenta://thread/<id> opens the
thread: it switches view and reveals the sidebar row, and notification
clicks get the same path. solenta://project/<id> scopes the sidebar to the
project. The preload holds a link that arrives on cold launch until React
subscribes.

Copy link is in the thread header menu, the sidebar row menu and the
project scope menu. package-app.sh declares CFBundleURLTypes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T07:59:27.288349Z f34839c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit c1c071b into main Oct 10, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f34839cb43

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread electron/main.js
/** @type {{ kind: "thread" | "project", id: string } | null} */
let pendingDeepLink = deepLinkFromArgv(process.argv);
if (app.isPackaged) {
app.setAsDefaultProtocolClient(DEEP_LINK_SCHEME);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Ship a protocol handler with the Linux artifact

For the Linux build produced by scripts/package-cross.sh, this call cannot make clicked solenta:// links launch Solenta: the script creates only a portable Electron directory and never creates or installs a .desktop entry advertising x-scheme-handler/solenta. Electron's packaging documentation explicitly requires updating the Linux .desktop file for deep links, so this feature is unavailable to Linux users until the artifact supplies and registers that metadata. Electron deep-link packaging documentation

Useful? React with 👍 / 👎.

Comment on lines +1038 to +1040
setProjectScope(scopeRequest);
saveStored(SCOPE_KEY, scopeRequest);
onScopeRequestHandled?.();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve project links until projects finish loading

On a cold launch, the renderer intentionally mounts before the store-backed lists are available, but this effect immediately applies and clears the request. On the following render, the existing stale-scope effect at lines 594–600 sees that the still-empty projectById does not contain the requested ID and resets the scope before the boot:ready-triggered projects.list() completes. Consequently, a cold-start solenta://project/... link commonly opens unscoped; keep the request pending until the project list has loaded and contains the ID.

Useful? React with 👍 / 👎.

Comment thread electron/main.js
Comment on lines +430 to +432
const win = focusMainWindow();
if (win && !win.webContents.isDestroyed()) {
win.webContents.send(`${link.kind}:select`, link.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retain deep links when no main window exists

If a valid link arrives while the process has no BrowserWindow—a normal state after closing the last window on macOS, and also possible when --serve-web keeps the process alive—focusMainWindow() returns null and this branch silently discards the link. A later activation may create a fresh window, but nothing then selects the linked thread or project; create the window here or retain the link until one is available.

Useful? React with 👍 / 👎.

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.

solenta:// deep links to threads and projects

1 participant