Skip to content

Conversation

@divv919
Copy link

@divv919 divv919 commented Nov 11, 2025

Description

This change is only for UI UX purpose , no functionality is changed or added.
Fixed the Accordian transition by adding style properties max height and opacity , which makes the item visible only when it is active, this styling change allows a smooth transition to take place

Related issue(s)
Fixes #4566

Summary by CodeRabbit

  • New Features
    • Accordion items now feature smooth expand/collapse animations, enhancing the user experience with polished visual transitions when opening or closing sections.

@netlify
Copy link

netlify bot commented Nov 11, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 28bfa3b
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/6912e09986d5a7000796ebda
😎 Deploy Preview https://deploy-preview-4569--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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Nov 11, 2025

We require all PRs to follow Conventional Commits specification.
More details 👇🏼

 The subject "Add smooth transition on Accordian" found in the pull request title "fix: Add smooth transition on Accordian" should start with a lowercase character.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

The AccordionItem component now always renders the content area but controls visibility through dynamic CSS classes instead of conditional rendering. This enables smooth height and opacity transitions when expanding or collapsing accordion items, fixing animation jankiness reported in the linked issue.

Changes

Cohort / File(s) Summary
Accordion Animation Refactor
components/Accordion/AccordionItem.tsx
Changed content visibility from conditional rendering to CSS class toggling. Content div always renders with max-h-0 opacity-0 py-0 when inactive and max-h-40 opacity-100 py-2 when active. Adds overflow-hidden duration-300 ease-in-out transition for smooth expand/collapse animation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modification with focused, straightforward logic
  • Animation pattern is consistent and applies uniform styling rules
  • Change is well-scoped to a specific UI component behavior
  • Requires validation that CSS classes produce smooth transitions without layout shift or affecting other components

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • sambhavgupta0705
  • anshgoyalevil
  • Mayaleeeee

Poem

🐰 Smooth as clover, slick as spring,
No more jitter in accordion's swing,
CSS classes dance and play,
Gliding open, tucked away!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: Add smooth transition on Accordian' describes the main change—adding smooth transitions to the accordion component. However, it contains a spelling error ('Accordian' should be 'Accordion'), and per Conventional Commits lint, the subject should start with lowercase. Consider correcting the spelling to 'Accordion' and ensure the subject 'Add smooth transition on Accordion' starts with lowercase to comply with Conventional Commits specification.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #4566 by implementing smooth transitions on FAQ accordion items through CSS animations with max-height, opacity, and transition properties.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to the AccordionItem component's styling to fix the transition issue reported in #4566, with no unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@divv919
Copy link
Author

divv919 commented Nov 11, 2025

fix-faq-section.mp4

@asyncapi-bot
Copy link
Contributor

⚡️ Lighthouse report for the changes in this PR:

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

Lighthouse ran on https://deploy-preview-4569--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

🧹 Nitpick comments (2)
components/Accordion/AccordionItem.tsx (2)

60-64: Consider adding aria-hidden for accessibility.

The content is always in the DOM but visually hidden when inactive. Screen readers may still announce it.

-      {
-        <div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-40 opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
+      <div
+        className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${
+          isActive ? 'max-h-screen opacity-100 py-2' : 'max-h-0 opacity-0 py-0'
+        }`}
+        aria-hidden={!isActive}
+      >
         {content}
       </div>
-      }

60-64: Remove unnecessary curly braces.

The wrapping { } on lines 60 and 64 serve no purpose and reduce readability.

-      {
-        <div className={`...`}>
+      <div className={`...`}>
          {content}
        </div>
-      }
📜 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 406151e and 28bfa3b.

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

[error] 61-61: Prettier formatting issue. Replace the long className string with a formatted multi-line expression. Run 'prettier --write' to fix code style.

⏰ 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

{isActive && (
<div className='rounded-sm border-t border-gray-200 py-2 font-body font-regular text-gray-700 antialiased'>
{
<div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-40 opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
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 | 🔴 Critical

Critical: max-h-40 will truncate content exceeding 160px.

The fixed max-h-40 class (160px) will clip FAQ answers longer than that height, breaking the user experience. FAQ content varies significantly in length.

Use max-h-screen or a sufficiently large value instead:

-        <div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-40 opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
+        <div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-screen opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
📝 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
<div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-40 opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
<div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-screen opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
🧰 Tools
🪛 GitHub Actions: PR testing - if Node project

[error] 61-61: Prettier formatting issue. Replace the long className string with a formatted multi-line expression. Run 'prettier --write' to fix code style.

🤖 Prompt for AI Agents
In components/Accordion/AccordionItem.tsx around line 61, the hardcoded class
max-h-40 (160px) will truncate longer FAQ answers; replace it with a much larger
max-height such as max-h-screen (or a large explicit value like max-h-[1000px])
so content is not clipped when expanded, keeping the existing transition/opacity
classes intact and ensuring the expanded state uses the new max-h class instead
of max-h-40.

⚠️ Potential issue | 🟠 Major

Fix Prettier formatting violation.

The pipeline flagged this line for exceeding length limits. Break the className into multiple lines.

-        <div className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${isActive ? 'max-h-40 opacity-100 py-2' : 'max-h-0 opacity-0 py-0'}`}>
+        <div
+          className={`rounded-sm border-t border-gray-200 font-body font-regular text-gray-700 antialiased overflow-hidden transition-all duration-300 ease-in-out ${
+            isActive ? 'max-h-screen opacity-100 py-2' : 'max-h-0 opacity-0 py-0'
+          }`}
+        >
           {content}
         </div>

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 GitHub Actions: PR testing - if Node project

[error] 61-61: Prettier formatting issue. Replace the long className string with a formatted multi-line expression. Run 'prettier --write' to fix code style.

🤖 Prompt for AI Agents
In components/Accordion/AccordionItem.tsx around line 61, the single-line JSX
className exceeds Prettier's line-length limit; break the className string into
multiple concatenated/template segments or multiline JSX expression so each line
is shorter. Reformat the div's className prop across multiple lines (group
static classes on one or more lines and the conditional part on its own line),
keeping the same classes and ternary logic, ensuring indentation aligns with JSX
and Prettier will accept the wrapped lines.

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

2 participants