Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
49b8341
UI: Make TagsFilter state part of the layout module
Sidnioulz Dec 30, 2025
e987318
Address code quality issues
Sidnioulz Jan 23, 2026
99cc016
Address code quality issues
Sidnioulz Jan 23, 2026
14ba070
Fix stories
Sidnioulz Mar 2, 2026
eb00ffd
Move all filter logic to stories module
Sidnioulz Mar 11, 2026
87ee27c
Address doc and TS issues
Sidnioulz Mar 11, 2026
8a39eab
Rework types again to pass CI type check
Sidnioulz Mar 11, 2026
51b8afe
Merge branch 'next' into sidnioulz/issue-32986
Sidnioulz Mar 11, 2026
bd21c77
Restore playwright config file
Sidnioulz Mar 11, 2026
758e083
Tests: Make locator logic more robust for tags
Sidnioulz Mar 11, 2026
1dde480
Reinstate highlight logic of old TagsFilter button
Sidnioulz Mar 12, 2026
792af17
Avoid API getters that return state
Sidnioulz Mar 12, 2026
d019e28
Fix regression in TagsFilterPanel story mock
Sidnioulz Mar 12, 2026
ba45194
Merge branch 'next' into sidnioulz/issue-32986
Sidnioulz Mar 12, 2026
e538742
Tidy up manager context in story code and redundant index check
Sidnioulz Mar 12, 2026
15677b7
Fix playwright config url AGAIN :)
Sidnioulz Mar 12, 2026
ce5cd19
Fix prioritisation issue in active filter count
Sidnioulz Mar 12, 2026
2524cae
Fix stories module unit test
Sidnioulz Mar 12, 2026
83cc88a
Merge branch 'next' into sidnioulz/issue-32986
Sidnioulz Mar 13, 2026
39f77c0
Merge branch 'next' into sidnioulz/issue-32986
Sidnioulz Mar 13, 2026
6e52655
Try to help CI tsc not get stuck on false positives
Sidnioulz Mar 13, 2026
99654b4
Work around prod-only tsc limitation
Sidnioulz Mar 13, 2026
1fdeddf
Merge branch 'next' into sidnioulz/issue-32986
Sidnioulz Mar 13, 2026
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
2 changes: 2 additions & 0 deletions code/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import * as templatePreview from '../core/template/stories/preview';
import '../renderers/react/template/components/index';
import { isChromatic } from './isChromatic';

sb.mock(import('@storybook/global'), { spy: true });

sb.mock('../core/template/stories/test/ModuleMocking.utils.ts');
sb.mock('../core/template/stories/test/ModuleSpyMocking.utils.ts', { spy: true });
sb.mock('../core/template/stories/test/ModuleAutoMocking.utils.ts');
Expand Down
31 changes: 0 additions & 31 deletions code/core/src/core-server/presets/common-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/* these imports are in the exact order in which the panels need to be registered */
import { global } from '@storybook/global';

import { addons, Tag } from 'storybook/manager-api';

// THE ORDER OF THESE IMPORTS MATTERS! IT DEFINES THE ORDER OF PANELS AND TOOLS!
import controlsManager from '../../controls/manager';
Expand All @@ -12,36 +9,8 @@ import measureManager from '../../measure/manager';
import outlineManager from '../../outline/manager';
import viewportManager from '../../viewport/manager';

const TAG_FILTERS = 'tag-filters';
const STATIC_FILTER = 'static-filter';

const tagFiltersManager = addons.register(TAG_FILTERS, (api) => {
// FIXME: this ensures the filter is applied after the first render
// to avoid a strange race condition in Webkit only.
const staticExcludeTags = Object.entries(global.TAGS_OPTIONS ?? {}).reduce(
(acc, entry) => {
const [tag, option] = entry;
if ((option as any).excludeFromSidebar) {
acc[tag] = true;
}
return acc;
},
{} as Record<string, boolean>
);

api.experimental_setFilter(STATIC_FILTER, (item) => {
const tags = item.tags ?? [];
return (
// we can filter out the primary story, but we still want to show autodocs
(tags.includes(Tag.DEV) || item.type === 'docs') &&
tags.filter((tag) => staticExcludeTags[tag]).length === 0
);
});
});

export default [
measureManager,
tagFiltersManager,
actionsManager,
backgroundsManager,
componentTestingManager,
Expand Down
53 changes: 30 additions & 23 deletions code/core/src/manager-api/modules/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,30 +121,36 @@ export interface SubAPI {

type PartialSubState = Partial<SubState>;

export const defaultLayoutState: SubState = {
ui: {
enableShortcuts: true,
},
layout: {
initialActive: ActiveTabs.CANVAS,
showToolbar: true,
navSize: 300,
bottomPanelHeight: 300,
rightPanelWidth: 400,
recentVisibleSizes: {
navSize: 300,
bottomPanelHeight: 300,
rightPanelWidth: 400,
export const DEFAULT_NAV_SIZE = 300;
export const DEFAULT_BOTTOM_PANEL_HEIGHT = 300;
export const DEFAULT_RIGHT_PANEL_WIDTH = 400;

export const getDefaultLayoutState: () => SubState = () => {
return {
ui: {
enableShortcuts: true,
},
layout: {
initialActive: ActiveTabs.CANVAS,
showToolbar: true,
navSize: DEFAULT_NAV_SIZE,
bottomPanelHeight: DEFAULT_BOTTOM_PANEL_HEIGHT,
rightPanelWidth: DEFAULT_RIGHT_PANEL_WIDTH,
recentVisibleSizes: {
navSize: DEFAULT_NAV_SIZE,
bottomPanelHeight: DEFAULT_BOTTOM_PANEL_HEIGHT,
rightPanelWidth: DEFAULT_RIGHT_PANEL_WIDTH,
},
panelPosition: 'bottom',
showTabs: true,
},
panelPosition: 'bottom',
showTabs: true,
},
layoutCustomisations: {
showSidebar: undefined,
showToolbar: undefined,
},
selectedPanel: undefined,
theme: create(),
layoutCustomisations: {
showSidebar: undefined,
showToolbar: undefined,
},
selectedPanel: undefined,
theme: create(),
};
};

export const focusableUIElements = {
Expand Down Expand Up @@ -434,6 +440,7 @@ export const init: ModuleFn<SubAPI, SubState> = ({ store, provider, singleStory

getInitialOptions() {
const { theme, selectedPanel, layoutCustomisations, ...options } = provider.getConfig();
const defaultLayoutState = getDefaultLayoutState();

return {
...defaultLayoutState,
Expand Down
Loading
Loading