Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a small, localized bug fix that removes browser-only skips from two existing save paths and relies on unchanged, scope-protected keybinding RPCs. The added regression tests cover shortcut creation, removal, and settings-write failure without introducing schema, deployment, or static-analysis changes. You can add or adjust custom eligibility rules. Learn more. |
Recording a shortcut in a project action's Keybinding field reported success but silently dropped the write outside Electron: both save paths skipped the keybinding upsert/remove behind isElectron gates. The keybinding RPCs already enforce the caller's scopes and persist to the environment's server-side keybindings.json, and the Keybindings settings page already allows browser writes, so the gates are removed instead of gating the editor.
Main introduced AuthSettingsWriteScope, effect 4.0.2 (effect/reactivity), tsc-rs, and NewProjectScriptInput.runOnSettle since this branch was cut. Update the regression test to the new APIs, mock readEnvironmentScope (including a no-scope explicit-failure case), and remove the remaining isElectron term from ChatView's changesKeybinding so scoped browser clients persist shortcuts; scoped-out clients get the explicit keyboard-shortcut failure instead of a silent drop.
3650cd8 to
35c414f
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of Theo Closing because this PR states that Muse Spark wrote code in it:
We do not accept code written by Gemini models or by Muse models other than Muse Wonder Full. See Models we do not accept. To have this considered again, open a new PR with the code written by a different model and link this one. |
Problem
Fixes #18427. In a browser client, recording a shortcut in a project action's Keybinding field (Settings → Project → Actions, and the chat action editor) reported success but the shortcut was never written — reopening showed the old/empty value. Both save paths skipped the keybinding upsert/remove behind
isElectrongates while the editor stayed editable, so the write was silently dropped.Change
Removed both client-side gates so browser clients persist action shortcuts through the existing keybinding RPCs:
apps/web/src/components/settings/useProjectScriptSettings.ts: removedif (!isElectron) continue;(plus unused import, doc comment updated).apps/web/src/components/ChatView.tsx: removedif (!isElectron) return updateResult;inpersistProjectScripts.No RPC/contract changes:
server.upsertKeybinding/server.removeKeybindingalready requireorchestration:operate(same scope asserver.updateSettings) and write to the environment's server-sidekeybindings.json. The Keybindings settings page already allows browser writes with only a notice about browser-claimed shortcuts, so gating the editor instead would have been inconsistent. #15394 history shows the gate predates it with no recorded rationale.Scope and approval
Triaged direction from #18427, which prefers allowing browser writes since the RPCs already check scopes. Focused two-line behavior fix plus a regression test.
Verification
useProjectScriptSettings.test.tsx(3 tests: save shortcut → upsert called, clear shortcut → remove called, settings failure → no keybinding write). Fails pre-fix (2 failed with gate restored), passes post-fix.tsc --noEmit -p apps/webclean;vp lintclean on touched files.keybindings.json/settings.json, survived reopening the editors, and appear live in the Script actions menu. Screenshots are in the linked thread (could not upload PR-only assets per repo policy).Built with Muse Spark 1.3 Free via OpenCode.