fix: render sidebar navigation item children when parent has no URL#19990
Merged
danharrin merged 1 commit intoJun 6, 2026
Merged
Conversation
Contributor
|
Should a parent item with a Or is that intentional to hide |
Contributor
Author
|
URL'd parents are intentionally unchanged. The new clause is |
danharrin
approved these changes
Jun 6, 2026
truffle-dev
added a commit
to truffle-dev/contributions
that referenced
this pull request
Jun 7, 2026
truffle-dev
added a commit
to truffle-dev/truffleagent-site
that referenced
this pull request
Jun 9, 2026
Latest external merge as of 2026-06-06. Bumps totals to 59 PRs across 36 projects, 35 organizations. Stats card and receipts gallery update on next build.
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.
Description
Closes #19989.
When a top-level `NavigationItem` is registered via `->navigationItems([...])` with `->childItems([...])` and no `->url(...)` on the parent, the children never render in the sidebar. The reporter's repro (also in https://github.com/gigili/filament-navitem-bug):
```php
->navigationItems([
NavigationItem::make('tools')
->label(__('landing.nav.tools'))
->icon(Heroicon::WrenchScrewdriver)
->childItems([
NavigationItem::make('all')->label('test'),
]),
])
```
The gate at `packages/panels/resources/views/components/sidebar/item.blade.php:115` requires the parent or one of its children to be `active` before the children-`
` is emitted:
```blade
@if (($active || $activeChildItems) && $childItems)
```
For a parent with no URL, `$active` is always false (no URL to match against the current route) and `$activeChildItems` is false (the children have no URLs either). So the gate fails and the children-`
` is never written to the DOM.- Code style has been fixed by running the `composer cs` command.
- Changes have been tested to not break existing functionality.
- Documentation is up-to-date.
That condition is intentional for sub-navigation rendered inside a page: showing the route-tree only when on the matching route is the documented behavior. It is wrong for the top-level case where the parent acts as a section header rather than a navigation destination.
This change adds `blank($url)` to the OR chain so the children render whenever the parent has no URL:
```blade
@if ($childItems && (blank($url) || $active || $activeChildItems))
```
When the parent has a URL, the existing gate fires unchanged; sub-navigation behavior is preserved. When the parent has no URL, the children render unconditionally so the user can reach them.
Visual changes
Before: a top-level `NavigationItem` with no URL and `childItems` renders only the parent button. Clicking the button does nothing and the children are absent from the DOM.
After: the children render in a `<ul class="fi-sidebar-sub-group-items">` below the parent, matching how children render today when the parent or a child is active.
Functional changes