Skip to content

FE-1048: Petrinaut use ds toggle#8891

Merged
alex-e-leon merged 3 commits into
mainfrom
FE-1048-petrinaut-use-ds-toggle
Jun 24, 2026
Merged

FE-1048: Petrinaut use ds toggle#8891
alex-e-leon merged 3 commits into
mainfrom
FE-1048-petrinaut-use-ds-toggle

Conversation

@alex-e-leon

Copy link
Copy Markdown
Contributor

🌟 What is the purpose of this PR?

Replaces Toggle in Petrinaut with toggle from the DS
@kube, the new Toggle has a few new tones(colors): neutral + brand, with neutral being the default - I've switched over a couple of the toggles to be neutral as a result, in particular, where the toggle behaves more like a form element rather than a setting, or where the success (green) variation felt too heavy/distracting.

The one controversial change in tone is likely in the user-settings dialog, since there are so many toggles on that dialog, making them neutral felt less visually distracting than all success.

Let me know if you prefer me to change any of the tones, and any other feedback also appreciated.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

@alex-e-leon alex-e-leon requested a review from kube June 22, 2026 11:34
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jun 24, 2026 12:50pm
hashdotdesign-tokens Ready Ready Preview, Comment Jun 24, 2026 12:50pm
petrinaut Ready Ready Preview, Comment Jun 24, 2026 12:50pm

@cursor

cursor Bot commented Jun 22, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Removes a published DS export (Switch) and changes boolean control APIs and visuals across many editor surfaces; behavior should be equivalent but tone/size choices affect UX consistency.

Overview
Removes the standalone Switch component from @hashintel/ds-components (and its public export) and deletes Petrinaut’s tooltip-wrapping Switch wrapper. Petrinaut now uses Toggle everywhere boolean controls appeared—simulation settings, place properties, scenario forms, experiment metrics, and viewport settings.

Call sites move from checked / onCheckedChange to value / onChange, with explicit size (often xs or sm) and tone="success" where feature toggles should read as “on” (e.g. dynamics, visualizer, scenario initial-state options). Settings-heavy dialogs use the default neutral tone. Where tooltips used to live on the old wrapper, they are applied with Tooltip around Toggle when needed.

toggle.recipe.ts is adjusted for the migration: slightly tighter padding and inset border via box-shadow, smaller thumbs on xxs/xs, lighter thumb shadows on small sizes, and invalid styling expressed with box-shadow instead of border-only.

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

@github-actions github-actions Bot added 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 Jun 22, 2026

@kube kube left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alignment

The thumbs are not properly aligned with the "rail":

Image

Green vs Dark Gray

I personally prefer green for enablement, but this is just my opinion.

Image

Would be worth checking with designers.
If you did it already, go with the dark gray.

"Refraction"

Refraction was already removed, now we remove the transform while dragging.

I wonder how we'll put refraction back.

@kube kube left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perfect thanks!

@alex-e-leon alex-e-leon added this pull request to the merge queue Jun 24, 2026
Merged via the queue into main with commit 0eea201 Jun 24, 2026
47 checks passed
@alex-e-leon alex-e-leon deleted the FE-1048-petrinaut-use-ds-toggle branch June 24, 2026 13:44
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/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.

2 participants