Skip to content

feat(sidebar): per platform sidebar labels with auto cleanup#347

Draft
dobromirts wants to merge 2 commits into
vnextfrom
dtsvetkov/sidebar-label-auto-cleanup
Draft

feat(sidebar): per platform sidebar labels with auto cleanup#347
dobromirts wants to merge 2 commits into
vnextfrom
dtsvetkov/sidebar-label-auto-cleanup

Conversation

@dobromirts

Copy link
Copy Markdown
Contributor

Related to (#324

Summary

  • Adds platforms field to xplat toc.json for per-platform badge overrides
    The same topic can show New on React, Updated on WebComponents, Preview on Blazor.
  • Adds since field inside each platforms[P] entry to track when the label was introduced.
    Labels auto-expire after 2 minor package versions (e.g. added at 7.1.0 → cleared at 7.3.0).
  • Adds scripts/release-labels.mjs, fetches live versions from npm (Angular, React, WC) and
    nuget.org (IgniteUI.Blazor.Trial), clears expired labels, preserves original file indentation.
  • Adds .github/workflows/clear-expired-sidebar-labels.yml - runs every Tuesday + manual dispatch,
    opens a PR when any labels are cleared. Silent when nothing has expired.
  • Updates PLATFORM-LABELS.md with full usage guide including how to add a label step-by-step.
  • Updates TocItem type in sidebar.ts to document platforms and since.

Test plan

  • npm run dev:react / dev:webcomponents / dev:blazor - check sidebar labels for
    Chat, Open-Source vs Premium, Cell Merging match the table in PLATFORM-LABELS.md
  • Verify Localization(i18n) shows no badge on React or WC (expired test case)
  • npm run release:labels:dry — confirm only the expired test items are flagged, nothing else
  • Trigger the GitHub Actions workflow manually and confirm it completes without error

TODO (after approach is verified)

  • Go through all existing new / updated / preview entries in both
    src/content/en/toc.json and src/content/jp/toc.json and add the correct since value
    for each platform, matching the package version at the time the label was originally introduced
  • Update the since values on the 3 test items (Chat, Open-Source vs Premium, Cell Merging)
    to the actual current release versions (19.7.0 / 7.2.3 / 26.1.51)
  • Evaluate whether the angular toc (docs/angular/src/content/en/components/toc.json)
    should adopt the same since expiry pattern for single-platform labels
  • After the first real-world run of release-labels.mjs, confirm the GitHub Actions PR
    workflow opens and the diff looks as expected before merging

run: node scripts/release-labels.mjs

- name: Open PR if toc files changed
uses: peter-evans/create-pull-request@v6
const processed = processNodes(nodes, platform, currentVersion);
if (JSON.stringify(processed) === JSON.stringify(nodes)) return;
const out = JSON.stringify(processed, null, indent) + '\n';
if (!DRY_RUN) writeFileSync(tocPath, out, 'utf8');
@github-actions

Copy link
Copy Markdown
Contributor

Auto-tagged as stale status because no activity in the last 30 days.

@github-actions github-actions Bot added the status: stale PR was not update for a long time label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: stale PR was not update for a long time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants