Skip to content

Smooth FAQ accordion open/close animation - #3997

Merged
zamanafzal merged 2 commits into
mainfrom
zafzal/13284-faq-accordion-transition
Sep 28, 2026
Merged

zamanafzal merged 2 commits into
mainfrom
zafzal/13284-faq-accordion-transition

Conversation

@zamanafzal

@zamanafzal zamanafzal commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What are the relevant tickets?

https://github.com/mitodl/hq/issues/13284

Follow-up to the FAQ product-page feature (merged in #3954 / #3969). Addresses @mbilalmughal's feedback (relaying @steven-hatch) that the accordion content shifts slightly on expand and the transition feels abrupt — asking for a smoother, slightly slower animation: https://github.com/mitodl/hq/issues/13284#issuecomment-5865435081

Description (What does it do?)

Polishes the FAQ accordion open/close animation on course & program product pages.

  • Sets a fixed 250ms panel transition (slotProps={{ transition: { timeout: 250 } }}) so the open/close speed is consistent and a touch slower than MUI's default "auto", for a smoother, more natural feel.

Screenshots (if appropriate):

[attach screenshots — closed vs. open FAQ]

How can this be tested?

Setup — add FAQs in MITx Online (Wagtail admin):

  1. Go to the MITx Online CMS (http://mitxonline.odl.local:8013/cms/ on your MITx Online instance) and sign in.
  2. Pages → navigate to the Course or Program page you want to test, and click Edit.
  3. Scroll to the FAQs section → click Add FAQs → fill in a Question and an Answer (the answer is rich text, so bold/links work). Add 2–3 entries.
  4. Publish the page.

Verify on MIT Learn:

  • Open that product page on MIT Learn (e.g. /courses/course-v1:…) and scroll to FAQs.
  • Click a question → the answer panel expands smoothly over a consistent ~250ms (a touch slower than before) and collapses at the same speed.
  • The question turns red with a − icon when open; the question→answer gap is 16px when open and rows keep 24px spacing when closed.
  • Toggle several rows open/closed → the open/close speed stays consistent across all of them.

Use a fixed 250ms panel transition so open/close speed is consistent and
a touch slower than MUI's default "auto", addressing feedback that the
expansion felt abrupt. Also document the 16px-open / 24px-closed
question-to-answer spacing and why the summary-content margin has no CSS
transition (Chrome leaves it stuck at the start value on first expand).
Copilot AI balanced review requested due to automatic review settings September 28, 2026 10:16
@zamanafzal
zamanafzal requested a review from a team as a code owner September 28, 2026 10:16
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused animation change is valid and introduces no correctness issues.

Review effort: Balanced
Findings: None

What changed in this PR

Polishes FAQ accordions with consistent, smoother expansion and spacing.

Changes:

  • Sets a fixed 250ms accordion transition.
  • Documents intentional expanded spacing and Chrome workaround.
File Description
frontends/​main/​src/​app-pages/​ProductPages/​FaqsSection.tsx Adjusts FAQ transition timing and spacing documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@zamanafzal zamanafzal added the Needs Review An open Pull Request that is ready for review label Sep 28, 2026
@daniellefrappier18 daniellefrappier18 self-assigned this Sep 28, 2026
@zamanafzal
zamanafzal merged commit c64ee94 into main Sep 28, 2026
24 of 28 checks passed
@zamanafzal
zamanafzal deleted the zafzal/13284-faq-accordion-transition branch September 28, 2026 13:51
This was referenced Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants