Repository navigation
feat(studio): make edit with framey stand out in the header - #5019
Conversation
Wenbo's feedback: the button read like the ghost controls beside it. It now wears an accent tint and border, a larger Framey and a permanent New badge, and pulses three times as Studio opens (none under reduced motion).
jrusso1020
left a comment
There was a problem hiding this comment.
Approving at da0567b. Two files, Studio only.
The pulse.
- It's pure CSS:
.hf-framey-trigger { animation: hf-framey-pulse 1.6s ease-out 3 }. A finite iteration count stops on its own, with no timer, listener or state to leak. - The ring is a
box-shadow, so layout doesn't move.buttonBase'stransition-[…]list leaves out box-shadow, so nothing fights the keyframes. - Reduced motion:
.hf-framey-triggeris added to the existing@media (prefers-reduced-motion: reduce)block. The block comes after the base rule and has the same specificity, soanimation: nonewins. As a media query, it also takes effect immediately if the setting changes while Studio is open. - It plays once when the button mounts, which is after the route GET resolves. The button doesn't remount on press or while opening, so it doesn't replay.
No pulse on a dead button. The gating from #4999 on main is unchanged. useDesktopRoute returns null unless available is true and there's either a hand-off or a download URL.
- Windows:
handoffis false (not darwin) and there's no download URL, so the button doesn't render and nothing pulses. - Linux: the press opens the download card.
- macOS: the press hands off, or falls back to the download card.
Contrast. I computed WCAG ratios from the theme.css oklch tokens:
- Label
text-0onbg-surfaceplus the 10% accent tint: 15.1 light, 11.2 dark. On hover (20%): 13.2 light, 8.7 dark. - "New" badge (
on-accentonaccent): 4.85 light, 10.9 dark. That's the same pair as the filled Export button and passes AA for small text. - The 40% accent border is about 1.7 light and 2.7 dark. That's fine, since the tint and the label already mark the button.
cn puts the caller's classes after the ghost variant's, so bg-accent/10, enabled:hover:bg-accent/20, font-semibold and text-text-0 replace the ghost ones instead of stacking. Locally, the OpenInDesktopButton, StudioHeader and Button tests pass (28/28). CI was still running when I posted, with nothing failed.
Nits, none blocking:
- The badge text is part of the button's accessible name, so screen readers now read "Edit with Framey New". If that's not what you want, add
aria-hiddento the badge. data-[preview-state=hover](the gallery-only screenshot state) still uses the ghost'sbg-hover, so a gallery shot of the hovered state won't match the realbg-accent/20hover.
Keeping the "New" badge permanently is a product decision, not a defect.
— Rames
Edit accuracy: accurate 1556 (base branch 1556), smooth 1283 of thoseThe gate passes. Quarantined, measured but not gated (0) |
What
"Edit with Framey" in the Studio header stands out instead of reading like the ghost controls beside it:
prefers-reduced-motion.Export stays the only filled button.
Why
Wenbo's feedback on #4951: the button was easy to miss next to Window and the theme toggle, and it is the way into editing by chat with Framey.
Related work
Refs #4951, #4999.
How
Classes on the existing
Buttonplus one@keyframesincomponents.cssnext to Framey's wiggle and flight. The ring is abox-shadow, so it does not move the layout. No new state.Before
After
Test plan
OpenInDesktopButton.dom.test.tsx(7) passes; lint, format, typecheck and fallow pass in pre-commit.