Repository navigation
🐛 Fixed navigation markup changing for themes without the icons flag - #30129
Conversation
no ref The navigation icons work wrapped every label in the built-in navigation partial in `<span class="nav-label">`, but that wrapper was not gated on the `navigationIcons` flag. Every theme that relies on the built-in partial rather than shipping its own `partials/navigation.hbs` got new markup inside the anchor, which can break CSS and JS that targets the anchor's text directly. The helper now passes the flag through to the template as `@navigationIcons`, and the template only renders the icon and the label wrapper when it is set. With the flag off the output is byte-identical to the pre-flag markup, which the new test asserts in full.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (14)
🧰 Additional context used📓 Path-based instructions (3)**/*.{js,jsx,cjs,mjs}📄 CodeRabbit inference engine (Custom checks)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*{.,-}{test,spec}.{js,jsx,ts,tsx}⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (8)📚 Learning: 2026-01-08T10:26:38.700ZApplied to files:
📚 Learning: 2026-02-04T15:58:09.124ZApplied to files:
📚 Learning: 2026-04-09T09:44:26.783ZApplied to files:
📚 Learning: 2026-06-04T15:15:20.265ZApplied to files:
📚 Learning: 2026-06-22T14:36:35.803ZApplied to files:
📚 Learning: 2026-01-26T13:53:03.597ZApplied to files:
📚 Learning: 2026-03-12T10:43:01.366ZApplied to files:
📚 Learning: 2026-05-12T19:57:42.468ZApplied to files:
🔇 Additional comments (3)
WalkthroughThe navigation helper now passes the Possibly related PRs
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This localized change restores the previous navigation markup when the icons flag is disabled and adds coverage for that behavior; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 48s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 3m 25s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 3m 2s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 2m 54s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 34s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 21s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 18s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 4s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-19 18:33:32 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30129 +/- ##
==========================================
- Coverage 75.29% 75.26% -0.04%
==========================================
Files 1622 1622
Lines 144885 144885
Branches 17948 17943 -5
==========================================
- Hits 109086 109042 -44
- Misses 34798 34846 +48
+ Partials 1001 997 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
no ref Follow-up to #30129. The navigation settings validator accepts an item with an icon and no label regardless of the `navigationIcons` flag. So enabling the flag, adding an icon-only item, then disabling the flag leaves the front end rendering `<li class="nav-"><a href="/foo"></a></li>` — an empty, unlabelled link, since the icon is dropped when the flag is off. Before #28368 that data threw an `IncorrectUsageError`, which is the worse option: it 500s the whole front end for data Admin allowed to be saved. So items with nothing to render are now dropped instead, and a nav where every item drops out renders nothing, matching the existing empty-nav behaviour. Note this also drops an item with a null label and no icon, which previously rendered the same empty link. That shape is only reachable by writing to the database directly — Admin has always required a label (now label-or-icon). Tests: an icon-only item is dropped while a sibling label item still renders, and an all-icon-only nav renders an empty string. Flag-on icon-only rendering is unchanged and still covered.

no ref
#28368 added icons and visibility controls to navigation behind the
navigationIconslab flag, but one part of it shipped ungated: the built-in navigation partial started wrapping every label in<span class="nav-label">.That affects every theme that uses
{{navigation}}without shipping its ownpartials/navigation.hbs, whether or not the flag is on. CSS and JS that target the anchor's text directly —.nav aflex/gap layouts,::beforetricks, truncation on the anchor,a.textContentreads — see different markup than before.The helper now passes the flag to the template as
@navigationIcons, and the template renders the icon plus the label wrapper only when it is set. With the flag off, output is byte-identical to the pre-#28368 markup.The flag-off tests now assert the bare label, plus a new test that asserts the full rendered string matches the old markup exactly.