@vitrinka/web 0.1.5 → 0.2.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 (67) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +73 -21
  3. package/build/hud.d.ts +9 -0
  4. package/build/hud.iife.js +411 -0
  5. package/build/hud.js +8 -0
  6. package/build/recorder/api.d.ts +2 -0
  7. package/build/recorder/block.d.ts +7 -0
  8. package/build/recorder/block.js +7 -0
  9. package/build/recorder/capture/click.d.ts +2 -4
  10. package/build/recorder/capture/click.js +2 -31
  11. package/build/recorder/capture/rrweb.d.ts +2 -2
  12. package/build/recorder/capture/rrweb.js +2 -2
  13. package/build/recorder/capture/selector.d.ts +8 -0
  14. package/build/recorder/capture/selector.js +35 -0
  15. package/build/recorder/hud/AnnotateOverlay.d.ts +7 -1
  16. package/build/recorder/hud/AnnotateOverlay.js +51 -17
  17. package/build/recorder/hud/Hud.d.ts +16 -1
  18. package/build/recorder/hud/Hud.js +251 -83
  19. package/build/recorder/hud/LinkSheet.d.ts +3 -3
  20. package/build/recorder/hud/LinkSheet.js +1 -1
  21. package/build/recorder/hud/Menu.d.ts +30 -0
  22. package/build/recorder/hud/Menu.js +73 -0
  23. package/build/recorder/hud/RecorderPill.d.ts +36 -27
  24. package/build/recorder/hud/RecorderPill.js +212 -123
  25. package/build/recorder/hud/Sheet.d.ts +1 -1
  26. package/build/recorder/hud/Sheet.js +1 -1
  27. package/build/recorder/hud/Tooltip.d.ts +19 -0
  28. package/build/recorder/hud/Tooltip.js +94 -0
  29. package/build/recorder/hud/controller.d.ts +148 -0
  30. package/build/recorder/hud/controller.js +17 -0
  31. package/build/recorder/hud/flow.d.ts +54 -0
  32. package/build/recorder/hud/flow.js +39 -0
  33. package/build/recorder/hud/host.js +1 -1
  34. package/build/recorder/hud/icons.d.ts +7 -0
  35. package/build/recorder/hud/icons.js +19 -0
  36. package/build/recorder/hud/iife.d.ts +13 -0
  37. package/build/recorder/hud/iife.js +11 -0
  38. package/build/recorder/hud/layer.d.ts +29 -6
  39. package/build/recorder/hud/layer.js +67 -33
  40. package/build/recorder/hud/mount.d.ts +13 -0
  41. package/build/recorder/hud/mount.js +27 -0
  42. package/build/recorder/hud/place.d.ts +43 -0
  43. package/build/recorder/hud/place.js +63 -0
  44. package/build/recorder/hud/spots.d.ts +45 -0
  45. package/build/recorder/hud/spots.js +107 -0
  46. package/build/recorder/hud/status.d.ts +31 -0
  47. package/build/recorder/hud/status.js +67 -0
  48. package/build/recorder/hud/styles.d.ts +28 -18
  49. package/build/recorder/hud/styles.js +295 -122
  50. package/build/recorder/hud/useDock.d.ts +9 -8
  51. package/build/recorder/hud/useDock.js +41 -20
  52. package/build/recorder/index.d.ts +2 -2
  53. package/build/recorder/index.js +9 -18
  54. package/build/recorder/link.d.ts +1 -1
  55. package/build/recorder/link.js +8 -2
  56. package/build/recorder/me.d.ts +34 -0
  57. package/build/recorder/me.js +172 -0
  58. package/build/recorder/page-controller.d.ts +12 -0
  59. package/build/recorder/page-controller.js +100 -0
  60. package/build/recorder/queue.d.ts +4 -0
  61. package/build/recorder/queue.js +2 -0
  62. package/build/recorder/recents.d.ts +23 -0
  63. package/build/recorder/recents.js +80 -0
  64. package/build/recorder/session.d.ts +2 -2
  65. package/build/recorder/session.js +15 -1
  66. package/build/recorder/storage/index.js +2 -1
  67. package/package.json +9 -3
@@ -2,10 +2,11 @@ import { api, fetchPolicy, permanentStatus, VitrinkaApiError } from './api';
2
2
  import { setRedactionPolicy } from './capture/redact';
3
3
  import { recorderConfig } from './config';
4
4
  import { armReconcile, capturesSettled, disarmReconcile, drainBuffer, getState, pushEvent, queuedCount, resetHealth, resetIdle, resetQueues, setState, } from './queue';
5
+ import { noteRecent, updateRecent } from './recents';
5
6
  import { currentRoute, notify } from './state';
6
7
  export { currentRoute, notify, subscribe } from './state';
7
8
  /** Sent as `meta.recorder`; bumped with the package version. */
8
- export const RECORDER_VERSION = '0.1.5';
9
+ export const RECORDER_VERSION = '0.2.0';
9
10
  export const RECORDER_ID = `web/${RECORDER_VERSION}`;
10
11
  /**
11
12
  * Re-apply a RECOVERED session's redaction policy after a reload — and
@@ -95,6 +96,13 @@ export async function startSession(opts = {}) {
95
96
  resetQueues();
96
97
  resetHealth();
97
98
  resetIdle();
99
+ noteRecent({
100
+ sessionId: ses.id,
101
+ title: ses.title,
102
+ startedAt: Date.now(),
103
+ status: 'recording',
104
+ ...(ses.boardUrl ? { boardUrl: ses.boardUrl } : {}),
105
+ });
98
106
  await attachTags(ses.id, opts.tags);
99
107
  armReconcile();
100
108
  pushEvent('nav', { url: currentUrl(), route: currentRoute.pathname }, { tabId: currentRoute.tabId, tabHost: currentRoute.tabHost });
@@ -188,6 +196,8 @@ export async function stopSession() {
188
196
  const rec = getState();
189
197
  if (!rec)
190
198
  return null;
199
+ // The recording's length is what the tester saw at Stop, not Stop + drain.
200
+ const durationMs = elapsedOf(rec);
191
201
  disarmReconcile();
192
202
  for (const fn of beforeStopHooks) {
193
203
  try {
@@ -199,6 +209,7 @@ export async function stopSession() {
199
209
  }
200
210
  const completeDeadStop = (reason) => {
201
211
  const kept = queuedCount();
212
+ updateRecent(rec.sessionId, { status: 'unsaved', durationMs });
202
213
  setState(null);
203
214
  setRedactionPolicy(null);
204
215
  resetQueues();
@@ -239,6 +250,9 @@ export async function stopSession() {
239
250
  throw e;
240
251
  }
241
252
  }
253
+ // A permanent refusal still ends the recording locally, but it was not saved.
254
+ const boardUrl = done?.board?.url ?? rec.boardUrl;
255
+ updateRecent(rec.sessionId, { status: done ? 'saved' : 'unsaved', durationMs, ...(boardUrl ? { boardUrl } : {}) });
242
256
  setState(null);
243
257
  setRedactionPolicy(null);
244
258
  resetQueues();
@@ -11,7 +11,8 @@
11
11
  * back to the in-memory driver: capture still works for the life of the
12
12
  * document, only the reload-survival guarantee is lost — and it says so once.
13
13
  */
14
- // Keys land as `vitrinka.recorder.<key>`: rec · buffer · chunks · link.
14
+ // Keys land as `vitrinka.recorder.<key>`: rec · buffer · chunks · link (the
15
+ // recorder) and dock · prefs · me · recents (the HUD).
15
16
  const PREFIX = 'vitrinka.recorder.';
16
17
  let current = null;
17
18
  let used = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrinka/web",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "vitrinka toolkit for React DOM apps — the journey recorder: capture manual-testing sessions (rrweb DOM stream, clicks, navigation, network, console, notes) straight into vitrinka boards.",
5
5
  "license": "Elastic-2.0",
6
6
  "repository": {
@@ -29,6 +29,11 @@
29
29
  "types": "./build/next.d.ts",
30
30
  "default": "./build/next.js"
31
31
  },
32
+ "./hud": {
33
+ "types": "./build/hud.d.ts",
34
+ "default": "./build/hud.js"
35
+ },
36
+ "./hud.iife.js": "./build/hud.iife.js",
32
37
  "./package.json": "./package.json"
33
38
  },
34
39
  "files": [
@@ -38,11 +43,12 @@
38
43
  ],
39
44
  "sideEffects": false,
40
45
  "scripts": {
41
- "build": "tsc -p tsconfig.build.json",
46
+ "build": "tsc -p tsconfig.build.json && bun run build:hud",
47
+ "build:hud": "bun build src/recorder/hud/iife.ts --format=iife --minify --target=browser --define process.env.NODE_ENV='\"production\"' --outfile build/hud.iife.js",
42
48
  "typecheck": "tsc --noEmit",
43
49
  "test": "bun test src",
44
50
  "test:e2e": "playwright test -c playwright.config.ts --workers 1",
45
- "prepublishOnly": "tsc -p tsconfig.build.json"
51
+ "prepublishOnly": "tsc -p tsconfig.build.json && bun run build:hud"
46
52
  },
47
53
  "dependencies": {
48
54
  "@vitrinka/link": "^0.1.2",