Repository navigation
fix(app): scope web auto-approve toggle from route directory - #49843
Open
MykolaBiron wants to merge 1 commit into
Open
MykolaBiron wants to merge 1 commit into
MykolaBiron wants to merge 1 commit into
Conversation
DialogSettings already derives the current directory from layout.route() (covering home/draft/dir-new-session/session) and passes it to the Providers tab, but the General tab's permission scope controller instead derived scope solely from session lineage, so the auto-approve toggle stayed permanently disabled whenever Settings was opened without an active session in view (e.g. via the global keybind). Pass the dialog's directory accessor into SettingsGeneralV2 and fall back to directory-level auto-accept when no session is in scope, matching the legacy settings-general.tsx behavior. Fixes anomalyco#49721
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Open
1 task done
This branch has not been deployed
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 #49721
Type of change
What does this PR do?
The auto-approve permissions toggle in Settings > General silently did nothing when clicked or tapped. Its directory scope was derived only from session lineage (
serverSync().session.lineage.peek(sessionID)), which requires an active session. When Settings is opened without one in view (e.g. via themod+,keybind from the home page, or a draft/new-session route), that lookup stayedundefined, so the toggle'senabled()memo was alwaysfalseand the switch was permanently disabled, no visual change, no toast.DialogSettingsalready computes the correct directory fromlayout.route()(covering the home/draft/dir-new-session/session route cases) and passes it to the Providers tab, but it was never passed to the General tab. This PR threads that samedirectoryaccessor intoSettingsGeneralV2/createPermissionScopeController, and adds a directory-only fallback (isAutoAcceptingDirectory/toggleAutoAcceptDirectory) for when no session is active, matching how the legacysettings-general.tsxcomponent (which this replaced) handled the same case.How did you verify your code works?
Added a regression test for
createPermissionScopeControlleringeneral-controllers.test.tscovering three scopes: no directory (disabled, no-op), directory-only (falls back to directory-level auto-accept), and session+directory. Confirmed the new test fails against the pre-fix implementation (throwsServerSync context must be used within a context provider) and passes against the fix. Also ranbun typecheckandbun run linton the changed files, both clean.Screenshots / recordings
N/A - this fixes a non-visual interaction bug (the toggle doing nothing on click); Therefore there's no layout change to show.
Checklist