Skip to content

Add catalog pages for single package URLs#1038

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/add-catalog-index-pages
Closed

Add catalog pages for single package URLs#1038
Copilot wants to merge 3 commits intomainfrom
copilot/add-catalog-index-pages

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

Single package URLs (e.g., /react, /angular) currently compare a package to itself, which is not useful. This adds catalog/index pages that show ~16 sensible version diffs instead.

Changes

Catalog link generation (src/lib/catalog/generateCatalogLinks.ts)

  • Algorithm generates up to 5 major, 5 minor, and 5 patch version diffs
  • Major diffs compare last version of previous major to first version (X.0.0) of next major
  • Minor diffs compare last version of previous minor to first version (X.Y.0) of next minor
  • Patch diffs compare consecutive patch versions
  • Filters prerelease versions
  • Backfills with additional diffs if fewer than 16 are found

Catalog page (src/app/[...parts]/_catalog/CatalogPage.tsx)

  • Displays package name and grouped diff links
  • Three sections displayed in order: Patch, Minor, Major Version Updates
  • Uses prefetch={false} to prevent preloading all diffs on page load

Routing (src/app/[...parts]/page.tsx)

  • Detects single package input before calling destination()
  • Fetches versions and generates catalog links
  • Renders catalog page for single packages, diff page for comparisons

Example

Visiting /react now shows:

  • Patch: 19.2.2 → 19.2.3, 19.2.1 → 19.2.2, ...
  • Minor: 19.1.4 → 19.2.0, 18.2.0 → 18.3.0, ...
  • Major: 18.3.1 → 19.0.0, 17.0.2 → 18.0.0, ...
Original prompt

I want to create "catalog" or "index" pages. so if I go to /react or /angular, instead of producing a diff that compares to itself, I want to show a page which shows a number of links to some diffs we can guess. look at the logic in the autocomplete which versions we pick. bur we want more on the catalog page. maybe show like the last 5 patch versions(all compared with previous patch), and last 5 minor(all compared with previous minor) and last 5 major (all compared with the major before). make sure the links do not preload as that would create way too many diffs if you first load the page.

let's say the catalog shows 16 links, using some clever method to keep looking until we have 16 links. sometimes packages will not have that many patch or minor or major, but make some combination of "sensible" diffs until you have 16


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
npm-diff Ready Ready Preview, Comment Jan 25, 2026 2:29pm

- Add generateCatalogLinks utility to create sensible version diffs
- Create CatalogPage component to display version comparisons
- Update routing to detect single package and show catalog
- Show 16 links organized by major/minor/patch versions
- Links use prefetch=false to avoid preloading diffs
- Tests passing for catalog link generation

Co-authored-by: oBusk <13413409+oBusk@users.noreply.github.com>
Copilot AI changed the title [WIP] Add catalog and index pages for version comparison Add catalog pages for single package URLs Jan 25, 2026
Copilot AI requested a review from oBusk January 25, 2026 01:02
@oBusk
Copy link
Owner

oBusk commented Jan 25, 2026

@copilot don't commit any changes to next-env.d.ts

Major diffs should be from the last version of a major span, to the first of next. So find <19 and diff to 19.0.0. diff <18 to 18.0.0. I want to see a diff between for example 18.3.4...19.0.0 or 17.9.4 and 18.0.0.

The diffs between minor should be from last minor to the first minor in the next. From 18.3.4 to 18.4.0 for example.

Show patch examples first on the catalog page.

- Revert next-env.d.ts to original state (auto-generated file)
- Change major diffs to compare last of previous major to first (X.0.0) of next major
- Change minor diffs to compare last of previous minor to first (X.Y.0) of next minor
- Reorder catalog sections to show patches first, then minors, then majors
- Update tests to match new behavior

Co-authored-by: oBusk <13413409+oBusk@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 25, 2026

@copilot don't commit any changes to next-env.d.ts

Major diffs should be from the last version of a major span, to the first of next. So find <19 and diff to 19.0.0. diff <18 to 18.0.0. I want to see...

Fixed in commit 0f880ce:

  • ✅ Reverted next-env.d.ts changes (auto-generated file)
  • ✅ Major diffs now compare last version of previous major to first version (X.0.0) of next major
    • Example: 18.3.1 → 19.0.0, 17.0.2 → 18.0.0
  • ✅ Minor diffs now compare last version of previous minor to first version (X.Y.0) of next minor
    • Example: 19.1.4 → 19.2.0, 18.2.0 → 18.3.0
  • ✅ Patch section is now shown first on catalog page

Screenshot: https://github.com/user-attachments/assets/2c209915-62be-4693-9c97-c2e38775e0cc

@oBusk
Copy link
Owner

oBusk commented Feb 1, 2026

Closed in favour of #1040

@oBusk oBusk closed this Feb 1, 2026
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

Comments