@crvouga/atlas 1.13.0 → 1.15.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 +14 -1
- package/dist/playwright/src/index.d.ts +4 -0
- package/dist/playwright/src/index.js +4 -0
- package/dist/playwright/src/ui-catalog.d.ts +51 -0
- package/dist/playwright/src/ui-catalog.js +44 -0
- package/dist/reports/src/evidence-detail.d.ts +19 -0
- package/dist/reports/src/evidence-detail.js +31 -4
- package/dist/reports/src/evidence-types.d.ts +5 -2
- package/dist/reports/src/layer-merge.d.ts +5 -1
- package/dist/reports/src/layer-merge.js +13 -5
- package/dist/reports/src/layer-store.d.ts +1 -1
- package/dist/reports/src/layer-store.js +4 -2
- package/dist/reports/src/layer-types.d.ts +2 -0
- package/dist/reports/src/report-index.js +9 -5
- package/dist/reports/src/run-compare.d.ts +182 -0
- package/dist/reports/src/run-compare.js +329 -0
- package/dist/reports/src/test-catalog.d.ts +8 -0
- package/dist/reports/src/test-catalog.js +14 -1
- package/dist/reports/src/ui-catalog-publish.d.ts +92 -0
- package/dist/reports/src/ui-catalog-publish.js +68 -0
- package/dist/reports/src/ui-catalog.d.ts +229 -0
- package/dist/reports/src/ui-catalog.js +273 -0
- package/dist/reports/src/ui-state.d.ts +70 -0
- package/dist/reports/src/ui-state.js +66 -0
- package/dist/schema/src/api.d.ts +354 -0
- package/dist/schema/src/api.js +78 -3
- package/dist/server/src/app.js +15 -0
- package/dist/server/src/openapi.js +22 -2
- package/docs/reference/http-api.md +46 -0
- package/docs/reference/playwright.md +63 -0
- package/docs/reference/reports.md +942 -4
- package/docs/reference/schema.md +33 -0
- package/docs/report-contract.md +2 -2
- package/docs/rich-evidence.md +5 -0
- package/docs/server.md +2 -0
- package/docs/ui-catalog.md +173 -0
- package/docs/ui.md +45 -1
- package/llms-full.txt +276 -3
- package/llms.txt +1 -0
- package/package.json +2 -1
- package/packages/schema/schemas/effective-delta.schema.json +75 -2
- package/packages/schema/schemas/effective-evidence.schema.json +75 -2
- package/packages/schema/schemas/evidence-page.schema.json +1 -1
- package/packages/schema/schemas/layer-rows.schema.json +74 -1
- package/packages/schema/schemas/report-run.schema.json +25 -3
- package/packages/schema/schemas/report-runs.schema.json +1 -1
- package/packages/schema/schemas/review-collection.schema.json +1 -1
- package/packages/schema/schemas/review-manifest.schema.json +1 -1
- package/packages/schema/schemas/test-catalog.schema.json +1 -1
- package/packages/schema/schemas/test-history.schema.json +2 -2
- package/packages/server/openapi.json +1559 -175
- package/packages/visualizer/src/app/AppShell.tsx +36 -30
- package/packages/visualizer/src/app/router.tsx +10 -1
- package/packages/visualizer/src/catalog/UiCatalogFilters.tsx +65 -0
- package/packages/visualizer/src/catalog/UiCatalogPage.tsx +342 -0
- package/packages/visualizer/src/catalog/provider.tsx +25 -0
- package/packages/visualizer/src/catalog/search.ts +68 -0
- package/packages/visualizer/src/catalog/words.ts +26 -0
- package/packages/visualizer/src/components/Header.tsx +17 -4
- package/packages/visualizer/src/explorer/ComparePair.tsx +597 -0
- package/packages/visualizer/src/explorer/CompareView.tsx +340 -0
- package/packages/visualizer/src/explorer/Explorer.tsx +6 -2
- package/packages/visualizer/src/explorer/RunsView.tsx +10 -0
- package/packages/visualizer/src/explorer/playlist.tsx +1 -1
- package/packages/visualizer/src/explorer/search.ts +15 -3
package/docs/reference/schema.md
CHANGED
|
@@ -498,6 +498,39 @@ export const RunDetailSchema = …
|
|
|
498
498
|
|
|
499
499
|
`GET /api/reports/runs/detail`: one run and its last result for every test, environment and producer it recorded.
|
|
500
500
|
|
|
501
|
+
#### `UiProfileSchema`
|
|
502
|
+
|
|
503
|
+
```ts
|
|
504
|
+
export const UiProfileSchema = …
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
A state's profile: the client and the choices it was captured under.
|
|
508
|
+
|
|
509
|
+
#### `UiImageSchema`
|
|
510
|
+
|
|
511
|
+
```ts
|
|
512
|
+
export const UiImageSchema = …
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
The picture of a capture.
|
|
516
|
+
|
|
517
|
+
#### `UiCellSchema`
|
|
518
|
+
|
|
519
|
+
```ts
|
|
520
|
+
export const UiCellSchema = …
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
One state in one profile.
|
|
524
|
+
|
|
525
|
+
#### `UiCatalogSchema`
|
|
526
|
+
|
|
527
|
+
```ts
|
|
528
|
+
export const UiCatalogSchema = …
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
`GET /api/reports/ui-catalog`: the UI catalog, computed from the winning results of the `ui-state` and `ui-plan` parts
|
|
532
|
+
of every layer. States are in id order and cells in profile order, so the same layers always give the same document.
|
|
533
|
+
|
|
501
534
|
### Command results (`--format json`)
|
|
502
535
|
|
|
503
536
|
Source: `packages/schema/src/cli-results.ts`
|
package/docs/report-contract.md
CHANGED
|
@@ -84,7 +84,7 @@ Zod schema as `LayerDocumentSchema` from `@crvouga/atlas/schema`.
|
|
|
84
84
|
| `freshness` | `modified`: recorded from a checkout with uncommitted changes. `unknown`: origin not captured. Advisory only; see [Statuses](#statuses-and-the-gate). |
|
|
85
85
|
| `run` | Optional `{ id, title?, startedAtMs?, endedAtMs? }`: the execution a local or manual producer names. Layers with the same `id` in one project are one run in the run list, however many shards or batches uploaded them; a later invocation at the same branch and commit gets another `id`. Without it a run is its `runUrl`, else `branch@sha`, as before. `title` is for people. Grouping and display only: it is **never part of the slot**, never decides a winner or a status, and never hides `sha`, `branch` or `freshness`. A `run` a reader cannot read is treated as absent. |
|
|
86
86
|
| `specs` | The specs the layer was recorded against, with a `fingerprint` of their text, so a reader can warn when a spec changed since. Optional. |
|
|
87
|
-
| `parts[].kind` | An open category (`behavior`, `performance`, `accessibility`, …). A new kind needs no change to any reader. Part of the slot. |
|
|
87
|
+
| `parts[].kind` | An open category (`behavior`, `performance`, `accessibility`, …). A new kind needs no change to any reader. Part of the slot. `ui-state` and `ui-plan` are the [UI catalog](ui-catalog.md)'s: a captured UI state, and the states that are expected. |
|
|
88
88
|
| `parts[].checks[]` | `id` (required, stable), `title`, `status`, `detail`, `specPath`, `measurements`, `durationMs`. |
|
|
89
89
|
| `tags`, `labels`, `links`, `attachments`, `annotations`, `extensions` | Evidence, on the layer, a part or a check: what a result carries beyond its outcome. All optional and open. See [evidence](#evidence) and [the guide](extending.md). |
|
|
90
90
|
| `checks[].steps`, `checks[].attempts` | A check's timeline, and every try when it was retried. Optional. |
|
|
@@ -227,7 +227,7 @@ are part of the contract:
|
|
|
227
227
|
Tools map to these four. CTRF `skipped`, `pending` and `other`, and JUnit `<skipped>`, are `not-run`.
|
|
228
228
|
An Atlas path that passed on retry (`flaky`) is `passed`, with the detail "Passed on retry (flaky)".
|
|
229
229
|
|
|
230
|
-
Timings that only qualify a check (parts of kind `performance`) are not counted as checks when
|
|
230
|
+
Timings that only qualify a check (parts of kind `performance`), and what a UI catalog expects (`ui-plan`), are not counted as checks when
|
|
231
231
|
anything else is recorded. A measurement over its allowance is reported and never fails a check.
|
|
232
232
|
|
|
233
233
|
Opinions (parts of kind `critique`, the verdicts of [automated UI reviewers](critics.md)) are never counted as checks,
|
package/docs/rich-evidence.md
CHANGED
|
@@ -191,6 +191,11 @@ time. Every field after `unit` is optional and none of them decides a status, a
|
|
|
191
191
|
- **Reading it from the API.** `GET /api/reports/tests/history` entries carry `latency` (their product-latency
|
|
192
192
|
measurements) next to `durationMs`. The pure functions are in `@crvouga/atlas/reports/latency`.
|
|
193
193
|
|
|
194
|
+
## A catalog of UI states
|
|
195
|
+
|
|
196
|
+
A screenshot per screen, per viewport and color scheme, is a *UI catalog*: check ids are the states, the viewport and scheme are
|
|
197
|
+
`parameters`, and the viewer's `/catalog` shows them with what is still to be captured. See [the UI catalog](ui-catalog.md).
|
|
198
|
+
|
|
194
199
|
## Finding runs and artifacts
|
|
195
200
|
|
|
196
201
|
The viewer's **Runs** and **Artifacts** tabs and the API answer one query, so a link means the same thing everywhere.
|
package/docs/server.md
CHANGED
|
@@ -522,6 +522,8 @@ curl "$ATLAS_SERVER_URL/api/projects/$ATLAS_PROJECT/reports/tests?format=markdow
|
|
|
522
522
|
| `GET /api/projects/{project}/reports/runs` | read | The runs that recorded the report. |
|
|
523
523
|
| `GET /api/reports/artifacts` | read | Recorded results that carry evidence, across the whole history. |
|
|
524
524
|
| `GET /api/projects/{project}/reports/artifacts` | read | Recorded results that carry evidence, across the whole history. |
|
|
525
|
+
| `GET /api/reports/ui-catalog` | read | The UI catalog: captured UI states per profile, and what is still expected. |
|
|
526
|
+
| `GET /api/projects/{project}/reports/ui-catalog` | read | The UI catalog: captured UI states per profile, and what is still expected. |
|
|
525
527
|
| `GET /api/reports/runs/detail` | read | Every test one run recorded. |
|
|
526
528
|
| `GET /api/projects/{project}/reports/runs/detail` | read | Every test one run recorded. |
|
|
527
529
|
| `GET /api/reports/outline` | read | The specs a report is laid over. |
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# The UI catalog
|
|
2
|
+
|
|
3
|
+
A browsable inventory of a product's user interface: each **state** (a screen, or one state of a screen) captured once per
|
|
4
|
+
**profile** (a viewport, a color scheme, a device), with the facts needed to find and trust it, and what should exist but has not
|
|
5
|
+
been captured yet. Any program that can write a layer can feed it, and the catalog fills in as results stream in, so a run of
|
|
6
|
+
thousands of captures can be watched while it happens and split across as many machines as needed.
|
|
7
|
+
|
|
8
|
+
Nothing about it is new to the report contract. A state is an ordinary check with a screenshot, the expected set is an ordinary
|
|
9
|
+
layer, and the stream is the one every viewer already holds. This page is the convention that makes those usable as a catalog, the
|
|
10
|
+
decisions behind it, and what is not built yet.
|
|
11
|
+
|
|
12
|
+
- [How a state is written](#how-a-state-is-written)
|
|
13
|
+
- [What is expected](#what-is-expected)
|
|
14
|
+
- [Publishing from any collector](#publishing-from-any-collector)
|
|
15
|
+
- [Sharding](#sharding)
|
|
16
|
+
- [Streaming and loading](#streaming-and-loading)
|
|
17
|
+
- [Exploring it](#exploring-it)
|
|
18
|
+
- [Decisions](#decisions)
|
|
19
|
+
- [What stays in your project, and what is not built yet](#what-stays-in-your-project-and-what-is-not-built-yet)
|
|
20
|
+
|
|
21
|
+
## How a state is written
|
|
22
|
+
|
|
23
|
+
A state is one **check** in a layer whose part has `kind` **`ui-state`**.
|
|
24
|
+
|
|
25
|
+
| Part of the idea | Where it goes |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| The state's identity | The check `id`. Make it stable (`checkout/payment`, `home?cohort=new`): a new capture replaces an old one only if the id is the same. |
|
|
28
|
+
| How the capture went | `status`: `passed` is **captured**, `failed` is attempted and failed (say why in `detail`), `running` is being taken, `not-run` is skipped. |
|
|
29
|
+
| The picture | An attachment with `role: "screenshot"` (else the first image), stored in the layer by content or given as an `https` `uri`. `width` and `height` help the viewer lay it out. |
|
|
30
|
+
| The profile | The layer's `environment` (`desktop-web`, `mobile-web`, `ios`, `android`) and `parameters` (`{ "viewport": "390x844", "scheme": "dark" }`). Parameters split a slot, so the same state at another viewport is **another result, side by side**, never a replacement. |
|
|
31
|
+
| Facts the producer declares | The check's `extensions["atlas.ui-state"]`: `route`, `fixture`, `cohort`, `area`, `flags` (a list), `covers` (the product surfaces the state shows). All optional. |
|
|
32
|
+
| Facts that describe without splitting | The check's `labels` (`shard`, `browser`) and `tags`. Labels never make a different slot. |
|
|
33
|
+
| Where it came from | The layer's `producer`, `sha`, `branch`, `runUrl`, `freshness`, `recordedAtMs`: shown with every capture, with the layer id and the backend that holds it. |
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"producer": "device-farm", "kind": "ui-state", "environment": "mobile-web",
|
|
38
|
+
"parameters": { "viewport": "390x844", "scheme": "dark" }, "recordedAtMs": 1760000000000,
|
|
39
|
+
"checks": [{
|
|
40
|
+
"id": "checkout/payment", "title": "Payment, card declined", "status": "passed",
|
|
41
|
+
"labels": { "shard": "2/8" },
|
|
42
|
+
"extensions": { "atlas.ui-state": { "route": "/checkout", "fixture": "declined-card", "cohort": "new-customer", "flags": ["new-nav"], "covers": ["payment-form"] } },
|
|
43
|
+
"attachments": [{ "name": "payment.png", "role": "screenshot", "contentType": "image/png", "path": "payment.png" }]
|
|
44
|
+
}]
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`atlas report publish --checks file.json --store …` publishes that file, reading `payment.png` from beside it. Nothing in it
|
|
49
|
+
mentions how the page was driven. Because a state is a check, the gate counts it (a `failed` capture fails `atlas report status`),
|
|
50
|
+
`atlas report status` lists it, and a reader that does not know the catalog still shows a check with a screenshot. Evidence never
|
|
51
|
+
decides a result: a picture that cannot be read leaves the check, its status and its slot as they were.
|
|
52
|
+
|
|
53
|
+
## What is expected
|
|
54
|
+
|
|
55
|
+
What should exist is a **layer too**, of kind **`ui-plan`**: the same ids, the same profiles (environment and parameters), every
|
|
56
|
+
check `not-run`, published by a planner, by each shard for the states it was given, or both. A plan fills a slot of its own (the
|
|
57
|
+
kind is part of the slot), so a capture never erases it and it never hides a capture; and `not-run` is never a pass.
|
|
58
|
+
|
|
59
|
+
| A cell (one state in one profile) is | When |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| **Captured** | the winning capture passed |
|
|
62
|
+
| **Capture failed** | the winning capture failed (its `detail` says why, and a diagnostic picture may be attached) |
|
|
63
|
+
| **Capturing** | the winning result is `running` |
|
|
64
|
+
| **Skipped** | a producer recorded it as `not-run` |
|
|
65
|
+
| **Not captured yet** | a plan expects it and nothing has been recorded |
|
|
66
|
+
|
|
67
|
+
A captured cell that no plan names is shown as **not in the expected set**. **Without any plan, nothing is "not captured yet" and
|
|
68
|
+
nothing is "not in the expected set"**: what should exist is then unknown, and the catalog says so instead of guessing. "Not yet
|
|
69
|
+
captured" is therefore different from "never declared".
|
|
70
|
+
|
|
71
|
+
Coverage against an **inventory of the product's surfaces** is a plan entry with `"inventory": true` (the id is the surface;
|
|
72
|
+
nothing is captured for it). A state says which surfaces it shows in `covers`. The catalog lists every surface as *covered* (a
|
|
73
|
+
state that shows it is captured), *states cover it, none captured yet*, or *no state covers it*.
|
|
74
|
+
|
|
75
|
+
## Publishing from any collector
|
|
76
|
+
|
|
77
|
+
Any program that writes the layer format feeds the catalog: a shell script, a Go test, a Storybook crawler, a device farm.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { publishChecks } from '@crvouga/atlas/reports/publish-checks';
|
|
81
|
+
import { uiPlanLayer, uiStateLayer } from '@crvouga/atlas/reports/ui-catalog-publish';
|
|
82
|
+
|
|
83
|
+
// The planner, once: what the product should have, in every profile.
|
|
84
|
+
await publishChecks(store, uiPlanLayer({
|
|
85
|
+
producer: 'catalog-plan', recordedAtMs: Date.now(), environment: 'mobile-web', profile: { viewport: '390x844', scheme: 'dark' },
|
|
86
|
+
states: [{ id: 'checkout/payment', covers: ['payment-form'] }, { id: 'settings', inventory: true }]
|
|
87
|
+
}));
|
|
88
|
+
|
|
89
|
+
// Each collector or shard, with its own captures and no knowledge of the others.
|
|
90
|
+
await publishChecks(store, uiStateLayer({
|
|
91
|
+
producer: 'web-capture', recordedAtMs: Date.now(), environment: 'mobile-web', profile: { viewport: '390x844', scheme: 'dark' }, shard: '2/8',
|
|
92
|
+
states: [{ id: 'checkout/payment', route: '/checkout', covers: ['payment-form'], screenshot: { data: png, width: 390, height: 844 } }]
|
|
93
|
+
}));
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
`uiStateLayer` and `uiPlanLayer` only build the input of `publishChecks`; they use no browser and no test framework. `store` can be
|
|
97
|
+
a directory, a bucket or the server (`httpStore`), exactly as for any layer.
|
|
98
|
+
|
|
99
|
+
**Playwright is one adapter and not a dependency.** `captureUiState(page, { id, ready })` from `@crvouga/atlas/playwright` waits
|
|
100
|
+
for a readiness check (bounded), photographs the page and returns the capture for `uiStateLayer`. A page that never became ready is
|
|
101
|
+
a `failed` capture that says why (with a picture of what it showed), never an exception that ends the run. Nothing that reads,
|
|
102
|
+
composes or shows the catalog imports a collection framework, and a test keeps it that way.
|
|
103
|
+
|
|
104
|
+
## Sharding
|
|
105
|
+
|
|
106
|
+
A shard is **any publisher that does not know the others**: by case, by profile, by area or by machine; Atlas does not care which.
|
|
107
|
+
Each publishes its own layers (a `shard` label records which, and is shown with each capture). The guarantees are those of every
|
|
108
|
+
layer ([the contract](report-contract.md#guarantees)), which is what the tests prove for the catalog:
|
|
109
|
+
|
|
110
|
+
- The captures of N shards (N is 1 or more), combined, equal the catalog one unsharded run produces.
|
|
111
|
+
- Running a shard again replaces only the cells it produces (a newer `recordedAtMs` wins its slot); every other cell is untouched.
|
|
112
|
+
- A shard that never publishes leaves its cells **not captured yet** when a plan names them, and absent otherwise. They are never
|
|
113
|
+
shown as captured, and the other shards' cells are unaffected.
|
|
114
|
+
- Atlas does not need the shard count. Completeness is the plan: a cell is expected because a plan says so.
|
|
115
|
+
|
|
116
|
+
## Streaming and loading
|
|
117
|
+
|
|
118
|
+
- **Streaming.** There is no second stream. A viewer holds the report over `/api/events` and reads what changed with
|
|
119
|
+
`/api/reports/evidence/effective?since=<version>`; the catalog is computed from the report it holds, so a capture appears when
|
|
120
|
+
its layer arrives, with no reload and no file rebuilt. Events carry metadata only; the picture is fetched when a card is on screen.
|
|
121
|
+
- **Reconnecting.** A viewer that was offline or whose stream dropped reads the delta since the version it holds (or the whole report
|
|
122
|
+
when the server no longer remembers it). Cells are keyed by state and profile, so nothing is missing and nothing is duplicated.
|
|
123
|
+
- **No stream.** A viewer without the stream (or a static export) polls, as the rest of the viewer does, and shows everything that exists.
|
|
124
|
+
- **Slow and failing backends.** Each backend is listed and read on its own, so a slow one never holds back the others: their
|
|
125
|
+
captures are shown, and the slow backend's appear when it answers. A backend that fails, or a layer that cannot be read, is named
|
|
126
|
+
on the page and in the document (`sources`); a capture that depended on it is not shown as captured.
|
|
127
|
+
- **Images.** A picture is a file in the layer, addressed by content (`/layers/<layer>/blobs/attachments/<sha256>`), loaded lazily
|
|
128
|
+
for the cards on screen, and served under the same untrusted-bytes rules as every attachment. A picture given as a `uri` is
|
|
129
|
+
followed only if it is `http` or `https`. A producer may leave the bytes out (`omitted`), which is told apart from never taken.
|
|
130
|
+
|
|
131
|
+
## Exploring it
|
|
132
|
+
|
|
133
|
+
The viewer's **UI catalog** (`/catalog`, in the menu beside the spec types once the report holds a state or a plan) shows a card per
|
|
134
|
+
state with its picture and a coverage badge per profile, and filters by words, coverage, profile, area, route, cohort, feature flag,
|
|
135
|
+
surface and producer. The address holds the filters and the open state, so a link reproduces the view. Opening a state shows its
|
|
136
|
+
profiles side by side with the declared facts, the failure reason, and for each picture the layer, backend, producer, shard, commit
|
|
137
|
+
and time. *Download the manifest* saves the filtered catalog as JSON.
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
curl "$ATLAS_SERVER_URL/api/reports/ui-catalog?coverage=failed,missing&profile=…" # JSON; add format=markdown for text
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`GET /api/reports/ui-catalog` answers the same document the viewer computes (`uiCatalog` from
|
|
144
|
+
`@crvouga/atlas/reports/ui-catalog`), filtered by `q`, `coverage`, `profile`, `area`, `route`, `cohort`, `flag`, `surface` and
|
|
145
|
+
`producer`, paged with `limit` and `offset`, with an ETag. Its picture `path` is relative to `/api/reports`.
|
|
146
|
+
|
|
147
|
+
## Decisions
|
|
148
|
+
|
|
149
|
+
The questions the original proposal left open, and how they are answered here. Each is the simplest answer that stays inside the
|
|
150
|
+
[stable contracts](report-contract.md#versioning-and-stability): optional fields only, no change to a slot or a winner.
|
|
151
|
+
|
|
152
|
+
| Question | Decision |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| Layer and event schema | An existing check in a `ui-state` part, a `screenshot` attachment, facts under the `atlas.ui-state` extension. No new part type, no new schema version. The report row gained one optional field, `state`, only for `ui-state` and `ui-plan` rows. |
|
|
155
|
+
| Identity and slot | The check id is the state; the slot is the usual (producer, kind, spec, id, environment, parameters). Profile dimensions are `parameters` because they must split the slot; labels never do. |
|
|
156
|
+
| Expected versus captured | A `ui-plan` layer. `ui-plan` is a diagnostic kind (like `performance`): it qualifies a check and is not counted as one when the check has any other result. |
|
|
157
|
+
| Coverage against an inventory | `inventory: true` plan entries plus each state's `covers`. |
|
|
158
|
+
| Carrying images | By content in the layer (`bundleKey`) or by `uri`; loaded lazily; the existing size limits of an upload apply. |
|
|
159
|
+
| The event stream | No new stream or events: the existing `report` event and `?since=` deltas. |
|
|
160
|
+
| Sharding | No shard concept in the format; a shard is any publisher. A `shard` label is provenance. Completeness comes from the plan, so Atlas needs no shard count. |
|
|
161
|
+
| What moves | Reading, composing, the viewer, the document and the API, the publish builders, a Playwright capture adapter. Staying with a product: its state declarations, its inventory, its fixtures and its runner. |
|
|
162
|
+
| Where it lives | `@crvouga/atlas/reports/ui-catalog` (model), `…/ui-catalog-publish` (builders), `…/ui-state` (convention); the viewer's `/catalog`; the server's `/api/reports/ui-catalog`; `@crvouga/atlas/playwright`'s `captureUiState`. |
|
|
163
|
+
| Exploration capabilities | Search, filters, profile comparison, coverage and surface coverage, failure diagnostics, deep links, manifest export. |
|
|
164
|
+
| Static export | The catalog is computed from the layers a viewer holds, so a static export (`atlas client build`) shows it; it just does not stream. |
|
|
165
|
+
|
|
166
|
+
## What stays in your project, and what is not built yet
|
|
167
|
+
|
|
168
|
+
**Stays in a project** (it is specific to the product): the list of states and profiles to capture, the inventory of surfaces,
|
|
169
|
+
fixtures and test data, the runner that drives the product to each state, and the readiness conditions of each screen.
|
|
170
|
+
|
|
171
|
+
**Not built yet:** a command line to list and publish a catalog without a script (use `atlas report publish --checks` today), a
|
|
172
|
+
dedicated static single-file export, diff views that compare two commits of a state, and a hosting-platform publish step beyond
|
|
173
|
+
`atlas serve`. The first slice makes the catalog explorable, streaming, shardable and independent of how it was collected.
|
package/docs/ui.md
CHANGED
|
@@ -96,6 +96,20 @@ when Watch is on screen.
|
|
|
96
96
|
- The spec index searches titles, paths and declared domains, and can group by the domain from spec metadata (specs with
|
|
97
97
|
none are listed under "No domain declared"; the Tests view reports domain problems).
|
|
98
98
|
|
|
99
|
+
## UI catalog
|
|
100
|
+
|
|
101
|
+
`/catalog` (`catalog/`) is the viewer's inventory of captured UI states ([the guide](ui-catalog.md)). It is computed in the page from
|
|
102
|
+
the layers the viewer already holds (`catalog/provider.tsx`, only while the page is open), so states appear as results stream in and
|
|
103
|
+
it works without a server. Cards are Mantine `Card`s in a responsive `SimpleGrid`; the filters live in the shell's navigation column
|
|
104
|
+
(`UiCatalogFilters`) and the open state in a `Drawer`, and both are the address (`catalog/search.ts`).
|
|
105
|
+
|
|
106
|
+
- Only `captured` is called captured. Every other coverage (`Capture failed`, `Capturing`, `Skipped`, `Not captured yet`) has its own
|
|
107
|
+
words and mark, and a cell without a picture says so in words instead of showing an empty frame. Never show a plan as a result.
|
|
108
|
+
- A backend that is not available, a notice, and layers that could not be read are shown above the grid; the catalog says it may be
|
|
109
|
+
incomplete. Waiting follows the loading policy below, and layers still arriving are counted.
|
|
110
|
+
- Pictures are `loading="lazy"` and only the cards on screen are fetched. The grid is bounded with *Show more*.
|
|
111
|
+
- The open state shows every profile side by side with the layer, backend, producer, shard, commit and time of each picture.
|
|
112
|
+
|
|
99
113
|
## Reliability
|
|
100
114
|
|
|
101
115
|
An open test shows its reliability (`explorer/Reliability.tsx`, worked out by `reports/reliability` from the history the page
|
|
@@ -129,6 +143,35 @@ environment) is unknown unless the producer declared it under the `atlas.failure
|
|
|
129
143
|
wording. Records of one source whose outcome changed are listed oldest first, and a later pass is never called a fix.
|
|
130
144
|
In the explorer the chosen source is the `source` search parameter (a layer id; unlike `layer` it does not pin a run).
|
|
131
145
|
|
|
146
|
+
## Compare two runs
|
|
147
|
+
|
|
148
|
+
The **Compare** tab (`explorer/CompareView.tsx`, `explorer/ComparePair.tsx`, `@crvouga/atlas/reports/run-compare`) sets a
|
|
149
|
+
baseline run against a candidate run. Both are pinned in the address (`base` and `cand`, run keys; `change` is the group
|
|
150
|
+
shown and `pair` the behavior opened), so a link reproduces the comparison and a newer run never replaces either. A run
|
|
151
|
+
that is no longer in the report is said to be missing and is never swapped for another. A run's page offers "Compare with
|
|
152
|
+
this run as the baseline / candidate".
|
|
153
|
+
|
|
154
|
+
- Results are paired by the check they record (spec path and check id), then by the condition they were recorded under
|
|
155
|
+
(kind, producer, environment, parameters). A title never pairs two results. The same check under another condition is
|
|
156
|
+
paired and marked "Conditions differ".
|
|
157
|
+
- Every behavior is in one group: newly failing, recovered, still failing, promise or conditions differ, not run or
|
|
158
|
+
unfinished, not in the candidate run, not in the baseline run, same outcome. A result the candidate did not run is
|
|
159
|
+
unknown, never regressed or passed; one only the baseline has is "not in the candidate run" (not run, renamed or
|
|
160
|
+
dropped: the comparison cannot tell). A reworded behavior, or one recorded under different conditions, is not framed as
|
|
161
|
+
a regression or recovery: both outcomes are shown beside the changed promise. A different spec-file revision with the
|
|
162
|
+
same wording is disclosed beside the movement (a fingerprint is of the whole file); a revision that was not recorded is
|
|
163
|
+
unknown, never the same.
|
|
164
|
+
- Opening a behavior shows Mantine `Tabs`: **Promise** (wording, spec revision, recorded steps with the ones only one side
|
|
165
|
+
has), **Outcomes** (each side's own provenance, execution time and failure), **Recordings** (one `<video>` per side with
|
|
166
|
+
`preload="metadata"`, read only while that tab is on screen; each keeps its own attempt, spec revision and time
|
|
167
|
+
origin, they are not synchronized, and "Go to a step in both recordings" seeks each to its own recorded step time when
|
|
168
|
+
the steps are shared by name and timed; otherwise the page says why they are not aligned) and **Figures**.
|
|
169
|
+
- Figures are compared like for like. Product latency is compared only for the same measurement on the same devices,
|
|
170
|
+
environments and instrumentation, and reliability only when both sides count at least the minimum of independent
|
|
171
|
+
executions against the same recorded spec revision (and a difference inside the uncertainty is "cannot be told apart").
|
|
172
|
+
Otherwise the page says "Not compared" with the reasons and computes no change. Test execution time is labelled as such
|
|
173
|
+
and is never product latency.
|
|
174
|
+
|
|
132
175
|
## Watch a filtered set as a playlist
|
|
133
176
|
|
|
134
177
|
The Artifacts tab and an opened run have a **Watch these N results** button. It opens a Mantine `Modal` (`explorer/playlist.tsx`)
|
|
@@ -276,7 +319,8 @@ The narrowly scoped exceptions are:
|
|
|
276
319
|
| Area | Screens/interactions | Mantine composition |
|
|
277
320
|
| --- | --- | --- |
|
|
278
321
|
| Shared shell | Project switching, spec navigation, run selection, connection status, diagnostics, mobile index | AppShell, Burger, NavLink, Menu, Popover, NativeSelect, Drawer |
|
|
279
|
-
|
|
|
322
|
+
| UI catalog | Captured UI states per profile as cards with coverage badges, filters in the index column, surface coverage, an open state with its profiles side by side and where each picture came from, manifest download | AppShell navbar, SimpleGrid, Card, Image, MultiSelect, TextInput, Drawer, Accordion, Table, Badge, Alert |
|
|
323
|
+
| Project home | Tests/runs/artifacts/compare tabs, a two-run comparison with promise, outcome, recording and figure tabs per behavior, a run's Artifacts (files of its layers, shared recordings, direct links), Watch playlist of a filtered set, metrics, search, status/environment/domain/artifact-tag filters, run and artifact facets with saved views, grouping, sorting, show more | Container, Tabs, SimpleGrid, Paper, TextInput, MultiSelect, Popover, Button, Accordion, Modal, Grid, Switch |
|
|
280
324
|
| Test detail | Current outcomes, statistics, duration graph, product latency with budgets and baselines, history, artifacts, recording; the `layer` address parameter pins it to one run's result, labelled "This run" against "Latest combined evidence" | Drawer, Table, Badge, Alert, Stage |
|
|
281
325
|
| Specs | All six existing kinds, overview/index with title search and folder or declared-domain grouping, Gherkin rules/scenarios/examples with a coverage summary and Read / Watch / Inspect per behavior, Quint declarations/traces, DMN tables, source text | SpecHeader, Accordion, Tabs, Table, CodeHighlightTabs, ResultRow |
|
|
282
326
|
| Statecharts | Graph, screen/event/journey details, developer metadata, chart test results | Mantine cards/navigation and product compositions; graph exception above |
|