Skip to content

FE-2385: Build new Salt slider UI + api - #10691

Open
alex-e-leon wants to merge 1 commit into
mainfrom
FE-2385-add-slider-to-salt
Open

alex-e-leon wants to merge 1 commit into
mainfrom
FE-2385-add-slider-to-salt

Conversation

@alex-e-leon

Copy link
Copy Markdown
Contributor

🌟 Purpose

Updates the UI for Slider to match the design guidelines and introduces a new more flexible api, new options and new variants.

Also updates petrinaut and brunch to use the new Slider api, and swaps two custom slider implementations from petrinaut over to Slider.

@alex-e-leon
alex-e-leon requested review from a team as code owners December 2, 2026 13:22
@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Dec 3, 2026 12:26pm UTC
hashdotdesign-tokens Ready Ready Preview Dec 3, 2026 12:26pm UTC
petrinaut Ready Ready Preview Dec 3, 2026 12:26pm UTC
petrinaut-docs Ready Ready Preview Dec 3, 2026 12:26pm UTC

Request Review

@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps > hash.design Affects the `hash.design` design site (app) labels Dec 2, 2026
@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Breaking minor-version API on a widely exported component; incorrect onChange/onDrag wiring in remaining consumers could cause stuck values or missed updates.

Overview
Rebuilds @hashintel/ds-components Slider with new visuals, a controlled-only API (value required), and onChange vs onDrag semantics (onChange on settle; onDrag for live updates and optional overrides). Adds type="dot" and type="range" (dual thumbs, minDistance, thumb collision behaviors), plus marks/step modes ("any", "marks"), non-linear scale, formatValue, tones, sizes, and form integration. Removes label, showValueText, variant, defaultValue, onChangeEnd, and the SliderProps / SliderVariant exports (use ComponentProps<typeof Slider>).

Implementation is largely new: slider-util for value/step/range math, slider.recipe for styling, Ark UI used read-only for layout, with custom pointer/keyboard handling. Adds docs, Storybook coverage, and RTL/DOM tests.

Call sites in this PR are updated: brunch voice audio controls; petrinaut drops its native <input type="range"> slider and adopts the design-system component for simulation ratio, event-time scrubber, and sweep navigator. unwrapLinkTags in docs props tables is fixed for docgen link formatting.

Reviewed by Cursor Bugbot for commit d2aceff. Bugbot is set up for automated code reviews on this repo. Configure here.

@veria-ai

veria-ai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread .changeset/ds-slider-rebuild.md Outdated
"@hashintel/ds-components": minor
---

**Breaking:** `Slider` has a new look and is now a controlled input — `value` is required, and `onChange` fires once per interaction with the settled value (use `onDrag` for every value on the way). `onChangeEnd`, `label`, `showValueText`, `variant`, `defaultValue` and `style` are removed; name the slider with a `Form.Field` label or `aria-label` instead. A new `type` prop adds `dot`, which leaves the track unfilled, and `range`, which selects a span with two thumbs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two changeset gaps:

  1. Missing @hashintel/petrinaut changeset: This PR changes user-facing UI and keyboard behavior in three Petrinaut controls (event-time-controls, sweep-navigator, simulation-scenario-controls), including PageUp/PageDown now jumping 10% of the range. Per libs/@hashintel/petrinaut/AGENTS.md, consumer-facing Petrinaut changes need a separate patch changeset.
  2. Omitted removed type exports: libs/@hashintel/ds-components/src/main.ts stops exporting SliderProps and SliderVariant (and adds SliderMark and SliderScale). Note the removed type exports here (pointing callers to ComponentProps<typeof Slider>) so external consumers aren't hit by an undocumented compile break.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm not sure that these small UI changes warrant a petrinaut changeset? If I was a consumer of petrinaut, these changes would read as noise to me. @kube ?

  2. 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. We already spam changeset enough.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

* focuses it, as they would a native input.
*
* Ark only positions the parts, and is kept read-only. Pointer and keyboard
* handling live here because `onChange` reports settled values (so the values

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two points on the custom interaction layer:

  1. Missing component tests: slider.tsx owns pointer drag, track press, onDrag overrides, settled onChange, Form.Field naming/legend, and range push/swap hand-over, yet there is no slider.test.tsx (only slider-util.test.ts and 4 Petrinaut keyboard tests). Please add component tests covering the changeset's core contract (onChange firing once per interaction with the settled value, onDrag firing on each step and overriding the thumb, no-op release, cancel, and range collision).
  2. Architectural question: @zag-js/slider (already installed via @ark-ui/react) natively supports onValueChange/onValueChangeEnd, grab offset (thumbDragOffset), minStepsBetweenThumbs, thumbCollisionBehavior (none/push/swap), largeStep, and getAriaValueText. Putting Ark in readOnly and hand-rolling ~350 lines here (plus ~250 lines in slider-util.ts) is driven mainly by scale and step="marks", neither of which any consumer in this PR uses. Are scale and step="marks" needed right now, or could we drop them and delegate interaction to Ark/Zag?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 👍
  2. scale is probably unnecessary, and I was on the fence on whether to include it, but it also only adds ~30 lines of code. The bigger impact is from step="marks" - but it's a useful and common enough pattern that I'd like to keep it, as it unlocks some ui patterns.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// ring is held back while the thumb's focus came from a pointer.
const [pointerFocus, setPointerFocus] = useState(false);

if (disabled && drag !== null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turning disabled on mid-drag clears drag (removing the document listeners) but leaves gestureRef.current set and never calls endDrag(). As a result, onDrag has already emitted intermediate values while onChange is silently dropped (same on unmount mid-drag). Clear gestureRef.current and decide whether disabling mid-drag should commit or revert.

Related question at lines 398-399: pointercancel and contextmenu currently call endDrag() and commit the mid-drag value — should a cancelled gesture revert to gesture.start instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


const dragging = drag !== null;
// Re-subscribed on every render so the listeners see current props
useLayoutEffect(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this useLayoutEffect has no dependency array and dragTo calls setDrag on every step, all four document event listeners are removed and re-attached on every frame during a drag. Keeping the latest handlers in a ref (or useEffectEvent) and depending only on [dragging] subscribes once per drag gesture.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return { min, max };
}
return thumbIndex === 0
? { min, max: upperShown - minDistance }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upperShown - minDistance and lowerShown + minDistance aren't snapped to step, so with e.g. step={1} and minDistance={1.5} the lower thumb reports aria-valuemax="4.5" even though it can only reach 4 (contradicting slider.docs.mdx:935, which says these report how far the thumb can currently travel). Snap through values.atMost / values.atLeast here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}) => {
const continuous = step === "any";
// A scale that cannot place both ends, such as a log scale from 0, is ignored
const usableScale =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several invalid inputs are silently coerced rather than failing informatively:

  • An unusable scale (e.g. a log scale starting at 0) silently drops the scale and renders linearly.
  • step <= 0 (line 157) silently becomes 1.
  • A NaN controlled value returns NaN from stepFrom; because NaN !== NaN, sameThumbs([NaN], [NaN]) is false, so every keypress emits onChange(NaN).

Confirm whether silent fallback is intentional for scale and step (if not, warn or throw in dev), and guard NaN values so keypresses don't loop onChange(NaN).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I'll add some warnings.

I don't think that a consumer should expect all components to work with invalid values, and type-safety is rarely enough to completely make components bullet-proof, so a consumer will always be on the hook to use components appropriately - but adding these checks seems reasonable and low cost.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

/** The smallest gap allowed between the two thumbs, in the same unit as `value`. Only applies when `type` is `range`. */
minDistance?: number;
/** What a dragged thumb does on reaching the other: `none` stops it there, `push` moves the other along, and `swap` lets it pass and carry on as the other thumb. Only applies when `type` is `range`. */
thumbCollisionBehavior?: "none" | "push" | "swap";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional cleanup: Import ThumbCollisionBehavior from ./slider-util instead of repeating "none" | "push" | "swap" here, so the prop type stays in sync with moveThumb.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*/
const unwrapLinkTags = (text: string): string =>
// eslint-disable-next-line react-refresh/only-export-components -- exported for tests
export const unwrapLinkTags = (text: string): string =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional cleanup: PropsTable already renders descriptions through react-markdown (line 167), and the only prop description using {@link url|label} is slider.tsx:104. Writing a standard markdown link there removes unwrapLinkTags, this eslint-disable, and props-table.test.ts.

If you want TSDoc {@link} syntax for IDE hover as well, move unwrapLinkTags into docs/blocks/props-table/unwrap-link-tags.ts so props-table.tsx stays component-only without the lint disable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, like you noted, the reason is to support @link syntax for IDE hover.

Personally I don't think this function is big enough to warrant its own file, and since its only used internally by props-table, makes more sense to stay in the same file, so I think I'll leave this as is.

@@ -350,15 +331,17 @@ export const AudioSettings = ({
<span className={labelStyle}>Speed</span>
<div className={sliderRowStyle}>
<Slider

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visible 1.05× readout below is aria-hidden and this <Slider> sets no formatValue, so screen readers announce bare "1.05" without a unit. Pass formatValue={(speed) => ${speed.toFixed(2)}×} to match the new Slider accessibility guidance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

kube
kube previously approved these changes Dec 3, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d2aceff. Configure here.

};
setDrag({ thumbs: committed, index: pressed, handedOver: false });
focusThumb(pressed);
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second pointer resets active drag

Medium Severity

A new pointerdown always overwrites the active gesture and seeds it from committed, without checking for an existing drag. A second finger (or another pointer) on the track therefore jumps the thumbs back to the pre-drag value and the original pointer's pointerId no longer matches, so the in-progress movement is discarded instead of committed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d2aceff. Configure here.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Benchmark results

hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$21.1 \mathrm{ms} \pm 189 \mathrm{μs}\left({\color{gray}0.691 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.72 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}1.73 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$10.9 \mathrm{ms} \pm 86.1 \mathrm{μs}\left({\color{red}7.71 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$116 \mathrm{ms} \pm 760 \mathrm{μs}\left({\color{lightgreen}-20.058 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$12.5 \mathrm{ms} \pm 129 \mathrm{μs}\left({\color{red}5.38 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$21.3 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{red}8.80 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$21.6 \mathrm{ms} \pm 150 \mathrm{μs}\left({\color{gray}0.080 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.90 \mathrm{ms} \pm 21.4 \mathrm{μs}\left({\color{gray}-2.474 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$11.6 \mathrm{ms} \pm 89.0 \mathrm{μs}\left({\color{gray}-2.348 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$2.94 \mathrm{ms} \pm 24.1 \mathrm{μs}\left({\color{gray}1.08 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.40 \mathrm{ms} \pm 16.2 \mathrm{μs}\left({\color{gray}2.11 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$2.69 \mathrm{ms} \pm 19.7 \mathrm{μs}\left({\color{gray}1.35 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.15 \mathrm{ms} \pm 27.2 \mathrm{μs}\left({\color{gray}2.89 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.88 \mathrm{ms} \pm 22.3 \mathrm{μs}\left({\color{gray}1.47 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$3.33 \mathrm{ms} \pm 24.5 \mathrm{μs}\left({\color{gray}1.11 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.55 \mathrm{ms} \pm 27.0 \mathrm{μs}\left({\color{gray}0.430 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.73 \mathrm{ms} \pm 20.9 \mathrm{μs}\left({\color{gray}0.868 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.25 \mathrm{ms} \pm 21.4 \mathrm{μs}\left({\color{gray}-0.165 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.20 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}1.37 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.17 \mathrm{ms} \pm 14.2 \mathrm{μs}\left({\color{gray}3.17 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.21 \mathrm{ms} \pm 14.0 \mathrm{μs}\left({\color{gray}3.22 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.44 \mathrm{ms} \pm 19.2 \mathrm{μs}\left({\color{gray}0.624 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.27 \mathrm{ms} \pm 13.3 \mathrm{μs}\left({\color{gray}0.533 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.50 \mathrm{ms} \pm 19.8 \mathrm{μs}\left({\color{gray}1.36 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.48 \mathrm{ms} \pm 16.3 \mathrm{μs}\left({\color{gray}1.75 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.24 \mathrm{ms} \pm 18.2 \mathrm{μs}\left({\color{gray}-0.171 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$2.33 \mathrm{ms} \pm 14.4 \mathrm{μs}\left({\color{gray}-1.455 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.76 \mathrm{ms} \pm 16.3 \mathrm{μs}\left({\color{gray}-0.966 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.48 \mathrm{ms} \pm 17.2 \mathrm{μs}\left({\color{gray}0.614 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$2.66 \mathrm{ms} \pm 21.2 \mathrm{μs}\left({\color{gray}-0.174 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.80 \mathrm{ms} \pm 29.2 \mathrm{μs}\left({\color{gray}3.09 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.47 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}1.70 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.67 \mathrm{ms} \pm 20.7 \mathrm{μs}\left({\color{gray}-0.687 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$27.9 \mathrm{ms} \pm 204 \mathrm{μs}\left({\color{gray}1.39 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$58.1 \mathrm{ms} \pm 422 \mathrm{μs}\left({\color{gray}0.612 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$31.9 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{gray}-1.755 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$33.1 \mathrm{ms} \pm 328 \mathrm{μs}\left({\color{gray}1.92 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$39.5 \mathrm{ms} \pm 295 \mathrm{μs}\left({\color{gray}3.08 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$29.1 \mathrm{ms} \pm 190 \mathrm{μs}\left({\color{gray}2.09 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$326 \mathrm{ms} \pm 1.12 \mathrm{ms}\left({\color{gray}0.785 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$91.3 \mathrm{ms} \pm 637 \mathrm{μs}\left({\color{gray}5.00 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$59.6 \mathrm{ms} \pm 506 \mathrm{μs}\left({\color{gray}3.52 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$312 \mathrm{ms} \pm 1.77 \mathrm{ms}\left({\color{lightgreen}-5.626 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$9.67 \mathrm{ms} \pm 85.0 \mathrm{μs}\left({\color{red}7.91 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$9.90 \mathrm{ms} \pm 63.6 \mathrm{μs}\left({\color{red}8.62 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.0 \mathrm{ms} \pm 68.4 \mathrm{μs}\left({\color{red}7.97 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$9.70 \mathrm{ms} \pm 81.6 \mathrm{μs}\left({\color{red}6.52 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$9.89 \mathrm{ms} \pm 77.2 \mathrm{μs}\left({\color{red}9.21 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$9.47 \mathrm{ms} \pm 76.6 \mathrm{μs}\left({\color{red}5.20 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$9.82 \mathrm{ms} \pm 96.1 \mathrm{μs}\left({\color{red}10.5 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$9.60 \mathrm{ms} \pm 71.7 \mathrm{μs}\left({\color{red}6.91 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$9.69 \mathrm{ms} \pm 69.3 \mathrm{μs}\left({\color{red}6.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$9.70 \mathrm{ms} \pm 84.4 \mathrm{μs}\left({\color{gray}-0.420 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$11.0 \mathrm{ms} \pm 83.7 \mathrm{μs}\left({\color{red}6.32 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$10.8 \mathrm{ms} \pm 85.3 \mathrm{μs}\left({\color{gray}4.24 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.0 \mathrm{ms} \pm 69.8 \mathrm{μs}\left({\color{red}7.22 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$10.9 \mathrm{ms} \pm 96.0 \mathrm{μs}\left({\color{gray}3.98 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$10.9 \mathrm{ms} \pm 87.6 \mathrm{μs}\left({\color{gray}4.32 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$10.9 \mathrm{ms} \pm 88.3 \mathrm{μs}\left({\color{red}5.38 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$10.7 \mathrm{ms} \pm 82.0 \mathrm{μs}\left({\color{gray}1.48 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$10.9 \mathrm{ms} \pm 84.2 \mathrm{μs}\left({\color{gray}2.89 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.1 \mathrm{ms} \pm 90.3 \mathrm{μs}\left({\color{red}7.09 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$6.30 \mathrm{ms} \pm 50.2 \mathrm{μs}\left({\color{gray}4.44 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$46.9 \mathrm{ms} \pm 299 \mathrm{μs}\left({\color{gray}1.70 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$88.7 \mathrm{ms} \pm 726 \mathrm{μs}\left({\color{gray}2.05 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$53.2 \mathrm{ms} \pm 491 \mathrm{μs}\left({\color{gray}2.26 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$60.7 \mathrm{ms} \pm 456 \mathrm{μs}\left({\color{gray}1.92 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$67.3 \mathrm{ms} \pm 605 \mathrm{μs}\left({\color{gray}2.72 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$72.1 \mathrm{ms} \pm 502 \mathrm{μs}\left({\color{gray}2.77 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$44.0 \mathrm{ms} \pm 252 \mathrm{μs}\left({\color{gray}3.41 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$64.9 \mathrm{ms} \pm 378 \mathrm{μs}\left({\color{gray}-1.836 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$49.9 \mathrm{ms} \pm 386 \mathrm{μs}\left({\color{gray}3.30 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$56.6 \mathrm{ms} \pm 442 \mathrm{μs}\left({\color{gray}1.86 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$57.0 \mathrm{ms} \pm 356 \mathrm{μs}\left({\color{gray}-0.186 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$57.2 \mathrm{ms} \pm 425 \mathrm{μs}\left({\color{gray}0.859 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$100 \mathrm{ms} \pm 638 \mathrm{μs}\left({\color{gray}-3.571 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$109 \mathrm{ms} \pm 640 \mathrm{μs}\left({\color{gray}-3.279 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$25.2 \mathrm{ms} \pm 185 \mathrm{μs}\left({\color{gray}2.45 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$400 \mathrm{ms} \pm 1.47 \mathrm{ms}\left({\color{gray}-4.692 \mathrm{\%}}\right) $$ Flame Graph

This branch was successfully deployed

4 active deployments
Preview – hash — d2aceffc Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut — d2aceffc Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut-docs — d2aceffc Deployed Dec 3, 2026 by vercel[bot]
Preview – hashdotdesign-tokens — d2aceffc Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps > hash.design Affects the `hash.design` design site (app) area/deps Relates to third-party dependencies (area) area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

3 participants