@overdoser/react-toolkit 0.10.1 → 0.11.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/AGENTS.md +2 -2
- package/CHANGELOG.md +55 -0
- package/components/Timeline/GanttTimeline.js +66 -64
- package/components/Timeline/HistoryTimeline.js +58 -57
- package/components/Timeline/Timeline.module.scss.js +112 -96
- package/components/Timeline/TimelineShared.d.ts +14 -4
- package/components/Timeline/TimelineShared.js +135 -95
- package/components/Timeline/TraceTimeline.d.ts +40 -9
- package/components/Timeline/TraceTimeline.js +598 -370
- package/components/Timeline/TraceTimeline.module.scss.js +163 -103
- package/components/Timeline/index.d.ts +1 -1
- package/index.css +1 -1
- package/index.d.ts +1 -1
- package/index.layered.css +1 -1
- package/llms.txt +12 -7
- package/manifest.json +29 -8
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -1286,13 +1286,15 @@ Three event-timeline views sharing one interaction model: wheel-zoom anchored at
|
|
|
1286
1286
|
|
|
1287
1287
|
Theming: `--crk-timeline-1..6` category palette (cycled over services/tags/rows), plus `--crk-timeline-*` chrome tokens (ink, muted, hairline, grid, accent, highlight amber…) defaulting to the design's warm paper palette; `--crk-timeline-font-mono` / `--crk-timeline-font-display` for the data/display fonts.
|
|
1288
1288
|
|
|
1289
|
-
**Summary panel (all three):** `showSummary` (default `false`) adds a dense one-line-per-item panel beside the timeline — every item numbered chronologically from `01`, a contiguous highlight band over the items currently visible in the viewport (auto-follows drag-panning by keeping the band centered in the list; suppressed while the pointer is over the panel so it can scroll independently), and click-to-navigate: the timeline smooth-scrolls (~900ms ease-out deceleration, cancelled by user wheel/grab, instant under `prefers-reduced-motion`) to center the picked item. `summaryPlacement` docks it `'left'` (default) / `'right'` of the timeline, renders it full-width `'top'` / `'bottom'` (rows flow into responsive columns),
|
|
1289
|
+
**Summary panel (all three):** `showSummary` (default `false`; `true` on TraceTimeline) adds a dense one-line-per-item panel beside the timeline — every item numbered chronologically from `01`, a contiguous highlight band over the items currently visible in the viewport (auto-follows drag-panning by keeping the band centered in the list; suppressed while the pointer is over the panel so it can scroll independently), and click-to-navigate: the timeline smooth-scrolls (~900ms ease-out deceleration, cancelled by user wheel/grab, instant under `prefers-reduced-motion`) to center the picked item. `summaryPlacement` docks it `'left'` (default; `'bubble'` on TraceTimeline) / `'right'` of the timeline, renders it full-width `'top'` / `'bottom'` (rows flow into responsive columns), `'floating'` — a draggable palette anchored over the timeline, grabbed by its header (viewport-bounded, arrow-key movable when the handle is focused); `summaryDefaultPosition?: { x, y }` sets the floating start offset — or `'bubble'`: a collapsed pill anchored bottom-left of the timeline (heading + count + service-colored glyph) that expands in place into a draggable 262px panel with a "Tinted rows are in the viewport" footer; collapsing always snaps it back to its home corner (the dragged position is deliberately not persisted).
|
|
1290
1290
|
|
|
1291
1291
|
**Customization layers (all three):** (1) `--crk-timeline-*` tokens for colors/fonts; (2) `classes` for per-element class overrides; (3) **render-prop slots to inject custom components** — `renderChip`/`renderCard`/`renderBar`+`renderRowLabel` replace an item's inner content (positioning/geometry stays component-owned), `renderTooltip(item, ctx)` replaces tooltip content (return `null` to suppress it for that item), `renderDetails(item, { close, … })` replaces the side-panel content (the sticky panel shell is kept; call `close()` from your own ✕). Each slot receives a context object (`*ItemContext`: resolved `color`, live flag, `durationMs`, index/number where relevant).
|
|
1292
1292
|
|
|
1293
1293
|
#### TraceTimeline
|
|
1294
1294
|
One correlated request/response flow (a "manifest", an order, a saga) as duration bars on a single proportional time band (UTC display). Overlapping bars pack into vertical sub-rows; each event gets a collision-free description chip (`Origin → Target` tinted badges, bold operation id, start ISO) placed by a 3-pass nudging algorithm (never overlaps another chip; slides with an elbow line or accepts a stem crossing rather than hiding). Sticky two-rail UTC axis: cursor timestamp chip, teal `▸ start` chip for the hovered event, tick clock labels, `YYYY-MM-DD` labels only on day changes, and a sticky current-date label. Events whose interval contains the cursor time get a "hot" ring.
|
|
1295
1295
|
|
|
1296
|
+
**Dock rail + drawers (default on):** a sticky 44px icon rail on the far right toggles one docked drawer at a time — *Event details* (the request/response panel, now with its own uppercase header, an empty state until an event is picked, and Copy buttons beside the Request/Response payloads) or *Full log* (420px: every event vertically — number, method/status chips, `source → service`, clock, op, path, then REQUEST/RESPONSE payloads stacked full-width, each with a Copy button that doesn't select the row). Nothing is docked initially; clicking an event opens the details drawer. Timeline↔log stay in sync both ways: clicking a timeline event (or summary row) scrolls an open log to that entry and flashes it; clicking a log entry selects the event and centers the timeline on it (centering waits for the drawer-induced resize to settle). `showDock={false}` removes the rail and full log — the details panel then simply opens/closes with the selection as before. The events-summary bubble (see the summary panel section) is also on by default.
|
|
1297
|
+
|
|
1296
1298
|
`TraceTimelineEvent`: `{ id: string; service: string; source?; op?; requestId?; method?; url?; label?; query?: Record<string,string>; reqHeaders?; reqBody?; status?: number; resHeaders?; resBody?; start: number; end?: number | null }` — only `id`, `service`, `start` required; extra fields allowed (searched by `highlight`). `end` unset = in flight (dashed bar, pulsing dot, "now" line, "Awaiting response…" panel).
|
|
1297
1299
|
|
|
1298
1300
|
Props:
|
|
@@ -1306,14 +1308,17 @@ Props:
|
|
|
1306
1308
|
- `showGridlines?: boolean` — default `true`.
|
|
1307
1309
|
- `showControls?: boolean` — default `true` (zoom −/%/+/Fit).
|
|
1308
1310
|
- `showLegend?: boolean` — default `true`.
|
|
1309
|
-
- `showSummary?: boolean` — default `
|
|
1310
|
-
- `summaryPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'floating'` — default `'
|
|
1311
|
-
- `
|
|
1311
|
+
- `showSummary?: boolean` — default `true`. Summary panel (see above); picking a row also selects the event.
|
|
1312
|
+
- `summaryPlacement?: 'bubble' | 'left' | 'right' | 'top' | 'bottom' | 'floating'` — default `'bubble'`; `summaryDefaultPosition?: { x, y }` for floating.
|
|
1313
|
+
- `showDock?: boolean` — default `true`. Dock rail + drawers (see above).
|
|
1314
|
+
- `defaultDock?: 'details' | 'log' | null` (`TraceTimelineDock`) — drawer docked open initially; default `null`.
|
|
1315
|
+
- `maxHeight?: number | string` — default `'80vh'` (caps the scrollable canvas).
|
|
1316
|
+
- `minHeight?: number` — default `420`. Minimum event-band height, px (the sticky axis adds its 68px on top): sparse traces stretch to it with the bar band vertically centered; dense traces still grow past it.
|
|
1312
1317
|
- `selectedEventId?: string | null`, `defaultSelectedEventId?`, `onEventSelect?: (ev | null) => void`
|
|
1313
1318
|
- `renderChip?: (ev, ctx: TraceTimelineItemContext) => ReactNode` — replace the chip's inner content (chip box width is still estimated from the default text).
|
|
1314
1319
|
- `renderTooltip?: (ev, ctx) => ReactNode` — replace tooltip content; return `null` to suppress.
|
|
1315
1320
|
- `renderDetails?: (ev, { close, pending }) => ReactNode` — replace the request/response panel content.
|
|
1316
|
-
- `classes?: Partial<TraceTimelineClasses>` where `TraceTimelineClasses = { root, toolbar, legend, card, scroller, axis, bar, chip, summary, search, drawer, tooltip, footnote }`
|
|
1321
|
+
- `classes?: Partial<TraceTimelineClasses>` where `TraceTimelineClasses = { root, toolbar, legend, card, scroller, axis, bar, chip, summary, search, drawer, log, rail, tooltip, footnote }`
|
|
1317
1322
|
|
|
1318
1323
|
Example:
|
|
1319
1324
|
```tsx
|
|
@@ -1341,7 +1346,7 @@ Props:
|
|
|
1341
1346
|
- `showControls?: boolean` — default `true` (orientation + spacing toggles + zoom).
|
|
1342
1347
|
- `showLegend?: boolean` — default `true` (tag bullets).
|
|
1343
1348
|
- `showSummary?: boolean` — default `false`. Summary panel (see above); numbering matches the card numbers.
|
|
1344
|
-
- `summaryPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'floating'` — default `'left'`; `summaryDefaultPosition?: { x, y }` for floating.
|
|
1349
|
+
- `summaryPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'floating' | 'bubble'` — default `'left'`; `summaryDefaultPosition?: { x, y }` for floating.
|
|
1345
1350
|
- `maxHeight?: number | string` — defaults 84vh (horizontal) / 78vh (vertical).
|
|
1346
1351
|
- `selectedEventId?: string | null`, `defaultSelectedEventId?`, `onEventSelect?`
|
|
1347
1352
|
- `renderCard?: (ev, ctx: HistoryTimelineItemContext) => ReactNode` — replace the card's inner content (card box size is still computed from the default content, so keep custom content roughly equivalent).
|
|
@@ -1372,7 +1377,7 @@ Props:
|
|
|
1372
1377
|
- `showGridlines?: boolean` — default `true`.
|
|
1373
1378
|
- `showControls?: boolean` — default `true`.
|
|
1374
1379
|
- `showSummary?: boolean` — default `false`. Summary panel (see above; heading "Tasks").
|
|
1375
|
-
- `summaryPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'floating'` — default `'left'`; `summaryDefaultPosition?: { x, y }` for floating.
|
|
1380
|
+
- `summaryPlacement?: 'left' | 'right' | 'top' | 'bottom' | 'floating' | 'bubble'` — default `'left'`; `summaryDefaultPosition?: { x, y }` for floating.
|
|
1376
1381
|
- `maxHeight?: number | string` — default `'74vh'`.
|
|
1377
1382
|
- `selectedTaskId?: string | null`, `defaultSelectedTaskId?`, `onTaskSelect?: (task | null) => void`
|
|
1378
1383
|
- `renderRowLabel?: (task, ctx: GanttTimelineItemContext) => ReactNode` — replace the sticky label-column content.
|
package/manifest.json
CHANGED
|
@@ -2610,7 +2610,7 @@
|
|
|
2610
2610
|
"import": "import { TraceTimeline } from '@overdoser/react-toolkit'",
|
|
2611
2611
|
"element": "div",
|
|
2612
2612
|
"forwardsRef": true,
|
|
2613
|
-
"behavior": "Request/response trace of one correlated flow on a single proportional UTC time band. Overlapping bars pack into sub-rows; description chips are placed collision-free (3-pass nudging). Wheel-zoom, drag-pan, Fit, keyword highlight, hover tooltip
|
|
2613
|
+
"behavior": "Request/response trace of one correlated flow on a single proportional UTC time band. Overlapping bars pack into sub-rows; description chips are placed collision-free (3-pass nudging). Wheel-zoom, drag-pan, Fit, keyword highlight, hover tooltip. A right-side icon rail (default on) docks one drawer at a time: Event details (request/response panel with copy buttons, opened by clicking an event, empty state until then) or Full log (every event vertically with stacked payloads + copy buttons; kept in sync with timeline clicks both ways — timeline click scrolls/flashes the log entry, log click selects and centers the timeline). An events-summary bubble (default on) sits bottom-left and expands into a draggable panel. Fully controlled data: pass the pre-filtered array; the component does no filtering/grouping. Items with an unset end render live (dashed/pulsing) and grow on an internal ticker until an update supplies end.",
|
|
2614
2614
|
"props": {
|
|
2615
2615
|
"events": {
|
|
2616
2616
|
"type": "TraceTimelineEvent[]",
|
|
@@ -2658,24 +2658,41 @@
|
|
|
2658
2658
|
},
|
|
2659
2659
|
"showSummary": {
|
|
2660
2660
|
"type": "boolean",
|
|
2661
|
-
"default":
|
|
2662
|
-
"notes": "Dense one-line-per-item summary panel: items numbered from 01, highlight band over the currently visible viewport (auto-follows panning, scrolls independently), click smooth-scrolls (~1s ease-out) to center
|
|
2661
|
+
"default": true,
|
|
2662
|
+
"notes": "Dense one-line-per-item summary panel: items numbered from 01, highlight band over the currently visible viewport (auto-follows panning, scrolls independently), click selects the event and smooth-scrolls (~1s ease-out) to center it (also scrolls an open full-log drawer to its entry)."
|
|
2663
2663
|
},
|
|
2664
2664
|
"summaryPlacement": {
|
|
2665
2665
|
"type": "enum",
|
|
2666
2666
|
"values": [
|
|
2667
|
+
"bubble",
|
|
2667
2668
|
"left",
|
|
2668
2669
|
"right",
|
|
2669
2670
|
"top",
|
|
2670
2671
|
"bottom",
|
|
2671
2672
|
"floating"
|
|
2672
2673
|
],
|
|
2673
|
-
"default": "
|
|
2674
|
-
"notes": "
|
|
2674
|
+
"default": "bubble",
|
|
2675
|
+
"notes": "bubble = collapsed pill anchored bottom-left of the timeline, expanding in place into a draggable panel (collapse snaps it back to its corner). Or dock beside the timeline, render full-width above/below (rows flow into responsive columns), or float as a draggable palette grabbed by its header. summaryDefaultPosition?: { x, y } sets the floating start offset."
|
|
2676
|
+
},
|
|
2677
|
+
"showDock": {
|
|
2678
|
+
"type": "boolean",
|
|
2679
|
+
"default": true,
|
|
2680
|
+
"notes": "Sticky 44px icon rail on the far right toggling one docked drawer at a time: Event details or Full log. Nothing docked initially; clicking an event opens details. false removes the rail and full log — the details panel then opens/closes with the selection."
|
|
2681
|
+
},
|
|
2682
|
+
"defaultDock": {
|
|
2683
|
+
"type": "'details' | 'log' | null",
|
|
2684
|
+
"default": null,
|
|
2685
|
+
"notes": "Drawer docked open initially (uncontrolled). Type TraceTimelineDock."
|
|
2675
2686
|
},
|
|
2676
2687
|
"maxHeight": {
|
|
2677
2688
|
"type": "number | string",
|
|
2678
|
-
"default": "80vh"
|
|
2689
|
+
"default": "80vh",
|
|
2690
|
+
"notes": "Caps the scrollable canvas; does not stretch content."
|
|
2691
|
+
},
|
|
2692
|
+
"minHeight": {
|
|
2693
|
+
"type": "number",
|
|
2694
|
+
"default": 420,
|
|
2695
|
+
"notes": "Minimum event-band height in px (sticky axis adds 68px on top). Sparse traces stretch to it with the bar band vertically centered; dense traces grow past it."
|
|
2679
2696
|
},
|
|
2680
2697
|
"selectedEventId": {
|
|
2681
2698
|
"type": "string | null",
|
|
@@ -2710,6 +2727,8 @@
|
|
|
2710
2727
|
"summary",
|
|
2711
2728
|
"search",
|
|
2712
2729
|
"drawer",
|
|
2730
|
+
"log",
|
|
2731
|
+
"rail",
|
|
2713
2732
|
"tooltip",
|
|
2714
2733
|
"footnote"
|
|
2715
2734
|
]
|
|
@@ -2779,7 +2798,8 @@
|
|
|
2779
2798
|
"right",
|
|
2780
2799
|
"top",
|
|
2781
2800
|
"bottom",
|
|
2782
|
-
"floating"
|
|
2801
|
+
"floating",
|
|
2802
|
+
"bubble"
|
|
2783
2803
|
],
|
|
2784
2804
|
"default": "left",
|
|
2785
2805
|
"notes": "Dock beside the timeline, render full-width above/below (rows flow into responsive columns), or float as a draggable palette grabbed by its header. summaryDefaultPosition?: { x, y } sets the floating start offset."
|
|
@@ -2877,7 +2897,8 @@
|
|
|
2877
2897
|
"right",
|
|
2878
2898
|
"top",
|
|
2879
2899
|
"bottom",
|
|
2880
|
-
"floating"
|
|
2900
|
+
"floating",
|
|
2901
|
+
"bubble"
|
|
2881
2902
|
],
|
|
2882
2903
|
"default": "left",
|
|
2883
2904
|
"notes": "Dock beside the timeline, render full-width above/below (rows flow into responsive columns), or float as a draggable palette grabbed by its header. summaryDefaultPosition?: { x, y } sets the floating start offset."
|