Bruno DelorenceBruno
Appearance
Appearance

Choose your reading theme.

Contact

Request trace

New

A platform hero you can use: press anything in a small store and its request replaces the log’s top row, while a comet of light runs the circuit between the windows.

request-trace/request-trace.tsx
Live · interactive
console.relay.example
FunctionsFJELL SUPPLYRequest activity
RequestExecutionStatus

GET/products/flask

Load the product · via Functions

  • Cache
  • Database

Frankfurt

FRA · 08

200 OK

38ms

fjellsupply.example/products/flaskAlex · Frankfurt

Drinkware / the field edit

The Ridge Flask

$54 USD

Flare Orange

Platform

Press anything in the shop.
Follow the request it sends.

Functions answer from the region nearest the shopper. Cache, Database, Email and AI are one hop away, on every row.

The live component, numbered part by part. Every measurement is read from it as it is drawn. Point at a row to outline its part, or at a part to find its row.

The choices it offers, each value drawn live and the default marked, with how to pick one.

When to use

  • A product page for a platform or an API, where what you sell happens behind the screen and needs showing: one action in an app, one request in a log.
  • A hero that people can use, not only watch: the store responds by hand, and each action sends its own row.
  • Explaining a round trip and what it touches, with the services named on each row.

When not to use

  • A real log or monitoring screen. The rows are simulated, and the times come from the requests data. Don’t present them as measurements of your service.
  • A page that must weigh almost nothing: it needs a WebGL context and its own small renderer.
  • A place with no room for two windows side by side. Under 620 px the windows stack, and their small text gets small.

One request

  • 0 s: the top row turns to skeleton and the comet leaves the store, heading for the node.
  • 0.2 s: the new row is in, with Running… and its chips.
  • 0.17 s: the node’s icon changes as the comet goes through it.
  • 0.65 s: the comet reaches the log, a ring of dots pops, and the status turns to 200 OK. A catalog’s cards start here, 130 ms apart.
  • 1.1 s: the comet is back at the store, and Notify me or the bag count changes. The 3D request makes this trip twice.

What the rows should say

  • Pass requests with your own paths, descriptions and services; the store’s actions stay the same.
  • Keep ms plausible for what the row describes: tens of ms for a read, seconds for an AI call.

Each one drawn with the component itself, used well or badly.

You can add this component with the shadcn CLI or by hand:

Into components/request-trace of any React project, with no setup:

Terminal
npx shadcn@latest add https://brunodelorence.com/r/request-trace.json

Either way it needs React 19.2 and a bundler that supports CSS Modules, such as Next.js or Vite. It has a dark colour scheme: it follows your page’s color-scheme, light unless the page sets one, or its colorScheme prop, with nothing to configure. Browsers without light-dark() show it light.

Usage

platform-hero.tsx
import { RequestTrace, Term } from './request-trace';export function PlatformHero() {  return (    <RequestTrace      tag="Platform"      headline="Press anything in the shop. Follow the request it sends."      requests={{ notify: { path: '/v2/alerts', ms: 64 } }}      onRequest={(request) => console.log(request.method, request.path, request.status)}    >      <Term>Functions</Term> answer from the region nearest the shopper.    </RequestTrace>  );}

Each state below is a live instance, locked so you can study it.

The pieces it is built from, each with its measurements read live.

Two overlapping windows on a faint grid: a hosting platform’s request log, and a store it serves. Every action in the store, by hand or by a named cursor, sends a request. The log’s top row is replaced by it, with its method, path, region, services and time, and a small comet travels a thin line from one window to the other through a node whose icon says what is being called. Open a product and a slower request turns it into a 3D object that rises out of the page and can be turned by hand, drawn by a tiny WebGL renderer in the folder, with no library and no model files.

  • One clock per request, timed: the row blanks to a skeleton for 0.2 s, the comet goes out in 0.65 s, the status turns to 200 OK on arrival, and the comet comes back in 0.45 s. The 3D request makes the trip twice, 2.2 s, and reports 2.3 s. The times are simulated from each request’s `ms`, with a small spread; nothing goes to a network.
  • The comet is four strokes of one path with a set length of 1000: dashes of 160, 100, 46 and 18, yellow to red and 1 to 2.4 px wide, moved together by their dash offset with the Web Animations API. It passes under both windows, and a small ring of dots pops at each end. The node’s icon crossfades 0.17 s after it leaves.
  • The products are surfaces of revolution from a profile, with tubes swept along a path for handles and wires. Rounded corners come from the profile; anything sharper than 50 degrees keeps two normals, so a lid keeps its edge. Contact shade is stored per vertex, including the handle’s on the mug’s wall.
  • The light is what the surfaces reflect: a function paints a cove, a large softbox, a strip and a dim floor in reflection directions, sharp or blurred by roughness. So enamel shows a clean window, powder coat a broad sheen and steel the whole room. Pebble, knurling and enamel flecks tilt the normal or tint the colour in the fragment shader; the printed mark is a small canvas texture. The shadow is two soft blobs on the floor.
  • The page holds one WebGL context, on a canvas outside the document: each instance asks for a frame and copies it to its own 2D canvas. It draws only while something moves, caps the device pixel ratio at 2, frees its bitmap off screen, and gives the context back 0.5 s after no instance is on screen. Catalog photos are one render each, kept as data URLs, at the same scale as the flight into the card, so the swap doesn’t show.
  • Opening a product flies it from its card to its place in 1.05 s while turning, ease-out; going back shrinks it to its card in 0.62 s as the catalog request runs, and the other cards fade in 130 ms apart. A drag turns it 0.012 radians per px and leaves inertia that dies at a rate of 3.2 per second.
  • The stage is designed at 872 px, or 500 px with the windows stacked under a 620 px container, and scaled with `zoom`, so it is laid out and rasterised at the size it shows. The text below is outside the zoom and keeps its size.
  • While on screen and untouched, the named cursor uses Notify me, Shop all, a product, the drag, a size and Add to bag, in a loop of about 18 s; any input from the reader stops it for good. Colours are tokens with `light-dark()` pairs on the root; the products keep theirs in both schemes.
PropTypeDefaultDescription
headlineReactNodePress anything in the shop. Follow the request it sends.The heading under the windows.
childrenReactNode—The paragraph under the heading. `Term`, also exported, underlines a word.
tagstring'Platform'The small tag above the heading.
onRequest(request: TraceRequest & { status: 'running' | 'done' }) => void—Called when a request starts and again when it finishes.
requestsPartial<Record<RequestKind, Partial<Omit<TraceRequest, 'kind'>>>>—Overrides by kind (page, catalog, model, stock, bag, notify): method, path, note, services and ms.
cursorstring'Alex'The name on the demo’s cursor and in the store’s bar.
region{ city: string; code: string }Frankfurt, 'FRA · 08'Where the requests run.
defaultView'product' | 'catalog''product'Which page the store opens on.
defaultProduct'flask' | 'mug' | 'lantern''flask'Which product it opens on.
defaultRunningbooleanfalseHolds the top row in Running, as a still; it also turns the demo off.
defaultNotifiedbooleanfalseStarts with Notify me taken, as a still.
defaultBagnumber0How many are in the bag at the start.
autoplaybooleantrueWhile on screen and untouched, the named cursor uses the store by itself.
colorScheme'light' | 'dark' | 'system'—Sets the scheme; left out, it follows the page.
classNamestring—Added to the root.

Keyboard and screen readers

  • The store’s controls are real buttons, the sizes a radio group, the log a real table, and the product a slider: left and right turn it, up and down tilt it, Home resets it.
  • A status region reads out each finished request, with its method, path, status and time.
  • When a page replaces the one with the control in use, the focus moves to the new title, or to the first card.

Motion

  • With reduced motion there is no comet, flight or inertia and no demo: rows and pages simply change. Dragging still turns the product.

In this build

  • The store is real buttons, a radio group for sizes and a heading per page; the log is a real table. A status region reads each finished request.
  • The product is a slider: drag it, or use left and right to turn, up and down to tilt, Home to reset.
  • When a new page replaces the control in use, the focus moves to the product’s title or the first card.
  • With reduced motion there is no comet, flight, inertia or demo: rows and pages simply change.
  • Where WebGL is missing or its context is lost, the products are drawn in SVG, and the renders come back if the context does.

The complete source behind this demo. Open source under the MIT license, © 2026 Bruno Delorence: copy it, change it, ship it.

request-trace.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useEffectEvent,  useRef,  useState,  type CSSProperties,  type ReactNode,} from 'react';import { NamedCursor, runDemo, type Point } from './demo-pointer';import {  BagGlyph,  BellGlyph,  CheckGlyph,  ChevronGlyph,  Glyph,  HistoryGlyph,  KIND_ICON,  NODE_ICON,  PlatformMark,  SERVICE_ICON,
request-trace.module.css
/* Request trace (request-trace.tsx): a hero with two overlapping windows on a faint grid, and a   tag, a heading and a paragraph under them.   The stage is drawn on a fixed design width, 872 px, or 500 px where the container is under 620 px,   and scaled with `zoom` so everything is laid out and rasterised at the size it shows. The text   under it is outside the zoom and keeps its own size. Inside the stage, hairlines are inset   box-shadows, because zoom snaps borders.   Sizes at design width: the log 560 × 481, the store 480 × 361, overlapping by 320 × 181; each has   a 38 px bar and an 8 px inset frame. The product canvas is 420 px square, centred 60 px right of   the store's left edge, so the product hangs out over the edge and the bottom.   Layers: grid and circuit (0), the log (1), the store (2), the product (3), the cursor (4).   Colours are the tokens below, light-dark(light, dark) where the two differ. The products keep   their colours in both. */.root {  --page: #fbfbfb;  --grid: #ececed;  --grid-text: #dcdcde;  --window: #fff;  --window-edge: rgb(0 0 0 / 0.07);  --window-shadow: rgb(20 20 30 / 0.1);
products.ts
// Copyright (c) 2026 Bruno Delorence. MIT License./* * The store's catalog and the requests each action sends. Plain data: the store, the dashboard and * the renderer all read from here, so a product's name, its colour and its model stay together. */export type ProductId = 'flask' | 'mug' | 'lantern';export type Product = {  id: ProductId;  name: string;  /** The word used in a request's description: “Turn the flask into 3D”. */  noun: string;  category: 'Drinkware' | 'Lighting';  price: number;  colour: string;  /** The colour's swatch, in the store's product section. */  swatch: string;  sizes: string[];};export const PRODUCTS: Product[] = [  {
product-view.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import {  useEffect,  useImperativeHandle,  useRef,  useState,  type KeyboardEvent,  type PointerEvent,  type Ref,} from 'react';import { modelOf } from './meshes';import { ProductStill } from './product-still';import { product as productOf, type ProductId } from './products';import { onStudioChange, release, renderTo, retain, studioBroken, type Pose } from './studio';/* * The product standing out of the page: a 2D canvas the shared studio paints into, only when * something has changed. It moves by flights (rising out of the page, shrinking back into a * catalog card), by dragging, and by the inertia a drag leaves. Off screen it draws nothing and * gives its bitmap back; where WebGL can't be had it shows the drawn still instead. */
studio.ts
// Copyright (c) 2026 Bruno Delorence. MIT License.import { modelOf, type Material, type Part } from './meshes';import type { ProductId } from './products';/* * The photo studio: one WebGL context for the whole page, however many of these components are * mounted. It lives on a canvas that is never in the document; each view asks for a frame and * copies it to its own 2D canvas, so a still costs one 2D bitmap and nothing while it rests. * When no view is on screen the context is given back to the browser. * * There are no lights to speak of: a product is lit by what it reflects. `studio()` paints a room * in reflection directions, a pale cove, a big softbox up on the left, a strip on the right and a * dim floor, and the surfaces read it sharp or blurred by their roughness. So enamel shows a clean * window, powder coat a broad sheen, and steel the whole room. The shadow is two soft blobs on the * floor; contact shade is stored per vertex by the meshes. */export type Pose = {  yaw: number;  pitch: number;  /** Relative to the product's size at rest. */  scale: number;  /** Offset from the canvas's centre, in shares of its size. */
meshes.ts
// Copyright (c) 2026 Bruno Delorence. MIT License.import type { ProductId } from './products';/* * The products' geometry: surfaces of revolution from a profile, and tubes swept along a path for * handles and wires. No model files: everything is built here once, as plain arrays, and the * renderer uploads it. Units: the floor is y = 0 and a product stands about 1 tall. * * A profile is walked from the axis at the bottom, up the outside, and back down the inside, so a * segment's outward normal is always (dy, -dr). Corners are rounded by `round`; what remains * sharper than 50 degrees keeps two normals, so a lid's edge stays an edge. */export type Material = {  /** sRGB, 0 to 1. */  colour: [number, number, number];  metal?: number;  rough: number;  /** How strong the powder coat's fine pebble is. */  peel?: number;  /** Fine dark flecks, as fired enamel has. */  fleck?: number;  /** Vertical knurling, as a count of ribs around. */
product-still.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.import type { ProductId } from './products';/* * The products drawn in SVG: what shows where WebGL can't be had, or while a lost context is away. * The same products, the same colours, flat-lit: two gradients and a highlight per body. */const Shadow = ({ cx, rx }: { cx: number; rx: number }) => (  <ellipse cx={cx} cy="372" rx={rx} ry="12" fill="#000" opacity="0.16" />);export function ProductStill({ id, className }: { id: ProductId; className?: string }) {  return (    <svg className={className} viewBox="0 0 420 420" role="img" aria-hidden="true">      <defs>        <linearGradient id="rt-flask" x1="0" x2="1">          <stop offset="0" stopColor="#ff7a2e" />          <stop offset="0.35" stopColor="#f24a0c" />          <stop offset="1" stopColor="#b02f04" />        </linearGradient>        <linearGradient id="rt-mug" x1="0" x2="1">          <stop offset="0" stopColor="#ffd042" />
demo-pointer.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import type { Ref } from 'react';import { CursorArrow } from './glyphs';/* * The named cursor the demo moves around, and the steps that move it. A demo is a script of awaited * steps: wait, or glide somewhere. Stopping the demo (the reader takes over, or it scrolls away) * ends the step in progress at once: its promise rejects, which ends the script right there, and * the cursor fades out. * * Each glide is a curved flight played by the Web Animations API, so nothing runs frame by frame. */export type Point = { x: number; y: number };export type Demo = {  /** Resolves after `ms`. */  wait: (ms: number) => Promise<void>;  /** Glides the cursor to `to`, in the stage's own px, in `ms`. */  glide: (to: Point, ms: number) => Promise<void>;  /** Plays the small press on the cursor's label. */
use-autoplay.ts
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useCallback, useEffect, useRef, useState } from 'react';/* * When a demo may play on its own: while part of it is on screen and the tab is visible, never * under reduced motion, and never again once the reader has used it: `take()` hands it to the * reader for good (until the component mounts again), so it can't come back on its own. */export function useAutoplay<T extends HTMLElement>() {  const ref = useRef<T>(null);  const [visible, setVisible] = useState(false);  const [reduced, setReduced] = useState(true);  const [taken, setTaken] = useState(false);  useEffect(() => {    const element = ref.current;    if (!element) return;    let onScreen = false;    const update = () => setVisible(onScreen && !document.hidden);    const observer = new IntersectionObserver(      ([entry]) => {
glyphs.tsx
// Copyright (c) 2026 Bruno Delorence. MIT License.import type { RequestKind, ServiceId } from './products';/* The small icons, stroked on a 16 px grid in the current colour. */type Props = { className?: string };const Icon = ({ className, d }: Props & { d: string }) => (  <svg    className={className}    viewBox="0 0 16 16"    fill="none"    stroke="currentColor"    strokeWidth="1.2"    strokeLinecap="round"    strokeLinejoin="round"    aria-hidden="true"  >    <path d={d} />  </svg>);const BAG = 'M3 3h10v10.5H3zM5.8 3v1.6a2.2 2.2 0 0 0 4.4 0V3';const LIST = 'M2.5 4.5h1.2M6 4.5h7.5M2.5 8h1.2M6 8h7.5M2.5 11.5h1.2M6 11.5h7.5';