Skip to content

feat(inspector): persist chart color mode in URL and add age/duplicated modes - #199

Merged
antfu merged 8 commits into
antfu:mainfrom
antfubot:feat/chart-color-modes
Aug 22, 2026
Merged

feat(inspector): persist chart color mode in URL and add age/duplicated modes#199
antfu merged 8 commits into
antfu:mainfrom
antfubot:feat/chart-color-modes

Conversation

@antfubot

Copy link
Copy Markdown
Contributor

What & why

The graph's color mode (Spectrum | Module) was only kept in localStorage, so it couldn't be shared or bookmarked. This PR moves it into the query string and adds two new modes.

Changes

  • Persist color mode in the URL — the active color mode now lives in the query hash (chart-coloring=...) alongside the existing filter state, so a chart view can be shared or bookmarked. The default (spectrum) is stored as an empty string to keep URLs clean.
  • New Published Age mode — fresh packages stay gray, then shift through yellow (>1y), orange (>2y), and red (>3y) as they get older. Packages without publish data render as a neutral gray.
  • New Duplicated mode — every package name that resolves to more than one version gets its own distinct color; everything else stays gray, making version duplication easy to spot at a glance.
  • Removed the now-unused chartColoringMode setting, since the mode is driven entirely from the URL.

Notes

The mode now lives solely in the URL rather than localStorage, so a fresh URL starts from the default spectrum. Happy to make it fall back to a saved setting if preferred.

This PR was created with the help of an agent.

…ed modes

Persist the chart coloring mode in the query string so it can be shared and
bookmarked, and add two new modes: "Published Age" (grays fresh packages and
shifts through yellow/orange/red as they get older) and "Duplicated" (gives
each multi-version package name its own color, leaving the rest gray).
@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@199
npm i https://pkg.pr.new/node-modules-tools@199

commit: c0d46d2

@antfu
antfu merged commit 60c9405 into antfu:main Aug 22, 2026
10 checks passed
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.

2 participants