feat(ui): motion & micro-interactions, prefers-reduced-motion aware (LC-196) #247
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-196-motion"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
LC-196: tasteful motion + a
prefers-reduced-motion: reducekill switch.CSS (server/assets/main.css)
Keyframes:
lc-fade-in,lc-scale-in,lc-slide-up,lc-shimmer,lc-spin.Helpers:
.lc-anim-swap- opt-in fade-in via htmx's.htmx-addedsettle class. Adding the class to a server-rendered element does NOT animate on initial page render (no htmx-added present); it animates only on OOB-swapped re-arrival, so backfill stays calm and live updates are gently announced..lc-skeleton- shimmering placeholder block, sized by parent..lc-spinner- small rotating ring; pairs with htmx's.htmx-indicator(parent gains.htmx-requestwhile in-flight, indicator becomes visible).Component motion baked into LC-195 vocabulary:
.toastslides up on insert,.modal-panelscales in,.modal-backdropfades in. Existing places that use these classes (poll_modal.html,scheduled_modal.html,reminders/picker.html) animate for free, no template change.Reduced-motion
A single universal
@media (prefers-reduced-motion: reduce)rule sets alltransition-durationandanimation-durationto0.001ms !importantand pinsscroll-behavior: auto. Kept non-zero (per the a11y-project convention) so JS listeners ontransitionend/animationendstill fire. Tailwind'smotion-safe:/motion-reduce:variants still compose on top.Adopted
server/templates/room/message.html: both message rows (system + regular) getlc-anim-swap, so new messages arriving over the WS fade in.<span class="htmx-indicator lc-spinner" aria-hidden="true">inside the button so the spinner appears beside the label while the POST is in flight. The.btngap-1.5from LC-195 spaces it correctly.Tests
lc-anim-swapclass on the message div (only delta: one extra class token in the row'sclass=).just testandjust test-saasboth green.Pre-existing CI noise on
main(not introduced here): clippyclippy::too_many_argumentsonresolve_msg_authorinserver/src/routes/mod.rs:154, andcargo fmtdrift inserver/tests/spike_image_decoder_hostile_corpus.rs:138. Goes to LC-187 (the standing Check-workflow issue).Still to come under LC-189
🤖 Generated with Claude Code