From 92f6b3e5b93b9b44b89e4025d4cbf278a69f7a1b Mon Sep 17 00:00:00 2001 From: mbeaulne Date: Thu, 27 Aug 2026 12:50:14 -0400 Subject: [PATCH] Enable AI Assistant and remove its feature flag --- .../layout/AiModelQuickSelect.test.tsx | 45 +------------------ src/components/layout/AiModelQuickSelect.tsx | 7 +-- src/flags.ts | 8 ---- src/routes/Settings/SettingsLayout.tsx | 22 +++------ src/routes/router.ts | 8 ---- src/routes/v2/pages/Editor/EditorV2.tsx | 3 +- .../v2/pages/Editor/hooks/useAiChatWindow.tsx | 8 +--- src/routes/v2/pages/RunView/RunViewV2.tsx | 4 +- .../runWindowVisibilityPersistence.test.tsx | 2 +- .../pages/RunView/hooks/useAiChatWindow.tsx | 8 +--- 10 files changed, 16 insertions(+), 99 deletions(-) diff --git a/src/components/layout/AiModelQuickSelect.test.tsx b/src/components/layout/AiModelQuickSelect.test.tsx index 0e984559bc..4b14dbc690 100644 --- a/src/components/layout/AiModelQuickSelect.test.tsx +++ b/src/components/layout/AiModelQuickSelect.test.tsx @@ -4,12 +4,6 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; import { AiModelQuickSelect } from "./AiModelQuickSelect"; const STORAGE_KEY = "tangle.aiProvider.config"; -const FLAGS_STORAGE_KEY = "betaFlags"; - -function enableFlags(flags: Record) { - window.localStorage.setItem(FLAGS_STORAGE_KEY, JSON.stringify(flags)); -} - describe("AiModelQuickSelect", () => { beforeEach(() => { window.localStorage.clear(); @@ -22,31 +16,12 @@ describe("AiModelQuickSelect", () => { }); it("does not render until AI provider settings are configured", () => { - enableFlags({ "ai-assistant": true }); - - render(); - - expect(screen.queryByRole("combobox", { name: "AI model" })).toBeNull(); - }); - - it("does not render when both AI features are disabled", () => { - enableFlags({ "ai-assistant": false, "component-search-v2": false }); - window.localStorage.setItem( - STORAGE_KEY, - JSON.stringify({ - apiBase: "https://api.example.com/v1", - apiKey: "", - model: "gpt-4.1-mini", - }), - ); - render(); expect(screen.queryByRole("combobox", { name: "AI model" })).toBeNull(); }); - it("shows configured model choices when component search is enabled", () => { - enableFlags({ "component-search-v2": true }); + it("shows configured model choices", () => { window.localStorage.setItem( STORAGE_KEY, JSON.stringify({ @@ -68,22 +43,4 @@ describe("AiModelQuickSelect", () => { screen.getByRole("option", { name: "GPT-4.1 mini" }), ).toBeInTheDocument(); }); - - it("shows configured model choices when the AI assistant is enabled", () => { - enableFlags({ "ai-assistant": true }); - window.localStorage.setItem( - STORAGE_KEY, - JSON.stringify({ - apiBase: "https://api.example.com/v1", - apiKey: "", - model: "gpt-4.1-mini", - }), - ); - - render(); - - expect( - screen.getByRole("combobox", { name: "AI model" }), - ).toBeInTheDocument(); - }); }); diff --git a/src/components/layout/AiModelQuickSelect.tsx b/src/components/layout/AiModelQuickSelect.tsx index b66e8e4c62..2c195eb334 100644 --- a/src/components/layout/AiModelQuickSelect.tsx +++ b/src/components/layout/AiModelQuickSelect.tsx @@ -1,4 +1,3 @@ -import { useFlagValue } from "@/components/shared/Settings/useFlags"; import { Select, SelectContent, @@ -16,8 +15,6 @@ import { import { useAiProviderSettings } from "@/hooks/useAiProviderSettings"; export function AiModelQuickSelect() { - const componentSearchEnabled = useFlagValue("component-search-v2"); - const aiAssistantEnabled = useFlagValue("ai-assistant"); const { config, update, isConfigured } = useAiProviderSettings(); const configuredModel = config.model.trim(); const options = getAiModelOptions(); @@ -28,9 +25,7 @@ export function AiModelQuickSelect() { update({ model: value }); }; - if ((!componentSearchEnabled && !aiAssistantEnabled) || !isConfigured) { - return null; - } + if (!isConfigured) return null; return (