Skip to content

Conversation

@Sharqiewicz
Copy link
Member

@Sharqiewicz Sharqiewicz commented Jan 22, 2026

📋 Summary
This PR adjusts the widget flow so clicking the Logo keeps navigation under the /widget route, and introduces a useReducedMotion hook to respect users’ reduced-motion preferences for animations.

🎯 Key Changes

  • Updates Logo click/redirect behavior so the widget flow stays scoped under /widget rather than bouncing to a broader app route.
  • Introduces useReducedMotion to detect reduced-motion preference and allow disabling/reducing animations accordingly.
  • Minor related UI behavior tweaks implied by the above routing + motion-preference integration (review for any side effects in navigation/animation defaults).

📛 Breaking changes: No.

🆙 Dependencies: No.

⚙️ Configuration: No.

✅ Review Focus Areas

  • Confirm all Logo entry points in the widget flow resolve to routes under /widget (including nested routes, query params, and back/forward browser navigation).
  • Verify useReducedMotion is wired to the correct animation/transition paths and that “reduced motion” mode results in usable UI (no missing state changes that were previously animation-driven).
  • Check edge cases: deep-linked widget pages, refresh-on-subroute, and any place where absolute navigation might still escape /widget (e.g., hardcoded links or redirects).

@netlify
Copy link

netlify bot commented Jan 22, 2026

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 580c2ea
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/697d026cf2605a00083c23c0
😎 Deploy Preview https://deploy-preview-1028--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 22, 2026

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 580c2ea
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/697d026c09699a0007fa776c
😎 Deploy Preview https://deploy-preview-1028--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Sharqiewicz Sharqiewicz changed the title draft: add new components stories ready: Change Logo redirect behaviour to stay under /widget in the widget flow + introduce useReducedMotion Jan 22, 2026
@Sharqiewicz Sharqiewicz marked this pull request as ready for review January 22, 2026 10:02
@Sharqiewicz Sharqiewicz requested review from ebma and gianfra-t January 22, 2026 10:05
@Sharqiewicz
Copy link
Member Author

The main purpose of the PR is what we discussed: when user is in the /widget flow and clicks on "Vortex" then they're going to stay under /widget and the flow resets.
In addition to this PR I implemented useReducedMotion

@Sharqiewicz Sharqiewicz changed the title ready: Change Logo redirect behaviour to stay under /widget in the widget flow + introduce useReducedMotion [READY] Change Logo redirect behaviour to stay under /widget in the widget flow + introduce useReducedMotion Jan 29, 2026
@ebma ebma requested a review from Copilot January 30, 2026 16:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request introduces reduced-motion accessibility support across the frontend application and modifies the Logo click behavior to keep navigation within the /widget route when in widget mode.

Changes:

  • Integrates useReducedMotion hook from framer-motion across 13 animation components to respect users' motion preferences
  • Updates Logo redirect behavior to navigate to /{-$locale}/widget when in widget mode (instead of always going to root)
  • Adds balanceUsd field to AssetHubTokenDetailsWithBalance interface with placeholder "0.00" values
  • Introduces standardized animation constants (easings, durations) in constants/animations.ts
  • Improves performance by replacing transition-all with specific transition properties
  • Adds comprehensive Storybook stories for 7 components demonstrating reduced motion support
  • Enhances type safety in API controllers with proper generic type parameters

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/shared/src/tokens/types/assethub.ts Adds balanceUsd field to AssetHubTokenDetailsWithBalance interface
apps/frontend/src/hooks/useOnchainTokenBalances.ts Updates all balance initialization to include balanceUsd field
apps/frontend/src/constants/animations.ts Adds standardized easing curves, durations, and animation variants
apps/frontend/src/components/Navbar/hooks/useNavbarHandlers.ts Updates logo navigation to respect widget mode context
apps/frontend/src/components/Navbar/index.tsx Adds z-index to header for proper layering
apps/frontend/src/components/menus/Menu/index.tsx Integrates useReducedMotion for accessible menu animations
apps/frontend/src/components/TokenSelection/** Adds reduced motion support to network/token selection animations
apps/frontend/src/components/TermsAndConditions/index.tsx Implements reduced motion for terms acceptance animations
apps/frontend/src/components/Stepper/** Updates stepper animations with reduced motion and specific transitions
apps/frontend/src/components/RampToggle/index.tsx Adds reduced motion support for toggle indicator animation
apps/frontend/src/components/KycLevel2Toggle/index.tsx Implements reduced motion for document type toggle
apps/frontend/src/components/CollapsibleCard/index.tsx Refactors to use grid-template-rows animation with reduced motion
apps/frontend/src/components/Accordion/index.tsx Removes layout animations and adds reduced motion support
apps/frontend/src/components/Navbar/MobileMenu.tsx Updates mobile menu with reduced motion variants
apps/frontend/src/components/Avenia/** Adds reduced motion to KYC flow animations
apps/frontend/src/components/EmailForm/index.tsx Replaces transition-all with specific properties
apps/frontend/src/stories/** Adds 7 new Storybook stories with reduced motion test cases
apps/frontend/.storybook/main.ts Removes unnecessary type annotation
apps/api/src/api/controllers/** Enhances type safety with proper Request generic parameters
Comments suppressed due to low confidence (2)

apps/frontend/src/components/Navbar/MobileMenu.tsx:107

  • When reduced motion is enabled, the parent motion.div uses reducedMotionVariants but the child elements (lines 79, 93, 107) still use menuItemVariants and buttonVariants which include animations. Since the parent doesn't have staggerChildren in reduced motion mode, the child animations will still execute. Consider either passing shouldReduceMotion down and conditionally using simpler variants for children, or ensure child variants also respect reduced motion by checking the parent's animation state.
      variants={shouldReduceMotion ? reducedMotionVariants : menuVariants}
    >
      <nav className="group flex flex-col px-6 py-4">
        <motion.div variants={menuItemVariants}>
          <Link
            activeProps={{
              className: "text-white group-hover:[&:not(:hover)]:text-gray-400"
            }}
            className="block w-full px-2 py-3 text-left text-gray-400 text-xl transition-colors hover:text-white"
            onClick={onMenuItemClick}
            params={params}
            to="/{-$locale}"
          >
            {t("components.navbar.individuals")}
          </Link>
        </motion.div>

        <motion.div variants={menuItemVariants}>
          <Link
            activeProps={{
              className: "text-white group-hover:[&:not(:hover)]:text-gray-400"
            }}
            className="block w-full px-2 py-3 text-left text-gray-400 text-xl transition-colors hover:text-white"
            onClick={onMenuItemClick}
            params={params}
            to="/{-$locale}/business"
          >
            {t("components.navbar.business")}
          </Link>
        </motion.div>

        <motion.div className="mt-6 mb-4" variants={buttonVariants}>

apps/frontend/src/components/TermsAndConditions/index.tsx:33

  • The fadeOutAnimation object (lines 15-19) is used in the exit animation at line 33, but it doesn't check for reduced motion preferences. When users have reduced motion enabled, the exit animation should be instant. Consider conditionally applying this animation based on useReducedMotion() hook, similar to how other animations in this component are handled.
const fadeOutAnimation = {
  opacity: [1, 1, 0],
  scale: [1, 1.05, 0],
  transition: { duration: durations.slow, ease: easings.easeOutCubic }
};

export const TermsAndConditions = (props: TermsAndConditionsProps) => {
  const { termsAccepted } = props;

  return <AnimatePresence mode="wait">{!termsAccepted && <TermsAndConditionsContent {...props} />}</AnimatePresence>;
};

const TermsAndConditionsContent = ({
  toggleTermsChecked,
  setTermsError,
  termsChecked,
  termsError
}: TermsAndConditionsProps) => (
  <motion.div exit={fadeOutAnimation} key="terms-conditions">

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

)}
</AnimatePresence>
<div
className={`grid transition-[grid-template-rows] duration-150 ease-out ${className || ""}`}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS class uses hardcoded duration-150 but the animation durations should respect reduced motion preferences. When prefers-reduced-motion is enabled, the CSS transition should also be instant. Consider adding the motion-reduce:transition-none utility class to the div at line 15-18.

Suggested change
className={`grid transition-[grid-template-rows] duration-150 ease-out ${className || ""}`}
className={`grid transition-[grid-template-rows] duration-150 ease-out motion-reduce:transition-none ${className || ""}`}

Copilot uses AI. Check for mistakes.
)}
</AnimatePresence>
<div
className={`grid transition-[grid-template-rows] duration-300 ease-out ${className}`}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS class uses hardcoded duration-300 but should respect reduced motion preferences. Consider adding the motion-reduce:transition-none utility class to ensure the grid-template-rows transition is also instant when users have reduced motion enabled.

Suggested change
className={`grid transition-[grid-template-rows] duration-300 ease-out ${className}`}
className={`grid transition-[grid-template-rows] duration-300 ease-out motion-reduce:transition-none ${className}`}

Copilot uses AI. Check for mistakes.
)}
</AnimatePresence>
<div
className="grid transition-[grid-template-rows] duration-300 ease-out"
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS class uses hardcoded duration-300 but should respect reduced motion preferences. Consider adding the motion-reduce:transition-none utility class to ensure the grid-template-rows transition is also instant when users have reduced motion enabled.

Suggested change
className="grid transition-[grid-template-rows] duration-300 ease-out"
className="grid transition-[grid-template-rows] duration-300 ease-out motion-reduce:transition-none"

Copilot uses AI. Check for mistakes.

export const Navbar = () => (
<header className="relative">
<header className="relative z-60">
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

z-60 is not a standard Tailwind CSS utility class. Tailwind's default z-index scale includes z-0, z-10, z-20, z-30, z-40, z-50, and z-auto, but not z-60. If this is intended to be a custom z-index value, it should be defined in the Tailwind config file. Otherwise, consider using z-50 or defining a custom value in the Tailwind configuration.

Suggested change
<header className="relative z-60">
<header className="relative z-50">

Copilot uses AI. Check for mistakes.
Comment on lines 19 to 20
fast: 0.15, // 100ms - micro-interactions (hover states)
micro: 0.1, // 150ms - tooltips, dropdowns
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment for durations.fast states "100ms" but the value is 0.15 which equals 150ms. Similarly, durations.micro states "150ms" but has value 0.1 which equals 100ms. These comments appear to be swapped.

Suggested change
fast: 0.15, // 100ms - micro-interactions (hover states)
micro: 0.1, // 150ms - tooltips, dropdowns
fast: 0.1, // 100ms - micro-interactions (hover states)
micro: 0.15, // 150ms - tooltips, dropdowns

Copilot uses AI. Check for mistakes.
};

const InteractiveDemo = () => {
const [openItems, setOpenItems] = useState<string[]>(["item-1"]);
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable setOpenItems.

Suggested change
const [openItems, setOpenItems] = useState<string[]>(["item-1"]);
const [openItems] = useState<string[]>(["item-1"]);

Copilot uses AI. Check for mistakes.
shouldReduceMotion
? { duration: 0 }
: {
delay: isOpen ? durations.fast : 0,
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This use of variable 'isOpen' always evaluates to true.

Suggested change
delay: isOpen ? durations.fast : 0,
delay: durations.fast,

Copilot uses AI. Check for mistakes.
@ebma
Copy link
Member

ebma commented Jan 30, 2026

@copilot please address the changes of this review in a different PR.

Copy link
Contributor

Copilot AI commented Jan 30, 2026

@ebma I've opened a new pull request, #1050, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits January 30, 2026 18:00
…ect animation durations, and cleanup unused vars

Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Address code review feedback: accessibility, z-index fix, and cleanup
@ebma ebma merged commit a48b406 into staging Jan 30, 2026
1 check passed
@ebma ebma deleted the chore/change-logo-redirect branch January 30, 2026 19:12
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.

3 participants