Skip to content

Animate Hide Later Items with a paced staggered reveal - #225

Merged
MaplumeX merged 2 commits into
mainfrom
feat/redesign-snoozed-items-transition-animations
Oct 13, 2026
Merged

MaplumeX merged 2 commits into
mainfrom
feat/redesign-snoozed-items-transition-animations

Conversation

@MaplumeX

Copy link
Copy Markdown
Owner

What

Gives the Hide Later Items toggle a deliberate reveal rhythm instead of an instant layout swap: hidden rows collapse (fading out before the height closes, so text never looks squashed), revealed rows first open their space and then fade in, and newly revealed rows flash a brief tint so it's clear which items just came back.

Changes

  • lib/laterReveal.ts (new) — single source of truth for the reveal pacing: revealExitOpacity() (opacity reaches 0 at 60% of the progress), revealEnterOpacity() (opacity starts rising at 30%), and flashRevealedRows(), which plays a short --primary-tinted background flash on the affected [data-selection-row] elements and fades back to each row's current background.
  • lib/dnd.ts — useFlipList exposes a new captureReveal() that snapshots the DOM before the toggle re-renders and marks the snapshot as reveal. Exit/enter animations then use the slightly different opacity keyframes and, critically, bypass the MAX_ENTER_EXIT cap — a single toggle can legitimately move many rows at once.
  • components/ui/collapse.tsx — new reveal prop applies the paced opacity keyframes to the height animation; new onOpen(element) callback fires when the expand animation starts (content already mounted), which lets callers kick off the row flash at the right moment.
  • components/project/ProjectTaskLayout.tsx — calls captureReveal() on the render where the Later-items state flips, keyed off a hidingLater ref. taskMap now also includes the hidden source tasks so rows still exist in the DOM and can play their FLIP exit rather than disappearing a frame early. hasContent is recomputed from the visible tasks plus draft/headings, so a project whose Later items are all hidden renders the empty state correctly.
  • pages/AreaDetail.tsx — wraps LaterItemSections in <Collapse reveal onOpen={flashRevealedRows}>, keyed by area id so switching areas doesn't animate. Spacing moves into pt/-mt so the gap collapses with the height instead of jumping on unmount.
  • components/common/LaterItemsToggle.tsx — the label fades in on toggle via a keyed span.

Tests

  • dnd.test.tsx: reveal-mode ghost fade-out keyframes, delayed enter fade-in with row highlight, no highlight on untouched rows, and no MAX_ENTER_EXIT cap when revealing.
  • collapse.test.tsx: reveal keyframes for both directions and the onOpen callback contract.
  • ProjectTaskLayout.test.tsx: end-to-end hide/show of a Later task, asserting the ghost exit and the paced re-entry of the revealed row.

@MaplumeX
MaplumeX merged commit 96d67b0 into main Oct 13, 2026
4 checks passed
@MaplumeX
MaplumeX deleted the feat/redesign-snoozed-items-transition-animations branch October 13, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant