Stop the content pane flashing its background on a dialog swap

Merged
FR
2mo ago
+60-49

What & why

Follow-up to #489. That fix stopped the Radix overlay re-fading on an in-place dialog swap, but a background flash remained. The real remaining cause: each per-kind detail view (tweet, article, note, video, …) is wrapped in its own motion.div with initial={{ opacity: 0 }} → animate={{ opacity: 1 }} — a fade that's separate from the frame's animateEntrance. On a swap, the new item's content faded in from transparent, briefly exposing the dark bg-gray-900 content pane behind it (the div the reporter isolated).

Gate those inner fades on animateEntrance too, so a swap shows content instantly while a fresh open still fades in. Image panes already use initial={false} (they morph via layoutId), so they're unaffected.

Checklist

  • User-facing change → PostHog event, or N/A — pure animation fix
  • New error paths report via captureServerException / the error boundary, or N/A
  • New behavior is covered by tests, or N/A — visual/animation only (jsdom has no layout engine)
  • If this fixes a recurring defect, considered a guardrail, or N/A

Notes

Diagnosed from the DOM the reporter isolated: the bg-gray-900 pane's inner bg-background wrapper carried style="opacity: …", i.e. a framer fade. Please confirm on deploy.


Summary by cubic

Stops the detail pane from flashing its background when a dialog swaps in place. The per-kind content views no longer fade in on a swap, because their entrance fade is now gated on animateEntrance; fresh opens still fade. The fade logic is centralized in DetailPaneFade, and image panes are unaffected.