Skip to content

Commit 8fbf690

Browse files
authored
Merge branch 'next' into kasper/cli-split
2 parents 3c18316 + 735b97f commit 8fbf690

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

code/core/src/manager-api/modules/shortcuts.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import { global } from '@storybook/global';
3-
import { FORCE_REMOUNT, PREVIEW_KEYDOWN } from '@storybook/core/core-events';
3+
import {
4+
FORCE_REMOUNT,
5+
PREVIEW_KEYDOWN,
6+
STORIES_COLLAPSE_ALL,
7+
STORIES_EXPAND_ALL,
8+
} from '@storybook/core/core-events';
49

510
import type { ModuleFn } from '../lib/types';
611

@@ -356,11 +361,11 @@ export const init: ModuleFn = ({ store, fullAPI, provider }) => {
356361
break;
357362
}
358363
case 'collapseAll': {
359-
fullAPI.collapseAll();
364+
fullAPI.emit(STORIES_COLLAPSE_ALL);
360365
break;
361366
}
362367
case 'expandAll': {
363-
fullAPI.expandAll();
368+
fullAPI.emit(STORIES_EXPAND_ALL);
364369
break;
365370
}
366371
case 'remount': {

code/core/src/manager/container/Menu.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type { API, State } from '@storybook/core/manager-api';
66
import { shortcutToHumanString } from '@storybook/core/manager-api';
77
import { styled, useTheme } from '@storybook/core/theming';
88
import { CheckIcon, InfoIcon, ShareAltIcon, WandIcon } from '@storybook/icons';
9+
import { STORIES_COLLAPSE_ALL } from '@storybook/core/core-events';
910

1011
const focusableUIElements = {
1112
storySearchField: 'storybook-explorer-searchfield',
@@ -222,7 +223,7 @@ export const useMenu = (
222223
() => ({
223224
id: 'collapse',
224225
title: 'Collapse all',
225-
onClick: () => api.collapseAll(),
226+
onClick: () => api.emit(STORIES_COLLAPSE_ALL),
226227
right: enableShortcuts ? <Shortcut keys={shortcutKeys.collapseAll} /> : null,
227228
}),
228229
[api, enableShortcuts, shortcutKeys]

0 commit comments

Comments
 (0)