Skip to content

fix(ui): optimise AdditionalResSection layout for iPad (issue #916)#1092

Open
EdrilanBerisha wants to merge 3 commits into
SAP:devfrom
EdrilanBerisha:dev
Open

fix(ui): optimise AdditionalResSection layout for iPad (issue #916)#1092
EdrilanBerisha wants to merge 3 commits into
SAP:devfrom
EdrilanBerisha:dev

Conversation

@EdrilanBerisha
Copy link
Copy Markdown

@EdrilanBerisha EdrilanBerisha commented May 22, 2026

Fixes #916.

On iPad-sized viewports (~768px-1024px wide) the 'Additional Resources' section was showing only 1 column, causing the last card description to be cut in half at the bottom.

The previous CSS had a single tablet breakpoint at max-width: 996px that switched directly to 1 column. This covers a range that includes iPad screens (768px-996px) and caused the layout issue.

Fix: the breakpoint is now split into two rules:

  • iPad / large tablet (601px–996px): 2-column grid (repeat(2, 1fr)) with max-width 700px and centered, so cards fit comfortably without being cut off.
  • Mobile (≤600px): 1-column grid, unchanged.

Testing:

  • Added src/sections/tests/AdditionalResSection.test.tsx (16 tests) covering rendering, structure, data integrity, and a CSS breakpoint regression note for issue [BUG] Display is not optimised for iPad for the additional resources section #916.
  • Added mocks/@docusaurus/{Link,useBaseUrl,theme-common, useDocusaurusContext}.js so the section can be rendered in Jest without a Docusaurus runtime.
  • Updated jest.config.js moduleNameMapper to resolve these @Docusaurus packages via the new manual mocks.
  • Installed identity-obj-proxy (dev dependency) to support CSS module mocking in Jest

hey @cernus76 could you please review this and let me know if you wish something to be changed

Fixes SAP#916.

On iPad-sized viewports (~768px-1024px wide) the 'Additional Resources'
section was showing only 1 column, causing the last card description to
be cut in half at the bottom.

The previous CSS had a single tablet breakpoint at max-width: 996px that
switched directly to 1 column. This covers a range that includes iPad
screens (768px-996px) and caused the layout issue.

Fix: the breakpoint is now split into two rules:
- iPad / large tablet (601px–996px): 2-column grid (repeat(2, 1fr))
  with max-width 700px and centered, so cards fit comfortably without
  being cut off.
- Mobile (≤600px): 1-column grid, unchanged.

Testing:
- Added src/sections/__tests__/AdditionalResSection.test.tsx (16 tests)
  covering rendering, structure, data integrity, and a CSS breakpoint
  regression note for issue SAP#916.
- Added __mocks__/@docusaurus/{Link,useBaseUrl,theme-common,
  useDocusaurusContext}.js so the section can be rendered in Jest without
  a Docusaurus runtime.
- Updated jest.config.js moduleNameMapper to resolve these @Docusaurus
  packages via the new manual mocks.
- Installed identity-obj-proxy (dev dependency) to support CSS module
  mocking in Jest.
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] Display is not optimised for iPad for the additional resources section

1 participant