Add desktop hooks settings UI / 添加桌面端 Hooks 设置界面#4118
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 691dfc8e3c
ℹ️ 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".
| try { | ||
| const parsed = parseHooksEditorJSON(); | ||
| if (!parsed) return; | ||
| await app.SaveHooksSettings(scope, parsed.hooks); |
There was a problem hiding this comment.
Pass the displayed project root when saving hooks
When the project hooks page has loaded for workspace A and the active tab changes before Save (for example via global shortcuts/palette while the settings modal remains open), this call only sends scope, so the Go binding recomputes activeHookProjectRoot() and can write the edited JSON into workspace B's .reasonix/settings.json while the UI still shows A's path/root. The trust flow already passes the displayed projectRoot; saving project hooks needs the same root/path to avoid modifying the wrong workspace.
Useful? React with 👍 / 👎.
|
Fixed the Windows CI failure in 211aa26. Root cause:
What changed:
Verified:
|
SaveHooksSettings recomputed the active project root, so switching the active tab while the hooks settings modal stayed open could write the edited JSON into a different workspace's settings.json than the one shown. Add a root-aware SaveHooksSettingsForRoot mirroring the trust flow, and pass the displayed projectRoot from the settings UI.
|
Thanks @SivanCola — really solid hooks settings UI. The binding contract (interface + dev mock kept in sync) and the trust model (project trust in global state, no auto-trust on save) are exactly right, and the test coverage is great. I pushed one follow-up commit before merging: |
Summary
/hooks trustsupport in the CLI/controller path and regression coverage for the trust behavior.Safety
Verification
wails generate modulego testfrom the desktop packagego test ./internal/hookgo test ./internal/controlwith an isolated HOMEpnpm --dir desktop/frontend typecheckpnpm --dir desktop/frontend check:cssgit diff --check