Skip to content

fix(ui): compliance card layout polish#10939

Merged
HugoPBrito merged 11 commits into
masterfrom
fix/ui-compliance-card-layout
May 4, 2026
Merged

fix(ui): compliance card layout polish#10939
HugoPBrito merged 11 commits into
masterfrom
fix/ui-compliance-card-layout

Conversation

@HugoPBrito
Copy link
Copy Markdown
Member

Context

The compliance cards on /compliance had a few layout rough edges after the export-menu repositioning landed in #10918:

  • The score progress bar was constrained to the right-hand content column instead of spanning the full card width.
  • The X / Y Passing Requirements caption lived at the bottom of the card, isolated from the title it describes.
  • The iso-27001.svg asset shipped with an asymmetric viewBox (x="0.666626" rect inside a 41-wide viewBox) and an off-center pattern transform, which made the ISO logo appear shifted to the right inside its tile.

Description

ui/components/compliance/compliance-card.tsx:

  • Restructured the inner layout into three full-width rows: [logo + (title / passing-requirements caption)] → [score label + percentage] → [progress bar]. The progress bar now uses the full card width.
  • Moved the X / Y Passing Requirements caption next to the framework logo, stacked under the title.
  • Wrapped the framework logo in an explicit flex items-center justify-center container with a fixed 32×32 next/image inside, so the image lands in the visual center of the 40×40 white tile regardless of the source asset's aspect ratio.
  • Dropdown export menu (top-right absolute) is unchanged.

ui/components/icons/compliance/iso-27001.svg:

  • Tightened the SVG viewBox from 0 0 41 45 to 0 0 40 45, anchored the rect at x="0", and adjusted the inner pattern transform translate from -0.237112 to -0.2575 so the embedded PNG is symmetrically cropped within the rect.

Steps to review

  1. cd ui && pnpm install && pnpm run dev
  2. Open /compliance after selecting any scan with at least one framework.
  3. Verify each card:
    • Logo tile sits to the left of the title; the X / Y Passing Requirements caption is directly under the title.
    • Score: label and percentage are on the same row, full card width.
    • Progress bar spans the full card width below them.
    • Three-dot export dropdown stays in the top-right corner; clicking it does not navigate to the compliance detail page.
    • The ISO 27001 logo emblem is centered horizontally inside its white tile.
  4. Click anywhere else on the card → navigates to the compliance detail page.

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

UI

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video - Mobile (X < 640px)
  • Screenshots/Video - Tablet (640px > X < 1024px)
  • Screenshots/Video - Desktop (X > 1024px)
  • Ensure new entries are added to ui/CHANGELOG.md

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Bump the compliance card progress bar from h-2.5 (10px) to h-3 (12px)
for better visual presence on the redesigned cards.
Restructure the compliance card so the framework logo and title share a
single top row (with right padding reserved for the absolute dropdown
menu) and the score progress bar spans the full card width below.

Wrap the framework logo in an explicit flex centering container so the
image stays vertically and horizontally centered within its 40x40 tile,
regardless of the source asset's aspect ratio.

Revert the previous bar height bump back to h-2.5 to keep the bar
proportionate to the wider footprint.
Wrap the framework logo in a flex container that explicitly centers a
fixed 32x32 next/image element inside the 40x40 white tile, so the
logo lands in the visual center regardless of how the source SVG/PNG
is structured.
The iso-27001.svg shipped with asymmetric framing:
- the rect was positioned at x=0.666 inside a viewBox of 41 wide,
  leaving uneven left/right whitespace
- the inner pattern transform translated the embedded PNG by
  -0.237112, cropping more of the right side than the left

Tighten the viewBox to 40x45, anchor the rect at x=0, and adjust the
pattern translate to -0.2575 so the cropped PNG is centered symmetrically
inside the rect.
Stack the framework title and the 'X / Y Passing Requirements' caption
in a column next to the logo, leaving the score row and full-width
progress bar below. The dropdown export menu stays absolute top-right
unchanged.
@HugoPBrito HugoPBrito requested a review from a team as a code owner April 29, 2026 15:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

✅ All necessary CHANGELOG.md files have been updated.

@HugoPBrito
Copy link
Copy Markdown
Member Author

image

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

🔒 Container Security Scan

Image: prowler-ui:7ad9890
Last scan: 2026-05-04 11:30:29 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 2
Total 2

2 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

@pfe-nazaries pfe-nazaries self-requested a review April 30, 2026 09:04
pfe-nazaries
pfe-nazaries previously approved these changes Apr 30, 2026
Comment thread ui/CHANGELOG.md Outdated
Updated version to 1.26.0 and made changes to compliance cards.
pfe-nazaries
pfe-nazaries previously approved these changes Apr 30, 2026
Copy link
Copy Markdown
Contributor

@pfe-nazaries pfe-nazaries left a comment

Choose a reason for hiding this comment

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

LGTM

@HugoPBrito HugoPBrito requested a review from pfe-nazaries May 4, 2026 11:25
@HugoPBrito HugoPBrito added the backport-to-v5.25 Backport PR to the v5.25 branch label May 4, 2026
@HugoPBrito HugoPBrito merged commit 652cb69 into master May 4, 2026
40 checks passed
@HugoPBrito HugoPBrito deleted the fix/ui-compliance-card-layout branch May 4, 2026 11:59
@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label May 4, 2026
@prowler-bot
Copy link
Copy Markdown
Collaborator

💚 All backports created successfully

Status Branch Result
v5.25

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

pfe-nazaries pushed a commit that referenced this pull request May 5, 2026
PR #10939 collapsed the compliance card to an always-stacked column
layout and removed `sm:flex-row`, but the existing source assertion test
was not updated and started failing in CI on every PR that touched the
UI. Update the assertion to reflect the new layout and rename the test
case accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v5.25 Backport PR to the v5.25 branch component/ui was-backported The PR was successfully backported to the target branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants