Skip to content

Commit

Permalink
Merge pull request #28580 from storybookjs/yann/fix-interaction-status
Browse files Browse the repository at this point in the history
Addon-Interactions: Fix status in panel tab
  • Loading branch information
ndelangen committed Jul 16, 2024
2 parents 6c895fe + 40b1b2f commit 7c3bac8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
6 changes: 3 additions & 3 deletions code/addons/interactions/src/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ export const Panel = memo<{ storyId: string }>(function PanelMemoized({ storyId
});
},
[STORY_THREW_EXCEPTION]: () => {
set((s) => ({ ...s, isErrored: true }));
set((s) => ({ ...s, isErrored: true, hasException: true }));
},
[PLAY_FUNCTION_THREW_EXCEPTION]: (e) => {
set((s) => ({ ...s, caughtException: e }));
set((s) => ({ ...s, caughtException: e, hasException: true }));
},
[UNHANDLED_ERRORS_WHILE_PLAYING]: (e) => {
set((s) => ({ ...s, unhandledErrors: e }));
set((s) => ({ ...s, unhandledErrors: e, hasException: true }));
},
},
[collapsed]
Expand Down
7 changes: 0 additions & 7 deletions code/addons/interactions/src/components/TabStatus.tsx

This file was deleted.

4 changes: 1 addition & 3 deletions code/addons/interactions/src/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import React, { useCallback } from 'react';
import type { Combo } from 'storybook/internal/manager-api';
import { addons, Consumer, types, useAddonState } from 'storybook/internal/manager-api';
import { AddonPanel, Badge, Spaced } from 'storybook/internal/components';
import { CallStates } from '@storybook/instrumenter';
import { ADDON_ID, PANEL_ID } from './constants';
import { Panel } from './Panel';
import { TabIcon } from './components/TabStatus';

function Title() {
const [addonState = {}] = useAddonState(ADDON_ID);
Expand All @@ -18,7 +16,7 @@ function Title() {
{interactionsCount && !hasException ? (
<Badge status="neutral">{interactionsCount}</Badge>
) : null}
{hasException ? <TabIcon status={CallStates.ERROR} /> : null}
{hasException ? <Badge status="negative">{interactionsCount}</Badge> : null}
</Spaced>
</div>
);
Expand Down

0 comments on commit 7c3bac8

Please sign in to comment.