storybook-addon-colab 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +82 -87
- package/dist/{chunk-K6X5UDOT.js → chunk-733YF4R5.js} +870 -659
- package/dist/index.js +1 -1
- package/dist/manager.js +234 -77
- package/dist/preset.js +75 -25
- package/dist/preview.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `storybook-addon-colab` are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Releases are published under npm's default dist-tag, `latest`; only a pre-release version (one with a `-`, such as `1.0.0-rc.1`) goes to `next`.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.3.0] - 2026-12-05
|
|
8
|
+
|
|
9
|
+
Every collection is now a canvas. Grid, Rows and Columns are no longer views you switch between: they are ways to arrange the stories on the canvas, once, from the **Arrange** menu.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **One canvas for every collection.** The collection page always shows its stories at full size on a surface you pan and zoom, as the Canvas view did. A story you haven't placed is laid out in the collection's arrangement, in list order, below the placed ones. The Grid, Rows and Columns views are gone, and so are Grid's scaled-down cards and the sideways scrolling of Columns.
|
|
14
|
+
- **Arrange replaces the view menu.** **Arrange** in the collection toolbar offers **Grid** (wrapping rows), **Rows** (one story per row) and **Columns** (side by side). Choosing one moves every story into it in the order they read on the canvas (top to bottom, then left to right), saves that order as the collection's order, saves the arrangement and clears every position in one write, then zooms to fit. It is an action, not a mode: you can drag any story anywhere afterwards. A file saved with `"view": "canvas"` is laid out as a grid.
|
|
15
|
+
- **One Comments button.** **Comment** and **Threads** are now one **Comments** button with the open thread count. It shows the thread sidebar and turns on comment mode together, and turns both off. <kbd>C</kbd> does the same. <kbd>Esc</kbd> closes the open thread first, then turns Comments off. Opening a thread from a pin, or with <kbd>J</kbd>/<kbd>K</kbd>, turns Comments on. A collection page now starts with Comments off; the sidebar no longer remembers whether it was open.
|
|
16
|
+
- **Choosing a thread brings it into view.** Clicking a thread in the sidebar, or moving to one with <kbd>J</kbd>/<kbd>K</kbd>, pans and zooms the canvas so the thread's story fits beside the sidebar (never above 100%), and marks its pin with a ring. A thread on a whole story fits the story; a thread on the collection or on a removed story leaves the canvas where it is.
|
|
17
|
+
- **Storybook's toolbar is hidden on collection pages**, as the addons panel already was. It comes back when you open a story. Storybook's zoom is set to 100% when a collection opens and stays there: the canvas has its own zoom, so there is only one.
|
|
18
|
+
- **The collection menu.** The collection's name in the collection toolbar is now a menu: **Add stories…**, **Rename…**, **Delete…**, every other collection to switch to, and **New collection…**. **Add stories…** opens a dialog where you search the project's stories and add the ones you check to the end of the collection. The **Collections** menu and **Add to collection** stay in Storybook's toolbar on story pages.
|
|
19
|
+
- **Agent tools describe arrangements.** `update_collection { view }` now arranges the stories as the Arrange menu does: it puts the list in reading order (placed stories top to bottom, then left to right, then the others in list order), saves the arrangement and removes every story's position in the same write. Collection results report `arrangement` (`"grid"`, `"rows"` or `"columns"`). The `view` input still takes `"grid"`, `"rows"`, `"columns"` and `"canvas"` (laid out as a grid).
|
|
20
|
+
- **Default story width.** A story with no viewport is 480 pixels wide. Grid's 1280 × 800 desktop size and Rows' page width are gone with those views.
|
|
21
|
+
|
|
22
|
+
### Deprecated
|
|
23
|
+
|
|
24
|
+
- **`view` in agent tool results.** Collection results still include `view`, with the same value as `arrangement` (so a collection saved as `"canvas"` reports `"grid"`). Read `arrangement` instead; `view` will be removed from results in a later release. The `view` input of `create_collection` and `update_collection` is not deprecated.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **Snapping.** A story you drag by its title bar snaps to the edges and centres of the stories around it, within 8 screen pixels at any zoom, and guide lines show what it lines up with. The width handle snaps to the left and right edges of other stories as well as to your viewports, with a guide line on the shared edge. Hold <kbd>Alt</kbd>/<kbd>⌥</kbd>, before or during a drag, to turn snapping off. Arrow-key moves and width steps don't snap.
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
|
|
32
|
+
- **Reordering on the page.** Dragging a story by its grip, or using the arrow keys on it, now moves the story on the canvas; it no longer changes the collection's order. The order starts as the order stories were added in; **Arrange** saves the current reading order as the new order. Agents can still change it with `reorder_stories`.
|
|
33
|
+
|
|
5
34
|
## [0.2.1] - 2026-12-04
|
|
6
35
|
|
|
7
36
|
### Fixed
|
|
@@ -95,6 +124,8 @@ The first pre-release. Install it with `npm install -D storybook-addon-colab@nex
|
|
|
95
124
|
|
|
96
125
|
See [Known limitations](https://github.com/winkerVSbecks/addon-colab#known-limitations) and [How comment pins find their element](https://github.com/winkerVSbecks/addon-colab#how-comment-pins-find-their-element-and-when-they-dont) in the README for the full list.
|
|
97
126
|
|
|
127
|
+
[Unreleased]: https://github.com/winkerVSbecks/addon-colab/compare/v0.3.0...HEAD
|
|
128
|
+
[0.3.0]: https://github.com/winkerVSbecks/addon-colab/compare/v0.2.1...v0.3.0
|
|
98
129
|
[0.2.1]: https://github.com/winkerVSbecks/addon-colab/compare/v0.2.0...v0.2.1
|
|
99
130
|
[0.2.0]: https://github.com/winkerVSbecks/addon-colab/compare/v0.1.0...v0.2.0
|
|
100
131
|
[0.1.0]: https://github.com/winkerVSbecks/addon-colab/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://main--6b084d0ac639954a18641c7a.chromatic.com)
|
|
4
4
|
|
|
5
|
-
CoLab (`storybook-addon-colab`) adds collections to Storybook. A collection is a set of stories to review together: every state of a component, the screens of a flow, or the stories a change touched. You see them as a grid,
|
|
5
|
+
CoLab (`storybook-addon-colab`) adds collections to Storybook. A collection is a set of stories to review together: every state of a component, the screens of a flow, or the stories a change touched. You see them at full size on a canvas you pan and zoom, arranged as a grid, in rows or in columns, or placed where you want them, at the viewports you choose, and you discuss them in threads pinned to an element, a whole story or the collection.
|
|
6
6
|
|
|
7
7
|
A coding agent connected over MCP can build collections for you ("put every Button state in a collection"), ask you questions on them, and work through your comments: each thread tells it the story file, a CSS selector, the HTML and the text of what you pointed at, which is enough to find the code.
|
|
8
8
|
|
|
@@ -10,43 +10,43 @@ Each collection is a JSON file in your repository, so collections can be committ
|
|
|
10
10
|
|
|
11
11
|
<picture>
|
|
12
12
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/hero-dark.png">
|
|
13
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/hero.png" alt="A collection named Design review in Storybook
|
|
13
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/hero.png" alt="A collection named Design review in Storybook: the Header and Button stories on the left and the Page story at the Small mobile viewport on the right, at full size on the canvas, a note on the Header story, a comment pin on the Header's Sign up button, and the thread sidebar on the right listing the collection's threads by story." width="800">
|
|
14
14
|
</picture>
|
|
15
15
|
|
|
16
16
|
## A short walkthrough
|
|
17
17
|
|
|
18
18
|
1. **Ask your agent to build a collection.** With the agent connected (see [Connect a coding agent](#connect-a-coding-agent)), ask something like "put the Header, Button and Page stories in a collection called Design review, and note what to look at". It finds the stories, creates the collection and gives you its link. The collection also appears in Storybook's sidebar under **Collections**.
|
|
19
19
|
|
|
20
|
-
You can build one by hand too: **Collections** in Storybook's toolbar → **New collection…**, then drag stories from the sidebar onto the
|
|
20
|
+
You can build one by hand too: **Collections** in Storybook's toolbar → **New collection…**, then drag stories from the sidebar onto the canvas, or choose **Add stories…** from the collection menu (click the collection's name).
|
|
21
21
|
|
|
22
|
-
2. **
|
|
22
|
+
2. **Arrange the stories.** Every story is shown at full size on a canvas you pan and zoom. **Arrange** in the collection toolbar lays them all out once, in the order they read on the canvas: **Grid** (wrapping rows), **Rows** (one story per row) or **Columns** (side by side). Then drag any story by its title bar to where you want it; it snaps to the stories around it.
|
|
23
23
|
|
|
24
24
|
<picture>
|
|
25
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
26
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/arrange-menu-dark.png">
|
|
26
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/arrange-menu.png" alt="The Arrange menu open in the collection toolbar: Grid (wrapping rows), Rows (one per row) and Columns (side by side)." width="600">
|
|
27
27
|
</picture>
|
|
28
28
|
|
|
29
29
|
<picture>
|
|
30
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
31
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
30
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/canvas-dark.png">
|
|
31
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/canvas.png" alt="The Button story being dragged by its title bar on the canvas: it has snapped into line with the Header story above it, and guide lines run along their shared left and right edges and centres." width="800">
|
|
32
32
|
</picture>
|
|
33
33
|
|
|
34
34
|
3. **Interact with a story.** Stories are frozen when they load (animations paused, no hot reload), so a collection of many stories stays quiet. Turn on **Live** in a story's header to use it: click its buttons, type in its inputs, and see code changes hot-reload.
|
|
35
35
|
|
|
36
|
-
4. **Comment.** Turn on
|
|
36
|
+
4. **Comment.** Turn on **Comments** in the collection toolbar, or press <kbd>C</kbd>: the thread sidebar opens and comment mode is on. The element under the pointer is highlighted with a label such as `button “Sign up”`. Click it, write your comment and press **Comment** or <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+<kbd>Enter</kbd>. A pin marks the element. Click the empty part of a story to comment on the whole story. See [Comments and threads](#comments-and-threads).
|
|
37
37
|
|
|
38
38
|
<picture>
|
|
39
39
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/commenting-dark.png">
|
|
40
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/commenting.png" alt="Comment mode
|
|
40
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/commenting.png" alt="Comment mode: a new pin on the Page story's heading, and the new-thread box beside it reads “Shorter heading? It wraps on phones.”." width="800">
|
|
41
41
|
</picture>
|
|
42
42
|
|
|
43
43
|
5. **Ask the agent to work through your comments**, for example "fix the open threads on the design-review collection". It lists the threads waiting on it, finds each element in the code, makes the change, replies to say what it changed and resolves the thread. Its replies appear in the open collection at once, and live stories re-render with the change.
|
|
44
44
|
|
|
45
|
-
6. **Follow the conversation in the thread sidebar.** **
|
|
45
|
+
6. **Follow the conversation in the thread sidebar.** With **Comments** on, the sidebar shows every thread, grouped by story. Threads waiting on you are marked: **Agent replied** when the agent answered you, **Agent asked** when the agent started the thread and you haven't answered yet. Click one to read and answer it: the canvas fits its story in view and marks its pin.
|
|
46
46
|
|
|
47
47
|
<picture>
|
|
48
48
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/thread-dark.png">
|
|
49
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/thread.png" alt="The thread sidebar open on the thread about the Sign up button: the user's question, the agent's reply explaining what it changed, and the reply box with Resolve." width="800">
|
|
49
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/thread.png" alt="The thread sidebar open on the thread about the Sign up button: the user's question, the agent's reply explaining what it changed, and the reply box with Resolve. The Header story is fitted in view beside the sidebar, its pin marked with a ring." width="800">
|
|
50
50
|
</picture>
|
|
51
51
|
|
|
52
52
|
## Requirements
|
|
@@ -105,7 +105,7 @@ The folder is created when the dev server starts. You don't need to add it to `s
|
|
|
105
105
|
|
|
106
106
|
0.2.0 breaks with 0.1.0, with no aliases for the old names; the [CHANGELOG](CHANGELOG.md) has the details.
|
|
107
107
|
|
|
108
|
-
- **What 0.1.0 called a canvas is now a collection.** The 0.1.0 board (free-size frames on one zoomable surface, and drawing) is gone. A collection shows its stories
|
|
108
|
+
- **What 0.1.0 called a canvas is now a collection.** The 0.1.0 board (free-size frames on one zoomable surface, and drawing) is gone. A collection shows its stories at full size on a canvas.
|
|
109
109
|
- **Move the folder:** collections live in `.storybook/collections/` (`git mv .storybook/canvases .storybook/collections`). The addon option `canvasDir` is now `collectionDir`.
|
|
110
110
|
- **Recreate your files.** This version reads collection files with `schemaVersion: 3` only. Older files are listed as broken collections, with an error saying an older version wrote them, and are never upgraded, overwritten or deleted.
|
|
111
111
|
- **Reconnect your agent.** The tools `list_canvases`, `get_canvas`, `create_canvas` and `update_canvas` are now `list_collections`, `get_collection`, `create_collection` and `update_collection`, and every tool takes `collectionId`. A thread on the whole collection is `{ "type": "collection" }`.
|
|
@@ -114,34 +114,34 @@ The folder is created when the dev server starts. You don't need to add it to `s
|
|
|
114
114
|
|
|
115
115
|
## Using a collection
|
|
116
116
|
|
|
117
|
-
- **Collections** in Storybook's toolbar lists your collections and creates, renames and deletes them. Each collection is also a sidebar entry under **Collections**; its URL stays the same when you rename it.
|
|
117
|
+
- **Collections** in Storybook's toolbar lists your collections and creates, renames and deletes them. Each collection is also a sidebar entry under **Collections**; its URL stays the same when you rename it. On a collection page Storybook's toolbar is hidden: the collection toolbar replaces it.
|
|
118
|
+
- The **collection toolbar** shows the collection's name, its description (an agent can set one; hover to read all of it) and how many stories it has. On the right are **Arrange**, the viewport menu, a divider, then **Comments** with the open thread count. In a narrow toolbar the buttons show only their icons; their tooltips name them.
|
|
119
|
+
- **The collection menu.** Click the collection's name to open it: **Add stories…**, **Rename…**, **Delete…**, the other collections to switch to, and **New collection…**. **Add stories…** opens a search over your project's stories; the ones you check go to the end of the collection.
|
|
118
120
|
|
|
119
121
|
<picture>
|
|
120
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
121
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/
|
|
122
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/collection-menu-dark.png">
|
|
123
|
+
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/collection-menu.png" alt="The collection menu open from the collection's name, Design review: Add stories, Rename, Delete, the Design review collection checked, and New collection." width="600">
|
|
122
124
|
</picture>
|
|
123
125
|
|
|
124
|
-
-
|
|
125
|
-
- **Adding stories.** Drag a story from Storybook's sidebar and drop it where it should go: a line shows where it will land. **Add to collection** in Storybook's toolbar (shown while a story is open) adds that story at the end of a collection you pick. A story can be in a collection more than once, for example at two viewports.
|
|
126
|
+
- **Adding stories.** Drag a story from Storybook's sidebar and drop it on the canvas where it should go. **Add stories…** in the collection menu adds several at the end. **Add to collection** in Storybook's toolbar (shown while a story is open) adds that story to the end of a collection you pick. A story can be in a collection more than once, for example at two viewports.
|
|
126
127
|
- **Each story's header** has a grip, the story's title (click it to open the story in Storybook), its open thread count, its viewport menu, **Live**, and **✕** to remove it from the collection. Removing shows an **Undo** button for 10 seconds.
|
|
127
|
-
- **
|
|
128
|
-
- **Notes.** A story can have a short note (what to look at), shown under its header
|
|
128
|
+
- **Order.** A collection's stories have an order: at first, the order they were added in. The canvas lays out stories you haven't placed in that order. **Arrange** lays every story out in its current reading order on the canvas (top to bottom, then left to right) and saves that as the new order, so tabbing through the stories and grouping threads by story follow it. An agent can change the order too (`reorder_stories`).
|
|
129
|
+
- **Notes.** A story can have a short note (what to look at), shown under its header. Notes are set by an agent (`set_story_note`) or in the file; the page doesn't edit them yet.
|
|
129
130
|
- **Live.** Stories load frozen: Storybook's `freeze=finished` mode, with animations paused and no hot reload. **Live** reloads the story without freezing it, so you can interact with it, its play function runs, and code changes hot-reload. Live isn't saved: stories are frozen again when you reopen the collection.
|
|
130
|
-
- **Loading.** Each story renders in its own iframe, like on its own Storybook page. Only stories near the visible part of the
|
|
131
|
-
- **Zoom.**
|
|
132
|
-
- **Scrolling.** Each view scrolls inside the page. In the Columns view, scroll sideways with a trackpad, <kbd>Shift</kbd>+wheel, or the arrow keys once the stories area has focus.
|
|
131
|
+
- **Loading.** Each story renders in its own iframe, like on its own Storybook page. Only stories near the visible part of the canvas are loaded (a few at a time); stories far away are unloaded and keep their size.
|
|
132
|
+
- **Zoom.** The canvas has its own zoom (see [The canvas](#the-canvas)). Storybook's zoom is set to 100% when a collection opens and stays there, so there is only one zoom. Pins and highlights stay on their elements at any zoom, and the thread sidebar keeps its size.
|
|
133
133
|
- A story whose file was deleted or renamed shows **This story no longer exists** with a **Remove** button, and comes back by itself when the file returns. A story that fails to load shows the error and a **Retry** button.
|
|
134
134
|
- Everything you change is saved to the collection file at once. A change made elsewhere (another tab, the agent, a hand edit) shows up in an open collection without a reload, and without reloading the stories that didn't change.
|
|
135
135
|
- Storybook 11 marks a collection you have edited as new or modified in the sidebar, the same as a story file you changed, because each collection is a file in your repository.
|
|
136
136
|
|
|
137
137
|
### Viewports
|
|
138
138
|
|
|
139
|
-
By default
|
|
139
|
+
By default a story is 480 pixels wide and as tall as it renders. You can render stories at a viewport instead:
|
|
140
140
|
|
|
141
|
-
- **Every story:** the viewport menu in the collection toolbar (**Auto** =
|
|
142
|
-
- **One story:** the viewport menu in its header sets that story apart, ahead of the toolbar's choice, until the next choice in the toolbar. While a story has its own choice, the menu's button is in the accent colour and the menu says so; **Use collection viewport** removes the choice (**Use story's viewport** when its story file sets one, which then applies). When the story itself is narrower than 400 pixels the button shows only its icon, so the title keeps room. This goes by the story's width, not the size it is drawn at:
|
|
141
|
+
- **Every story:** the viewport menu in the collection toolbar (**Auto** = the default, 480 pixels wide). Choosing here applies to every story: it also clears each story's own choice in this collection (set in its header, or by an agent), in the same save. Choosing the entry that is already checked does this too. Only stories that set a viewport in their story file keep it; the menu says how many. Choosing in this menu also resets any temporary widths (see [The canvas](#the-canvas)), and **Reset temporary widths** there resets them without choosing.
|
|
142
|
+
- **One story:** the viewport menu in its header sets that story apart, ahead of the toolbar's choice, until the next choice in the toolbar. While a story has its own choice, the menu's button is in the accent colour and the menu says so; **Use collection viewport** removes the choice (**Use story's viewport** when its story file sets one, which then applies). When the story itself is narrower than 400 pixels the button shows only its icon, so the title keeps room. This goes by the story's width, not the size it is drawn at: a Tablet story still shows its viewport's name when the canvas is zoomed out. Choosing here also resets that story's temporary width.
|
|
143
143
|
|
|
144
|
-
The menus are how a viewport is saved in the collection file, for everyone who opens it.
|
|
144
|
+
The menus are how a viewport is saved in the collection file, for everyone who opens it. A story's width handle only tries a width in your browser tab.
|
|
145
145
|
|
|
146
146
|
Both menus list your project's Storybook viewports (the toolbar's list: `parameters.viewport.options`, or Storybook's defaults when you haven't set any) and take a **custom width** from 40 to 4000 pixels. Viewports without a pixel width, such as `100%`, aren't offered.
|
|
147
147
|
|
|
@@ -152,36 +152,33 @@ Both menus list your project's Storybook viewports (the toolbar's list: `paramet
|
|
|
152
152
|
|
|
153
153
|
Which viewport a story renders at, first match wins:
|
|
154
154
|
|
|
155
|
-
1.
|
|
155
|
+
1. A temporary width from the story's width handle (in your browser tab only, never saved).
|
|
156
156
|
2. The viewport chosen for that story in the collection.
|
|
157
157
|
3. The story's own viewport, when it sets one (`globals: { viewport: { value: 'mobile1' } }` on the story or its meta, or the project's `initialGlobals`). A rotated viewport reads, for example, "Small mobile (rotated)".
|
|
158
158
|
4. The collection-wide viewport.
|
|
159
|
-
5. The
|
|
159
|
+
5. The default width, 480 pixels.
|
|
160
160
|
|
|
161
161
|
A choice that names a viewport no longer in your project's list is skipped, and the next rule applies.
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
A viewport sets the story's width; its height is always the story's own.
|
|
164
164
|
|
|
165
165
|
The story is loaded with Storybook's `viewport` global set to the chosen viewport, so the story's own tooling sees it too. Storybook's own rule still applies inside the story: a story that sets its own viewport keeps reading its own value from `globals.viewport`, even when a collection choice for that story changes its width.
|
|
166
166
|
|
|
167
|
-
### The
|
|
167
|
+
### The canvas
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
<picture>
|
|
172
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/canvas-dark.png">
|
|
173
|
-
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/canvas.png" alt="The collection in the Canvas view: the Header and Button stories on the left and the Page story at the Small mobile viewport on the right, placed freely, with the zoom panel in the canvas's bottom-right corner. The Button story's width handle is being dragged and has snapped to 414 px, Large mobile." width="800">
|
|
174
|
-
</picture>
|
|
169
|
+
Every collection shows its stories at full size on a surface you can pan and zoom. At 100% zoom a story is the same size as on its own page, pixel for pixel. Each story sits where you put it; stories you haven't placed are laid out in the collection's arrangement, in list order, below the ones you have.
|
|
175
170
|
|
|
171
|
+
- **Arrange** in the collection toolbar lays every story out once, in the order they read on the canvas now (top to bottom, then left to right): **Grid** (rows of up to four that wrap), **Rows** (one story per row, left edges aligned) or **Columns** (side by side, tops aligned). It saves that reading order as the collection's order, saves the arrangement and clears every story's position in one save, then zooms to fit; arranging again changes nothing. It is an action, not a mode: drag any story anywhere afterwards.
|
|
176
172
|
- **Pan** by dragging the empty background, with the wheel or a trackpad, or by holding <kbd>Space</kbd> (or the middle mouse button) and dragging anywhere, stories included. With the canvas focused, the arrow keys pan too.
|
|
177
173
|
- **Zoom** with a pinch, <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+wheel (around the pointer), or the zoom panel in the canvas's bottom-right corner: zoom out, the zoom level (click for 100%), zoom in, and zoom to fit every story. <kbd>Tab</kbd> reaches the panel after the last story. Keys, with the canvas focused: <kbd>+</kbd> and <kbd>-</kbd>, <kbd>0</kbd> for 100%, <kbd>Shift</kbd>+<kbd>1</kbd> to fit. Zoom only scales the picture: each story keeps rendering at its own width.
|
|
178
174
|
- **Move a story** by dragging its title bar, or focus its grip and press the arrow keys (10 pixels; 50 with <kbd>Shift</kbd>). The new position is read out. Drop a story from Storybook's sidebar where you want it on the canvas.
|
|
179
|
-
- **
|
|
180
|
-
|
|
175
|
+
- **Snapping.** While you drag a story, it snaps to the edges and centres of the stories around it when it comes within 8 screen pixels (at any zoom), and guide lines show what it lines up with. Hold <kbd>Alt</kbd>/<kbd>⌥</kbd>, before or during the drag, to place it freely. Arrow-key moves don't snap.
|
|
176
|
+
- **Try a story at another width** with the handle on its right edge. Drag it, or focus it and press <kbd>←</kbd>/<kbd>→</kbd> (10 pixels; 50 with <kbd>Shift</kbd>) or <kbd>Page Up</kbd>/<kbd>Page Down</kbd> for the next larger or smaller viewport. The story really re-lays out at that width (it isn't scaled). While you drag, the width snaps to one of your viewports or to the left or right edge of another story, whichever is nearer (within 8 screen pixels); the width shows, with the viewport's name or a guide line on the shared edge. Hold <kbd>Alt</kbd>/<kbd>⌥</kbd> to drag without snapping, and press <kbd>Esc</kbd> to cancel the drag. Keyboard steps don't snap to edges. The story doesn't move while you resize it.
|
|
177
|
+
The width is **temporary**: it is only in your browser tab and is never saved, so other people, other tabs and agents don't see it. While a story has one, its title bar shows the width (and the viewport's name when the width is one of your viewports and the story is at least 560 pixels wide) with a reset button that puts it back at its saved viewport; **Reset temporary widths** in the toolbar's viewport menu resets every story. A reload or a new tab starts without any (unlike the pan and zoom, which the tab remembers), so a temporary width never hides a viewport saved meanwhile. To keep a width, choose it in the story's viewport menu (or the toolbar's): that saves it and clears the temporary width. A viewport saved anywhere else clears it the same way, so the saved choice always shows: by an agent (`set_story_viewport` clears that story's, `update_collection { viewport }` every story's) or in another tab.
|
|
181
178
|
A temporary width changes only the frame's width: inside the story, Storybook's `viewport` global stays the saved viewport, so a story that reads that global (rather than a media query or its own width) still sees the saved one.
|
|
182
179
|
- <kbd>Tab</kbd> goes through the stories in reading order (top to bottom, then left to right), and the canvas pans to whatever gets focus.
|
|
183
|
-
- **Comments
|
|
184
|
-
- **What is saved.** Positions are saved in the collection file when you move a story,
|
|
180
|
+
- **Comments.** Pins stay on their elements at any pan and zoom. Opening a thread fits its story in view (see [The thread sidebar](#the-thread-sidebar)), and in comment mode the wheel scrolls a scrollable box inside a story before it pans the canvas.
|
|
181
|
+
- **What is saved.** Positions are saved in the collection file when you move or drop a story; the first move also saves every other story where it is shown, so nothing jumps. **Arrange** saves the reading order and the arrangement and clears the positions. Opening a collection, panning, zooming and the width handle write nothing. The pan and zoom are remembered for the browser tab (temporary widths are not: a reload clears them); the first time, the canvas zooms to fit, never past 100%.
|
|
185
182
|
|
|
186
183
|
## Comments and threads
|
|
187
184
|
|
|
@@ -193,50 +190,50 @@ A thread is a conversation pinned to one of three places:
|
|
|
193
190
|
|
|
194
191
|
### Adding a comment
|
|
195
192
|
|
|
196
|
-
1. Turn on
|
|
193
|
+
1. Turn on **Comments** in the collection toolbar, or press <kbd>C</kbd>. The thread sidebar opens and comment mode is on: the stories stop taking clicks (live ones included) so a click picks what to comment on.
|
|
197
194
|
2. Point at what you want to comment on. The highlight shows what a click would pick, with a label such as `button “Sign up”`. Interactive elements win over what is inside them: pointing at a button's icon picks the button. Hold <kbd>Alt</kbd>/<kbd>⌥</kbd> to pick the exact element under the pointer instead.
|
|
198
195
|
3. Click. A new pin marks the spot and a box opens beside it. Write your comment and press **Comment** or <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+<kbd>Enter</kbd>. **Cancel** throws the draft away.
|
|
199
196
|
|
|
200
|
-
The box doesn't block the page. While it is open you can
|
|
197
|
+
The box doesn't block the page. While it is open you can pan and zoom, and use the thread sidebar: filter it, open threads and read them. <kbd>Esc</kbd>, or a click outside the stories, closes the box but keeps what you typed with its pin; click the pin to bring the box back. A click on another story while the box has text brings the box back into view instead of starting a second comment.
|
|
201
198
|
|
|
202
199
|
A comment or reply can be up to 10,000 characters (about 1,500 words). From 9,000 characters the box counts them; past 10,000 it says how many characters are over, and **Comment** or **Reply** (and <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+<kbd>Enter</kbd>) do nothing until the text is shorter, so nothing you typed is lost. Split a long comment into a comment and replies.
|
|
203
200
|
|
|
204
201
|
4. To comment on a whole story, click its empty area, or press <kbd>Tab</kbd> until the story is focused and press <kbd>Enter</kbd> or <kbd>Space</kbd>.
|
|
205
202
|
|
|
206
|
-
Press <kbd>C</kbd
|
|
203
|
+
Press <kbd>C</kbd>, or <kbd>Esc</kbd> once no thread is open, to turn Comments off: comment mode ends and the sidebar closes. Outside comment mode, pins stay visible and clicking one opens its thread and turns Comments on. On a live story, clicks go through the pins to the story, so it works as usual; open those threads from the sidebar, or from their pins in comment mode.
|
|
207
204
|
|
|
208
205
|
### The thread sidebar
|
|
209
206
|
|
|
210
|
-
**
|
|
207
|
+
**Comments** in the collection toolbar shows the sidebar and turns on comment mode together, and hides both; the sidebar's close button turns both off too. A collection page opens with Comments off. The sidebar lists threads grouped by **Whole collection**, then each story in collection order, then **Removed stories**, with open threads first. Filters: **Open**, **Waiting on me** (the agent spoke last: marked **Agent replied**, or **Agent asked** on a thread the agent started), **Resolved** and **All**, each with its count.
|
|
211
208
|
|
|
212
209
|
<picture>
|
|
213
210
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/threads-dark.png">
|
|
214
211
|
<img src="https://raw.githubusercontent.com/winkerVSbecks/addon-colab/main/assets/screenshots/threads.png" alt="The thread sidebar: the Open filter selected, the thread on the Header's Sign up button marked Agent replied, and the agent's question on the Button story marked Agent asked." width="600">
|
|
215
212
|
</picture>
|
|
216
213
|
|
|
217
|
-
Click a thread, or a pin on the page, to open the conversation: every message with its author and time (the agent's are marked in purple), a reply box, and **Resolve** or **Reopen**. Opening a thread
|
|
214
|
+
Click a thread, or a pin on the page, to open the conversation: every message with its author and time (the agent's are marked in purple), a reply box, and **Resolve** or **Reopen**. Opening a thread, from the list or with <kbd>J</kbd>/<kbd>K</kbd>, pans and zooms the canvas so its story fits beside the sidebar (never above 100%, and loading the story if needed), scrolls the element into view inside the story, and marks its pin with a ring. A thread on a whole story fits the story; a thread on the collection or on a removed story leaves the canvas where it is.
|
|
218
215
|
|
|
219
216
|
### Keyboard shortcuts
|
|
220
217
|
|
|
221
218
|
On a collection page:
|
|
222
219
|
|
|
223
|
-
| Keys | Where
|
|
224
|
-
| ------------------------------------------------------------------------ |
|
|
225
|
-
| <kbd>C</kbd> | the collection page, or a live story with focus
|
|
226
|
-
| <kbd>Esc</kbd> | the collection page
|
|
227
|
-
| <kbd>Enter</kbd> / <kbd>Space</kbd> | a focused story, in comment mode
|
|
228
|
-
| Hold <kbd>Alt</kbd>/<kbd>⌥</kbd> | comment mode
|
|
229
|
-
| <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+<kbd>Enter</kbd> | in a comment or reply box
|
|
230
|
-
| <kbd>J</kbd> / <kbd>K</kbd> | the collection page, not while typing
|
|
231
|
-
| <kbd>↑</kbd> / <kbd>↓</kbd> | the sidebar's list
|
|
232
|
-
| Arrow keys | a story's grip
|
|
233
|
-
|
|
|
234
|
-
| <kbd
|
|
235
|
-
|
|
|
236
|
-
|
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
| Arrow keys, <kbd>Home</kbd>, <kbd>End</kbd> | an open
|
|
220
|
+
| Keys | Where | What |
|
|
221
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------------------ | -------------------------------------------------------------------- |
|
|
222
|
+
| <kbd>C</kbd> | the collection page, or a live story with focus | Turn Comments (the sidebar and comment mode) on or off |
|
|
223
|
+
| <kbd>Esc</kbd> | the collection page | Close the open thread or the new-thread box, then turn Comments off |
|
|
224
|
+
| <kbd>Enter</kbd> / <kbd>Space</kbd> | a focused story, in comment mode | Start a thread on the whole story |
|
|
225
|
+
| Hold <kbd>Alt</kbd>/<kbd>⌥</kbd> | comment mode | Pick the exact element under the pointer |
|
|
226
|
+
| <kbd>⌘</kbd>/<kbd>Ctrl</kbd>+<kbd>Enter</kbd> | in a comment or reply box | Send it |
|
|
227
|
+
| <kbd>J</kbd> / <kbd>K</kbd> | the collection page, not while typing | Next / previous open thread, fitted in view |
|
|
228
|
+
| <kbd>↑</kbd> / <kbd>↓</kbd> | the sidebar's list | Move between threads |
|
|
229
|
+
| Arrow keys | a story's grip | Move the story (<kbd>Shift</kbd> for larger steps) |
|
|
230
|
+
| Hold <kbd>Alt</kbd>/<kbd>⌥</kbd> | while dragging a story or its width handle | Turn snapping off |
|
|
231
|
+
| Arrow keys, <kbd>Page Up</kbd> / <kbd>Page Down</kbd> | a story's width handle | Try another width; jump to the next or previous viewport (not saved) |
|
|
232
|
+
| <kbd>+</kbd> / <kbd>-</kbd>, <kbd>0</kbd>, <kbd>Shift</kbd>+<kbd>1</kbd> | the focused canvas | Zoom in or out, 100%, zoom to fit |
|
|
233
|
+
| Arrow keys | the focused canvas | Pan |
|
|
234
|
+
| Hold <kbd>Space</kbd> and drag | the canvas | Pan, over stories too |
|
|
235
|
+
| <kbd>↓</kbd>, <kbd>Enter</kbd> or <kbd>Space</kbd> | the collection's name, Arrange or the viewport menu's button | Open the menu |
|
|
236
|
+
| Arrow keys, <kbd>Home</kbd>, <kbd>End</kbd> | an open menu | Move between items; <kbd>Enter</kbd> chooses, <kbd>Esc</kbd> closes |
|
|
240
237
|
|
|
241
238
|
Keys pressed inside a live story belong to the story, apart from <kbd>C</kbd> and <kbd>Esc</kbd> for comment mode. <kbd>C</kbd> doesn't work while focus is in Storybook's own UI (the sidebar, the toolbar); click the collection page first.
|
|
242
239
|
|
|
@@ -321,24 +318,24 @@ The path is different from `@storybook/addon-mcp`'s `/mcp`, so both addons can b
|
|
|
321
318
|
|
|
322
319
|
The server has 16 tools:
|
|
323
320
|
|
|
324
|
-
| Tool | What it does
|
|
325
|
-
| --------------------- |
|
|
326
|
-
| `list_collections` | Every collection with its id, name, view, link (`url`), story count and open/total thread counts. Files in the collection folder that are not valid collections are listed under `invalid`, with the reasons.
|
|
327
|
-
| `get_collection` | One collection: name, description, view, viewport, link, its stories in order (item id, story id, title, story file, note, viewport) and every thread with its location, replies and who spoke last.
|
|
328
|
-
| `find_stories` | Searches Storybook's story index. Every word of the query must appear in the story id, component title, story name or story file. Returns story ids with title, name and story file.
|
|
329
|
-
| `create_collection` | Creates a collection with a name, an optional description, view and viewport, and stories in order, each with an optional note and viewport. Every story id must be in Storybook's index; unknown ids are named, with stories of the same component suggested, and nothing is written.
|
|
330
|
-
| `add_stories` | Adds stories to a collection, at the end or at an index.
|
|
331
|
-
| `remove_story` | Removes one story (by item id). Its threads are kept and say the story is no longer in the collection.
|
|
332
|
-
| `set_story_note` | Sets or removes the note shown with one story (up to 500 characters).
|
|
333
|
-
| `set_story_viewport` | Sets the viewport one story renders at, ahead of its own and the collection's; `null` resets it.
|
|
334
|
-
| `reorder_stories` | Puts stories in the order of the given item ids; stories not listed keep their order after them.
|
|
335
|
-
| `set_story_positions` | Places stories
|
|
336
|
-
| `update_collection` | Changes a collection's name, description, view (`grid`, `rows
|
|
337
|
-
| `list_threads` | Threads, oldest first, in one collection or all of them, filtered by `status` (`open`/`resolved`), `author` (who started it) or `waitingOn`: `"agent"` lists open threads where the user spoke last, `"user"` those where the agent did.
|
|
338
|
-
| `start_thread` | Starts an open thread written by the agent, anchored to a story (`{ type: "story", itemId }`), an element (`{ type: "element", itemId, target: { selector } }`), the collection (`{ type: "collection" }`) or the same place as another thread (`{ type: "sameAs", threadId }`).
|
|
339
|
-
| `reply_to_thread` | Adds a reply written by the agent. Does not change the thread's status.
|
|
340
|
-
| `resolve_thread` | Marks a thread resolved. Resolving a resolved thread changes nothing and keeps its original `resolvedAt`.
|
|
341
|
-
| `reopen_thread` | Marks a resolved thread open again.
|
|
321
|
+
| Tool | What it does |
|
|
322
|
+
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
323
|
+
| `list_collections` | Every collection with its id, name, arrangement (also as `view`, deprecated), link (`url`), story count and open/total thread counts. Files in the collection folder that are not valid collections are listed under `invalid`, with the reasons. |
|
|
324
|
+
| `get_collection` | One collection: name, description, arrangement (also as `view`, deprecated), viewport, link, its stories in order (item id, story id, title, story file, note, viewport, position) and every thread with its location, replies and who spoke last. |
|
|
325
|
+
| `find_stories` | Searches Storybook's story index. Every word of the query must appear in the story id, component title, story name or story file. Returns story ids with title, name and story file. |
|
|
326
|
+
| `create_collection` | Creates a collection with a name, an optional description, arrangement (`view`) and viewport, and stories in order, each with an optional note and viewport. Every story id must be in Storybook's index; unknown ids are named, with stories of the same component suggested, and nothing is written. |
|
|
327
|
+
| `add_stories` | Adds stories to a collection, at the end or at an index. |
|
|
328
|
+
| `remove_story` | Removes one story (by item id). Its threads are kept and say the story is no longer in the collection. |
|
|
329
|
+
| `set_story_note` | Sets or removes the note shown with one story (up to 500 characters). |
|
|
330
|
+
| `set_story_viewport` | Sets the viewport one story renders at, ahead of its own and the collection's; `null` resets it. |
|
|
331
|
+
| `reorder_stories` | Puts stories in the order of the given item ids; stories not listed keep their order after them. |
|
|
332
|
+
| `set_story_positions` | Places stories on the canvas: `{ itemId, position: { x, y } }`, the top-left corner of the story in pixels at 100% zoom; `null` lets the page lay it out in the arrangement. One write for all of them. `create_collection` and `add_stories` take a `position` per story too. |
|
|
333
|
+
| `update_collection` | Changes a collection's name, description or collection-wide viewport, or arranges its stories: `view` (`grid`, `rows` or `columns`) puts the list in reading order, saves the arrangement and clears every position, as **Arrange** does. With `applyToAll: true` it also clears every story's own viewport in the collection in the same write, as the toolbar menu does; without it, those stories keep theirs. |
|
|
334
|
+
| `list_threads` | Threads, oldest first, in one collection or all of them, filtered by `status` (`open`/`resolved`), `author` (who started it) or `waitingOn`: `"agent"` lists open threads where the user spoke last, `"user"` those where the agent did. |
|
|
335
|
+
| `start_thread` | Starts an open thread written by the agent, anchored to a story (`{ type: "story", itemId }`), an element (`{ type: "element", itemId, target: { selector } }`), the collection (`{ type: "collection" }`) or the same place as another thread (`{ type: "sameAs", threadId }`). |
|
|
336
|
+
| `reply_to_thread` | Adds a reply written by the agent. Does not change the thread's status. |
|
|
337
|
+
| `resolve_thread` | Marks a thread resolved. Resolving a resolved thread changes nothing and keeps its original `resolvedAt`. |
|
|
338
|
+
| `reopen_thread` | Marks a resolved thread open again. |
|
|
342
339
|
|
|
343
340
|
- Every result that names a collection includes its link (`url`), built from the address the agent connected to.
|
|
344
341
|
- Each thread says who started it (`author`), who spoke last (`lastAuthor`, `lastMessageAt`) and, while it is open, who is expected to answer (`waitingOn`).
|
|
@@ -470,9 +467,9 @@ One JSON file per collection, named after its id: `.storybook/collections/design
|
|
|
470
467
|
|
|
471
468
|
- `id` is a lowercase slug (letters, digits, single dashes) and must match the file name. Timestamps are ISO strings in UTC. Ids are unique across items, threads and replies.
|
|
472
469
|
- `name` is up to 200 characters, `description` (optional) up to 2000.
|
|
473
|
-
- `view` is `"grid"` (the default), `"rows"
|
|
470
|
+
- `view` is the arrangement for stories without a position: `"grid"` (the default), `"rows"` or `"columns"`. `"canvas"`, written by 0.2, is read as `"grid"`.
|
|
474
471
|
- `viewport` (optional, in the collection and on each item) is `{ "name": "<key>" }`, a key in your project's `parameters.viewport.options` (or Storybook's defaults: `mobile1`, `mobile2`, `tablet`, `desktop`), or `{ "width": <40–4000> }` in CSS pixels. Absent means the default; see [Viewports](#viewports) for the order of precedence.
|
|
475
|
-
- **Items** are `{ id, storyId, note?, viewport?, position? }`, in the order the
|
|
472
|
+
- **Items** are `{ id, storyId, note?, viewport?, position? }`, in list order: the order the canvas lays out stories without a position in. **Arrange** rewrites it to the reading order on the canvas before it clears the positions. `position` is `{ "x": <integer>, "y": <integer> }`, the story's top-left corner on the canvas in pixels at 100% zoom, from -1,000,000 to 1,000,000; absent means the canvas lays it out in the arrangement. Only the position is stored: a story's width is its viewport and its height is its own. `note` is up to 500 characters. The same story can appear in more than one item.
|
|
476
473
|
- **Threads** are `{ id, author: "user" | "agent", body, status: "open" | "resolved", anchor, createdAt, resolvedAt?, replies }`. `resolvedAt` is present exactly when `status` is `"resolved"`. **Replies** are `{ id, author, body, createdAt }`. A `body` is trimmed text of 1 to 10,000 characters; a file with a longer one is shown as invalid, and the agent tools refuse one with an error that says the limit.
|
|
477
474
|
- **Anchors** are one of:
|
|
478
475
|
- `{ "type": "element", itemId, target }`: an element inside a story.
|
|
@@ -496,10 +493,8 @@ One JSON file per collection, named after its id: `.storybook/collections/design
|
|
|
496
493
|
- Comment mode picks elements with the pointer; from the keyboard you can only start a thread on a whole story. Pins are buttons you can reach with <kbd>Tab</kbd>.
|
|
497
494
|
- Elements inside a shadow root or a nested iframe can't be commented on individually; comment on the story instead.
|
|
498
495
|
- On the page, people can't start a thread on the whole collection or edit a story's note; agents can, and so can a hand edit of the file. There is no delete for threads.
|
|
499
|
-
-
|
|
500
|
-
- Opening a whole-story thread pinned at a spot scrolls the story into view, but not the story's own scroll to that spot.
|
|
496
|
+
- Opening a whole-story thread pinned at a spot fits the story in view, but doesn't scroll inside the story to that spot.
|
|
501
497
|
- A thread's pin sits at its element's top-right corner. When that corner is at the top or right edge of the story, the pin moves inside the story: below the element if there is room, otherwise over the element's corner.
|
|
502
|
-
- Grid cards lay every story out at 1280 × 800 unless a viewport applies; stories that are taller scroll inside their card.
|
|
503
498
|
- To know each story's own viewport, the collection page loads each story's CSF module once (not its rendering), so a story file with side effects at import time runs them on the collection page too.
|
|
504
499
|
- Only one Storybook dev server should use a collection folder at a time. Two servers writing the same files can lose each other's writes.
|
|
505
500
|
- When there are no collections yet, Storybook prints `No story files found for the specified pattern: …/collections/*.json` at startup. It is harmless; Storybook gives addons no way to silence it.
|
|
@@ -520,7 +515,7 @@ The repository ships two example collections in `.storybook/collections/` (`comp
|
|
|
520
515
|
|
|
521
516
|
`pnpm check:browser` runs `scripts/check-story-frame.mjs` and every `scripts/check-collection-*.mjs` in the installed Google Chrome through `playwright-core` (set `CHROME` to its executable if it is not in `/Applications`). It starts its own Storybook on port 6190 (set `PORT` to change it) from `scripts/check-storybook`, which loads the addon from `src/` with the example stories and the check-only stories in `scripts/fixtures`, and keeps collections in a temporary `.sb-checks/` folder (set `CHECK_WORK_DIR` to use another one) that is deleted afterwards, so it never touches `.storybook/collections`. Pass words to run some of the checks only: `pnpm check:browser threads viewports`. Some checks edit or delete a story file in `scripts/fixtures` and put it back; the command restores any fixture that is missing (from git) before and after the run, also when it had to kill a check that hung.
|
|
522
517
|
|
|
523
|
-
`pnpm screenshots` regenerates the README screenshots in `assets/screenshots/` (`scripts/readme-screenshots.mjs`). Like the browser checks, it starts its own Storybook (port 6197, `PORT` to change it; config in `scripts/screenshot-storybook`) with a temporary `.sb-screenshots/` collection folder (`WORK_DIR` to use another; `SB=<url>` uses a Storybook that is already running). It builds the scene the way a person and an agent would (the collection over MCP, a comment through comment mode, the agent's reply over MCP), then takes every shot in Storybook's light theme (`<name>.png`) and dark theme (`<name>-dark.png`): `hero`, `threads`, `thread`, `commenting`, `
|
|
518
|
+
`pnpm screenshots` regenerates the README screenshots in `assets/screenshots/` (`scripts/readme-screenshots.mjs`). Like the browser checks, it starts its own Storybook (port 6197, `PORT` to change it; config in `scripts/screenshot-storybook`) with a temporary `.sb-screenshots/` collection folder (`WORK_DIR` to use another; `SB=<url>` uses a Storybook that is already running). It builds the scene the way a person and an agent would (the collection over MCP, a comment through comment mode, the agent's reply over MCP), then takes every shot in Storybook's light theme (`<name>.png`) and dark theme (`<name>-dark.png`): `hero`, `threads`, `thread`, `commenting`, `arrange-menu`, `viewport-menu`, `collection-menu` and `canvas`. It captures at 1440 × 900 at 2x and scales full-window shots to 1600 px wide; close-ups keep their 2x pixels. `ONLY=hero,thread pnpm screenshots` makes some of them. Compress the PNGs before committing, for example with `npx -y pngquant-bin --quality 80-95 --strip --force --ext .png assets/screenshots/*.png` and `npx -y oxipng -o 4 --strip safe assets/screenshots/*.png`.
|
|
524
519
|
|
|
525
520
|
### Visual tests
|
|
526
521
|
|