Skip to content

Extension toggle in Settings snaps back to On when disabling #9881

Closed

Description

@TheSeydiCharyyev

Describe the bug
In Settings → Extensions, turning OFF an enabled extension makes the toggle immediately snap back to On for the duration of the (async) toggle, instead of showing the optimistic Off state. Enabling works correctly, so the behavior is asymmetric.

Root cause
ExtensionItem keeps a local visuallyEnabled state for optimistic feedback, but the Switch's checked is computed as (isToggling && visuallyEnabled) || extension.enabled. While disabling an enabled extension, extension.enabled is still true until the async config write completes, so || extension.enabled forces checked back to true. (ui/desktop/src/components/settings/extensions/subcomponents/ExtensionItem.tsx)

To Reproduce

  1. Open Settings → Extensions.
  2. Toggle an enabled extension off.
  3. The switch flips off, then immediately jumps back on until the operation completes (more visible on a slow config write).

Expected behavior
The toggle should reflect the optimistic state immediately in both directions (off when disabling, on when enabling).

Environment

  • Interface: Desktop UI
  • Affected file: ExtensionItem.tsx (current main)

I have a one-line fix (checked={visuallyEnabled}, kept in sync by the existing effect) plus a regression test; will open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions