-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): interface for the experiment flags (#1724)
* feat(ui): experimental ai ui interface * fix warning; * [autofix.ci] apply automated fixes * integrate with local storage * [autofix.ci] apply automated fixes * rename * update * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8dc0548
commit 7b3f532
Showing
4 changed files
with
95 additions
and
10 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
ee/tabby-ui/app/(dashboard)/experiments/components/feature-list.tsx
This file contains 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,29 @@ | ||
'use client' | ||
|
||
import { useEnableCodeBrowserQuickActionBar } from '@/lib/experiment-flags' | ||
import { Switch } from '@/components/ui/switch' | ||
|
||
export default function FeatureList() { | ||
const [quickActionBar, toggleQuickActionBar] = | ||
useEnableCodeBrowserQuickActionBar() | ||
return ( | ||
<> | ||
{!quickActionBar.loading && ( | ||
<div className="flex items-center space-x-4 rounded-md border p-4"> | ||
<div className="flex-1 space-y-1"> | ||
<p className="text-sm font-medium leading-none"> | ||
{quickActionBar.title} | ||
</p> | ||
<p className="text-sm text-muted-foreground"> | ||
{quickActionBar.description} | ||
</p> | ||
</div> | ||
<Switch | ||
checked={quickActionBar.value} | ||
onCheckedChange={toggleQuickActionBar} | ||
/> | ||
</div> | ||
)} | ||
</> | ||
) | ||
} |
This file contains 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,18 @@ | ||
import { Metadata } from 'next' | ||
|
||
import FeatureList from './components/feature-list' | ||
|
||
export const metadata: Metadata = { | ||
title: 'Experiment Flags' | ||
} | ||
|
||
export default function IndexPage() { | ||
return ( | ||
<div className="mx-auto flex max-w-xl flex-col gap-3"> | ||
<h3 className="scroll-m-20 text-2xl font-semibold tracking-tight"> | ||
Experiment Flags | ||
</h3> | ||
<FeatureList /> | ||
</div> | ||
) | ||
} |
This file contains 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 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