Skip to content

fix(app): scope web auto-approve toggle from route directory - #49843

Open
MykolaBiron wants to merge 1 commit into
anomalyco:devfrom
MykolaBiron:auto-approve-toggle
Open

MykolaBiron wants to merge 1 commit into
anomalyco:devfrom
MykolaBiron:auto-approve-toggle

Conversation

@MykolaBiron

@MykolaBiron MykolaBiron commented Sep 18, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #49721

Type of change

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

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 the mod+, keybind from the home page, or a draft/new-session route), that lookup stayed undefined, so the toggle's enabled() memo was always false and the switch was permanently disabled, no visual change, no toast.

DialogSettings already computes the correct directory from layout.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 same directory accessor into SettingsGeneralV2 / createPermissionScopeController, and adds a directory-only fallback (isAutoAcceptingDirectory / toggleAutoAcceptDirectory) for when no session is active, matching how the legacy settings-general.tsx component (which this replaced) handled the same case.

How did you verify your code works?

Added a regression test for createPermissionScopeController in general-controllers.test.ts covering 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 (throws ServerSync context must be used within a context provider) and passes against the fix. Also ran bun typecheck and bun run lint on 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

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

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
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
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.

[web] Auto-approve permissions setting in Settings UI does not respond when clicked/tapped

1 participant