@vitrinka/web 0.2.2 → 0.3.1

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +48 -4
  3. package/build/hud.d.ts +1 -1
  4. package/build/hud.iife.js +9 -8
  5. package/build/recorder/RecorderProvider.d.ts +2 -1
  6. package/build/recorder/RecorderProvider.js +18 -4
  7. package/build/recorder/capture/net.js +16 -10
  8. package/build/recorder/capture/redact.d.ts +3 -1
  9. package/build/recorder/capture/redact.js +2 -1
  10. package/build/recorder/capture/rrweb.d.ts +7 -1
  11. package/build/recorder/capture/rrweb.js +21 -6
  12. package/build/recorder/config.d.ts +6 -0
  13. package/build/recorder/config.js +1 -0
  14. package/build/recorder/flight.d.ts +66 -0
  15. package/build/recorder/flight.js +99 -0
  16. package/build/recorder/hud/Hud.d.ts +2 -1
  17. package/build/recorder/hud/Hud.js +113 -11
  18. package/build/recorder/hud/Menu.d.ts +4 -2
  19. package/build/recorder/hud/Menu.js +2 -2
  20. package/build/recorder/hud/RecorderPill.d.ts +2 -1
  21. package/build/recorder/hud/RecorderPill.js +11 -5
  22. package/build/recorder/hud/Sheet.d.ts +11 -2
  23. package/build/recorder/hud/Sheet.js +13 -4
  24. package/build/recorder/hud/controller.d.ts +29 -0
  25. package/build/recorder/hud/flow.d.ts +13 -3
  26. package/build/recorder/hud/flow.js +17 -6
  27. package/build/recorder/hud/icons.d.ts +1 -0
  28. package/build/recorder/hud/icons.js +3 -0
  29. package/build/recorder/hud/styles.d.ts +1 -1
  30. package/build/recorder/hud/styles.js +1 -0
  31. package/build/recorder/index.d.ts +5 -0
  32. package/build/recorder/index.js +9 -1
  33. package/build/recorder/page-controller.js +4 -0
  34. package/build/recorder/queue.d.ts +11 -4
  35. package/build/recorder/queue.js +15 -8
  36. package/build/recorder/report.d.ts +36 -0
  37. package/build/recorder/report.js +264 -0
  38. package/build/recorder/session.d.ts +12 -2
  39. package/build/recorder/session.js +23 -10
  40. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @vitrinka/web
2
2
 
3
+ ## 0.3.1
4
+
5
+ - **A bug report always carries the current screen.** When a checkout
6
+ window went over the 4 MiB / 20 000-event cap on its own, it was dropped
7
+ and the buffer stayed empty until the next 30-second checkout; a report
8
+ opened in that gap (or before the first snapshot) froze a clip with no
9
+ rrweb window, so vitrinka rendered no stills, the board stayed empty and
10
+ the description never reached intake. Opening the report sheet now takes
11
+ a fresh checkout when the clip holds no snapshot, so the clip opens on at
12
+ least the current screen. A clip that already holds a window is frozen
13
+ as-is — a checkout would rotate its older window out.
14
+
15
+ ## 0.3.0
16
+
17
+ - **Report a bug, without a recording running.** A new ⋯ menu row. While
18
+ the pill is mounted and idle on a device that can record, it keeps the
19
+ page's last minute in memory — rrweb as two 30-second checkout windows,
20
+ plus the click, navigation, console and network lanes. Report freezes
21
+ that clip, asks what went wrong (required) and lets you **Mark on
22
+ screen** (annotate mode's element pick or region drag). Send files one
23
+ short session: `meta.kind: "report"`, title `Bug report: <first line>`,
24
+ the buffered events with their original timestamps, the rrweb windows as
25
+ chunks, then your description as a task annotation, then done. vitrinka
26
+ renders stills from the clip and the annotation becomes an intake draft.
27
+ The pill says **Sending…**, then **Sent · Open board**, or offers
28
+ **Retry**. During a recording, Report adds the task annotation to the
29
+ running session instead.
30
+ - **The buffer never leaves memory before Send.** Nothing is written to
31
+ storage or sent; it runs the recording's own redaction (the workspace
32
+ policy is fetched once when it starts); caps of 4 MiB / 20 000 rrweb
33
+ events and 500 lane events drop the older window; a reload, an unlink or
34
+ a recording start discards it. `flightRecorder={false}` on
35
+ `VitrinkaRecorderRoot` turns it off.
36
+ - **Every session sends `meta.devicePixelRatio`**, the scale its rects are
37
+ in, so the server renders stills at it.
38
+ - `HudController` gains optional `holdReport` / `report` and the snapshot an
39
+ optional `canReport`; a host without them (the extension today) shows no
40
+ report row.
41
+
3
42
  ## 0.2.2
4
43
 
5
44
  - **A click never records more than the DOM stream shows.** A click on a
package/README.md CHANGED
@@ -11,7 +11,8 @@ screenshots), **clicks** (selector, text, rect), **navigation**, **network**
11
11
  (fetch + XHR, headers + bodies redacted), **console errors**, and the
12
12
  **notes and annotations** you type in the pill. Everything is redacted by
13
13
  [`@vitrinka/redact`](../redact) before it is buffered; the full contract is
14
- [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md).
14
+ [`docs/PROTOCOL.md`](../../docs/PROTOCOL.md). Idle, the pill can also send
15
+ the last minute as a bug report ([Report a bug](#report-a-bug)).
15
16
 
16
17
  ## Install
17
18
 
@@ -130,7 +131,7 @@ controls**) that unfolds into the tools on hover, focus or tap and folds back
130
131
  | ✎ Note | ⌥⇧N | the note sheet — Enter sends, ⇧Enter newline, Esc / ✕ / click-outside cancel (the draft survives a cancel); the pill says **Saved** |
131
132
  | ⌖ Annotate | ⌥⇧A | click or tap an element, or drag a region (a finger too). While annotating, the page gets no press, move or hover, does not scroll, and selects no text. Then describe it: `board` (an annotation on the board) or `task` (also filed as an intake draft) |
132
133
  | ■ Stop | ⌥⇧S | the pill asks **Stop & save?** (Esc / **Keep recording** cancels), shows **Saving…** with progress while the tail drains, then **Saved · Open board** until you dismiss it |
133
- | ⋯ | | the linked account · **Open this board** · **Recent** (this device's last five recordings, each linked to its board) · **Go to vitrinka** · **Size** S/M/L · **Technical details** · **Position** · **Unlink this device** (asks first) |
134
+ | ⋯ | | the linked account · **Report a bug** (below) · **Open this board** · **Recent** (this device's last five recordings, each linked to its board) · **Go to vitrinka** · **Size** S/M/L · **Technical details** · **Position** · **Unlink this device** (asks first) |
134
135
 
135
136
  Move it anywhere: drag the puck or capsule and it lands on one of eight
136
137
  spots (a 3×3 grid without the centre). A flick lands where it is thrown.
@@ -163,6 +164,47 @@ Radix focus trap or a `<dialog>.showModal()` never fights it, and nothing
163
164
  you do on the pill reaches the page (a "close on outside click" never fires
164
165
  because of the recorder).
165
166
 
167
+ ## Report a bug
168
+
169
+ **Report a bug** (⋯ menu) files what led up to a bug — no recording needed.
170
+
171
+ **The last minute.** While the pill is mounted and idle on a device that can
172
+ record (a recorder key or a linked device), it keeps the page's last minute
173
+ **in memory**: the rrweb DOM stream as two 30-second checkout windows (a clip
174
+ covers the last 30–60 s and always opens on a full snapshot), plus the
175
+ click, navigation, console and network events since the older window
176
+ opened. Caps: 4 MiB of serialized rrweb, 20 000 rrweb events, 500 lane
177
+ events; over a cap the older window goes. It runs the recording's own
178
+ redaction (masked inputs, your workspace policy — fetched once when the
179
+ buffer starts — scrubbed URLs, click text that never reads a value). Nothing
180
+ of it is written to storage or sent until you press Send; a reload, an
181
+ unlink or a recording start discards it.
182
+
183
+ **The report.** The sheet freezes the last minute as it opens (when that
184
+ holds no full snapshot — a window over a cap was dropped — it takes one of
185
+ the current screen first), asks what
186
+ went wrong (required) and offers **Mark on screen** — annotate mode's
187
+ element pick or region drag. Send files one short session under the pill's
188
+ credential: title `Bug report: <first line>`, `meta.kind: "report"` and
189
+ `meta.devicePixelRatio`; the buffered events with their original
190
+ timestamps; the rrweb windows as chunks; your description as an annotation
191
+ with `task: true` (the marked region, else the whole viewport); then done.
192
+ vitrinka renders stills from the clip, pins the annotation on the board and
193
+ files it as an intake draft. The pill says **Sending…**, then **Sent · Open
194
+ board** (it is in Recents too); a failure offers **Retry**, which resumes
195
+ the same report. During a recording, Report adds that task annotation to
196
+ the running session instead.
197
+
198
+ **Turning it off.** A host that cannot accept even in-memory capture passes
199
+ `flightRecorder={false}`:
200
+
201
+ ```tsx
202
+ <VitrinkaRecorderRoot url={…} flightRecorder={false}>
203
+ ```
204
+
205
+ Then nothing is captured until a recording starts, and Report a bug is
206
+ offered only during one.
207
+
166
208
  ## Driving it from code
167
209
 
168
210
  `window.__vitrinkaRecorder` — for agents and tests:
@@ -191,10 +233,12 @@ const unmount = mountRecorderHud(controller, { title: () => document.title });
191
233
  - `getSnapshot()` returns the same object until something changes;
192
234
  `subscribe(fn)` calls back after a change. The snapshot holds `linked`,
193
235
  `canUnlink`, `annotating`, `recording` (session, clock, sync), `account`,
194
- `prefs`, `recents`, `workspaceUrl` and `version`.
236
+ `prefs`, `recents`, `workspaceUrl`, `version` and, optionally,
237
+ `canReport`.
195
238
  - Actions: `start`, `togglePause`, `stop` (resolves `{boardUrl?}`, rejects
196
239
  while the server is unreachable), `note`, `annotate`, `setAnnotating`,
197
- `link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`.
240
+ `link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`; optionally
241
+ `holdReport` and `report` — without them the menu has no **Report a bug**.
198
242
 
199
243
  The full contract is in `src/recorder/hud/controller.ts`.
200
244
 
package/build/hud.d.ts CHANGED
@@ -5,5 +5,5 @@
5
5
  * defining `globalThis.VitrinkaHud.mount`.
6
6
  */
7
7
  export { mountRecorderHud, type MountHudOptions } from './recorder/hud/mount';
8
- export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
8
+ export { DEFAULT_PREFS, type HudAccount, type HudAnnotation, type HudController, type HudLinkCode, type HudLinkFlow, type HudPrefs, type HudRecent, type HudRecentStatus, type HudRecording, type HudRect, type HudReport, type HudSize, type HudSnapshot, type HudSync, type HudSyncState, } from './recorder/hud/controller';
9
9
  export type { RecorderStorage } from './recorder/storage';