Skip to content

fix(frontend): navigation during open popover breaks closing animation#5080

Merged
jog1t merged 1 commit into
mainfrom
05-20-fix_frontend_navigation_during_open_popover_breaks_closing_animation
May 21, 2026
Merged

fix(frontend): navigation during open popover breaks closing animation#5080
jog1t merged 1 commit into
mainfrom
05-20-fix_frontend_navigation_during_open_popover_breaks_closing_animation

Conversation

@jog1t
Copy link
Copy Markdown
Contributor

@jog1t jog1t commented May 20, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 20, 2026

PR Review: Navigation During Open Popover Breaks Closing Animation

Summary

This PR adds a closeAnimation prop to PopoverContent, DropdownMenuContent, and DropdownMenuSubContent to allow immediate unmounting instead of waiting for exit animations. This fixes a UX bug where navigating during an open popover/dropdown causes the menu to linger while TanStack Router's async beforeLoad transition holds the old tree on-screen.


Strengths

  • Correct diagnosis: The root cause (Radix keeps the component mounted for its exit animation while Router holds the old tree) is accurately identified and documented in the inline comments.
  • Backward-compatible API: closeAnimation?: boolean defaults to true, so no existing callers are affected.
  • Consistent application: The prop is uniformly applied across all three component variants and all four affected call sites (context-switcher.tsx, user-dropdown.tsx).
  • Good inline documentation: Each usage site has a comment explaining why closeAnimation={false} is needed, which satisfies the "non-obvious WHY" comment convention.

Issues

Verify async beforeLoad on all navigated routes

The comments at each call site state that the route has an async beforeLoad. If any of those routes only have sync setup, the comment is misleading and the fix is unnecessary (though harmless). Worth a quick verification against the route definitions.

Missing test coverage

There are no tests verifying:

  • The closeAnimation prop defaults to true (backward compat)
  • The conditional Tailwind classes are correctly applied/omitted
  • The menu actually unmounts immediately when navigating (vs. lingering with animation)

Given the fix targets a timing interaction between Radix and the router, a test (even a simple Vitest snapshot or a component test) would help prevent regression.

Empty PR description

The PR body is unfilled (just the template). The code comments are thorough, but the PR description is the canonical place for future maintainers to understand motivation without reading each change. Please fill it in.


CLAUDE.md Conventions Check

Convention Status
Comments are complete sentences with proper punctuation
No new unnecessary imports
Follows existing patterns in neighboring files
No breaking changes

Performance / Security

  • Negligible performance impact (conditional class string concat).
  • No security implications (pure UI/CSS animation control).
  • The fix actually improves perceived performance by eliminating frozen/lingering UI during router transitions.

Verdict

Clean, well-reasoned fix. Safe to merge after:

  1. Confirming the relevant routes have async beforeLoad (or updating the comments if not)
  2. Filling in the PR description

Copy link
Copy Markdown
Contributor Author

jog1t commented May 21, 2026

Merge activity

  • May 21, 8:51 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 21, 8:59 PM UTC: Graphite rebased this pull request as part of a merge.
  • May 21, 8:59 PM UTC: @jog1t merged this pull request with Graphite.

@jog1t jog1t changed the base branch from 05-20-fix_frontend_hover_animation_on_project_cards_not_moving_billing_badge to graphite-base/5080 May 21, 2026 20:56
@jog1t jog1t changed the base branch from graphite-base/5080 to main May 21, 2026 20:57
@jog1t jog1t force-pushed the 05-20-fix_frontend_navigation_during_open_popover_breaks_closing_animation branch from cee0b4c to db1544d Compare May 21, 2026 20:58
@jog1t jog1t merged commit 6e43f3c into main May 21, 2026
8 of 11 checks passed
@jog1t jog1t deleted the 05-20-fix_frontend_navigation_during_open_popover_breaks_closing_animation branch May 21, 2026 20:59
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