Skip to content

feat(permissions): default unconfigured installs to the auto permission mode - #90

Merged
JeanBaptisteRenard merged 1 commit into
mainfrom
feat/permission-mode-auto-default
Aug 3, 2026
Merged

feat(permissions): default unconfigured installs to the auto permission mode#90
JeanBaptisteRenard merged 1 commit into
mainfrom
feat/permission-mode-auto-default

Conversation

@JeanBaptisteRenard

Copy link
Copy Markdown
Collaborator

Narrowed successor to #87. Stacked on #88 (the v0.0.31 upstream sync) — based on chore/sync-upstream-v0.0.31 and targeting it, so the diff stays clean. GitHub will retarget this to main once #88 merges.

Why this is smaller than #87

#87 did two things: hoist the thrice-duplicated permission-mode list into a PERMISSION_MODES constant, and change main.js's default resolution. Upstream implemented the identical hoist independently in a7698f4 — same diagnosis, same solution, same three call sites — and it arrived via #88. That half is no longer ours to contribute, so it is dropped here. #87 is closed as superseded.

What upstream does not have is the main.js half, which is all that's left:

Changes

1. SETTING_DEFAULTS.permissionMode: null to 'auto' — a never-configured install gets Claude Code's own default mode rather than prompting for every action.

2. get-effective-settings no longer skips on an explicit null. Only undefined (key never saved at that scope) falls through now.

The second is a prerequisite for the first, and also a bug on its own. settings-panel.js persists the "Default (none)" choice as value || null — a real, deliberate null. The read side then treated null the same as "absent", so:

  • a project that narrowed permissionMode back to "Default" kept inheriting the global mode, and
  • any SETTING_DEFAULTS value other than null was unreachable at project scope.

Without fixing that, flipping the default in change 1 would have silently upgraded every explicitly-chosen "Default" to 'auto' — turning a user's "prompt me for everything" into "let Claude classify". The DB already encoded the distinction; only the read side was wrong.

That bug is independent of the default flip and is being contributed upstream separately, without the flip (which is this fork's preference, not an upstream concern).

Tests

test/dom-permission-mode-picker.test.js (8 tests) covers both halves, with the ownership split written down in its header:

  • the pickers offering auto and staying driven by one shared list — upstream's a7698f4, which shipped with no tests, so these guard against a future sync dropping it
  • this branch's main.js semantics, including an explicit guard that the [key] !== null skip cannot come back

Verified the mode list against the real CLI: the 2.1.220 binary's --permission-mode choice list is default, auto, acceptEdits, plan, dontAsk, bypassPermissions (plus manual, which upstream deliberately omits as UI-confusing next to "Default" — that decision is kept).

380/380 tests pass; eslint 0 errors.

⚠️ Switchboard runs as a built AppImage — nothing here takes effect until a rebuild.


Supersedes #89, which GitHub auto-closed when its base branch chore/sync-upstream-v0.0.31 was deleted on merge of #88. Same branch, same commit, retargeted to main.

…on mode

Narrowed successor to #87. The PERMISSION_MODES hoist that #87 also carried
landed upstream independently as a7698f4 and arrived via the v0.0.31 sync, so
all that remains here is the main.js half, which upstream does not have.

Two changes:

- SETTING_DEFAULTS.permissionMode becomes 'auto' (was null), so a
  never-configured install gets Claude Code's own default mode instead of
  prompting for every action.

- get-effective-settings stops skipping on an explicit `null`. Only
  `undefined` (key never saved at that scope) now falls through. The DB
  already distinguished the two — settings-panel.js persists the "Default"
  choice as `value || null`, i.e. a real null — but the read side collapsed
  them, so a user who deliberately picked "Default" was indistinguishable
  from one who never opened settings. Without this, flipping the default
  above would silently upgrade every explicit "Default" to 'auto'.

The second change is a bug in its own right, independent of the default
flip: because an explicit null never won, a project that narrowed
permissionMode back to "Default" kept inheriting the global mode, and any
SETTING_DEFAULTS value other than null was unreachable at project scope. It
is being contributed upstream separately, without the default flip.

test/dom-permission-mode-picker.test.js covers both halves: the pickers
offering `auto` (upstream's a7698f4, which shipped untested) and this
branch's main.js semantics, including a guard that the `!== null` skip can't
come back.

380/380 tests pass; eslint 0 errors.
@JeanBaptisteRenard
JeanBaptisteRenard merged commit aca24ff into main Aug 3, 2026
6 checks passed
@JeanBaptisteRenard
JeanBaptisteRenard deleted the feat/permission-mode-auto-default branch August 3, 2026 10:06
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.

1 participant