Skip to content

fix(architectures): pin the tag and card sort to English collation - #2033

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/pin-catalog-sort-collation
Oct 31, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:fix/pin-catalog-sort-collation

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

#2016 pinned eight of the nine comparators in src/components/ArchitectureFilters/index.js to English collation. The tag dropdown and compareAlphabetical (the card order under both sort options) stayed on the bare localeCompare, so they order by the runtime's default locale. Czech collates the digraph ch as one letter after h, so a visitor on a cs-family or traditional-Spanish locale hydrates Chaos engineering after ci-cd while the served HTML has it before, and React recovers from the mismatch by re-rendering the tag select client-side.

Both now go through the existing compareLabels.

Remit: a rendering defect on /architectures for visitors on cs-family and traditional-Spanish collations (hydration mismatch and a tag dropdown ordered on a different rule from the three beside it).

Refs #2031 (the tag-sort finding folded onto it on 2026-10-31; the industry-guard half of that issue is not in this diff).

Tests

  • tests/architecture-filters.test.mjs: runs sortArchitectures in a child process under LC_ALL=cs_CZ.UTF-8 and requires the English order. Fails before the fix, passes after.
  • tests/architecture-filters-ui.test.mjs: pins the Chaos engineering / ci-cd / cloud native order as a literal, with a self-check that the pair discriminates under cs.

Verification

  • node --test tests/architecture-filters.test.mjs tests/architecture-filters-ui.test.mjs: 52 pass; 51 pass / 1 fail with the src/ change reverted
  • npm run test:mutation -- --mutate src/components/ArchitectureFilters/index.js: 100.00 (142 killed, 0 survived)
  • check:format, check:lint (changed files), check:spelling, check:duplication (244/245, 37/37, unchanged) clean

cncf#2016 pinned eight filter-option comparators to English collation and left
the tag dropdown and the alphabetical card order on the runtime default. A
visitor whose locale collates the digraph ch as one letter (Czech,
traditional Spanish) hydrates a different option order than the HTML served
to them, so React re-renders the tag select client-side. Route both through
compareLabels and pin the order with a child-process run under cs_CZ.

Refs cncf#2031

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit 8e2df6c
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ae5d87c3595a5205204ee77
😎 Deploy Preview https://deploy-preview-2033--endusers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

[scanner] Verified locally against the PR head (8e2df6c):

  • node --test tests/architecture-filters.test.mjs tests/architecture-filters-ui.test.mjs: 52/52 pass.
  • With src/components/ArchitectureFilters/index.js reverted to main, the new child-process probe fails (actual: 'CI Corp|Chaos Labs', expected English order) — the test discriminates.
  • compareLabels pins localeCompare(b, 'en'); after this diff the only bare localeCompare left in src/ are the two YYYY-MM-DD date compares (compareRecentlyUpdated, CaseStudies publishedAt), which are collation-stable for fixed-width ASCII dates. No unpinned label comparators remain.

LGTM from the scanner lane.


🐝 Hive Agent: scanner | Instance: hosted-available-lke648397-260827-5n31 | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the change against the tree at the PR head; this looks correct to me.

  • src/components/ArchitectureFilters/index.js:34-38 and :70-71 were the only two comparators in the component still on bare localeCompare; both now route through compareLabels (src/components/shared/compareLabels.js:14, localeCompare(b, 'en')), matching the other option lists pinned by #2016. No caller of sortArchitectures / useArchitectureFilterOptions depends on locale-sensitive order.
  • The claimed hydration mechanism checks out: tagKey lowercases but keeps the ch digraph, so a cs-collating runtime really would order chaos engineering after ci-cd differently from the build host.
  • Tests discriminate: the child-process probe in tests/architecture-filters.test.mjs runs the sort under LC_ALL=cs_CZ.UTF-8, and the UI test self-checks that its fixture pair actually separates under cs before pinning the literal order — so neither can go stale silently.

No findings. All checks green at 8e2df6c.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 31, 2026
Merged via the queue into cncf:main with commit d760cde Oct 31, 2026
15 checks passed
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