Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 9 additions & 2 deletions code/core/src/manager/components/sidebar/ChecklistWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,21 @@ const title = (progress: number) => {
}
};

const OpenGuideAction = ({ children }: { children?: React.ReactNode }) => {
const OpenGuideAction = ({
children,
afterClick,
}: {
children?: React.ReactNode;
afterClick?: () => void;
}) => {
const api = useStorybookApi();
return (
<Listbox.Action
ariaLabel="Open onboarding guide"
onClick={(e) => {
e.stopPropagation();
api.navigate('/settings/guide');
afterClick?.();
}}
>
<Listbox.Icon>
Expand Down Expand Up @@ -231,7 +238,7 @@ export const ChecklistWidget = () => {
tooltip={({ onHide }) => (
<Listbox as="ul">
<Listbox.Item as="li">
<OpenGuideAction>
<OpenGuideAction afterClick={onHide}>
<Listbox.Text>Open full guide</Listbox.Text>
</OpenGuideAction>
</Listbox.Item>
Expand Down
4 changes: 4 additions & 0 deletions code/core/src/shared/checklist-store/checklistData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) =>
Expand Down Expand Up @@ -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 }) => (
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -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(
Expand Down