Skip to content

fix(report): truthful labels + security-product UI redesign for layer modals#239

Merged
Stanzin7 merged 1 commit into
masterfrom
fix/report-ui-trust-and-design
Jun 17, 2026
Merged

fix(report): truthful labels + security-product UI redesign for layer modals#239
Stanzin7 merged 1 commit into
masterfrom
fix/report-ui-trust-and-design

Conversation

@Stanzin7

@Stanzin7 Stanzin7 commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What changed

  • Layer modal triage: factors split into Issues → Not analyzed → Cleared. "High risk" / "Issue" only when severity warrants it; "Not analyzed" when coverage is absent (never "Clear"); "Clear" only when a check ran and passed.
  • Verdict pill in modal header: band-keyed accent rail + pill so a BLOCK layer can't read as safe.
  • Sidebar tile: issue count is now severity-tinted, not gray metadata. Pulse animation removed.
  • Key Findings label fix: FACTOR_HUMAN_TITLE keys in normalizeScanResult.ts didn't match backend factor names — fixed.

Files

LayerModal.jsx/scss/test.jsx, ResultsSidebarTile.jsx/scss, ScanResultsPageV2.jsx, normalizeScanResult.ts

Constraints respected

  • decision.resolve() precedence unchanged
  • TOS/protected-service gates and BLOCK verdicts unchanged
  • No detection logic or scoring changes

Tests

  • 11/11 assertions pass (node harness on bundled triage helpers)
  • Full npm run build passes (3015 modules)
  • LayerModal.test.jsx written; will run in CI (vitest has a cold-start issue in this sandbox)

Summary by CodeRabbit

  • New Features

    • Findings modal now organizes results into three tiers: Issues found, Not analyzed, and Cleared items.
    • Added visual category tags and severity indicators for each finding.
  • Style

    • Findings badges updated with band-specific styling.
    • Improved modal layout and visual hierarchy for better clarity.
  • Tests

    • Added test coverage for findings organization and display logic.

…odals

Make the scan report both factually correct and visually credible, focused
on the layer detail modals (the report's signature interactive surface) and
the verdict labels around them. No detection logic, scoring weights, or
decision.resolve() precedence changed.

Correctness / labels
- LayerModal: severity-first triage — Issues (loud) -> Not analyzed
  (neutral) -> Cleared (quiet). Status wording is now precise:
  "High risk" (>=0.7) / "Issue" (>=0.4) only with evidence; "Not analyzed"
  when coverage is absent (never "Clear"); "Clear" only when a check ran
  and found nothing. Triage is a pure, tested helper (triageFactors).
- LayerModal header restates the authoritative layer verdict (Safe /
  Needs review / Not safe) and the top accent rail reflects the verdict
  band (data-band), so BLOCK/Not-safe never reads like Review.
- Sidebar tile: issue count is a real signal (severity-tinted, "N issues",
  precise wording) instead of gray "N findings" metadata.
- Aggregate counter wording unified to "issue(s)".
- normalizeScanResult: fix FACTOR_HUMAN_TITLE keys that never matched the
  backend factor names (Entropy/ManifestPosture/WebStoreTrust/
  MaintenanceHealth -> Obfuscation/Manifest/Webstore/Maintenance, + add
  governance factors) so Key Findings titles humanize and match the modal.

Design
- Issues use a colored rail + tint + glyph + solid status pill; high risk
  (red) vs moderate (amber) read differently. Cleared rows are a quiet,
  dense, low-contrast list (no green pill noise). Not analyzed is dashed +
  neutral + HelpCircle + an explicit "treat as unknown, not safe" note.
- Stronger type hierarchy and spacing rhythm; sharper modal radius (14px).
- Sidebar tile tokenized to --risk-*/--theme-* (was hardcoded rgba),
  removed the templated pulse animation, added a keyboard focus ring.

Accessibility / responsive
- Status pills use dark ink on solid accent (white-on-amber failed WCAG AA).
- Mobile header verdict pill left-aligns when wrapped; cleared names wrap
  instead of silently truncating; status conveyed by text+icon, not color.

Tests
- LayerModal.test.jsx covers status mapping (Issue/High risk/Not analyzed/
  Clear) and triage ordering (issues severe-first; not-analyzed never in
  cleared). Verified by executing the real bundled functions (11/11) since
  vitest can't run in this sandbox; full `npm run build` passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 12:04
@github-actions github-actions Bot added bug Bug report or bug fix related work security Security-sensitive issue or change labels Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3684788-a42f-441d-8830-09572acf292f

📥 Commits

Reviewing files that changed from the base of the PR and between 27ef55c and 84713ce.

📒 Files selected for processing (7)
  • frontend/src/components/report/LayerModal.jsx
  • frontend/src/components/report/LayerModal.scss
  • frontend/src/components/report/LayerModal.test.jsx
  • frontend/src/components/report/ResultsSidebarTile.jsx
  • frontend/src/components/report/ResultsSidebarTile.scss
  • frontend/src/pages/scanner/ScanResultsPageV2.jsx
  • frontend/src/utils/normalizeScanResult.ts

📝 Walkthrough

Walkthrough

The PR overhauls the scan results report UI: LayerModal gains a triageFactors helper that splits factors into severity-ordered issues, not-analyzed, and cleared tiers, with humanizeFactor extended to emit a tone. LayerModal.scss is restructured to match the new tier layout with band-driven accent colors. ResultsSidebarTile gains band-specific badge classes and all "finding" labels are renamed to "issue". FACTOR_HUMAN_TITLE keys are realigned with backend FactorName strings.

Changes

Severity-triaged scan results UI overhaul

Layer / File(s) Summary
FACTOR_HUMAN_TITLE key alignment
frontend/src/utils/normalizeScanResult.ts
Replaces legacy factor-name keys (Entropy, ManifestPosture, WebStoreTrust, MaintenanceHealth) with aligned backend strings (Obfuscation, Manifest, Webstore, Maintenance) and adds ToSViolations, Consistency, DisclosureAlignment entries.
humanizeFactor tone + triageFactors logic and tests
frontend/src/components/report/LayerModal.jsx, frontend/src/components/report/LayerModal.test.jsx
Adds tone output (bad/warn/neutral/good) to humanizeFactor, introduces exported triageFactors producing three severity-ordered tiers, updates bandLabel/bandToneClass strings, swaps icon imports, and adds CATEGORY_TAG constants. Tests verify tone, tier partitioning, ordering rules, and empty-input safety.
LayerModal rendering overhaul + styles
frontend/src/components/report/LayerModal.jsx, frontend/src/components/report/LayerModal.scss
Replaces category-grouped check-card rendering with Issues / Not analyzed / Cleared tiers using a new PrimaryCheckRow component and a Check-icon cleared grid. SCSS is fully restructured with data-band-driven accent color, verdict pill system, tone-modifier check rows, responsive mobile layout changes, and trimmed light-theme overrides.
ResultsSidebarTile badge + wording
frontend/src/components/report/ResultsSidebarTile.jsx, frontend/src/components/report/ResultsSidebarTile.scss, frontend/src/pages/scanner/ScanResultsPageV2.jsx
Applies band-specific CSS class (tile-findings-badge--${band}) to the findings badge and renames all "finding(s)" labels to "issue(s)". Stylesheet switches verdict pills and badge to --risk-* CSS variables, removes tile-clickable-hint animation, adds :focus-visible outline, and adds --warn/--bad badge severity modifiers with light-theme overrides.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Stanzin7/ExtensionShield#236: Directly modifies LayerModal.jsx's humanizeFactor and isNotAnalyzed logic, which this PR extends with the new tone field and triageFactors helper.

Suggested labels

bug, area: frontend, area: tests

Poem

🐇 Hop hop, the modal's been triaged with care,
Three tiers now sorted — issues laid bare!
"Finding" is "issue," the labels are true,
Accent rails glowing in warn-red and blue.
CSS variables dance, old hardcodes take flight —
This bunny approves, the review stack's airtight! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/report-ui-trust-and-design

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 and usage tips.

@github-actions github-actions Bot added the area: frontend Changes to the React frontend label Jun 17, 2026
@Stanzin7 Stanzin7 merged commit 1ba32c8 into master Jun 17, 2026
22 of 23 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Not ready to approve

The updated LayerModal styles introduce a tooltip-clipping regression and a light-theme status-pill contrast issue that can break usability/accessibility.

Pull request overview

This PR refines the report UI to use “truthful” triage labels (Issues / Not analyzed / Cleared), aligns factor display names between Key Findings and the Layer modal, and updates sidebar/tile visuals to better communicate severity.

Changes:

  • Updates factor human-title mapping to match backend factor names and LayerModal labels.
  • Reworks LayerModal presentation and styling around severity-tiered triage, with accompanying unit tests.
  • Adjusts sidebar issue wording/badges and the aggregate “findings” label to consistently say “issue(s)”.
File summaries
File Description
frontend/src/utils/normalizeScanResult.ts Aligns FACTOR_HUMAN_TITLE keys/labels with backend factor names and LayerModal naming.
frontend/src/pages/scanner/ScanResultsPageV2.jsx Renames aggregate counter label from “findings” to “issues”.
frontend/src/components/report/ResultsSidebarTile.jsx Updates tile badge to show “issue(s)” and adds a severity-tinted dot.
frontend/src/components/report/ResultsSidebarTile.scss Removes pulse animation and tokens badge/border colors + focus-visible outline styling.
frontend/src/components/report/LayerModal.jsx Introduces pure triage/humanize helpers and restructures modal rendering into triaged tiers.
frontend/src/components/report/LayerModal.scss Implements the new severity-tier visual language, including verdict accent rail and tier layouts.
frontend/src/components/report/LayerModal.test.jsx Adds unit tests for triage/status helper behavior and ordering.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

transition: background 0.15s ease, border-color 0.15s ease;
animation: lmFadeUp 0.25s var(--lm-ease) both;
box-sizing: border-box;
overflow: hidden;
Comment on lines 457 to 459
.light .lm-status-issues {
background: var(--risk-warn-bg);
border-color: var(--risk-warn-border);
color: var(--risk-warn);
}

.light .lm-info-trigger {
color: var(--extensionshield-text-muted);
&:hover,
&:focus-visible {
color: var(--extensionshield-text-secondary);
}
color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: frontend Changes to the React frontend bug Bug report or bug fix related work security Security-sensitive issue or change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants