Skip to content

Hide deprecated packages behind a Type filter option#11445

Open
borisschlosser wants to merge 2 commits into
masterfrom
borisschlosser/hide-deprecated-packages
Open

Hide deprecated packages behind a Type filter option#11445
borisschlosser wants to merge 2 commits into
masterfrom
borisschlosser/hide-deprecated-packages

Conversation

@borisschlosser

Copy link
Copy Markdown
Contributor

What

Deprecated provider packages (those with publisher: DEPRECATED in their YAML) were listed intermixed with active packages in the registry A–Z list. This hides them by default and adds a Deprecated option to the existing multi-select Type filter so users can opt in to seeing them.

Behavior

Type selection Shows
(none) — default all non-deprecated packages
Provider non-deprecated providers only
Deprecated only deprecated packages
Provider + Deprecated non-deprecated providers + all deprecated (union)

Use-case (category) filters and the name search still AND with the above, unchanged.

Changes

  • package.html — tag each card with data-deprecated, derived from the publisher field (eq .package.publisher "DEPRECATED"). 29 packages currently tagged.
  • package-list.html — add a Deprecated option to the Type filter group.
  • packages.ts — deprecated cards stay hidden unless Deprecated is among the selected Type filters; when selected they count as a type match (union, consistent with the other Type options). Default filtering runs on initial load so deprecated packages start hidden.

Notes

  • Hiding is client-side (toggles a hidden class), the same mechanism the existing Type/Use-Case/search filters already use — so deprecated cards remain in the HTML and crawlable.
  • No featured package is deprecated, so the (unfiltered) featured section needs no change.

🤖 Generated with Claude Code

Deprecated provider packages (those with `publisher: DEPRECATED`) were
shown intermixed with active packages in the registry list. This hides
them by default and adds a "Deprecated" option to the existing
multi-select Type filter so users can opt in to seeing them.

- package.html: tag each card with `data-deprecated` derived from the
  publisher field.
- package-list.html: add a "Deprecated" option to the Type filter group.
- packages.ts: deprecated cards stay hidden unless "Deprecated" is
  selected; when selected they count as a type match (union semantics,
  consistent with the other Type options). Default filtering is applied
  on initial load so deprecated packages start hidden.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@borisschlosser

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-06-19 at 10 53 41 Screenshot 2026-06-19 at 10 54 52 Screenshot 2026-06-19 at 10 55 05

@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown

Registry Review — Hide deprecated packages behind a Type filter

Reviewed the three changed files. This is a clean, self-contained client-side filtering change. The core filter logic is correct — I traced every cell of the behavior matrix in the PR description (default, Provider-only, Deprecated-only, Provider+Deprecated union, and category/text AND-ing) and they all hold up. Nice work including the explanatory comments and handling the initial-load count correction.

A few minor / non-blocking observations below.


🟡 Minor: over-indented forEach body (themes/default/theme/src/ts/packages.ts, lines 19–60)

Removing the if (filters.length > 0 || filterText) wrapper left the callback body indented one level too deep (12 spaces) relative to its braces (packages.forEach(... { at line 19 and }); at line 60). It's purely cosmetic and won't fail make lint (TS isn't linted there), but a re-indent keeps the file consistent and would shrink a future diff. Worth running the theme's formatter over it.

🟡 Minor: DRY — reuse the new updateAllCount() helper (packages.ts)

You added a nice updateAllCount() helper (lines 84–87), but the three pre-existing inline copies of the same count logic weren't switched over:

  • lines 127–128 (filterSelect handler)
  • lines 144–145 (reset handler)
  • lines 164–165 (packageSearch handler)

Consider replacing those three blocks with updateAllCount() so the count behavior lives in one place:

    updateAllCount();

Not required for this PR, but it removes four duplicated lines and the risk of them drifting apart.

🟢 Note: initial badge count is corrected client-side

The Hugo template renders .all-count as {{ len \$allPackages }} (line 126 of package-list.html), i.e. the total including the 29 deprecated packages. Your initial-load filterByTextAndTags(...) + updateAllCount() (lines 170–171) correctly reconciles this down to the visible count. Just flagging that for users with JS disabled the badge will read high and deprecated cards will be visible — acceptable given filtering has always been JS-driven, but noting it for completeness.

🟢 Note: brief flash before hidden (FOUC)

Because hiding is applied by the module-eval call rather than at render time, deprecated cards exist in the DOM unhidden until the script runs. This matches the PR's intent (cards stay crawlable) and mirrors the existing filter mechanism, so no change needed — just be aware there may be a momentary flash of deprecated cards on slow loads.


Things I checked and found fine

  • data-deprecated="{{ \$isDeprecated }}" is placed on the same [data-category] element the TS reads from — correct. ✓
  • eq .package.publisher \"DEPRECATED\" renders true/false, matched by === \"true\"; absent/nil publisher safely yields false. ✓
  • Featured section is unaffected (filter only targets .all-packages .package), consistent with the note that no featured package is deprecated. ✓
  • New deprecated filter option value is unique within the Type group. ✓
  • Deprecated treated as its own union bucket (e.g. Component+Deprecated shows all deprecated, not just deprecated components) — consistent with the documented behavior. ✓

Overall this looks good to merge once the cosmetic indentation is tidied (optional). Mention @claude if you'd like another pass or want me to apply the indentation/DRY cleanups.

@borisschlosser borisschlosser requested a review from a team June 19, 2026 08:59
@github-actions

Copy link
Copy Markdown
Contributor

Your site preview for commit 4494ffd is ready! 🎉

http://registry--origin-pr-11445-4494ffde.s3-website.us-west-2.amazonaws.com/registry.

Replace the three inline count-badge update blocks in the filterSelect,
reset, and packageSearch handlers with the existing updateAllCount()
helper, removing the duplicated logic.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Your site preview for commit a3de4c8 is ready! 🎉

http://registry--origin-pr-11445-a3de4c80.s3-website.us-west-2.amazonaws.com/registry.

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