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
1 change: 1 addition & 0 deletions code/core/src/core-server/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export const features: PresetProperty<'features'> = async (existing) => ({
backgrounds: true,
outline: true,
measure: true,
sidebarOnboardingChecklist: true,
});

export const csfIndexer: Indexer = {
Expand Down
13 changes: 13 additions & 0 deletions code/core/src/manager/components/sidebar/Sidebar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ export const SimpleInProduction: Story = {
},
};

export const SimpleNoChecklist: Story = {
args: {
showCreateStoryButton: false,
},
beforeEach: () => {
const features = global.FEATURES;
global.FEATURES = { ...features, sidebarOnboardingChecklist: false };
return () => {
global.FEATURES = features;
};
},
};

export const Mobile: Story = {
decorators: [mobileLayoutDecorator],
globals: { sb_theme: 'light', viewport: { value: 'mobile1' } },
Expand Down
4 changes: 3 additions & 1 deletion code/core/src/manager/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export const Sidebar = React.memo(function Sidebar({
isLoading={isLoading}
onMenuClick={onMenuClick}
/>
{!isLoading && global.CONFIG_TYPE === 'DEVELOPMENT' && <ChecklistWidget />}
{!isLoading &&
global.CONFIG_TYPE === 'DEVELOPMENT' &&
global.FEATURES?.sidebarOnboardingChecklist !== false && <ChecklistWidget />}
</div>
<Search
dataset={dataset}
Expand Down
34 changes: 20 additions & 14 deletions code/core/src/manager/settings/GuidePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react';

import { Link } from 'storybook/internal/components';

import { global } from '@storybook/global';

import { styled } from 'storybook/theming';

import { useChecklist } from '../components/sidebar/useChecklist';
Expand Down Expand Up @@ -47,20 +49,24 @@ export const GuidePage = () => {
</p>
</Intro>
<Checklist {...checklist} />
{checklist.openItems.length === 0 ? (
<center>Your work here is done!</center>
) : checklist.widget.disable || checklist.openItems.every((item) => item.isMuted) ? (
<center>
Want to see this in the sidebar?{' '}
<Link onClick={() => checklist.disable(false)}>Show in sidebar</Link>
</center>
) : (
<center>
Don&apos;t want to see this in the sidebar?{' '}
<Link onClick={() => checklist.mute(checklist.allItems.map(({ id }) => id))}>
Remove from sidebar
</Link>
</center>
{global.FEATURES?.sidebarOnboardingChecklist !== false && (
<>
{checklist.openItems.length === 0 ? (
<center>Your work here is done!</center>
) : checklist.widget.disable || checklist.openItems.every((item) => item.isMuted) ? (
<center>
Want to see this in the sidebar?{' '}
<Link onClick={() => checklist.disable(false)}>Show in sidebar</Link>
</center>
) : (
<center>
Don&apos;t want to see this in the sidebar?{' '}
<Link onClick={() => checklist.mute(checklist.allItems.map(({ id }) => id))}>
Remove from sidebar
</Link>
</center>
)}
</>
)}
</Container>
);
Expand Down
7 changes: 7 additions & 0 deletions code/core/src/types/modules/core-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,13 @@ export interface StorybookConfigRaw {
*/
actions?: boolean;

/**
* Enable the onboarding checklist sidebar widget
*
* @default true
*/
sidebarOnboardingChecklist?: boolean;

/**
* @temporary This feature flag is a migration assistant, and is scheduled to be removed.
*
Expand Down
Loading