@vitrinka/web 0.2.2 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +46 -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 +63 -0
  15. package/build/recorder/flight.js +93 -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 +250 -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,32 @@
1
1
  # @vitrinka/web
2
2
 
3
+ ## 0.3.0
4
+
5
+ - **Report a bug, without a recording running.** A new ⋯ menu row. While
6
+ the pill is mounted and idle on a device that can record, it keeps the
7
+ page's last minute in memory — rrweb as two 30-second checkout windows,
8
+ plus the click, navigation, console and network lanes. Report freezes
9
+ that clip, asks what went wrong (required) and lets you **Mark on
10
+ screen** (annotate mode's element pick or region drag). Send files one
11
+ short session: `meta.kind: "report"`, title `Bug report: <first line>`,
12
+ the buffered events with their original timestamps, the rrweb windows as
13
+ chunks, then your description as a task annotation, then done. vitrinka
14
+ renders stills from the clip and the annotation becomes an intake draft.
15
+ The pill says **Sending…**, then **Sent · Open board**, or offers
16
+ **Retry**. During a recording, Report adds the task annotation to the
17
+ running session instead.
18
+ - **The buffer never leaves memory before Send.** Nothing is written to
19
+ storage or sent; it runs the recording's own redaction (the workspace
20
+ policy is fetched once when it starts); caps of 4 MiB / 20 000 rrweb
21
+ events and 500 lane events drop the older window; a reload, an unlink or
22
+ a recording start discards it. `flightRecorder={false}` on
23
+ `VitrinkaRecorderRoot` turns it off.
24
+ - **Every session sends `meta.devicePixelRatio`**, the scale its rects are
25
+ in, so the server renders stills at it.
26
+ - `HudController` gains optional `holdReport` / `report` and the snapshot an
27
+ optional `canReport`; a host without them (the extension today) shows no
28
+ report row.
29
+
3
30
  ## 0.2.2
4
31
 
5
32
  - **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,45 @@ 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, asks what
184
+ went wrong (required) and offers **Mark on screen** — annotate mode's
185
+ element pick or region drag. Send files one short session under the pill's
186
+ credential: title `Bug report: <first line>`, `meta.kind: "report"` and
187
+ `meta.devicePixelRatio`; the buffered events with their original
188
+ timestamps; the rrweb windows as chunks; your description as an annotation
189
+ with `task: true` (the marked region, else the whole viewport); then done.
190
+ vitrinka renders stills from the clip, pins the annotation on the board and
191
+ files it as an intake draft. The pill says **Sending…**, then **Sent · Open
192
+ board** (it is in Recents too); a failure offers **Retry**, which resumes
193
+ the same report. During a recording, Report adds that task annotation to
194
+ the running session instead.
195
+
196
+ **Turning it off.** A host that cannot accept even in-memory capture passes
197
+ `flightRecorder={false}`:
198
+
199
+ ```tsx
200
+ <VitrinkaRecorderRoot url={…} flightRecorder={false}>
201
+ ```
202
+
203
+ Then nothing is captured until a recording starts, and Report a bug is
204
+ offered only during one.
205
+
166
206
  ## Driving it from code
167
207
 
168
208
  `window.__vitrinkaRecorder` — for agents and tests:
@@ -191,10 +231,12 @@ const unmount = mountRecorderHud(controller, { title: () => document.title });
191
231
  - `getSnapshot()` returns the same object until something changes;
192
232
  `subscribe(fn)` calls back after a change. The snapshot holds `linked`,
193
233
  `canUnlink`, `annotating`, `recording` (session, clock, sync), `account`,
194
- `prefs`, `recents`, `workspaceUrl` and `version`.
234
+ `prefs`, `recents`, `workspaceUrl`, `version` and, optionally,
235
+ `canReport`.
195
236
  - Actions: `start`, `togglePause`, `stop` (resolves `{boardUrl?}`, rejects
196
237
  while the server is unreachable), `note`, `annotate`, `setAnnotating`,
197
- `link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`.
238
+ `link`, `unlink`, `getMe`, `setPrefs` and `refreshRecents`; optionally
239
+ `holdReport` and `report` — without them the menu has no **Report a bug**.
198
240
 
199
241
  The full contract is in `src/recorder/hud/controller.ts`.
200
242
 
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';