Name each canonical layout page in its window title

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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-15 06:28:31 +02:00
co-authored by Claude Opus 5
parent 1945f8233a
commit 783f7902cc
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -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',
+2 -1
View File
@@ -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>{$title} · Layout · Livewire Material</title>", 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)