@absolutejs/beacon 0.4.12 → 0.4.14

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/README.md CHANGED
@@ -105,6 +105,28 @@ beacon.captureMessage("checkout started", "info");
105
105
  Controls marked active through `aria-current`, `aria-pressed`, or
106
106
  `aria-selected` are excluded because clicking the already-current state is an
107
107
  intentional no-op; semantic anchors remain preferred for navigation.
108
+ - **Layout-overflow signals** — once layout settles (first load, resize end,
109
+ SPA navigation), a capped, deduped scan reports elements that visibly break
110
+ their bounds: in-flow elements crossing the viewport's horizontal edges, a
111
+ child painting past a non-scrolling parent (the flex-squeeze cutoff), and
112
+ content cut by `overflow: hidden` without an ellipsis treatment. Issues
113
+ group per element, kind, and viewport bucket (`xs/sm/md/lg/xl`), with the
114
+ spill size in tags. Subtrees of scroll containers and absolutely positioned
115
+ escapees (badges, popovers, drawers) are skipped by design; mark deliberate
116
+ bleeds with `data-beacon-overflow="allow"`.
117
+ - **Ambient watchdogs** — silent failures users abandon instead of reporting
118
+ become warning issues: scroll jail (a leaked modal scroll lock), stuck
119
+ loading (`aria-busy`/`role="progressbar"` that never resolves), occluded
120
+ controls (leaked scrims/z-index bugs, skipped while a dialog is open),
121
+ invisible text (fg composites to its background — theme-token bugs),
122
+ stalled `EventSource` streams, WebSocket connect/close flapping, request
123
+ storms (one endpoint hammered in seconds), reload loops, stale releases (a
124
+ service worker serving a build older than one this browser already ran),
125
+ font-face load failures, focus dropped to `<body>` when a dialog unmounts,
126
+ and form frustration (identical resubmits / repeated native-validation
127
+ failures). Each is individually toggleable on `signals`, deduped, capped,
128
+ and exempts `data-beacon-scan="allow"` subtrees where a DOM scan is
129
+ involved.
108
130
  - **Actionable network signals** — expected aborts remain breadcrumbs instead of
109
131
  issues; offline, timeout, isolated-endpoint, and multi-endpoint connectivity
110
132
  failures are classified separately. Concurrent failures become one event with
package/dist/index.d.ts CHANGED
@@ -24,15 +24,34 @@ export declare const BEACON_SIGNAL: {
24
24
  readonly CONSOLE_ERROR: "console_error";
25
25
  readonly DEAD_CLICK: "dead_click";
26
26
  readonly FETCH_FAILED: "fetch_failed";
27
+ readonly FOCUS_LOST: "focus_lost";
28
+ readonly FONT_FAILURE: "font_failure";
29
+ readonly FORM_FRUSTRATION: "form_frustration";
27
30
  readonly HTTP_5XX: "http_5xx";
31
+ readonly INVISIBLE_TEXT: "invisible_text";
32
+ readonly LAYOUT_OVERFLOW: "layout_overflow";
33
+ readonly OCCLUDED_CONTROL: "occluded_control";
28
34
  readonly RAGE_CLICK: "rage_click";
35
+ readonly RELOAD_LOOP: "reload_loop";
36
+ readonly REQUEST_STORM: "request_storm";
37
+ readonly SCROLL_JAIL: "scroll_jail";
29
38
  readonly SLOW_RESPONSE: "slow_response";
39
+ readonly SOCKET_FLAPPING: "socket_flapping";
40
+ readonly STALE_RELEASE: "stale_release";
41
+ readonly STALLED_STREAM: "stalled_stream";
42
+ readonly STUCK_LOADING: "stuck_loading";
30
43
  };
31
44
  export type BeaconSignal = (typeof BEACON_SIGNAL)[keyof typeof BEACON_SIGNAL];
32
- /** Stable DOM attributes understood by Beacon's click instrumentation. */
45
+ /** Stable DOM attributes understood by Beacon's instrumentation. */
33
46
  export declare const BEACON_ATTRIBUTE: {
34
47
  readonly DEAD_CLICK: "data-beacon-dead-click";
35
48
  readonly NAME: "data-beacon-name";
49
+ /** `="allow"` exempts an element AND its subtree from layout-overflow
50
+ * detection — for deliberate bleeds (decorative shapes, marquees). */
51
+ readonly OVERFLOW: "data-beacon-overflow";
52
+ /** `="allow"` exempts an element AND its subtree from the visual scan
53
+ * detectors (occluded controls, invisible text, stuck loading). */
54
+ readonly SCAN: "data-beacon-scan";
36
55
  };
37
56
  /** Response header used to correlate a browser signal with its server request. */
38
57
  export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
@@ -138,8 +157,72 @@ export type BeaconSignals = {
138
157
  failedRequests?: boolean;
139
158
  /** `console.error` calls (the app explicitly logged an error). Default true. */
140
159
  consoleErrors?: boolean;
160
+ /** A focused element inside an open dialog removed from the DOM with focus
161
+ * falling to `<body>` — keyboard users stranded. Default true. */
162
+ focusLoss?: boolean;
163
+ /** `FontFace` loads that end in `status: "error"` — icon fonts falling back
164
+ * to raw ligature text, custom faces silently missing. Default true. */
165
+ fontFailures?: boolean;
166
+ /** The same form submitted or failing native validation repeatedly within a
167
+ * minute — the quiet sibling of a rage click. Default true. */
168
+ formFrustration?: boolean;
169
+ /** Sampled scan for text rendered nearly the same color as its opaque
170
+ * background (theme-token bugs). Default true. */
171
+ invisibleText?: boolean;
172
+ /**
173
+ * Elements that visibly break their bounds once layout settles (first load,
174
+ * resize end, SPA navigation): in-flow elements crossing the viewport's
175
+ * horizontal edges, children painting past a non-scrolling parent, and
176
+ * content cut by `overflow: hidden` without an ellipsis treatment. Subtrees
177
+ * of scroll containers and absolutely positioned escapees (badges,
178
+ * popovers, drawers) are skipped by design. Default true.
179
+ */
180
+ layoutOverflows?: boolean;
181
+ /** Maximum layout-overflow issues reported per page load. Default 5. */
182
+ layoutOverflowMaxReports?: number;
183
+ /** Quiet period after load/resize/navigation before the settled visual
184
+ * scan runs, letting transitions and lazy content settle. Default 600ms. */
185
+ layoutOverflowSettleMs?: number;
186
+ /** Sampled `elementFromPoint` check for interactive controls covered by an
187
+ * unrelated element (leaked scrims, z-index bugs). Skipped entirely while
188
+ * a dialog is open. Default true. */
189
+ occludedControls?: boolean;
141
190
  /** Rapid-click count that trips a rage click. Default 3. */
142
191
  rageClickCount?: number;
192
+ /** Several full page loads within a minute — a crash or reload loop.
193
+ * Default true. */
194
+ reloadLoops?: boolean;
195
+ /** The same endpoint hit `requestStormCount` times inside
196
+ * `requestStormWindowMs` — refetch loops and retry storms. Needs the
197
+ * fetch/XHR instrumentation. Default true. */
198
+ requestStorms?: boolean;
199
+ /** Requests to one endpoint that trip a storm. Default 15. */
200
+ requestStormCount?: number;
201
+ /** Window for the request-storm counter. Default 10000ms. */
202
+ requestStormWindowMs?: number;
203
+ /** Repeated wheel/touch input while the scrollable page never moves — a
204
+ * scroll lock leaked by a closed modal. Boundary scrolling (already at the
205
+ * top/bottom) is exempt. Default true. */
206
+ scrollJail?: boolean;
207
+ /** WebSocket connect/close cycles to one URL tripping a flap report.
208
+ * Default true. */
209
+ socketFlapping?: boolean;
210
+ /** This page's `release` is older than one this browser has already run —
211
+ * a service worker or cache serving a stale build. Default true. */
212
+ staleReleases?: boolean;
213
+ /** An open `EventSource` on a visible page with no message for
214
+ * `stalledStreamMs` — the silent-stream failure. Default true. */
215
+ stalledStreams?: boolean;
216
+ /** Quiet period before an open, visible EventSource counts as stalled.
217
+ * Default 60000ms. */
218
+ stalledStreamMs?: number;
219
+ /** An `aria-busy`/`role="status"`/`role="progressbar"` element still
220
+ * visible after `stuckLoadingMs` — a load that silently hung.
221
+ * Default true. */
222
+ stuckLoading?: boolean;
223
+ /** Age at which a visible loading indicator counts as stuck.
224
+ * Default 20000ms. */
225
+ stuckLoadingMs?: number;
143
226
  /**
144
227
  * Maximum wait for a same-origin link accepted by an SPA router to finish
145
228
  * navigating before it is considered dead. Default 8000ms; never shorter