diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index a97672148..cc8a15e17 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -2,6 +2,19 @@ import React from "react"; import type { Preview } from "@storybook/react-vite"; import { ThemeProvider, type ThemeMode } from "../src/browser/contexts/ThemeContext"; import "../src/browser/styles/globals.css"; +import { TUTORIAL_STATE_KEY, type TutorialState } from "../src/common/constants/storage"; + +// Disable tutorials by default in Storybook to prevent them from interfering with stories +// Individual stories can override this by setting localStorage before rendering +function disableTutorials() { + if (typeof localStorage !== "undefined") { + const disabledState: TutorialState = { + disabled: true, + completed: { settings: true, creation: true, workspace: true }, + }; + localStorage.setItem(TUTORIAL_STATE_KEY, JSON.stringify(disabledState)); + } +} const preview: Preview = { globalTypes: { @@ -32,6 +45,11 @@ const preview: Preview = { document.documentElement.style.colorScheme = mode; } + // Disable tutorials by default unless explicitly enabled for this story + if (!context.parameters?.tutorialEnabled) { + disableTutorials(); + } + return ( diff --git a/src/browser/App.tsx b/src/browser/App.tsx index 7de592e5e..e5c6d5151 100644 --- a/src/browser/App.tsx +++ b/src/browser/App.tsx @@ -36,6 +36,7 @@ import { useStartWorkspaceCreation, getFirstProjectPath } from "./hooks/useStart import { SettingsProvider, useSettings } from "./contexts/SettingsContext"; import { SettingsModal } from "./components/Settings/SettingsModal"; +import { TutorialProvider } from "./contexts/TutorialContext"; const THINKING_LEVELS: ThinkingLevel[] = ["off", "low", "medium", "high"]; @@ -653,9 +654,11 @@ function App() { return ( - - - + + + + + ); diff --git a/src/browser/components/ChatInput/CreationControls.tsx b/src/browser/components/ChatInput/CreationControls.tsx index dd231843b..e728a1e1d 100644 --- a/src/browser/components/ChatInput/CreationControls.tsx +++ b/src/browser/components/ChatInput/CreationControls.tsx @@ -23,7 +23,11 @@ export function CreationControls(props: CreationControlsProps) {
{/* Trunk Branch Selector */} {props.branches.length > 0 && ( -
+
@@ -39,7 +43,11 @@ export function CreationControls(props: CreationControlsProps) { )} {/* Runtime Selector */} -
+