Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

refactor(frontend): ungate tour sidebar from tour-app-shell flag (#13493)

Ubbe7222a5f6770b
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
index e426bc1406..40042e87d3 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/TourCopilot.tsx
@@ -5,11 +5,9 @@ import { useIsMobile } from "@/app/(platform)/copilot/useIsMobile";
import { DotDistortionShader } from "@/components/ui/dot-distortion-shader";
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
import { useMountEffect } from "@/hooks/useMountEffect";
-import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";
import dynamic from "next/dynamic";
import { CSSProperties } from "react";
import { TourChatHost } from "./TourChatHost";
-import { TourScenarioChips } from "./components/TourScenarioChips/TourScenarioChips";
import { TourSidebar } from "./components/TourSidebar/TourSidebar";
import { buildTourArtifactRef } from "./helpers";
import { getTourScenario } from "./script/tourScenarios";
@@ -38,7 +36,6 @@ function TourBackdrop() {
export function TourCopilot() {
const activeScenarioId = useTourStore((s) => s.activeScenarioId);
const scenario = getTourScenario(activeScenarioId);
- const appShellEnabled = useGetFlag(Flag.TOUR_APP_SHELL);
const isMobile = useIsMobile();
const openArtifact = useCopilotUIStore((s) => s.openArtifact);
const clearArtifactPreview = useCopilotUIStore((s) => s.clearArtifactPreview);
@@ -51,19 +48,11 @@ export function TourCopilot() {
return () => closeArtifactPanel({ persist: false });
});
- // The completion artifact is not gated behind the app-shell flag — the demo
- // always ends by opening the scenario's mock file in the artifact panel.
const chatColumn = (
<div className="relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
<TourBackdrop />
<div className="relative z-10 flex min-h-0 flex-1 flex-col">
- {appShellEnabled ? (
- <div className="h-4 shrink-0" />
- ) : (
- <div className="px-3 pb-2 pt-5">
- <TourScenarioChips />
- </div>
- )}
+ <div className="h-4 shrink-0" />
<TourChatHost
key={scenario.id}
sessionId={scenario.id}
@@ -91,15 +80,6 @@ export function TourCopilot() {
</>
);
- if (!appShellEnabled) {
- return (
- <div className="relative flex h-dvh w-full overflow-hidden bg-[#fafafa]">
- {chatColumn}
- {artifactPanels}
- </div>
- );
- }
-
return (
<SidebarProvider
style={{ "--sidebar-width": "19rem" } as CSSProperties}
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx
index 5a4bc37cb8..9d96f39ffb 100644
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx
+++ b/autogpt_platform/frontend/src/app/(public)/tour/chat/__tests__/app-shell.test.tsx
@@ -17,8 +17,6 @@ vi.mock("@/app/(platform)/copilot/useIsMobile", () => ({
useIsMobile: () => false,
}));
-const flagState = vi.hoisted(() => ({ tourAppShell: true }));
-
vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
const actual =
await importOriginal<
@@ -26,8 +24,7 @@ vi.mock("@/services/feature-flags/use-get-flag", async (importOriginal) => {
>();
return {
...actual,
- useGetFlag: (flag: string) =>
- flag === actual.Flag.TOUR_APP_SHELL ? flagState.tourAppShell : false,
+ useGetFlag: () => false,
};
});
@@ -62,10 +59,9 @@ async function pressEnterToSend() {
}
}
-describe("Tour chat app shell (tour-app-shell flag)", () => {
+describe("Tour chat app shell", () => {
beforeEach(() => {
vi.useFakeTimers();
- flagState.tourAppShell = true;
// Both stores are module-level state — reset between tests.
useTourStore.setState({ activeScenarioId: DEFAULT_SCENARIO_ID });
useCopilotUIStore.getState().clearArtifactPreview();
@@ -150,16 +146,4 @@ describe("Tour chat app shell (tour-app-shell flag)", () => {
// store holds the artifact.
expect(screen.getByText("competitor-pricing-report.md")).toBeDefined();
}, 30_000);
-
- test("flag off keeps the scenario pills layout", () => {
- flagState.tourAppShell = false;
- render(<TourChatPage />);
-
- expect(
- screen
- .getByRole("button", { name: "Competitor watch" })
- .getAttribute("aria-pressed"),
- ).toBe("true");
- expect(screen.queryByText("Recent chats")).toBeNull();
- });
});
diff --git a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx b/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx
deleted file mode 100644
index 15523626a6..0000000000
--- a/autogpt_platform/frontend/src/app/(public)/tour/chat/components/TourScenarioChips/TourScenarioChips.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-"use client";
-
-import { useCopilotUIStore } from "@/app/(platform)/copilot/store";
-import { cn } from "@/lib/utils";
-import { tourScenarios } from "../../script/tourScenarios";
-import { useTourStore } from "../../tourStore";
-
-export function TourScenarioChips() {
- const activeScenarioId = useTourStore((s) => s.activeScenarioId);
- const setActiveScenario = useTourStore((s) => s.setActiveScenario);
- const clearArtifactPreview = useCopilotUIStore((s) => s.clearArtifactPreview);
-
- function selectScenario(id: string) {
- clearArtifactPreview();
- setActiveScenario(id);
- }
-
- return (
- <div className="flex flex-wrap items-center justify-center gap-2">
- {tourScenarios.map((scenario) => {
- const ChipIcon = scenario.icon;
- const isActive = scenario.id === activeScenarioId;
- return (
- <button
- key={scenario.id}
- type="button"
- onClick={() => selectScenario(scenario.id)}
- aria-pressed={isActive}
- className={cn(
- "flex items-center gap-2 rounded-full border bg-white px-4 py-2 text-sm font-medium transition-colors",
- isActive
- ? "border-violet-400 bg-violet-50 text-violet-700"
- : "border-zinc-200 text-zinc-600 hover:border-zinc-300 hover:text-zinc-900",
- )}
- >
- <ChipIcon className="size-4 shrink-0" />
- {scenario.label}
- </button>
- );
- })}
- </div>
- );
-}
diff --git a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
index f5a70bbf14..a354fdc45e 100644
--- a/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
+++ b/autogpt_platform/frontend/src/services/feature-flags/use-get-flag.ts
@@ -20,7 +20,6 @@ export enum Flag {
AUTOGPT_NEW_LAYOUT = "autogpt-new-layout",
CHAT_WORKSPACE_FILES = "chat-workspace-files",
CHAT_PINNING = "chat-pinning",
- TOUR_APP_SHELL = "tour-app-shell",
TASK_PROGRESS_BAR = "task-progress-bar",
// Graphiti memory + dream-system gates. Mirror of the backend
// ``Flag`` enum in ``backend/util/feature_flag.py``. Frontend reads
@@ -54,7 +53,6 @@ const defaultFlags = {
[Flag.AUTOGPT_NEW_LAYOUT]: false,
[Flag.CHAT_WORKSPACE_FILES]: false,
[Flag.CHAT_PINNING]: false,
- [Flag.TOUR_APP_SHELL]: false,
[Flag.TASK_PROGRESS_BAR]: false,
[Flag.GRAPHITI_MEMORY]: false,
[Flag.GRAPHITI_COMMUNITIES_ENABLED]: false,
@@ -112,8 +110,6 @@ function readEnvOverride(flag: Flag): string | undefined {
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_WORKSPACE_FILES;
case Flag.CHAT_PINNING:
return process.env.NEXT_PUBLIC_FORCE_FLAG_CHAT_PINNING;
- case Flag.TOUR_APP_SHELL:
- return process.env.NEXT_PUBLIC_FORCE_FLAG_TOUR_APP_SHELL;
case Flag.TASK_PROGRESS_BAR:
return process.env.NEXT_PUBLIC_FORCE_FLAG_TASK_PROGRESS_BAR;
case Flag.GRAPHITI_MEMORY: