fix(styles): UI/UX micro-interaction polish#552
Conversation
Add centralized motion tokens (durations, easings, spinner speed) to ds-tokens.css and apply them across 14 CSS files: button :active press feedback, modal/popover entrance animations, settings toggle spring animation, segmented control transitions, input focus transitions, consistent 0.7s spinner speed, pulse easing fix, transition:all cleanup, and a global prefers-reduced-motion rule.
The ds-popover-in keyframe was using the `transform` shorthand which overrides inline style transforms used for boundary-shift correction, causing popovers (e.g. sidebar sort menu) to clip off-screen. Switch to individual `translate` and `scale` properties which compose with `transform` instead of overriding it.
The blanket reduced-motion rule was killing spinner animations too, making loading states look frozen. Whitelist all spinner selectors so they keep rotating while decorative animations (entrances, pulses, shimmers, transitions) remain suppressed.
Replace per-option background swap with a ::before pseudo-element that physically slides between segments via translateX, giving spatial movement instead of a flat fade.
Code ReviewOverviewThis PR adds comprehensive motion design improvements to the UI, including:
Strengths
Issues & Concerns
Security ConcernsNone identified. Potential BugsNone identified. Test CoverageNo tests added for UI/animation changes. Recommendations
SummaryThis is a well-crafted PR that significantly improves the UX with thoughtful motion design. The accessibility consideration is excellent. The main areas for improvement are consistency in using design tokens and adding test coverage. Overall Assessment: Approve with minor suggestions |
Summary
Comprehensive micro-interaction polish pass across 14 CSS files. Centralizes motion timing/easing into design tokens and adds tactile feedback, entrance animations, and accessibility support.
ds-tokens.css:activescale-down + brightness/background responses for primary, ghost, icon buttonsjustify-contentswap withtranslateX+ spring easing for smooth knob slidevar(--ds-spinner-dur)(0.7s) instead of hard-coded 0.8–1stransition: allcleanup — replaced with explicit properties in sidebar, tabbar, compact-tablet, settingstranslate/scale) so inline boundary-shift transforms still applyprefers-reduced-motion— single rule inbase.csscovers all 47+ CSS files using the0.01mstrick to preserve JS event firing, with spinner whitelist to keep loading indicators functionalBefore / After
Send Button Press
Segmented Control Switch
Settings Toggle Switch
Modal Entrance
Thread Status Pulse
Spinner Speed
Popover Entrance
Files changed (14)
ds-tokens.cssbuttons.css:activepress states for all button typesds-modal.cssds-popover.csssettings.csstransition:allcleanupsidebar.csstransition:allcleanup, spinner tokenmessages.cssdiff.csscomposer.cssmain.csshome.csstabbar.csstransition:all→ explicit propertiescompact-tablet.csstransition:all→ explicit propertiesbase.cssprefers-reduced-motion: reducerule + spinner whitelistTest plan