From 45fd8985969a4de7002317c65991a9e57a89b898 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Wed, 23 Sep 2026 18:09:58 +0000 Subject: [PATCH 01/27] Declare chalk and unist-util-visit-parents as dependencies (#63215) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 35abb1df-6285-443c-892a-30c594d2d64c --- package-lock.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index d7e61b307e2b..27262f36a514 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "azure-kusto-data": "^7.0.4", "bottleneck": "2.19.5", "boxen": "8.0.1", + "chalk": "^5.0.1", "cheerio": "^1.2.0", "classnames": "^2.5.1", "clsx": "^2.1.1", @@ -108,6 +109,7 @@ "unified": "^11.0.5", "unist-util-find": "^3.0.0", "unist-util-visit": "^5.1.0", + "unist-util-visit-parents": "6.0.1", "url-template": "^3.1.1", "walk-sync": "^4.0.1" }, @@ -139,7 +141,6 @@ "@types/website-scraper": "^1.2.11", "@typescript-eslint/eslint-plugin": "^8.33.1", "@typescript-eslint/parser": "^8.33.1", - "chalk": "^5.0.1", "change-case": "^5.4.4", "commander": "^15.0.0", "cross-env": "^10.1.0", @@ -178,7 +179,6 @@ "sass": "^1.97.3", "start-server-and-test": "^3.0.0", "unist-util-remove": "^4.0.0", - "unist-util-visit-parents": "6.0.1", "vitest": "^5.0.0", "website-scraper": "^5.3.1" }, diff --git a/package.json b/package.json index 995fc6ee7dec..0c807cbf03a9 100644 --- a/package.json +++ b/package.json @@ -200,6 +200,7 @@ "azure-kusto-data": "^7.0.4", "bottleneck": "2.19.5", "boxen": "8.0.1", + "chalk": "^5.0.1", "cheerio": "^1.2.0", "classnames": "^2.5.1", "clsx": "^2.1.1", @@ -270,6 +271,7 @@ "unified": "^11.0.5", "unist-util-find": "^3.0.0", "unist-util-visit": "^5.1.0", + "unist-util-visit-parents": "6.0.1", "url-template": "^3.1.1", "walk-sync": "^4.0.1" }, @@ -301,7 +303,6 @@ "@types/website-scraper": "^1.2.11", "@typescript-eslint/eslint-plugin": "^8.33.1", "@typescript-eslint/parser": "^8.33.1", - "chalk": "^5.0.1", "change-case": "^5.4.4", "commander": "^15.0.0", "cross-env": "^10.1.0", @@ -340,7 +341,6 @@ "sass": "^1.97.3", "start-server-and-test": "^3.0.0", "unist-util-remove": "^4.0.0", - "unist-util-visit-parents": "6.0.1", "vitest": "^5.0.0", "website-scraper": "^5.3.1" }, From 65058c474a738ec701f7e55c57bad70d138cb206 Mon Sep 17 00:00:00 2001 From: Kevin Heis Date: Wed, 23 Sep 2026 18:10:07 +0000 Subject: [PATCH 02/27] Clean up comments in src/landings and src/links/tests (#63273) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 17588eeb-788a-4f82-9d36-b5079fb36521 --- src/landings/components/ArticleList.tsx | 3 -- src/landings/components/CategoryLanding.tsx | 4 +-- src/landings/components/SidebarProduct.tsx | 14 ++++----- src/landings/components/TocLanding.tsx | 2 +- .../shared/LandingArticleGridWithFilter.tsx | 29 +++---------------- .../components/shared/LandingCarousel.tsx | 15 ++-------- .../components/sidebar-navlist-depth.ts | 4 +-- .../components/useSidebarExpandState.tsx | 6 ++-- src/landings/context/LandingContext.tsx | 4 --- src/landings/lib/fuzzy-match.ts | 9 ++---- src/landings/lib/octicons.ts | 23 ++------------- src/landings/middleware/featured-links.ts | 1 - src/landings/tests/count-articles.ts | 1 - src/landings/tests/fuzzy-match.ts | 13 ++++----- src/landings/tests/octicons.test.ts | 6 ---- src/landings/tests/sidebar-custom-links.ts | 11 ------- src/landings/tests/sidebar-navlist-depth.ts | 2 +- src/landings/types.ts | 13 ++------- src/links/tests/cross-page-anchors.ts | 2 +- src/links/tests/extract-links.ts | 7 ++--- src/links/tests/link-report.ts | 5 +--- .../tests/validate-redirected-fragment.ts | 2 +- 22 files changed, 40 insertions(+), 136 deletions(-) diff --git a/src/landings/components/ArticleList.tsx b/src/landings/components/ArticleList.tsx index b0af1ac03a8b..61ac7172925d 100644 --- a/src/landings/components/ArticleList.tsx +++ b/src/landings/components/ArticleList.tsx @@ -21,9 +21,6 @@ export const ArticleList = ({ articles, }: ArticleListPropsT) => { const { t } = useTranslation('product_landing') - // Use TypeScript's "not null assertion" because `mainContext.page` should - // will present in mainContext if it's gotten to the stage of React - // rendering. return ( <> diff --git a/src/landings/components/CategoryLanding.tsx b/src/landings/components/CategoryLanding.tsx index 8378131f8574..995261e8edd7 100644 --- a/src/landings/components/CategoryLanding.tsx +++ b/src/landings/components/CategoryLanding.tsx @@ -87,7 +87,6 @@ export const CategoryLanding = () => { setSelectedComplexity('All') } - // Helper function to find article data from tocItems const findArticleData = (articlePath: string) => { const cleanPath = articlePath.startsWith('/') ? articlePath.slice(1) : articlePath return onlyFlatItems.find( @@ -97,7 +96,6 @@ export const CategoryLanding = () => { ) } - // Process spotlight items to get complete data const processedSpotlight = spotlight?.map((spotlightItem) => { const articleData = findArticleData(spotlightItem.article) @@ -114,7 +112,7 @@ export const CategoryLanding = () => { {router.route === '/[versionId]/rest/[category]' && } - {/* Doesn't matter *where* this is included because it will + {/* Position does not matter, because it will never render anything. It always just return null. */} diff --git a/src/landings/components/SidebarProduct.tsx b/src/landings/components/SidebarProduct.tsx index b8ef0f8a633e..5e66cf0f056d 100644 --- a/src/landings/components/SidebarProduct.tsx +++ b/src/landings/components/SidebarProduct.tsx @@ -71,11 +71,11 @@ function handleNavClick(router: Router, event: MouseEvent, href: st // navigate/prefetch callbacks, instead of every item calling useRouter itself. type SidebarNavValue = { // The real loaded route. Drives aria-current (the semantic "current page") and the - // auto-expanded active ancestor chain — both must reflect the page actually loaded. + // auto-expanded active ancestor chain. Both must reflect the page actually loaded. routePath: string // The in-flight click target, or null. Drives a VISUAL-ONLY optimistic accent bar // (via data-pending) so the click feels acknowledged before the slow - // getServerSideProps page loads — without lying to assistive tech about the current + // getServerSideProps page loads, without lying to assistive tech about the current // page. Once navigation completes, the keyed remount clears it and routePath catches up. pendingHref: string | null navigate: (event: MouseEvent, href: string) => void @@ -146,7 +146,7 @@ export const SidebarProduct = () => { // page is still loading. This SidebarProduct instance persists during the pending // fetch (SidebarNav keys it on asPath, which only changes once navigation completes), // so the state survives the wait and is discarded by the keyed remount when the new - // route lands. aria-current is NOT derived from this — it stays on the loaded route. + // route lands. aria-current is NOT derived from this: it stays on the loaded route. const [pendingHref, setPendingHref] = useState(null) const prefetchHref = usePrefetchOnInteraction() @@ -169,7 +169,7 @@ export const SidebarProduct = () => { useEffect(() => { // Clear the optimistic highlight if a navigation genuinely fails, so it doesn't - // stick on a page that never loaded. Skip cancellations (err.cancelled) — those + // stick on a page that never loaded. Skip cancellations (err.cancelled): those // fire when a second click supersedes the first, and pendingHref already points at // that newer target, which we want to keep highlighted. const clearPending = (err: { cancelled?: boolean }) => { @@ -303,7 +303,7 @@ function ExpandableItem({ // NavList.Item. Brand's NavList.Item forwards style/aria-hidden to its inner