Speak a shell destination's badge in words, and stop a null offset on PHP 8.5

<x-app-shell> passed no badge label to its rail and bar items, so a badge
like 0/3 reached a screen reader bare; a destination's badgeLabel now does.

The head script indexed the profiles with a null scheme when none are
configured, which PHP 8.5 reports as a deprecated null array offset on every
page with theme.meta on. It reads the default scheme without the lookup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RHoXZSHc8gGpZjFmA5fPc2
This commit is contained in:
Andreas Reinhold / reini
2026-09-13 22:20:37 +02:00
co-authored by Claude Opus 5
parent 433ddb2baa
commit a4bc046d1d
5 changed files with 39 additions and 6 deletions
@@ -107,3 +107,23 @@ it('gives the theme-color meta every profile\'s surfaces, the active one\'s firs
File::delete($path);
}
});
it('paints the meta without profiles and without a deprecation on PHP 8.5', function () {
config(['livewire-material.theme.meta' => true, 'livewire-material.profiles' => []]);
$deprecations = [];
set_error_handler(function (int $level, string $message) use (&$deprecations): bool {
$deprecations[] = $message;
return true;
}, E_DEPRECATED | E_USER_DEPRECATED);
try {
$html = (string) $this->blade('<x-theme-script />');
} finally {
restore_error_handler();
}
expect($html)->toContain('"meta":{')
->and($deprecations)->toBe([]);
});