-
Notifications
You must be signed in to change notification settings - Fork 960
[codex] move v2 toggle to experimental settings #3748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
...es/_authenticated/_dashboard/components/TopBar/components/VersionToggle/VersionToggle.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...erer/routes/_authenticated/_dashboard/components/TopBar/components/VersionToggle/index.ts
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...henticated/settings/experimental/components/ExperimentalSettings/ExperimentalSettings.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { Label } from "@superset/ui/label"; | ||
| import { Switch } from "@superset/ui/switch"; | ||
| import { useIsV2CloudEnabled } from "renderer/hooks/useIsV2CloudEnabled"; | ||
| import { useV2LocalOverrideStore } from "renderer/stores/v2-local-override"; | ||
| import { | ||
| isItemVisible, | ||
| SETTING_ITEM_ID, | ||
| type SettingItemId, | ||
| } from "../../../utils/settings-search"; | ||
|
|
||
| interface ExperimentalSettingsProps { | ||
| visibleItems?: SettingItemId[] | null; | ||
| } | ||
|
|
||
| export function ExperimentalSettings({ | ||
| visibleItems, | ||
| }: ExperimentalSettingsProps) { | ||
| const showSupersetV2 = isItemVisible( | ||
| SETTING_ITEM_ID.EXPERIMENTAL_SUPERSET_V2, | ||
| visibleItems, | ||
| ); | ||
| const { isV2CloudEnabled, isRemoteV2Enabled } = useIsV2CloudEnabled(); | ||
| const setForceV1 = useV2LocalOverrideStore((state) => state.setForceV1); | ||
|
|
||
| return ( | ||
| <div className="p-6 max-w-4xl w-full"> | ||
| <div className="mb-8"> | ||
| <h2 className="text-xl font-semibold">Experimental</h2> | ||
| <p className="text-sm text-muted-foreground mt-1"> | ||
| Try early access features and previews | ||
| </p> | ||
| </div> | ||
|
|
||
| <div className="space-y-6"> | ||
| {showSupersetV2 && ( | ||
| <div className="flex items-center justify-between"> | ||
| <div className="space-y-0.5"> | ||
| <Label htmlFor="superset-v2" className="text-sm font-medium"> | ||
| Try Superset Version 2 (Early Access) | ||
| </Label> | ||
| <p className="text-xs text-muted-foreground"> | ||
| Use the new workspace experience when early access is available | ||
| </p> | ||
| {!isRemoteV2Enabled && ( | ||
| <p className="text-xs text-muted-foreground"> | ||
| Early access is not enabled for this account. | ||
| </p> | ||
| )} | ||
| </div> | ||
| <Switch | ||
| id="superset-v2" | ||
| checked={isV2CloudEnabled} | ||
| onCheckedChange={(enabled) => setForceV1(!enabled)} | ||
| disabled={!isRemoteV2Enabled} | ||
| /> | ||
| </div> | ||
| )} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
1 change: 1 addition & 0 deletions
1
...erer/routes/_authenticated/settings/experimental/components/ExperimentalSettings/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { ExperimentalSettings } from "./ExperimentalSettings"; |
22 changes: 22 additions & 0 deletions
22
apps/desktop/src/renderer/routes/_authenticated/settings/experimental/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { createFileRoute } from "@tanstack/react-router"; | ||
| import { useMemo } from "react"; | ||
| import { useSettingsSearchQuery } from "renderer/stores/settings-state"; | ||
| import { getMatchingItemsForSection } from "../utils/settings-search"; | ||
| import { ExperimentalSettings } from "./components/ExperimentalSettings"; | ||
|
|
||
| export const Route = createFileRoute("/_authenticated/settings/experimental/")({ | ||
| component: ExperimentalSettingsPage, | ||
| }); | ||
|
|
||
| function ExperimentalSettingsPage() { | ||
| const searchQuery = useSettingsSearchQuery(); | ||
|
|
||
| const visibleItems = useMemo(() => { | ||
| if (!searchQuery) return null; | ||
| return getMatchingItemsForSection(searchQuery, "experimental").map( | ||
| (item) => item.id, | ||
| ); | ||
| }, [searchQuery]); | ||
|
|
||
| return <ExperimentalSettings visibleItems={visibleItems} />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
togglefunction is now dead codeThe
toggle()method was only called from the deletedVersionToggle.tsxcomponent. Now thatVersionToggleis removed andExperimentalSettingsusessetForceV1directly,togglehas no remaining callers and can be removed from both the interface and the store implementation.Prompt To Fix With AI