Skip to content

Conversation

@Recxsmacx
Copy link

@Recxsmacx Recxsmacx commented Dec 26, 2025

fixes #4566
https://github.com/user-attachments/assets/3d40af93-6e61-4652-b742-a8ffaf90ce33

Summary by CodeRabbit

  • Improvements
    • Accordion panels now expand/collapse with smooth height-based transitions for a more fluid animation experience.
    • The expand/collapse indicator uses a continuous rotation animation for clearer state feedback.
    • Content remains mounted during transitions to preserve layout and reduce visual flicker.

✏️ Tip: You can customize this high-level summary in your review settings.

@netlify
Copy link

netlify bot commented Dec 26, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a3f1e77
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69539fc4b355d50008907e2a
😎 Deploy Preview https://deploy-preview-4783--asyncapi-website.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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

📝 Walkthrough

Walkthrough

The AccordionItem component now measures its content height via a contentRef and stores it in contentHeight. Expand/collapse is animated by adjusting an overflow-hidden container's maxHeight and rotating a single SVG icon with CSS transforms, replacing conditional mounting of content.

Changes

Cohort / File(s) Summary
Accordion animation refactor
components/Accordion/AccordionItem.tsx
Adds contentRef and contentHeight state; useEffect updates height on isActive. Replaces conditional SVG/icon rendering with one SVG rotated via CSS. Keeps content mounted inside an overflow-hidden container whose maxHeight is set for height-based animation; inner div holds the measured content. Click handling unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I measured the heights with a twitch of my nose,
Then rotated my arrow where soft motion grows.
No mounts or unmounts, just a gentle slide—
A rabbit's small clap for the accordion's glide!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately reflects the main change: adding smooth transitions to the FAQ accordion component for improved user experience.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 26, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4783--asyncapi-website.netlify.app/

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6521774 and fa37618.

📒 Files selected for processing (1)
  • components/Accordion/AccordionItem.tsx
🧰 Additional context used
🪛 GitHub Actions: PR testing - if Node project
components/Accordion/AccordionItem.tsx

[error] 45-45: Prettier formatting issue detected. Run 'prettier --write' to fix code style in this file.

⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
🔇 Additional comments (3)
components/Accordion/AccordionItem.tsx (3)

26-27: LGTM!

Good approach using a ref to measure the actual content height and state to drive the CSS transition.


35-39: LGTM!

The effect correctly recalculates height on active state change. For static FAQ content, this works well.

Note: If the accordion content ever becomes dynamic (e.g., async-loaded), you may need to add a ResizeObserver to handle content size changes while expanded.


57-67: LGTM!

Clean implementation of height-based animation. The structure correctly separates the animated container (with overflow-hidden and maxHeight) from the inner content div that holds the ref for height measurement.

Comment on lines +46 to +54
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9'
stroke='#556061'
stroke-width='1.5'
stroke-linecap='round'
stroke-linejoin='round'
/>
</svg>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use camelCase for SVG attributes in JSX.

React requires camelCase for SVG attributes. The kebab-case attributes will cause React warnings in the console.

🔎 Proposed fix
          <svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
            <path
              d='M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9'
              stroke='#556061'
-              stroke-width='1.5'
-              stroke-linecap='round'
-              stroke-linejoin='round'
+              strokeWidth='1.5'
+              strokeLinecap='round'
+              strokeLinejoin='round'
            />
          </svg>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9'
stroke='#556061'
stroke-width='1.5'
stroke-linecap='round'
stroke-linejoin='round'
/>
</svg>
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path
d='M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9'
stroke='#556061'
strokeWidth='1.5'
strokeLinecap='round'
strokeLinejoin='round'
/>
</svg>
🤖 Prompt for AI Agents
In components/Accordion/AccordionItem.tsx around lines 46 to 54, the SVG uses
kebab-case attributes (stroke-width, stroke-linecap, stroke-linejoin) which
React warns about; change them to camelCase (strokeWidth, strokeLinecap,
strokeLinejoin) and keep other attributes (width, height, viewBox, fill, xmlns)
unchanged, then rebuild/lint to ensure no more JSX SVG attribute warnings.

@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1089dbc) to head (a3f1e77).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4783   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          798       798           
  Branches       146       146           
=========================================
  Hits           798       798           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@princerajpoot20
Copy link
Member

@Recxsmacx Please don’t ignore the PR description template.
You haven’t mentioned the related issue. Once the PR is merged, the issue will not be closed automatically, and it will also be difficult for us to track as well.
Hence, please follow the template that is provided. It is there for a reason.

@Recxsmacx
Copy link
Author

@princerajpoot20 Sure !! mentioned the issue number will take care in future

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.

[BUG] Faq sliders are not smooth and effecting the rest of the components

3 participants