From 783f7902cc453aca941643d558aca32edae387a9 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 06:28:31 +0200 Subject: [PATCH] Name each canonical layout page in its window title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan step 38 review: ShowcaseController::layout() passes a title ("List-detail · Layout"), but the frame overwrote it with the section's own, so all three pages and the Layout overview shared one title. The frame keeps a title it was given; the layout page test asserts each. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- resources/views/showcase/layout.blade.php | 3 ++- tests/Feature/ShowcaseTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/showcase/layout.blade.php b/resources/views/showcase/layout.blade.php index bb951fbe..7014633e 100644 --- a/resources/views/showcase/layout.blade.php +++ b/resources/views/showcase/layout.blade.php @@ -6,7 +6,8 @@ @php $sections ??= \NoNameWeb\LivewireMaterial\Showcase\Sections::all(); $section ??= null; - $title = $section !== null ? $sections[$section]['title'] : 'Livewire Material'; + // A page of a section's own (a canonical layout, ShowcaseController::layout()) names itself. + $title ??= $section !== null ? $sections[$section]['title'] : 'Livewire Material'; $destinations = [[ 'title' => 'Overview', diff --git a/tests/Feature/ShowcaseTest.php b/tests/Feature/ShowcaseTest.php index ca30e334..78ff29ce 100644 --- a/tests/Feature/ShowcaseTest.php +++ b/tests/Feature/ShowcaseTest.php @@ -53,9 +53,10 @@ it('gives every section a page of its own, linked from the overview and the rail }); it('gives each canonical layout a page of its own, linked from the Layout section', function () { - foreach (['list-detail', 'supporting-pane', 'feed'] as $page) { + foreach (['list-detail' => 'List-detail', 'supporting-pane' => 'Supporting pane', 'feed' => 'Feed'] as $page => $title) { test()->withoutVite()->get("/material/layout/{$page}") ->assertOk() + ->assertSee("{$title} · Layout · Livewire Material", false) ->assertSee('id="example-'.$page.'"', false) // Its own navigation reaches the other three pages, including itself. ->assertSee(route('livewire-material.layout', 'list-detail', false), false)