fix: workaround to nest all top-level menu items into an empty group …#22
fix: workaround to nest all top-level menu items into an empty group …#22
Conversation
…as the only new top level item, so as to be able to get around bug in mintlify where top level menu items are not allowed to be collapsed by default Signed-off-by: Brendan Graetz <bguiz@users.noreply.github.com>
WalkthroughThe pull request restructures the GitBook documentation navigation by introducing a new top-level "INJECTIVE" navigation group that wraps existing documentation sections. Individual page paths and content remain unchanged; only the hierarchical organization is modified. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.gitbook/docs.json (1)
42-45: Consider adding a descriptive comment or clarifying the group naming.The new "INJECTIVE" group wraps all documentation sections as a workaround for a Mintlify bug. While functional, the name may appear ambiguous to maintainers unfamiliar with this workaround.
Consider either:
- Adding an inline comment explaining this is a structural workaround for Mintlify's collapse behavior
- Choosing a more semantic container name if the tool later supports collapsible top-level items
| { | ||
| "group": "INJECTIVE", | ||
| "pages": | ||
| [ |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, check the file structure around the mentioned lines
wc -l .gitbook/docs.jsonRepository: InjectiveLabs/inj-docs-mintlify
Length of output: 97
🏁 Script executed:
# Read the file to see the current structure around lines 42-45 and the broader context
head -50 .gitbook/docs.json | tail -15Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 400
🏁 Script executed:
# Check lines around 674-675 to see the closing of the INJECTIVE group
tail -10 .gitbook/docs.jsonRepository: InjectiveLabs/inj-docs-mintlify
Length of output: 204
🏁 Script executed:
# Search for all instances of "expanded" property to understand the pattern
rg '"expanded"' .gitbook/docs.json -B 2 -A 1Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 1360
🏁 Script executed:
# Get a broader view of the structure - look for all "group" definitions
rg '"group"' .gitbook/docs.json -B 1 -A 3Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 8955
🏁 Script executed:
# Search for any Mintlify configuration or documentation in the repo
find . -name "*.md" -o -name "mintlify.json" -o -name "*.config.*" | grep -v node_modules | head -20Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 1002
🏁 Script executed:
# Check if there's documentation about the workaround in comments or commit messages
git log --oneline --all | head -20Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 1502
🏁 Script executed:
# Look for any recent changes or comments related to this restructuring
git log -p --all -S "INJECTIVE" -- .gitbook/docs.json | head -100Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 57
🏁 Script executed:
# Check for any nested groups without "expanded" property to understand the pattern
rg '"group"' .gitbook/docs.json -B 1 -A 5 | grep -A 5 '"group": "Wallet"'Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 274
🌐 Web query:
Mintlify expanded property default behavior groups collapse
💡 Result:
By default a navigation group is collapsed: set "expanded": true to make it open by default; "expanded": false or omitting it leaves the group collapsed. [1][2]
Note: theme interaction (the "drilldown" setting) controls whether expanding a group also navigates to its first page. [1]
🏁 Script executed:
# Check if there are any docs, comments, or issues mentioning Mintlify behavior
find . -name "*.md" -type f | xargs grep -l "expanded\|Mintlify\|collapse" 2>/dev/null | head -10Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 57
🏁 Script executed:
# Check the mintlify.json or any config files for documentation
find . -name "mintlify.json" -o -name "*.config.json" | xargs cat 2>/dev/nullRepository: InjectiveLabs/inj-docs-mintlify
Length of output: 57
🏁 Script executed:
# Look at the actual git diff for the commit that introduced this change
git show a976b59 --statRepository: InjectiveLabs/inj-docs-mintlify
Length of output: 31739
🏁 Script executed:
# Get more details about the commit
git show a976b59 | head -150Repository: InjectiveLabs/inj-docs-mintlify
Length of output: 12992
Add "expanded": true to the "INJECTIVE" wrapper group to ensure all documentation is visible by default.
Mintlify collapses groups by default when the "expanded" property is omitted. Since this PR wraps all documentation sections into the "INJECTIVE" group as a workaround for Mintlify's bug where top-level items cannot be collapsed, the wrapper group must explicitly set "expanded": true to ensure the documentation is accessible on first load. Without this, users will see only the "INJECTIVE" label with no expanded content, defeating the workaround's purpose.
Apply this fix:
{
"group": "INJECTIVE",
+ "expanded": true,
"pages":
[Also applies to: 674-675
🤖 Prompt for AI Agents
In .gitbook/docs.json around lines 42-45 and also at lines 674-675, the
"INJECTIVE" wrapper group is missing the "expanded": true property; add
"expanded": true to each of those group objects so the wrapper group is expanded
by default and all nested pages are visible on first load.
…as the only new top level item, so as to be able to get around bug in mintlify where top level menu items are not allowed to be collapsed by default
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.