You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configure/user-interface/change-detection.mdx
+17-19Lines changed: 17 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ sidebar:
5
5
order: 3
6
6
---
7
7
8
-
During development, Storybook monitors your git working tree and the builder's module graph to identify which stories are related to your changes. A **Review** button at the top of the sidebar shows live counts of new and modified stories and lets you filter the tree to just those entries with one click. Subtle status icons appear next to **new** stories so you can spot them at a glance.
8
+
During development, Storybook monitors your git working tree and the builder's module graph to identify which stories are related to your changes. A Review button at the top of the sidebar announces new and modified stories and lets you filter the tree to just those entries with one click. Status icons appear next to new stories and modified components so you can spot them at a glance.
9
9
10
-

10
+

11
11
12
12
## Requirements
13
13
@@ -24,37 +24,35 @@ If change detection status indicators never appear in your sidebar, check that b
24
24
25
25
When a change is detected, Storybook shows one of the following status icons next to the relevant stories in the sidebar:
| ✦ Sparkle|**new**| The story file is untracked or newly added in git. |
30
+
| ● Filled circle |**modified**| The story's own file, or a file it directly imports, was changed. |
31
+
||**related**| A file further up the story's dependency chain was changed (a transitive dependency). |
32
32
33
33
When multiple statuses apply to the same story, the highest priority wins: **new** > **modified** > **related**.
34
34
35
-
<Calloutvariant="info"icon="💡">
36
-
37
-
**Why are modified and related quiet by default?**
38
-
39
-
Heuristic-based statuses can over-report on real-world repositories — a route file that imports many components, or a utility that's imported broadly, can mark a large number of stories as modified or related even when the actual code change doesn't affect them. Storybook keeps these statuses available behind explicit filters so the sidebar stays calm by default while still giving you the information when you ask for it.
40
-
41
-
</Callout>
42
-
43
35
Change detection statuses are displayed alongside [test statuses](../../writing-tests/integrations/vitest-addon/index.mdx#storybook-ui) in the sidebar.
44
36
45
37

46
38
47
39
## Reviewing changes
48
40
49
-
A **Review** button appears between the search bar and the story tree whenever you have at least one new or modified story. The button shows live counts and toggles both the **new** and **modified** filters together with one click:
41
+
A **Review** button appears between the search bar and the story tree whenever you have at least one new or modified story. The button toggles both the **new** and **modified** filters together with one click.
50
42
51
-
Clicking the button enables the `new` and `modified` include filters so the sidebar shows just those stories. Clicking it again disables those two filters while preserving any other active filter selections.
43
+

52
44
53
-
The button hides when search results are shown so it doesn't compete with them.
45
+
<Calloutvariant="info"icon="💡">
46
+
47
+
**Why are change detection filters off by default?**
48
+
49
+
The heuristics that Storybook uses to determine modified and related stories are designed to be fast and work without any configuration, but they aren't perfect. They can produce false positives (marking stories as modified or related when they aren't), which can be distracting if you have a large repository with many shared dependencies. For example, if you change a widely used utility function, Storybook might mark dozens of stories as related even if the change doesn't actually affect them. To avoid overwhelming you with status icons, Storybook keeps the modified and related filters off by default, so you only see these statuses when you choose to review your changes.
50
+
51
+
</Callout>
54
52
55
53
## Filtering
56
54
57
-
For more granular control — for example, to inspect only **related** stories — open the filter menu next to the search bar and check or uncheck the individual statuses. Modified branch icons appear in the tree only while the **modified** filter is checked.
55
+
For more granular control (e.g., to view only new stories) open the filter menu next to the search bar and check or uncheck the individual statuses.
58
56
59
57

0 commit comments