Fix: apply root-level meta.jsonc order config#303
Merged
NullVoxPopuli merged 1 commit intoMay 27, 2026
Conversation
The findPathForJsonc and subPath helpers both required a leading/trailing slash that the root case doesn't have, so root-level meta.jsonc was never matched and the configured order silently fell back to alphabetical sort. Making the slashes optional fixes root-level config matching without changing behavior for nested configs. Reproducible by giving any group a root meta.jsonc and observing that clicking the group's nav landed on an alphabetically-first page instead of the order's first item.
|
|
|
@rmoodyab is attempting to deploy a commit to the universal-ember Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
NullVoxPopuli
approved these changes
May 27, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root-level
meta.jsoncorderis silently ignored — sort falls back to whateverbetterSortproduces (effectively alphabetical vialocaleCompare, often unhelpful). Nestedmeta.jsoncfiles work fine; only the root case is broken.Reproduction
In any group, place a
meta.jsoncat the group root:With folders
getting-started/,ui-schema/,data-schema/each containing anindex.md. Expected: clicking the group lands ongetting-started. Actual: lands on whatever sorts first alphabetically (in my repro,ui-schema/overview.md).Root cause
In
src/build/plugins/markdown-pages/sort.js,sortTreematches a config to a folder via:For the root tree,
parents=[]andtree.path='root', so the joined string is just'root'— no trailing slash to strip,subPathstays'root'. Meanwhile the config path at the root is'meta.jsonc'(no leading slash), andfindPathForJsonc('meta.jsonc')returns'meta.jsonc'(no leading slash to strip). They never match.For nested folders both regexes naturally hit their slash (e.g.
'root/ui-schema'→'ui-schema','ui-schema/meta.jsonc'→'ui-schema'), so nested configs work.Fix
Make the slash optional in both regexes (two
?characters):Now
findPathForJsonc('meta.jsonc')returns'',subPathfor the root tree becomes'', and they match.Tested
Verified locally against my consumer (kolay@5.1.4) — the patched version correctly applies root-level order. Without the patch, the sidebar shows alphabetical order; with it, the configured order is honored.
No test in this PR — happy to add one if you point me at the right test-app to wire it through (
test-apps/markdown-onlylooked closest but I didn't want to guess the convention).