Skip to content

fix(app): enable auto-accept keybind regardless of permission config#16259

Merged
adamdotdevin merged 3 commits intoanomalyco:devfrom
luisfelipesena:fix/auto-accept-keybind
Mar 6, 2026
Merged

fix(app): enable auto-accept keybind regardless of permission config#16259
adamdotdevin merged 3 commits intoanomalyco:devfrom
luisfelipesena:fix/auto-accept-keybind

Conversation

@luisfelipesena
Copy link
Contributor

@luisfelipesena luisfelipesena commented Mar 6, 2026

Issue for this PR

Closes #16258

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The Cmd+Shift+A auto-accept keybind was dead in two scenarios:

  1. On "New session" screen: disabled: !params.id prevented the keybind when no session was active.
  2. With permission: "allow" config: permissionsEnabled() returned false since there are no non-allow rules, gating the keybind permanently.

Changes:

  • Introduced directory-level auto-accept (store key base64(dir)/*) so the toggle works without an active session.
  • When config has permission: "allow", the directory-level auto-accept is enabled by default on first visit. Respects explicit user toggle (if user disables, it stays disabled).
  • The chevron » icon now reflects the correct state on both "New session" and active session screens.
  • Removed the ephemeral pendingAutoAccept local state in favor of the persisted directory-level store.
  • Build fix: updated @opentui/solid import path (bun-plugin instead of scripts/solid-plugin) and added fallback for hoisted parser.worker.js.

Related: #7928, #1813

How did you verify your code works?

  • 271 existing tests pass, 5 new tests added for directory-level auto-accept behavior
  • Typecheck passes across all 13 packages
  • Manual testing on desktop app: toggled auto-accept on "New session" screen, switched between projects, verified chevron icon state and toast notifications

Screenshots / recordings

Before — chevron » inactive on New Session, Cmd+Shift+A does nothing:

before

After — chevron » active, toggle works on New Session screen, toasts confirm state:

after

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

The Cmd+Shift+A keybind for toggling auto-accept permissions was
permanently disabled when no permission prompt rules were configured.
The permissionsEnabled() check prevented the command from entering
the keymap, making the keybind dead for most users.

Remove the permissionsEnabled() gate from the disabled condition so
the keybind works whenever a session is active.
The @opentui/solid package moved its bun plugin export from
`scripts/solid-plugin` to `bun-plugin`. Also add a fallback for
`parser.worker.js` to check the root node_modules when the package
is hoisted in the monorepo.
The Cmd+Shift+A keybind was dead when no session was active or when
switching projects. Three changes:

1. Keybind now works on the "New session" screen by toggling
   auto-accept at the directory level (key: base64(dir)/*).
2. When config has `permission: "allow"`, auto-accept is enabled
   by default for that directory on first visit.
3. The chevron icon correctly reflects the active state on both
   "New session" and active session screens.

Removes the ephemeral `pendingAutoAccept` local state in favor of
the persisted directory-level auto-accept store.
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@adamdotdevin adamdotdevin merged commit b7605ad into anomalyco:dev Mar 6, 2026
22 checks passed
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.

[Bug]: Auto-accept keybind (Cmd+Shift+A) dead on New Session screen and when switching projects

2 participants