From 40a08577b8cb6bff8629dbe1b7f05440d3842bb9 Mon Sep 17 00:00:00 2001 From: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com> Date: Tue, 10 Nov 2026 20:50:41 +0100 Subject: [PATCH] fix(dashboard): repo views on a phone, CRA figure, empty licence view (#957) Checked against the mockup in a local run: the tab strip scrolls on its own on a narrow screen instead of widening the page and no longer shows a stray scrollbar; the CRA tab counts the requirements checked without a finding (not those outside the code); the licence tab says why it is empty; the repo cards' bucket labels wrap as in the mockup. Co-Authored-By: Claude Opus 5.5 --- compliance-dashboard/assets/main.css | 14 ++++++++------ compliance-dashboard/src/i18n/texts.rs | 4 ++++ compliance-dashboard/src/pages/target_views.rs | 8 ++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/compliance-dashboard/assets/main.css b/compliance-dashboard/assets/main.css index 60c0ea8..8962dd2 100644 --- a/compliance-dashboard/assets/main.css +++ b/compliance-dashboard/assets/main.css @@ -7774,7 +7774,10 @@ span.repo-crumb-name { margin-bottom: 20px; border-bottom: 1px solid var(--border-bright); overflow-x: auto; + overflow-y: hidden; scrollbar-width: thin; + /* Scrolls on its own on a narrow screen instead of widening the page. */ + contain: inline-size; } .repo-tab { @@ -7784,7 +7787,6 @@ span.repo-crumb-name { flex: none; min-height: 44px; padding: 0 16px; - margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-secondary); font-size: 14px; @@ -7835,8 +7837,9 @@ span.repo-crumb-name { .repo-card-bucket { display: grid; gap: 2px; + align-content: start; min-width: 0; - min-height: 44px; + min-height: 56px; padding: 6px 8px; border: 1px solid var(--border); border-top: 3px solid var(--tone, var(--border-strong)); @@ -7861,9 +7864,8 @@ span.repo-crumb-name { } .repo-card-bucket-label { - overflow: hidden; - color: var(--text-tertiary); + color: var(--text-secondary); font-size: 11px; - text-overflow: ellipsis; - white-space: nowrap; + line-height: 1.25; + overflow-wrap: anywhere; } diff --git a/compliance-dashboard/src/i18n/texts.rs b/compliance-dashboard/src/i18n/texts.rs index d50f5ee..a8fc03d 100644 --- a/compliance-dashboard/src/i18n/texts.rs +++ b/compliance-dashboard/src/i18n/texts.rs @@ -6659,6 +6659,10 @@ pub mod repo_views { de: "Verwendet von", en: "Used by", }; + pub const NO_LICENCES: Text = Text { + de: "Die Stückliste nennt noch keine Komponenten, also auch keine Lizenzen.", + en: "The SBOM names no components yet, so no licences either.", + }; pub const LICENCES_LIST: Text = Text { de: "Alle Lizenzen im SBOM", en: "All licences in the SBOM", diff --git a/compliance-dashboard/src/pages/target_views.rs b/compliance-dashboard/src/pages/target_views.rs index b09bcb1..8b9fa02 100644 --- a/compliance-dashboard/src/pages/target_views.rs +++ b/compliance-dashboard/src/pages/target_views.rs @@ -101,7 +101,7 @@ fn tab_figure( + c.partial + c.no_violation_found + c.not_code_checkable; - format!("{}/{total}", c.no_violation_found + c.not_code_checkable) + format!("{}/{total}", c.no_violation_found) }), RepoView::Licences | RepoView::History => None, } @@ -303,6 +303,9 @@ fn LicencesTab(target_id: String) -> Element { return rsx! { div { class: "loading", {common::LOADING.get(lang)} } }; }; let counts: LicenseGroupCounts = summary.data.iter().map(|l| (l.category, l.count)).collect(); + if counts.total() == 0 { + return rsx! { p { class: "card target-muted", {tx::NO_LICENCES.get(lang)} } }; + } let group: Option = selected(); let licences: Vec = summary .data @@ -367,7 +370,8 @@ mod tests { assert_eq!(figure(RepoView::Findings).as_deref(), Some("47 offen")); assert_eq!(figure(RepoView::Cves).as_deref(), Some("15")); assert_eq!(figure(RepoView::Components).as_deref(), Some("312")); - assert_eq!(figure(RepoView::Cra).as_deref(), Some("26/40")); + // Checked in the code without a finding, of all 40. + assert_eq!(figure(RepoView::Cra).as_deref(), Some("14/40")); assert_eq!(figure(RepoView::Licences), None); assert_eq!(figure(RepoView::History), None); assert_eq!(tab_figure(RepoView::Cves, None, None, Lang::De), None);