diff --git a/code/core/src/manager/components/sidebar/ChecklistWidget.tsx b/code/core/src/manager/components/sidebar/ChecklistWidget.tsx index b6c10e201d9b..00e8f6ec18b2 100644 --- a/code/core/src/manager/components/sidebar/ChecklistWidget.tsx +++ b/code/core/src/manager/components/sidebar/ChecklistWidget.tsx @@ -146,7 +146,13 @@ const title = (progress: number) => { } }; -const OpenGuideAction = ({ children }: { children?: React.ReactNode }) => { +const OpenGuideAction = ({ + children, + afterClick, +}: { + children?: React.ReactNode; + afterClick?: () => void; +}) => { const api = useStorybookApi(); return ( { onClick={(e) => { e.stopPropagation(); api.navigate('/settings/guide'); + afterClick?.(); }} > @@ -231,7 +238,7 @@ export const ChecklistWidget = () => { tooltip={({ onHide }) => ( - + Open full guide diff --git a/code/core/src/shared/checklist-store/checklistData.tsx b/code/core/src/shared/checklist-store/checklistData.tsx index 20c5d23bdf22..d9c7fe9c4f84 100644 --- a/code/core/src/shared/checklist-store/checklistData.tsx +++ b/code/core/src/shared/checklist-store/checklistData.tsx @@ -145,6 +145,7 @@ export const checklistData = { available: ({ index }) => !!index && 'example-button--primary' in index && + !!globalThis?.FEATURES?.controls && addons.experimental_getRegisteredAddons().includes(ADDON_ONBOARDING_ID), criteria: 'Guided tour is completed', subscribe: ({ api, accept }) => @@ -353,6 +354,7 @@ export const Primary: Story = { id: 'controls', after: ['renderComponent'], label: 'Change a story with Controls', + available: () => !!globalThis?.FEATURES?.controls, criteria: 'Story args are updated', subscribe: ({ api, done }) => api.on(STORY_ARGS_UPDATED, done), content: ({ api }) => ( @@ -388,6 +390,7 @@ export const Primary: Story = { id: 'viewports', after: ['renderComponent'], label: 'Check responsiveness with Viewports', + available: () => !!globalThis?.FEATURES?.viewport, criteria: 'Viewport global is updated', subscribe: ({ api, done }) => api.on(UPDATE_GLOBALS, ({ globals }) => globals?.viewport && done()), @@ -621,6 +624,7 @@ export default { id: 'writeInteractions', after: ['renderComponent'], label: 'Test functionality with interactions', + available: () => !!globalThis?.FEATURES?.interactions, criteria: 'At least one story with a play or test function', subscribe: subscribeToIndex((entries) => Object.values(entries).some(