Skip to content

Commit 6f58c81

Browse files
committed
feat: add NightlyTestBanner component and integrate into App
1 parent 138b717 commit 6f58c81

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

webview-ui/src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import McpView from "./components/mcp/McpView"
1616
import ModesView from "./components/modes/ModesView"
1717
import { HumanRelayDialog } from "./components/human-relay/HumanRelayDialog"
1818
import { AccountView } from "./components/account/AccountView"
19+
import { NightlyTestBanner } from "./components/NightlyTestBanner"
1920

2021
type Tab = "settings" | "history" | "mcp" | "modes" | "chat" | "account"
2122

@@ -37,6 +38,7 @@ const App = () => {
3738
telemetryKey,
3839
machineId,
3940
cloudUserInfo,
41+
experiments,
4042
} = useExtensionState()
4143

4244
const [showAnnouncement, setShowAnnouncement] = useState(false)
@@ -121,6 +123,7 @@ const App = () => {
121123
<WelcomeView />
122124
) : (
123125
<>
126+
<NightlyTestBanner experiments={experiments} />
124127
{tab === "modes" && <ModesView onDone={() => switchTab("chat")} />}
125128
{tab === "mcp" && <McpView onDone={() => switchTab("chat")} />}
126129
{tab === "history" && <HistoryView onDone={() => switchTab("chat")} />}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from "react"
2+
import { AlertCircle } from "lucide-react"
3+
import type { ExperimentId } from "@roo-code/types"
4+
import { EXPERIMENT_IDS } from "@roo/experiments"
5+
6+
interface NightlyTestBannerProps {
7+
experiments: Record<ExperimentId, boolean>
8+
}
9+
10+
export const NightlyTestBanner: React.FC<NightlyTestBannerProps> = ({ experiments }) => {
11+
// Check if the internal nightly test banner experiment is enabled
12+
const showBanner = experiments[EXPERIMENT_IDS._NIGHTLY_TEST_BANNER] ?? false
13+
14+
if (!showBanner) {
15+
return null
16+
}
17+
18+
return (
19+
<div className="bg-yellow-500/10 border border-yellow-500/30 rounded-md p-3 mb-4 flex items-center gap-2">
20+
<AlertCircle className="w-5 h-5 text-yellow-600" />
21+
<div className="flex-1">
22+
<p className="text-sm font-medium text-yellow-800 dark:text-yellow-200">
23+
🧪 Nightly Build Test Feature
24+
</p>
25+
<p className="text-xs text-yellow-700 dark:text-yellow-300 mt-1">
26+
This banner is an internal test feature that only appears in nightly builds. It demonstrates that
27+
internal experiments with nightlyDefault=true are working correctly.
28+
</p>
29+
</div>
30+
</div>
31+
)
32+
}

webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ describe("mergeExtensionState", () => {
220220
apiConfiguration: { modelMaxThinkingTokens: 456, modelTemperature: 0.3 },
221221
experiments: {
222222
powerSteering: true,
223-
autoCondenseContext: true,
224223
concurrentFileReads: true,
224+
_nightlyTestBanner: false,
225225
} as Record<ExperimentId, boolean>,
226226
}
227227

0 commit comments

Comments
 (0)