Skip to content

[codex] move v2 toggle to experimental settings#3748

Merged
Kitenite merged 3 commits into
mainfrom
v2-toggle-experimental
Apr 26, 2026
Merged

[codex] move v2 toggle to experimental settings#3748
Kitenite merged 3 commits into
mainfrom
v2-toggle-experimental

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Apr 26, 2026

Summary

  • Move the Superset V2 switch from the dashboard top bar into Settings > Experimental.
  • Add the new Experimental settings route, sidebar entry, and settings search metadata.
  • Keep the existing local V2 override behavior while updating the setting label to "Try Superset Version 2 (Early Access)".

Validation

  • bun run --cwd apps/desktop typecheck
  • bunx @biomejs/biome@2.4.2 check apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx apps/desktop/src/renderer/routes/_authenticated/settings/components/SettingsSidebar/GeneralSettings.tsx apps/desktop/src/renderer/routes/_authenticated/settings/layout.tsx apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts apps/desktop/src/renderer/stores/settings-state.ts apps/desktop/src/renderer/stores/v2-local-override.ts apps/desktop/src/renderer/routes/_authenticated/settings/experimental/page.tsx apps/desktop/src/renderer/routes/_authenticated/settings/experimental/components/ExperimentalSettings/ExperimentalSettings.tsx apps/desktop/src/renderer/routes/_authenticated/settings/experimental/components/ExperimentalSettings/index.ts

Summary by cubic

Moved the Superset V2 switch from the dashboard top bar to Settings > System > Experimental to centralize control and declutter the UI. Keeps the local override behavior via setForceV1, adds settings search, and removes the unused top bar toggle and references.

  • New Features

    • Experimental settings page under System with a sidebar item.
    • Toggle: “Try Superset Version 2 (Early Access)”, disabled when not eligible and mirrors current V2 status.
    • Settings search entry for the V2 toggle.
  • Refactors

    • Removed TopBar VersionToggle and deleted its component files.
    • Cleaned up TopBar to drop the unused isRemoteV2Enabled.
    • Extended settings routing/layout to include the Experimental section.
    • Replaced toggle with setForceV1 in useV2LocalOverrideStore and wired the switch to it.

Written for commit fca3582. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added an "Experimental" settings page exposing a Superset Version 2 (Early Access) switch and searchable entry.
  • UI Changes

    • Removed the version toggle from the top bar and consolidated version control into the Experimental settings page.
    • When V2 isn’t enabled for your account, the switch is disabled and shows an explanatory message.
    • Changing the switch updates the local version preference immediately.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1f95da79-30fe-45ab-8041-525872c89b0b

📥 Commits

Reviewing files that changed from the base of the PR and between f710ee0 and fca3582.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/stores/v2-local-override.ts

📝 Walkthrough

Walkthrough

Removed the TopBar version toggle and fully deleted the VersionToggle component. Added a new "Experimental" settings page and ExperimentalSettings component (with V2 toggle) integrated into routing, search, and settings state. Replaced the v2-local-override store's toggle() action with setForceV1(forceV1: boolean).

Changes

Cohort / File(s) Summary
Top Bar
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx
Removed import and rendering of VersionToggle; stopped reading isRemoteV2Enabled from useIsV2CloudEnabled.
Version Toggle Removal
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/VersionToggle/VersionToggle.tsx, apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/components/VersionToggle/index.ts
Deleted VersionToggle component and its re-export.
Experimental Settings UI
apps/desktop/src/renderer/routes/_authenticated/settings/experimental/components/ExperimentalSettings/ExperimentalSettings.tsx, .../ExperimentalSettings/index.ts, apps/desktop/src/renderer/routes/_authenticated/settings/experimental/page.tsx
Added ExperimentalSettings component and page route; supports visibleItems filtering; renders V2 experimental switch that reads feature flags and calls setForceV1 when changed; added barrel export.
Settings Integration
apps/desktop/src/renderer/routes/_authenticated/settings/components/SettingsSidebar/GeneralSettings.tsx, apps/desktop/src/renderer/routes/_authenticated/settings/layout.tsx, apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts, apps/desktop/src/renderer/stores/settings-state.ts
Added "experimental" settings section and sidebar entry (beaker icon); extended routing/section mappings and search items; added SETTING_ITEM_ID.EXPERIMENTAL_SUPERSET_V2 and updated SettingsSection type.
Store API Change
apps/desktop/src/renderer/stores/v2-local-override.ts
Replaced toggle() action with setForceV1(forceV1: boolean) in the v2-local-override zustand store and updated initializer accordingly.

Sequence Diagram(s)

sequenceDiagram
  participant User as "User"
  participant UI as "ExperimentalSettings UI"
  participant Flags as "useIsV2CloudEnabled (feature flag)"
  participant Store as "v2-local-override store"

  User->>UI: Open Experimental settings page
  UI->>Flags: read isV2CloudEnabled, isRemoteV2Enabled
  Flags-->>UI: return enablement state
  UI->>User: render toggle (enabled/disabled) and messages
  User->>UI: toggle switch
  UI->>Store: call setForceV1(!currentForceV1)
  Store-->>UI: updated forceV1 state
  UI->>User: reflect new toggle state
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped from topbar to settings bright,
A beaker glows in experimental light,
I flip the store with a tiny paw,
V2's moved where seekers saw,
A little toggle, and hop—what a sight! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title directly and clearly summarizes the main change: moving the V2 toggle from the top bar to experimental settings.
Description check ✅ Passed The pull request description comprehensively covers the changes, validation steps, and refactoring details, though it does not follow the provided template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v2-toggle-experimental

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR moves the Superset V2 toggle from the dashboard top bar into a new Settings > Experimental page, making the feature more discoverable as a persistent setting rather than an ephemeral toolbar button. All wiring — sidebar entry, route registration, section ordering, search metadata, and the setForceV1 store action — is consistently applied across the codebase.

Confidence Score: 5/5

Safe to merge — all changes are consistent with existing patterns and the only finding is a minor dead-code cleanup.

All P2 findings. The sole issue is the now-unused toggle() method left in the store after VersionToggle was deleted. Every other aspect of the implementation — route registration, sidebar wiring, search metadata, store action, and switch logic — is correct and mirrors existing section patterns.

apps/desktop/src/renderer/stores/v2-local-override.ts — unused toggle method can be removed.

Important Files Changed

Filename Overview
apps/desktop/src/renderer/routes/_authenticated/settings/experimental/components/ExperimentalSettings/ExperimentalSettings.tsx New component exposing the V2 toggle as a Switch in the Experimental settings section; logic correctly mirrors the old VersionToggle behavior using setForceV1.
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/TopBar/TopBar.tsx Removes VersionToggle import and its render site; also drops the now-unused isRemoteV2Enabled destructure from useIsV2CloudEnabled.
apps/desktop/src/renderer/stores/v2-local-override.ts Adds setForceV1 action; toggle() is now dead code with no callers after VersionToggle was deleted.
apps/desktop/src/renderer/routes/_authenticated/settings/experimental/page.tsx New TanStack Router page for /settings/experimental, consistent with the pattern used by other settings pages.
apps/desktop/src/renderer/routes/_authenticated/settings/layout.tsx Registers 'experimental' in SECTION_ORDER, getSectionFromPath, and getPathFromSection — fully consistent with other sections.
apps/desktop/src/renderer/routes/_authenticated/settings/utils/settings-search/settings-search.ts Adds EXPERIMENTAL_SUPERSET_V2 item ID and its SETTINGS_ITEMS entry with appropriate keywords for search.
apps/desktop/src/renderer/routes/_authenticated/settings/components/SettingsSidebar/GeneralSettings.tsx Adds Experimental sidebar entry after Models using HiOutlineBeaker icon; route type union and section group updated correctly.
apps/desktop/src/renderer/stores/settings-state.ts Adds 'experimental' to the SettingsSection union type.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User opens Settings] --> B[SettingsSidebar]
    B --> C[Experimental entry\n/settings/experimental]
    C --> D[ExperimentalSettingsPage]
    D --> E{searchQuery?}
    E -- yes --> F[getMatchingItemsForSection\n'experimental']
    E -- no --> G[visibleItems = null\nshow all]
    F --> H[ExperimentalSettings\nvisibleItems=filtered]
    G --> H
    H --> I{isRemoteV2Enabled?}
    I -- no --> J[Switch disabled\nchecked=false]
    I -- yes --> K[Switch enabled\nchecked=isV2CloudEnabled]
    K --> L{onCheckedChange}
    L -- enable --> M[setForceV1 false]
    L -- disable --> N[setForceV1 true]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/stores/v2-local-override.ts
Line: 4-9

Comment:
**Unused `toggle` function is now dead code**

The `toggle()` method was only called from the deleted `VersionToggle.tsx` component. Now that `VersionToggle` is removed and `ExperimentalSettings` uses `setForceV1` directly, `toggle` has no remaining callers and can be removed from both the interface and the store implementation.

```suggestion
interface V2LocalOverrideState {
	/** When true, forces v1 mode locally even though v2 is enabled remotely. */
	forceV1: boolean;
	setForceV1: (forceV1: boolean) => void;
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "move v2 toggle to experimental settings" | Re-trigger Greptile

Comment on lines 4 to 9
interface V2LocalOverrideState {
/** When true, forces v1 mode locally even though v2 is enabled remotely. */
forceV1: boolean;
setForceV1: (forceV1: boolean) => void;
toggle: () => void;
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unused toggle function is now dead code

The toggle() method was only called from the deleted VersionToggle.tsx component. Now that VersionToggle is removed and ExperimentalSettings uses setForceV1 directly, toggle has no remaining callers and can be removed from both the interface and the store implementation.

Suggested change
interface V2LocalOverrideState {
/** When true, forces v1 mode locally even though v2 is enabled remotely. */
forceV1: boolean;
setForceV1: (forceV1: boolean) => void;
toggle: () => void;
}
interface V2LocalOverrideState {
/** When true, forces v1 mode locally even though v2 is enabled remotely. */
forceV1: boolean;
setForceV1: (forceV1: boolean) => void;
}
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/desktop/src/renderer/stores/v2-local-override.ts
Line: 4-9

Comment:
**Unused `toggle` function is now dead code**

The `toggle()` method was only called from the deleted `VersionToggle.tsx` component. Now that `VersionToggle` is removed and `ExperimentalSettings` uses `setForceV1` directly, `toggle` has no remaining callers and can be removed from both the interface and the store implementation.

```suggestion
interface V2LocalOverrideState {
	/** When true, forces v1 mode locally even though v2 is enabled remotely. */
	forceV1: boolean;
	setForceV1: (forceV1: boolean) => void;
}
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 11 files

@Kitenite Kitenite merged commit 8693869 into main Apr 26, 2026
7 checks passed
@Kitenite Kitenite deleted the v2-toggle-experimental branch April 26, 2026 02:33
@github-actions
Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

MocA-Love added a commit to MocA-Love/superset that referenced this pull request Apr 26, 2026
3 PR (#442, #443, #444) で取り込み済みの 9 commits を git 履歴上もマージ済みに記録する。
内容差分は無し (merge -s ours)。

取り込み内容:
- 6b96acd Improve sidebar group management UX (superset-sh#3745)
- a4079e7 Update dashboard sidebar workspace icons (superset-sh#3755)
- d3753d0 [codex] Use dynamic footer copyright years (superset-sh#3754)
- ce606be Handle browser passthrough during v2 resize (superset-sh#3744)
- b1e1eb7 Refactor v2 workspace page (superset-sh#3747)
- 8693869 [codex] move v2 toggle to experimental settings (superset-sh#3748)
- ef3f381 Revert "fix(desktop): refit v2 terminal after font settle (superset-sh#3742)" (superset-sh#3750) - 手動移植 (vibrancy patch 維持)
- 25b2d52 Show terminal sessions from all workspaces in dropdown (superset-sh#3751)
- 62737db fix v1 terminal resize repaint (superset-sh#3756)
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