feat(app): persist auto-accept permissions preference across sessions - #39328
Open
PinkR1ver wants to merge 1 commit into
Open
feat(app): persist auto-accept permissions preference across sessions#39328PinkR1ver wants to merge 1 commit into
PinkR1ver wants to merge 1 commit into
Conversation
The Settings toggle for auto-accept permissions was only session-scoped and did not persist across app restarts or new sessions. The global settings already had a permissions.autoApprove field that was unused. - Connect V2 Settings toggle (general-controllers.ts) to the global settings.permissions.autoApprove preference for persistence across sessions - Connect V1 Settings toggle (settings-general.tsx) similarly - Add enableAutoApproveDirectory() alongside enableConfiguredDirectory() to auto-enable auto-accept for new directories using the global preference - Session-level override via Cmd+Shift+A takes precedence as before - Toggle is no longer disabled when settings is opened outside a session Closes anomalyco#38289
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: The search found one related PR that's different from the current PR: Related PR (not a duplicate):
No duplicate PRs found |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #38289
Type of change
What does this PR do?
The Settings toggle for auto-accept permissions was only session-scoped and did not persist across app restarts or new sessions. The underlying state store uses
Persist.serverGlobal()which is server-scoped and lost on restart. Meanwhile, the global settings store (settings.tsx) already had apermissions.autoApprovefield that was completely unused.Changes:
general-controllers.ts(V2 Settings) — Toggle reads/writessettings.permissions.autoApprove(global, persistent). Falls back to global preference when settings is opened outside a session context. Toggle is always enabled.settings-general.tsx(V1 Settings) — Same: writes tosettings.permissions.autoApprovealongside session-level toggle. Falls back to global preference when no directory context.permission.tsx— NewenableAutoApproveDirectory()function, modeled afterenableConfiguredDirectory(). Auto-enables directory-level auto-accept for new directories when global preference is ON. Only sets ifautoAccept[key] === undefined(never overrides explicit user settings).Session-level override via
Cmd+Shift+Astill takes precedence — session-level keys are checked before directory-level inautoRespondsPermission().How did you verify your code works?
permission-auto-respond.tsandpermission-auto-respond.test.ts— existing 9 tests pass unchangedenableAutoApproveDirectory()guard (autoAccept[key] !== undefined) ensures explicit user settings are never overwrittenScreenshots / recordings
N/A — this is a state management fix, no visual UI changes.
Checklist