Skip to content

fix: resolve card overflow and layout issues in Learn page sections - #7813

Merged
Maanvi212006 merged 4 commits into
layer5io:masterfrom
AnkitRewar11:fix/learn-page-card-layout
Oct 13, 2026
Merged

Maanvi212006 merged 4 commits into
layer5io:masterfrom
AnkitRewar11:fix/learn-page-card-layout

Conversation

@AnkitRewar11

@AnkitRewar11 AnkitRewar11 commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Description
This PR fixes #7807

This PR fixes two layout issues on the layer5.io/learn page where card sections were not displaying properly on desktop screens.

Issue 1: Learning Paths cards overflow

File: src/sections/Learn/LearnPage-Sections/learning-path.js

The three cards in this section did not have proper width settings for desktop screens, so they were overflowing the row and getting clipped on the sides.

Fix: Added the missing width settings ($md, $lg, $xl props) to the Col component so all three cards now fit properly within the row on all desktop screen sizes.

Issue 2: Workshops cards collapse to 2 columns

File: src/sections/Learn/LearnPage-Sections/workshops.js

The workshop cards were missing width settings for some desktop screen sizes, and an existing CSS rule was forcing them into a 2-column layout. This pushed the third card off-screen.

Fix:

  • Added the missing width settings to the Col component.
  • Replaced the hardcoded card width value with a CSS variable, so it's easy to update later if the number of cards changes.

Bonus fix: Cards were different sizes

While testing, I noticed the cards were also showing up in different sizes instead of being equal.

Fix: Removed a margin: auto rule that was causing uneven spacing, and made sure all card images use the same width and crop style so every card looks consistent.

Testing

  • Ran npm run build — build completed successfully with no errors.
  • Tested locally with gatsby develop on both desktop and mobile screen sizes. All cards now show up at equal sizes with even spacing, no overflow, and no unexpected column changes.

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.
Screenshot (458) Screenshot (457)

Summary by CodeRabbit

  • Style
    • Updated learning path cards to display four per row on medium-sized screens.
    • Updated workshop cards to display three per row on screens up to 1600px wide, with adjusted spacing.

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for PR #7813 removed.

This PR preview was automatically pruned because we keep only the 3 most recently updated previews on GitHub Pages to stay within deployment size limits.

If needed, push a new commit to this PR to generate a fresh preview.

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

@Rajesh-Nagarajan-11

@Sbragul26 Sbragul26 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.

This section is not responsive on mobile. Some content is getting cut off. Could you please make it responsive for smaller screens?

Preview

Image

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

Hi @Sbragul26

I took a closer look at the mobile card sizing issue. The desktop layout is now working as expected, but the second card still appears a bit smaller on mobile.

From what I found, the issue doesn't seem to be coming from the CSS. The three thumbnail images have different aspect ratios, which makes the cards look visually uneven.

I don't think we can completely solve this with CSS alone without creating other visual compromises elsewhere.

Screenshot (505)

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

@kanishksingh23

Copy link
Copy Markdown
Contributor

@AnkitRewar11, can you please push a new commit to generate a fresh preview.

@AnkitRewar11

AnkitRewar11 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@AnkitRewar11, can you please push a new commit to generate a fresh preview.

done

@AnkitRewar11
AnkitRewar11 requested a review from Sbragul26 June 27, 2026 17:55
@Bhumikagarggg

Copy link
Copy Markdown
Contributor

@AnkitRewar11 Thank you for your contribution! Let's discuss this during the website call tomorrow at 5:30 PM IST | 7 AM CST Add it as an agenda item to the meeting minutes, if you would 🙂

@kanishksingh23

Copy link
Copy Markdown
Contributor

@Sbragul26, the content cut-off issue on mobile is resolved. The remaining slight height difference between cards is an asset issue. The three thumbnails have different aspect ratios. We can create a separate issue to standardise the thumbnail image dimensions.

@AnkitRewar11, it looks good to me.

@AasthathecoderX
AasthathecoderX self-requested a review July 13, 2026 06:08
@AasthathecoderX

Copy link
Copy Markdown
Contributor

@AnkitRewar11, can you please push a new commit to generate a fresh preview.
Also an essential check that supports deployment is failing,do look into it.

@AasthathecoderX

Copy link
Copy Markdown
Contributor

@AnkitRewar11 ,
The overflow issue looks fixed. One minor observation: compared to the previous layout, the cards now occupy noticeably less horizontal space on larger desktop screens, leaving more empty space on the sides. Was this intentional?
If not, we could consider slightly increasing the card width or adjusting the layout to make better use of the available space.

I have attached the screenshots of before and after for reference.
Before:
image

After:
image

@AnkitRewar11

AnkitRewar11 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@AasthathecoderX Thanks for pointing this out. It wasn’t intentional. I’ve updated the container and card layout so the cards now use the available desktop space more effectively while remaining responsive. Please take another look.

Screenshot (619)

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

@banana-three-join, please take a look when you have some time. Thanks!

@banana-three-join banana-three-join 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.

Is there a way to scope the fixes to the components of resusecore/Layout?

My question comes from the fact that the more solo components that we have, the harder that they'll be to maintain so could you look into it? If our reusable components can't be used under this context, then we can go ahead with this fix. Ty!

@PARTH-TUSSLE PARTH-TUSSLE 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.

Hey @AnkitRewar11 One small thing I noticed is the Learning Paths section is using a custom CSS grid with multiple extra wrappers, while we already have the existing Row/Col layout components. Could we simplify this and use the existing layout components here if possible?
Also, learning-path-cards is being used on both the Row and the inner div, so it might be worth cleaning that up to avoid duplicate styling.

@emphor11

Copy link
Copy Markdown

Hey @AnkitRewar11 One small thing I noticed is the Learning Paths section is using a custom CSS grid with multiple extra wrappers, while we already have the existing Row/Col layout components. Could we simplify this and use the existing layout components here if possible? Also, learning-path-cards is being used on both the Row and the inner div, so it might be worth cleaning that up to avoid duplicate styling.

I agree with this concern. The original layout already uses the shared Container/Row/Col system, and the original overflow could be addressed by providing the missing responsive column props. The current implementation instead introduces a separate container, grid breakpoints, and wrapper hierarchy just for this section. Could we keep the reusable layout components here and only add the required responsive sizing, unless there is a concrete limitation that prevents them from achieving the intended 3-column desktop layout?

Signed-off-by: ankitrewar11 <rewarankit18@gmail.com>
@AnkitRewar11
AnkitRewar11 force-pushed the fix/learn-page-card-layout branch from a1fbf0e to c94c5d4 Compare September 20, 2026 08:30
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94d7f7a2-98b3-401d-b217-cf37fdc5a568
📥 Commits

Reviewing files that changed from the base of the PR and between 4976317 and fe34ea1.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 48f12307-cd8c-419a-a35f-5049ec6c239b

📥 Commits

Reviewing files that changed from the base of the PR and between c2617d0 and c94c5d4.

📒 Files selected for processing (2)
  • src/sections/Learn/LearnPage-Sections/learning-path.js
  • src/sections/Learn/LearnPage-Sections/workshops.js

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The Learn page updates responsive card layouts. Learning Path cards use four columns at the medium breakpoint. Workshop cards use three columns below 1600px with adjusted margins.

Changes: Learn page card layouts

Layer / File(s) Summary
Responsive card widths
src/sections/Learn/LearnPage-Sections/learning-path.js, src/sections/Learn/LearnPage-Sections/workshops.js
Learning Path cards add $md={4}. Workshop cards change from two columns to three columns below 1600px, and their horizontal margin changes to 0.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: fixing card overflow and layout issues in the Learn page sections.
Linked Issues check ✅ Passed Issue #7807 requires three Learning Paths cards to fit across desktop rows and three Workshops cards to avoid an unintended two-column layout. The PR adds $md={4} to Learning Paths columns. This giv…
Out of Scope Changes check ✅ Passed The reviewed diff changes only Learning Paths column sizing and Workshop card sizing and margins. Both changes directly support the desktop layout fixes in issue #7807. No unrelated behavior or files …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@AnkitRewar11

AnkitRewar11 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@emphor11 @PARTH-TUSSLE @banana-three-join Thanks for the feedback. The implementation has been simplified to reuse the existing layout components. The custom grid and extra wrappers were removed, and only the required responsive column sizing changes remain.

Final result

Screenshot (1102) Screenshot (1101) Screenshot (1100) Screenshot (1099)

@PARTH-TUSSLE

Copy link
Copy Markdown
Contributor

Hey @AnkitRewar11 could you add this as an agenda item in the meeting minutes for the websites meet on Monday, we could discuss it there?

@AnkitRewar11

Copy link
Copy Markdown
Contributor Author

@Maanvi212006 @PARTH-TUSSLE Please take a look when you have some time. This PR has been ready for quite a while. Thank you!

@Maanvi212006
Maanvi212006 merged commit f13a2d3 into layer5io:master Oct 13, 2026
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.

Layout issues in Learning Paths and Workshops card sections on desktop (layer5.io/learn)