Skip to content

feat: add package trends comparison and chart export - #1076

Open
pastelsky wants to merge 12 commits into
bundlephobiafrom
codex/package-trends-comparison
Open

feat: add package trends comparison and chart export#1076
pastelsky wants to merge 12 commits into
bundlephobiafrom
codex/package-trends-comparison

Conversation

@pastelsky

@pastelsky pastelsky commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

The package-trends feature, stacked on #1080. Review and merge that foundations PR first; this PR then contains only the trends route, API, data collection, rendering, and feature-specific styling.

What changed

  • Compare package downloads, cached bundle-size history, and current GitHub repository snapshots at /trends.
  • Add supported ranges, grouping, release overlays, recommendation shortcuts, magnetic chart inspection, and accessible package snapshots.
  • Provide /api/trends and /api/trends-image with cache-backed data collection and share/export support.
  • Add the Trends navigation link and feature-scoped tooltip/layout tokens.

Validation

  • yarn test __tests__/trends.test.ts __tests__/trendsRecommendations.test.ts --runInBand (16 passed)
  • yarn build
  • Earlier Playwright desktop and 390px mobile checks passed; rerun once the stacked PR is mergeable.

@pastelsky
pastelsky force-pushed the codex/package-trends-comparison branch 2 times, most recently from 6a75e01 to a550333 Compare August 10, 2026 13:39
@pastelsky
pastelsky changed the base branch from bundlephobia to codex/trends-foundations August 10, 2026 13:39
@pastelsky

Copy link
Copy Markdown
Owner Author

Visual evidence — package trends

Captured against the stacked trends branch. It covers loading, data-bearing states, interaction variants, themes, and responsive navigation.

Initial and chart states

Loading state

Default downloads chart

Stars chart

Size chart

Three-year size chart

Three-year weekly size chart

Hover inspection

Package and theme variants

Three package comparison

Light theme comparison

Mobile states

Mobile overview

Mobile navigation menu

Mobile chart viewport

@pastelsky
pastelsky force-pushed the codex/package-trends-comparison branch from a550333 to 97ffc83 Compare August 10, 2026 13:55
@pastelsky

pastelsky commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

Trends suggestion composition

The trends route now owns related-package suggestion composition. It passes loadRelatedPackageSuggestions to the shared autocomplete, rather than passing related package names into it.

rankSuggestionsByQuery is a pure trends helper: it deduplicates merged results, removes non-matches, places prefix matches first, then applies the shared search-score ordering. The shared autocomplete and all existing consumers continue to use a single suggestion loader.

@pastelsky
pastelsky force-pushed the codex/trends-foundations branch from ccb3df4 to 655a4d0 Compare August 10, 2026 14:30
@pastelsky
pastelsky force-pushed the codex/package-trends-comparison branch from 97ffc83 to bfc2ab6 Compare August 10, 2026 14:33
@pastelsky
pastelsky force-pushed the codex/trends-foundations branch from 55997fd to 77061e1 Compare August 10, 2026 14:47
@pastelsky
pastelsky force-pushed the codex/package-trends-comparison branch from 1a7553c to 3047355 Compare August 10, 2026 14:48
Base automatically changed from codex/trends-foundations to bundlephobia August 10, 2026 14:58
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