Skip to content

Commit 7527438

Browse files
committed
Docs: Fixes for change detection
- Replace images - Structure and prose improvements
1 parent e4ac3cc commit 7527438

5 files changed

Lines changed: 17 additions & 19 deletions

File tree

6.27 KB
Loading
-1.88 KB
Loading
-5.11 KB
Loading
28.7 KB
Loading

docs/configure/user-interface/change-detection.mdx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ sidebar:
55
order: 3
66
---
77

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.
99

10-
![Sidebar showing change detection status icons](../../_assets/configure/change-detection-full.png)
10+
![Sidebar showing review button and new storya status icons](../../_assets/configure/change-detection-full.png)
1111

1212
## Requirements
1313

@@ -24,37 +24,35 @@ If change detection status indicators never appear in your sidebar, check that b
2424

2525
When a change is detected, Storybook shows one of the following status icons next to the relevant stories in the sidebar:
2626

27-
| Icon | Status | Definition |
28-
| --------------- | ------------ | ------------------------------------------------------------------------------------- |
29-
| 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). |
27+
| Icon | Status | Definition |
28+
| ------------------------- | ------------ | ------------------------------------------------------------------------------------- |
29+
| 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). |
3232

3333
When multiple statuses apply to the same story, the highest priority wins: **new** > **modified** > **related**.
3434

35-
<Callout variant="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-
4335
Change detection statuses are displayed alongside [test statuses](../../writing-tests/integrations/vitest-addon/index.mdx#storybook-ui) in the sidebar.
4436

4537
![Sidebar showing change detection and test status icons](../../_assets/configure/change-detection-dual-slot.png)
4638

4739
## Reviewing changes
4840

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.
5042

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+
![Sidebar with active review button](../../_assets/configure/change-detection-review-button-active.png)
5244

53-
The button hides when search results are shown so it doesn't compete with them.
45+
<Callout variant="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>
5452

5553
## Filtering
5654

57-
For more granular control — for example, to inspect only **related** storiesopen 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.
5856

5957
![Filter menu showing change detection status options](../../_assets/configure/change-detection-filter-menu.png)
6058

0 commit comments

Comments
 (0)