From b81cc4116d22291f196c56eac85faeab77efa917 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 9 Nov 2026 17:49:07 +0100 Subject: [PATCH] fix(breadcrumb): link breadcrumb names to their page The section and resource names in the top breadcrumb open their page. The arrow next to a name still opens the switch list. Co-Authored-By: Claude Opus 5.5 --- .changes/breadcrumb-section-name-link.md | 8 ++ .../components/breadcrumb-switcher.blade.php | 30 ++++--- .../views/components/top-breadcrumb.blade.php | 80 +++++++++++-------- .../views/livewire/server/navbar.blade.php | 28 ++++--- tests/v4/Browser/BreadcrumbRenameTest.php | 8 +- 5 files changed, 92 insertions(+), 62 deletions(-) create mode 100644 .changes/breadcrumb-section-name-link.md diff --git a/.changes/breadcrumb-section-name-link.md b/.changes/breadcrumb-section-name-link.md new file mode 100644 index 0000000000..bc2103b8f3 --- /dev/null +++ b/.changes/breadcrumb-section-name-link.md @@ -0,0 +1,8 @@ +--- +type: changed +--- +Names in the top breadcrumb, which now link to their page + +- The section name, such as `Servers`, opens the list page of the section +- The project, environment, resource, server, storage, source, destination, and tag names open their own page +- The arrow next to a name still opens the switch list diff --git a/resources/views/components/breadcrumb-switcher.blade.php b/resources/views/components/breadcrumb-switcher.blade.php index 3f739544c0..5cb6653515 100644 --- a/resources/views/components/breadcrumb-switcher.blade.php +++ b/resources/views/components/breadcrumb-switcher.blade.php @@ -1,20 +1,28 @@ @props(['label', 'items', 'title', 'uuid' => null]) +@php + $href = collect($items)->firstWhere('active', true)['href'] ?? null; +@endphp + /
- +
+ + {{ $label }} + + +
@isset($meta) {{ $meta }} @endisset diff --git a/resources/views/components/top-breadcrumb.blade.php b/resources/views/components/top-breadcrumb.blade.php index 41d05fe3b0..ff6421b6d1 100644 --- a/resources/views/components/top-breadcrumb.blade.php +++ b/resources/views/components/top-breadcrumb.blade.php @@ -85,24 +85,24 @@ ? \App\Models\Tag::ownedByCurrentTeam()->orderBy('name')->get()->unique('name')->values() : collect(); $currentTag = $tags->firstWhere('name', $tagName); - $dashboardContext = match (true) { - request()->routeIs('dashboard') => 'Dashboard', - request()->routeIs('project.index', 'project.canvas.index') => 'Projects', - request()->routeIs('terminal') => 'Terminal', - request()->routeIs('server.*') => 'Servers', - request()->routeIs('source.*') => 'Sources', - request()->routeIs('destination.*') => 'Destinations', - request()->routeIs('registries.*') => 'Registries', - request()->routeIs('storage.*') => 'Storage', - request()->routeIs('shared-variables.*') => 'Shared Variables', - request()->routeIs('team.*') => 'Team', - request()->routeIs('notifications.*') => 'Notifications', - request()->routeIs('security.*') => 'Keys & Tokens', - request()->routeIs('tags.*') => 'Tags', - request()->routeIs('settings.*') => 'Settings', - request()->routeIs('profile*') => 'Profile', - request()->routeIs('admin.*') => 'Admin', - default => null, + [$dashboardContext, $dashboardContextRoute] = match (true) { + request()->routeIs('dashboard') => ['Dashboard', 'dashboard'], + request()->routeIs('project.index', 'project.canvas.index') => ['Projects', 'project.index'], + request()->routeIs('terminal') => ['Terminal', 'terminal'], + request()->routeIs('server.*') => ['Servers', 'server.index'], + request()->routeIs('source.*') => ['Sources', 'source.all'], + request()->routeIs('destination.*') => ['Destinations', 'destination.index'], + request()->routeIs('registries.*') => ['Registries', 'registries.index'], + request()->routeIs('storage.*') => ['Storage', 'storage.index'], + request()->routeIs('shared-variables.*') => ['Shared Variables', 'shared-variables.index'], + request()->routeIs('team.*') => ['Team', 'team.index'], + request()->routeIs('notifications.*') => ['Notifications', 'notifications.email'], + request()->routeIs('security.*') => ['Keys & Tokens', 'security.private-key.index'], + request()->routeIs('tags.*') => ['Tags', 'tags.show'], + request()->routeIs('settings.*') => ['Settings', 'settings.index'], + request()->routeIs('profile*') => ['Profile', 'profile'], + request()->routeIs('admin.*') => ['Admin', 'admin.index'], + default => [null, null], }; @endphp
/ - {{ $dashboardContext }} + {{ $dashboardContext }} @endif @if ($currentStorage) @@ -217,14 +217,19 @@ / {{-- Project switcher --}}
- +
@@ -244,13 +249,18 @@ / {{-- Environment switcher --}}
- +
diff --git a/resources/views/livewire/server/navbar.blade.php b/resources/views/livewire/server/navbar.blade.php index 2241cf26f2..0c9bb9f38c 100644 --- a/resources/views/livewire/server/navbar.blade.php +++ b/resources/views/livewire/server/navbar.blade.php @@ -118,18 +118,22 @@ - +
diff --git a/tests/v4/Browser/BreadcrumbRenameTest.php b/tests/v4/Browser/BreadcrumbRenameTest.php index e933d194b1..419a02570b 100644 --- a/tests/v4/Browser/BreadcrumbRenameTest.php +++ b/tests/v4/Browser/BreadcrumbRenameTest.php @@ -13,12 +13,12 @@ it('updates the project breadcrumb after the project is renamed', function () { loginAndSkipBoarding(); $page = visit(route('project.edit', ['project_uuid' => $this->stack['project']->uuid])); - $page->assertSeeIn('button[title="Switch project"]', 'Browser Project') + $page->assertSeeIn('a[title="Go to project"]', 'Browser Project') ->fill('name', 'Renamed Project'); submitLivewireForm($page); - $page->assertSeeIn('button[title="Switch project"]', 'Renamed Project') + $page->assertSeeIn('a[title="Go to project"]', 'Renamed Project') ->screenshot(filename: 'breadcrumb-project-renamed'); }); @@ -27,11 +27,11 @@ it('updates the resource breadcrumb after the database is renamed', function () loginAndSkipBoarding(); $page = visit(databaseConfigurationUrl($this->stack['project'], $this->stack['environment'], $postgres)); - $page->assertSeeIn('button[title="Switch resource"]', 'Old Postgres') + $page->assertSeeIn('a[title="Go to resource"]', 'Old Postgres') ->fill('name', 'Renamed Postgres'); submitLivewireForm($page); - $page->assertSeeIn('button[title="Switch resource"]', 'Renamed Postgres') + $page->assertSeeIn('a[title="Go to resource"]', 'Renamed Postgres') ->screenshot(filename: 'breadcrumb-database-renamed'); });