Skip to content

Fix card mapping visibility on mobile for long translations#2662

Merged
sydseter merged 3 commits intoOWASP:masterfrom
Mysterio-17:fix/webapp-preview-margin
Mar 19, 2026
Merged

Fix card mapping visibility on mobile for long translations#2662
sydseter merged 3 commits intoOWASP:masterfrom
Mysterio-17:fix/webapp-preview-margin

Conversation

@Mysterio-17
Copy link
Copy Markdown
Contributor

Changes

This PR addresses the issue #2646 where mapping information (STRIDE, OWASP DevGuide, OWASP ASVS, CAPEC, SAFECODE) was invisible on mobile devices for cards with longer translations, particularly noticeable in the Russian translation.

Modified Files

  • cardPreview.svelte: Adjusted description font size from 3.2vw to 3.1vw and added line-height: 1.3 for better text compression on mobile
  • webAppCardMapping.svelte: Reduced mapping font size to 1.9vw, added line-height: 1.2, and adjusted top margin to 1.5vw
  • companionCardMapping.svelte: Added consistent top margin (2vw) for mapping section
  • mobileAppCardMapping.svelte: Added consistent top margin (2vw) for mapping section

Why

The card has a fixed aspect ratio (20/32) with overflow hidden. When translations are longer (like Russian), the description text pushes the mapping section below the visible area. By slightly reducing font sizes and tightening line heights, all content now fits within the card boundaries while maintaining readability.

Testing

Tested on mobile viewport with the Russian translation at /edition/webapp/VE2/2.2/ru#card


If the issue still persists after this PR is merged, I would be glad to try out more options to fix it.

Copilot AI review requested due to automatic review settings March 18, 2026 14:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR makes small responsive typography/layout adjustments in the Cornucopia Svelte UI to improve readability and spacing of card text when rendered in the browser-card-container (notably under the (max-aspect-ratio: 1.5/1) breakpoint).

Changes:

  • Tweaks responsive font sizes and adds explicit line-height for better text legibility.
  • Adds extra top spacing for the first mapping title in multiple mapping components under the narrow-aspect media query.
  • Slightly adjusts responsive description text sizing in the card preview.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
cornucopia.owasp.org/src/lib/components/webAppCardMapping.svelte Refines responsive mapping typography and adds first-title top spacing.
cornucopia.owasp.org/src/lib/components/mobileAppCardMapping.svelte Adds first-title top spacing under the responsive breakpoint.
cornucopia.owasp.org/src/lib/components/companionCardMapping.svelte Adds first-title top spacing under the responsive breakpoint.
cornucopia.owasp.org/src/lib/components/cardPreview.svelte Adjusts responsive description font-size and line-height for readability.

You can also share your feedback on Copilot code review. Take the survey.

@sydseter
Copy link
Copy Markdown
Collaborator

Three cards still have issues:

/edition/webapp/C8/3.0/ru#card
/edition/webapp/CJ/3.0/ru#card
/edition/webapp/VE3/3.0/ru#card
/edition/webapp/VEX/3.0/ru#card
/edition/webapp/VEK/3.0/ru#card
/edition/webapp/AT3/3.0/ru#card
/edition/webapp/AT6/3.0/ru#card
/edition/webapp/ATX/3.0/ru#card
/edition/webapp/SM8/3.0/ru#card
/edition/webapp/SM9/3.0/ru#card
/edition/webapp/AZ5/3.0/ru#card
/edition/webapp/C2/3.0/ru#card

@Mysterio-17
Copy link
Copy Markdown
Contributor Author

Three cards still have issues:

/edition/webapp/C8/3.0/ru#card /edition/webapp/CJ/3.0/ru#card /edition/webapp/VE3/3.0/ru#card /edition/webapp/VEX/3.0/ru#card /edition/webapp/VEK/3.0/ru#card /edition/webapp/AT3/3.0/ru#card /edition/webapp/AT6/3.0/ru#card /edition/webapp/ATX/3.0/ru#card /edition/webapp/SM8/3.0/ru#card /edition/webapp/SM9/3.0/ru#card /edition/webapp/AZ5/3.0/ru#card /edition/webapp/C2/3.0/ru#card

Thanks for testing! Yes, I was initially testing with just the VE2/2.2/ru card to verify the approach. I can see that some cards with even longer descriptions still have the issue.
Let me adjust the font sizes and spacing further to accommodate these longer translations. I'll test with the cards you mentioned and push an update shortly.

@Mysterio-17
Copy link
Copy Markdown
Contributor Author

Hey @sydseter , have a look at this.

@sydseter
Copy link
Copy Markdown
Collaborator

@Mysterio-17 perfect!

@sydseter sydseter merged commit 210c7e2 into OWASP:master Mar 19, 2026
9 checks passed
@Mysterio-17
Copy link
Copy Markdown
Contributor Author

@Mysterio-17 perfect!

Great, also if the issue still persists after this PR is merged, I would be glad to try out more options to fix it.

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.

3 participants