fix(ui): minor story fixes for data-viz-misc and dialogs-modals

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-04-20 11:01:03 -05:00
1 parent 098fc41b2f
commit bbe1993dee
2 files changed
+11 -3

No files matched your search

@@ -317,10 +317,15 @@ function LiveRunWidgetStory({ empty = false, loading = false }: { empty?: boolea
function OpenOnboardingOnMount({ initialStep }: { initialStep: 1 | 2 }) {
const { openOnboarding } = useDialog();
const queryClient = useQueryClient();
useEffect(() => {
queryClient.setQueryData(queryKeys.agents.adapterModels(companyId, "claude_local"), [
{ id: "claude-sonnet-4-5", label: "Claude Sonnet 4.5" },
{ id: "claude-opus-4-1", label: "Claude Opus 4.1" },
]);
openOnboarding(initialStep === 1 ? { initialStep } : { initialStep, companyId });
}, [initialStep, openOnboarding]);
}, [initialStep, openOnboarding, queryClient]);
return <OnboardingWizard />;
}
@@ -1,4 +1,4 @@
import { useEffect, useLayoutEffect, useState, type ReactNode } from "react";
import { useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react";
import type { Meta, StoryObj } from "@storybook/react-vite";
import type {
DocumentRevision,
@@ -468,7 +468,10 @@ function clickButtonByText(text: string) {
}
function useOpenOnMount(open: () => void) {
useEffect(() => {
const didOpenRef = useRef(false);
useLayoutEffect(() => {
if (didOpenRef.current) return;
didOpenRef.current = true;
open();
}, [open]);
}