Skip to content

bug(frontend): PermissionModeSelect has two 'default' options with confusingly overlapping semantics #273

@fireddd

Description

@fireddd

Bug

The PermissionModeSelect component in project settings renders two entries that both mean "use the default permission mode":

  1. "Project default" — the __default__ sentinel (mapped to empty string "")
  2. "Default" — the literal string "default" from PERMISSION_MODE_OPTIONS

These appear as two distinct dropdown choices but may resolve to the same behavior on the daemon side. Users have no way to know which to pick.

Analyzed against: 96d1649 (current main)
Confidence: High — read the component source directly.

Root Cause

frontend/src/renderer/components/ProjectSettingsForm.tsx:

Lines 18-23 — PERMISSION_MODE_OPTIONS includes { value: "default", label: "Default" }:

const PERMISSION_MODE_OPTIONS = [
    { value: "default", label: "Default" },        // ← literal "default"
    { value: "accept-edits", label: "Accept edits" },
    { value: "auto", label: "Auto" },
    { value: "bypass-permissions", label: "Bypass permissions" },
] as const;

Lines 217-228 — PermissionModeSelect adds a "Project default" sentinel and then iterates all options:

<SelectItem value="__default__">Project default</SelectItem>  // ← sentinel → ""
{PERMISSION_MODE_OPTIONS.map((opt) => (
    <SelectItem key={opt.value} value={opt.value}>
        {opt.label}
    </SelectItem>
))}

The dropdown shows: Project default, Default, Accept edits, Auto, Bypass permissions.

Reproduction

  1. Open any project's settings page
  2. Click the permission mode dropdown
  3. See both "Project default" and "Default" as separate options
  4. Select "Default" — it sends "default" to the daemon
  5. Select "Project default" — it sends "" to the daemon
  6. Both likely produce the same runtime behavior

Impact

  • UX confusion: two options appear to do the same thing
  • If the daemon treats "default" and "" differently, users might unknowingly select the wrong one

Suggested Fix

Either:

  1. Remove "default" from PERMISSION_MODE_OPTIONS (the sentinel already covers "use default")
  2. Or rename the sentinel from "Project default" to something like "Unset" and keep "Default" as the explicit value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions