Repository navigation
solenta:// deep links to threads and projects (#186) - #1573
Conversation
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]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| /** @type {{ kind: "thread" | "project", id: string } | null} */ | ||
| let pendingDeepLink = deepLinkFromArgv(process.argv); | ||
| if (app.isPackaged) { | ||
| app.setAsDefaultProtocolClient(DEEP_LINK_SCHEME); |
There was a problem hiding this comment.
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 👍 / 👎.
| setProjectScope(scopeRequest); | ||
| saveStored(SCOPE_KEY, scopeRequest); | ||
| onScopeRequestHandled?.(); |
There was a problem hiding this comment.
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 👍 / 👎.
| const win = focusMainWindow(); | ||
| if (win && !win.webContents.isDestroyed()) { | ||
| win.webContents.send(`${link.kind}:select`, link.id); |
There was a problem hiding this comment.
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 👍 / 👎.
Closes #186.
What
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.How
electron/deepLinks.jsparses links. It accepts onlythread/projectwith an[A-Za-z0-9_-]id, and main checks the id exists in the store before pushingthread:selectorproject:select.open-url.scripts/package-app.shaddsCFBundleURLTypesso LaunchServices routes the scheme to the app.second-instanceand exits withapp.exit(0), so it never starts a second store writer.boot:ready. The preload also holds the last select push until the renderer subscribes, because ipcRenderer drops pushes that have no listener.project:selectis added to ipcChannels, preload, ipc types, the wire list, devCoder and fakeCoder.Behaviour changes / limits
solenta://. On macOS, whichever was launched last gets the links..desktopfile 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:selectopens the thread from kanban, andproject:selectscopes the sidebar.npm run typecheck,vite build, andtest:electronwith a CI-like env all pass (4474 pass / 0 fail).🤖 Generated with Claude Code