Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8fcdc4f
feat(storybook): add Storybook setup and Button component stories
Nov 25, 2025
5523af2
ci(storybook): add GitHub Pages deployment workflow
Nov 25, 2025
5f89c5d
fix(storybook): align Storybook versions and fix TypeScript issues
Nov 25, 2025
1093454
feat(storybook): replace Button stories with Dropdown component stories
Nov 25, 2025
84630ec
feat(storybook): add SettingsPage stories and remove dropdown stories
Nov 25, 2025
6309eb5
feat(storybook): fix SettingsPage stories to show full page and add p…
Nov 25, 2025
599aa30
revert(storybook): restore SettingsPage stories to original working v…
Nov 25, 2025
e54e969
feat(storybook): add stories for ShortcutsPage and GlobalVariablesPag…
Nov 25, 2025
b261777
fix(storybook): add QueryClientProvider to GlobalVariablesPage stories
Nov 25, 2025
07b9b65
fix(storybook): remove WithGeneralSettings story to fix nested router…
Nov 25, 2025
55f0dcb
feat(storybook): enhance SettingsPage stories with multiple states an…
Nov 25, 2025
db7d2f4
fix(storybook): initialize Zustand stores synchronously in SettingsPa…
Nov 25, 2025
bc6bce4
feat(storybook): add story to verify store state accessibility
Nov 25, 2025
e660e94
fix(storybook): remove router from SettingsPage stories to fix errors
Nov 25, 2025
b924ed4
fix(storybook): add router back to SettingsPage stories for useNaviga…
Nov 25, 2025
7324203
fix(storybook): fix router decorator order in SettingsPage stories
Nov 25, 2025
eb61a54
feat(storybook): add PlaygroundPage story as example for complex page…
Nov 26, 2025
f3c5ce4
chore(storybook): remove SettingsPage stories
Nov 26, 2025
255cc35
chore: restore pyproject.toml to match main branch
Nov 26, 2025
847c583
chore: restore pyproject.toml to match main branch
Nov 26, 2025
3c56aa1
Revert "chore: restore pyproject.toml to match main branch"
Nov 26, 2025
6002388
chore: remove src/frontend/pyproject.toml as it doesn't exist in main
Nov 26, 2025
686dce6
fix gitignore and add make commands
Nov 26, 2025
11ac198
update package-json
Nov 26, 2025
8cfe170
chore(storybook): migrate from v8.6.14 to v10.1.0
Nov 26, 2025
d0cd3fe
fix: update package-lock.json to sync with package.json
Nov 26, 2025
67e8974
fix: regenerate package-lock.json with all optional dependencies
Nov 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:storybook/recommended"
],
"plugins": [
"react",
Expand Down Expand Up @@ -87,4 +88,4 @@
"node/prefer-promises/dns": "error",
"node/prefer-promises/fs": "error"
}
}
}
49 changes: 49 additions & 0 deletions .github/workflows/deploy-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Storybook to GitHub Pages

on:
push:
branches:
- main
paths:
- 'src/frontend/**/*.stories.*'
- 'src/frontend/.storybook/**'
- 'src/frontend/package.json'
- '.github/workflows/deploy-storybook.yml'
workflow_dispatch: # Allow manual trigger

jobs:
deploy:
name: Deploy Storybook
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write

steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: src/frontend/package-lock.json

- name: Install dependencies
run: cd src/frontend && npm ci

- name: Build Storybook
run: cd src/frontend && npm run build-storybook

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: src/frontend/storybook-static

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

24 changes: 23 additions & 1 deletion Makefile.frontend
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
FRONTEND_DIR = src/frontend
NPM = npm

.PHONY: install_frontend install_frontendci install_frontendc frontend_deps_check build_frontend run_frontend frontend frontendc format_frontend tests_frontend test_frontend test_frontend_watch test_frontend_coverage test_frontend_verbose test_frontend_ci test_frontend_clean test_frontend_file test_frontend_pattern test_frontend_snapshots test_frontend_config test_frontend_bail test_frontend_silent test_frontend_coverage_open help_frontend
.PHONY: install_frontend install_frontendci install_frontendc frontend_deps_check build_frontend run_frontend frontend frontendc format_frontend tests_frontend test_frontend test_frontend_watch test_frontend_coverage test_frontend_verbose test_frontend_ci test_frontend_clean test_frontend_file test_frontend_pattern test_frontend_snapshots test_frontend_config test_frontend_bail test_frontend_silent test_frontend_coverage_open help_frontend storybook storybook_build storybook_network

######################
# FRONTEND DEPENDENCIES
Expand Down Expand Up @@ -166,6 +166,23 @@ test_frontend_coverage_open: test_frontend_coverage ## run tests with coverage a
echo "Coverage report generated at: $(FRONTEND_DIR)/coverage/lcov-report/index.html"; \
fi

######################
# STORYBOOK
######################

storybook: frontend_deps_check ## run Storybook development server and open in browser
@echo "Starting Storybook development server on http://localhost:6006..."
@cd $(FRONTEND_DIR) && $(NPM) run storybook

storybook_build: frontend_deps_check ## build static Storybook
@echo "Building static Storybook..."
@cd $(FRONTEND_DIR) && $(NPM) run build-storybook
@echo "Storybook built to $(FRONTEND_DIR)/storybook-static"

storybook_network: frontend_deps_check ## run Storybook accessible on network (0.0.0.0:6006)
@echo "Starting Storybook development server accessible on network..."
@cd $(FRONTEND_DIR) && $(NPM) run storybook:network

######################
# FRONTEND HELP
######################
Expand Down Expand Up @@ -212,5 +229,10 @@ help_frontend: ## show frontend help
@echo " $(GREEN)make test_frontend_snapshots$(NC) - Update Jest snapshots"
@echo " $(GREEN)make test_frontend_config$(NC) - Show Jest configuration"
@echo ''
@echo "$(GREEN)Storybook:$(NC)"
@echo " $(GREEN)make storybook$(NC) - Run Storybook dev server and open in browser"
@echo " $(GREEN)make storybook_build$(NC) - Build static Storybook"
@echo " $(GREEN)make storybook_network$(NC) - Run Storybook accessible on network"
@echo ''
@echo "$(GREEN)═══════════════════════════════════════════════════════════════════$(NC)"
@echo ''
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ dependencies = [
"fastparquet>=2024.11.0,<2025.0.0",
"traceloop-sdk>=0.43.1,<1.0.0",
"vlmrun[all]>=0.2.0",
"cuga==0.1.11",
"cuga==0.1.10",
"agent-lifecycle-toolkit~=0.4.1",
"astrapy>=2.1.0,<3.0.0",
"aioboto3>=15.2.0,<16.0.0"
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
# production
/build

# storybook
/storybook-static
*storybook.log

# misc
.DS_Store
.env.local
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/.storybook/css.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Type declarations for CSS imports in Storybook
declare module "*.css" {
const content: Record<string, string>;
export default content;
}
41 changes: 41 additions & 0 deletions src/frontend/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// This file has been automatically migrated to valid ESM format by Storybook.
import { fileURLToPath } from "node:url";
import type { StorybookConfig } from "@storybook/react-vite";
import path, { dirname } from "path";
import { mergeConfig } from "vite";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: ["@storybook/addon-links", "@storybook/addon-docs"],
framework: {
name: "@storybook/react-vite",
options: {},
},
async viteFinal(config) {
return mergeConfig(config, {
resolve: {
alias: {
"@": path.resolve(__dirname, "../src"),
},
},
});
},
typescript: {
check: false,
reactDocgen: "react-docgen-typescript",
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) => {
if (prop.parent) {
return !prop.parent.fileName.includes("node_modules");
}
return true;
},
},
},
};

export default config;
87 changes: 87 additions & 0 deletions src/frontend/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import type { Preview } from "@storybook/react-vite";
import * as React from "react";
import { useEffect } from "react";
// Import all CSS files to match the app's styling
import "../src/style/classes.css";
import "../src/style/index.css";
import "../src/App.css";
import "../src/style/applies.css";
import { TooltipProvider } from "../src/components/ui/tooltip";
import { useDarkStore } from "../src/stores/darkStore";

// Global decorator to provide TooltipProvider for all stories
const withTooltipProvider = (Story: React.ComponentType) => {
const TooltipWrapper = (): React.ReactElement => {
const storyElement = React.createElement(Story);
return React.createElement(TooltipProvider, {
skipDelayDuration: 0,
children: storyElement,
});
};
return React.createElement(TooltipWrapper);
};

// Global decorator to handle dark mode for all stories
const withTheme = (
Story: React.ComponentType,
context: {
args?: { darkMode?: boolean };
initialArgs?: { darkMode?: boolean };
parameters?: { darkMode?: boolean };
globals?: { theme?: string };
},
) => {
const ThemeWrapper = (): React.ReactElement => {
// Check for dark mode in args, parameters, or globals
const dark =
context.args?.darkMode === true ||
context.initialArgs?.darkMode === true ||
context.parameters?.darkMode === true ||
context.globals?.theme === "dark";

useEffect(() => {
const bodyElement = document.getElementById("body") || document.body;
const htmlElement = document.documentElement;

if (dark) {
bodyElement.classList.add("dark");
htmlElement.classList.add("dark");
useDarkStore.setState({ dark: true });
} else {
bodyElement.classList.remove("dark");
htmlElement.classList.remove("dark");
useDarkStore.setState({ dark: false });
}
}, [dark]);

// Sync immediately on render
const bodyElement = document.getElementById("body") || document.body;
const htmlElement = document.documentElement;
if (dark) {
bodyElement.classList.add("dark");
htmlElement.classList.add("dark");
} else {
bodyElement.classList.remove("dark");
htmlElement.classList.remove("dark");
}

return React.createElement(Story);
};

return React.createElement(ThemeWrapper);
};

const preview: Preview = {
decorators: [withTooltipProvider, withTheme],
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading
Loading