fix(ui): name the deepest menu on the resource menu row

- Backup pages show Backup, and service sub-resources show their own
  name, because the row opens that menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras BacsaiandClaude Opus 5.5 committed 2026-10-30 17:23:49 +01:00
1 parent 49346aeb29
commit a80f0c7ca8
5 files changed
+8 -5

No files matched your search

+2 -1
View File
@@ -312,7 +312,8 @@ Class names below are examples. Keep the values and structure.
- A menu that replaces another menu in place starts with a back row: a
centered label and a 12px left chevron (`‹ Dashboard`).
- On a resource page, the main menu starts with a row that opens the resource
menu again. It points right and shows the resource name (`adonisjs ›`). On
menu again. It points right and shows the name of the deepest menu (`adonisjs ›`,
`Backup ›`). On
other pages the main menu has no row above its items, and Dashboard is the
first item, right under Search.
@@ -51,7 +51,7 @@
};
@endphp
<x-main-nav-menu :depth="1" :back-label="$parentMenu" :back-title="'Back to the '.strtolower($parentMenu).' menu'"
<x-main-nav-menu :depth="1" :back-label="$parentMenu" :back-title="'Back to the '.strtolower($parentMenu).' menu'" name="Backup"
data-settings-search-items="{{ json_encode(settingsSearchItems(['Backup' => collect($items)->map(fn (array $item): array => [...$item, 'route' => $routes[$item['key']]])], $parameters)) }}">
<nav aria-label="Backup settings"
class="grid grid-cols-1 gap-0.5">
@@ -3,7 +3,8 @@
'serviceDatabase',
])
<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu">
<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu"
:name="$serviceDatabase->human_name ?: $serviceDatabase->name">
<nav aria-label="Compose resource settings"
class="grid grid-cols-1 gap-0.5">
<a class="menu-item" data-page-only {{ wireNavigate() }}
@@ -11,7 +11,8 @@
@if (! $embedded && $resourceType === 'database')
<x-service-database.sidebar :parameters="$parameters" :serviceDatabase="$serviceDatabase" />
@elseif (! $embedded)
<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu">
<x-main-nav-menu :depth="1" back-label="Service" back-title="Back to the service menu"
:name="$serviceApplication->human_name ?: $serviceApplication->name">
<nav aria-label="Compose resource settings"
class="grid grid-cols-1 gap-0.5">
<a class="menu-item" data-page-only {{ wireNavigate() }}
+1 -1
View File
@@ -144,7 +144,7 @@ test('a database backup page keeps the database menu one back away in the main s
->toContain('x-teleport="#main-nav-context-1"')
->toMatch('#@click="navLevel = -1; navSwap = \'back\'"\s+title="Back to the main menu"#')
->toMatch('#@click="navLevel = 0; navSwap = \'back\'"\s+title="Back to the database menu"#')
->toContain('Back to the orders-db menu')
->toContain('Back to the Backup menu')
->and(substr_count($html, 'aria-label="Database settings"'))->toBe(1)
->and(substr_count($html, 'aria-label="Backup settings"'))->toBe(2);
});