Skip to content

Update report UI and embed refreshed report assets - #28

Merged
JosephMaynard merged 12 commits into
masterfrom
feat/report-ui-improvements
Apr 30, 2026
Merged

JosephMaynard merged 12 commits into
masterfrom
feat/report-ui-improvements

Conversation

@JosephMaynard

@JosephMaynard JosephMaynard commented Apr 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Refresh the report UI styling and layout for the dependency radar graph view
  • Update the report entrypoint and type definitions to support the new interactions
  • Regenerate and embed the bundled report assets consumed by src/report.ts

Testing

  • Not run (not requested)

Summary by CodeRabbit

  • New Features

    • Focused graph layout with ancestor/descendant placement, smooth viewport pan/animate (respects reduced motion), focused-edge highlighting, and render loop updates to settle viewport movement.
  • UI Updates

    • Redesigned header CTA card with icon, copy, action and privacy note.
    • Filters converted to grouped dropdown/dialog with license controls, active-filter chips, counts, clear-all, and responsive behavior.
    • New metadata panel toggle with controlled open/close.
  • Data

    • Environment now includes platform/arch/ci and package-manager/version/toolVersions.
  • Accessibility

    • Enhanced ARIA/inert state and keyboard/outside-click handling for panels.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cd510244-40a3-42ed-b89a-715f250a9f1e

📥 Commits

Reviewing files that changed from the base of the PR and between c272825 and a990268.

📒 Files selected for processing (3)
  • report-ui/graphView.ts
  • report-ui/main.ts
  • src/report.ts

📝 Walkthrough

Walkthrough

Adds a focus-aware graph layout and smooth viewport animation; converts the CTA into a structured card; restructures filter and metadata UI into accessible dropdown/popover panels with active-filter chips; and extends AggregatedData.environment with package manager and tool-version fields.

Changes

Cohort / File(s) Summary
Graph visualization & viewport
report-ui/graphView.ts
Adds BFS-based collectDirectedDistances, buildFocusLayoutTargets for focus-centered node targets, focus viewport controls (focusViewportOn, setViewportTarget, animateViewport, clearViewportTarget) with reduced-motion handling, focus easing constant, focused-edge rendering (drawFocusedEdge), and integrates viewport settling into the render/tick loop.
Report HTML template & sticky bar
report-ui/index.html, src/report.ts
Replaces CTA markup with .cta-card (inline SVG/copy/privacy), adds Filters and Metadata toggles with ARIA/inert dialog semantics, inserts #metadata-panel and active-filters chip row, restructures filter/license/risk markup, and adds "Clear all filters" control.
Filter & metadata behavior
report-ui/main.ts
Implements renderReportMetadata panel, popover-style filter open/close (outside-click, Escape, inert/aria-hidden), active-filter chips with counts and removal/clear handlers, and centralizes filter predicates (workspace/vulnerability helpers).
Styling & responsive layout
report-ui/style.css
Adds .metadata-panel and .cta-card styles, redesigns filter panel and active-filter chip styling, refactors license panel layout, adjusts dependency summary alignment, and updates responsive rules for dropdown-to-static collapse.
Types / schema
report-ui/types.ts
Extends AggregatedData.environment with optional platform, arch, ci, packageManagerField, `packageManager: 'npm'
Build HTML / templating
src/report.ts
Updates buildHtml template to emit the new CTA card, removes secondary CTA and branch/node disclaimer, wires filter/metadata toggle elements, and reforms filter markup consistent with index.html changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GraphView as Graph View
    participant Layout as Layout Engine
    participant Viewport as Viewport
    participant Render as Render Loop

    User->>GraphView: focus on node (click)
    GraphView->>Layout: collectDirectedDistances (BFS)
    Note over Layout: compute directed parent/child distances
    Layout-->>GraphView: distance map
    GraphView->>Layout: buildFocusLayoutTargets (assign columns/rows)
    Layout-->>GraphView: node target coordinates
    GraphView->>Viewport: focusViewportOn(target center)
    Viewport->>Render: setViewportTarget / animateViewport (easing, reduced-motion aware)
    Render->>Render: update camera and node interpolation each tick
    Render->>GraphView: apply node positions & drawFocusedEdge for highlights
    Render-->>User: animated focused layout visible
Loading
sequenceDiagram
    participant User
    participant UI as Filter/Metadata UI
    participant Logic as Filter Logic
    participant DataView as List/Graph Renderer

    User->>UI: open Filters or Metadata
    UI->>UI: set aria-hidden/inert, open popover
    User->>UI: change filter option
    UI->>Logic: update predicates (workspace/vuln)
    Logic->>DataView: apply filters and update view
    DataView-->>User: refreshed list/graph
    User->>UI: click outside or press Escape
    UI->>UI: close popover and clear pending viewport targets
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hop to center, BFS in tow,
Left and right the neighbors grow,
The camera glides, the edges gleam,
Filters open, metadata beam,
I nibble bytes — the graph does glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: refreshing report UI styling/layout and embedding updated report assets. It is concise, clear, and directly related to the primary focus of the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/report-ui-improvements

Review rate limit: 3/5 reviews remaining, refill in 19 minutes and 12 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
report-ui/style.css (1)

773-787: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Duplicate display property causes unintended visibility.

The display: none on line 775 is immediately overridden by display: flex on line 783, making the element always visible. Based on the mobile media query (line 2564-2566) also setting display: none, the intent appears to be hiding this toggle by default.

🐛 Proposed fix
 .license-filter-toggle {
   display: none;
   padding: 6px 12px;
   border: 1px solid var(--border-color);
   border-radius: var(--radius);
   background: transparent;
   color: var(--text-secondary);
   font-size: 12px;
   cursor: pointer;
-  display: flex;
   align-items: center;
   gap: 6px;
   transition: all var(--transition);
 }

If the element should be flex when visible, consider using a class toggle or separate selector for the visible state.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report-ui/style.css` around lines 773 - 787, The .license-filter-toggle rule
currently declares display: none then immediately display: flex, causing it to
always be visible; remove the duplicate display property so the default state is
hidden (keep display: none) and move display: flex into a separate visible state
selector or class (e.g., .license-filter-toggle--visible or a
media/query-specific selector) so the element is only flex when explicitly
shown; update any scripts or markup that toggle visibility to add/remove that
visible class (refer to .license-filter-toggle and the mobile media query that
also sets display: none).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report-ui/main.ts`:
- Around line 2197-2212: The list view dropdown and counting logic fails to
treat missing usage.origins.workspaces as ["root"], causing workspace
counts/filters to mismatch the graph; update the code that builds options (the
block using controls.workspace, workspaceNames, formatCount, and countBy) to
normalize each dependency's usage.origins.workspaces to ["root"] when undefined
or empty before counting/filtering (same normalization used in graphView.ts),
and ensure the same normalization is applied in the filtering logic that runs
when a workspace option is selected so "Workspace root" includes deps that omit
the field.
- Around line 2372-2478: getActiveFilterChips() currently omits the search input
so the UI shows zero filters when only a search is active; update
getActiveFilterChips to add an ActiveFilterChip for controls.search when
controls.search.value is non-empty (e.g., id "search", label "Search: " +
selectedOptionLabel or controls.search.value, and remove handler that clears
controls.search.value = ""), and ensure the remove handler triggers the same
update path as other controls (either call syncActiveFilterUi() or dispatch the
input/change event used elsewhere) so clearing the chip actually removes the
filter; adjust any clear-all handlers if they rely on chip-count to also clear
controls.search.

---

Outside diff comments:
In `@report-ui/style.css`:
- Around line 773-787: The .license-filter-toggle rule currently declares
display: none then immediately display: flex, causing it to always be visible;
remove the duplicate display property so the default state is hidden (keep
display: none) and move display: flex into a separate visible state selector or
class (e.g., .license-filter-toggle--visible or a media/query-specific selector)
so the element is only flex when explicitly shown; update any scripts or markup
that toggle visibility to add/remove that visible class (refer to
.license-filter-toggle and the mobile media query that also sets display: none).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d0b9f9f-15da-4dca-9ec9-b994016d15ae

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed0533 and 53ad2c6.

⛔ Files ignored due to path filters (2)
  • report-ui/dist/report.css is excluded by !**/dist/**
  • report-ui/dist/report.iife.js is excluded by !**/dist/**
📒 Files selected for processing (7)
  • report-ui/graphView.ts
  • report-ui/index.html
  • report-ui/main.ts
  • report-ui/style.css
  • report-ui/types.ts
  • src/report-assets.ts
  • src/report.ts

Comment thread report-ui/main.ts
Comment thread report-ui/main.ts

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
report-ui/main.ts (1)

2744-2767: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Don't treat sort changes as filter resets.

controls.sort already has its own change handler, so including it in filterControls makes mobile sort changes also call handleFilterControlChange(), clear forcedVisibleDepKeys, and hide dependencies surfaced from graph/root-link navigation. Desktop column-header sorting does not do that, so the two sort paths diverge.

Suggested fix
   const filterControls = [
     controls.search,
     controls.direct,
     controls.runtime,
-    controls.sort,
     controls.hasVulns,
     controls.workspace,
     controls.licensePermissive,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@report-ui/main.ts` around lines 2744 - 2767, The sort control (controls.sort)
is incorrectly included in filterControls causing its mobile change handler to
call handleFilterControlChange which clears forcedVisibleDepKeys and calls
renderList; remove controls.sort from the filterControls array so that sort
changes use their dedicated change handler only, leaving
handleFilterControlChange, forcedVisibleDepKeys, and renderList behavior
reserved for actual filter inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@report-ui/index.html`:
- Around line 279-296: The search input with id "search" inside the
"search-wrapper" lacks an accessible label; update the markup to provide an
explicit label (either a visible <label for="search">Packages</label> or an
sr-only label) or add an aria-label="Search packages" to the input, and apply
the same change in the embedded report code referencing the same "search" input
in src/report.ts so both the index.html's input and the programmatic input have
a persistent accessible name for screen readers.

---

Outside diff comments:
In `@report-ui/main.ts`:
- Around line 2744-2767: The sort control (controls.sort) is incorrectly
included in filterControls causing its mobile change handler to call
handleFilterControlChange which clears forcedVisibleDepKeys and calls
renderList; remove controls.sort from the filterControls array so that sort
changes use their dedicated change handler only, leaving
handleFilterControlChange, forcedVisibleDepKeys, and renderList behavior
reserved for actual filter inputs.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 538c2395-adb3-4742-8932-7a2147f9e78c

📥 Commits

Reviewing files that changed from the base of the PR and between 53ad2c6 and d256b4f.

⛔ Files ignored due to path filters (4)
  • dist/report-assets.js is excluded by !**/dist/**
  • dist/report.js is excluded by !**/dist/**
  • report-ui/dist/report.css is excluded by !**/dist/**
  • report-ui/dist/report.iife.js is excluded by !**/dist/**
📒 Files selected for processing (5)
  • report-ui/index.html
  • report-ui/main.ts
  • report-ui/style.css
  • src/report-assets.ts
  • src/report.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • report-ui/style.css

Comment thread report-ui/index.html
@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 3 file(s) based on 1 unresolved review comment.

Files modified:

  • dist/report.js
  • report-ui/index.html
  • src/report.ts

Commit: c272825616327747f6e17fdab5b842545f9a6434

The changes have been pushed to the feat/report-ui-improvements branch.

Time taken: 1m 34s

Fixed 3 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings and committed to branch feat/report-ui-improvements (commit: a99026893b44b0f8d195aa7bc012f7d1d1c8b446)

Docstrings generation was requested by @JosephMaynard.

The following files were modified:

* `report-ui/graphView.ts`
* `report-ui/main.ts`
* `src/report.ts`

These file types are not supported:
* `report-ui/index.html`
* `report-ui/style.css`
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.

1 participant