Skip to content

fix(app): devtools toggle stuck ON — persist enabled state bidirectionally - #223

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/devtools-toggle-stuck-on
Aug 21, 2026
Merged

fix(app): devtools toggle stuck ON — persist enabled state bidirectionally#223
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
fix/devtools-toggle-stuck-on

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

The developer tools release ↔ dev toggle in Settings was non-functional. Clicking it did nothing visible — the switch stayed ON permanently.

Root Cause

A controlled-component + state-persistence mismatch:

  1. defaultSettings.developer.enabled was true — the toggle always showed ON
  2. The OFF path deliberately did NOT persist false to the SolidJS store (stale comment: "marketplace build doesn't render this section")
  3. Kobalte's controlled <Switch checked={enabled()}/> always reflected the stale true
  4. Every user click fired onChange(false) but since the signal never updated, the visual snapped back to ON
  5. The ON path (setEnabled(true), which autofills paths and triggers rebuild) was unreachable from the UI

Fix

  • Default developer.enabled to false (fresh installs show OFF, toggle can be turned ON)
  • Persist both true and false via settings.developer.setEnabled(value) unconditionally — the controlled component now reflects reality

The toggle is now bidirectional: ON triggers a full rebuild, OFF restores the marketplace dist and reloads.

Companion PR

harmoniqs/amicode#489 (same fix in the overlay source of truth)

Summary by CodeRabbit

  • Bug Fixes
    • Developer mode now correctly saves both enabled and disabled states.
    • Disabling developer mode now reliably restores the marketplace build and reloads the extension.
  • Settings
    • Developer mode is now disabled by default for new installations.

…nally

The developer tools toggle was stuck in the ON position because:
1. The default for developer.enabled was true (always showed ON)
2. Toggling OFF never persisted false to the store
3. Kobalte's controlled Switch always reflected the stale true value
4. Every click triggered onChange(false) but the visual never changed

Fix: default to false, and persist both true/false so the controlled
component reflects reality. The toggle now works bidirectionally:
ON triggers rebuild, OFF restores marketplace and reloads.

Companion: harmoniqs/amicode#489
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: db0ab3d9-1afc-445f-b8d0-5d220775e589

📥 Commits

Reviewing files that changed from the base of the PR and between 1fe5815 and 8c028c9.

📒 Files selected for processing (2)
  • packages/app/src/components/settings-v2/developer-tools-controller.ts
  • packages/app/src/context/settings.tsx

📝 Walkthrough

Walkthrough

Developer mode now defaults to disabled. Toggle changes persist for both enabling and disabling, while disabling retains the rebuild and extension restore flow.

Changes

Developer mode settings

Layer / File(s) Summary
Developer mode defaults and toggle persistence
packages/app/src/context/settings.tsx, packages/app/src/components/settings-v2/developer-tools-controller.ts
The default developer mode state is false. The controller persists the requested state for both toggle directions and retains rebuilding behavior when disabling.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: brendonovich, hona

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/devtools-toggle-stuck-on

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 21, 2026 22:01
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 8dfb210 into local/amicode Aug 21, 2026
2 of 5 checks passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the fix/devtools-toggle-stuck-on branch August 21, 2026 22:01
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