Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s

- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3)
- Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung
- Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü
- Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person
- Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“
- Benutzerverwaltung im Admin, Zugang vorläufig über is_admin
- vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/
- PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung
- VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-25 20:35:30 +00:00
parent 7197eaebf2
commit 9c0f8de791
15771 changed files with 1564103 additions and 5 deletions

View file

@ -0,0 +1,36 @@
<?php
namespace Filament\Support\Livewire\Partials;
use Livewire\Component;
use Livewire\Livewire;
use Livewire\Mechanisms\DataStore;
class DataStoreOverride extends DataStore
{
/**
* @param Component $instance
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get($instance, $key, $default = null)
{
if ($key !== 'skipRender') {
return parent::get($instance, $key, $default);
}
if (! Livewire::isLivewireRequest()) {
return parent::get($instance, $key, $default);
}
if ($trueOrPlaceholderHtml = parent::get($instance, $key, $default)) {
return $trueOrPlaceholderHtml;
}
$supportPartials = app(PartialsComponentHook::class);
$supportPartials->setComponent($instance);
return $supportPartials->shouldSkipRender();
}
}

View file

@ -0,0 +1,224 @@
<?php
namespace Filament\Support\Livewire\Partials;
use Closure;
use Illuminate\View\View;
use Livewire\Component;
use Livewire\ComponentHook;
use Livewire\Drawer\Utils;
use Livewire\Mechanisms\HandleComponents\ComponentContext;
use Livewire\Mechanisms\HandleComponents\ViewContext;
use function Livewire\store;
use function Livewire\trigger;
class PartialsComponentHook extends ComponentHook
{
public function shouldSkipRender(): bool
{
if ($this->shouldForceRender()) {
return false;
}
if (! $this->isLackingPartialRendersToCoverAllCallsAndUpdates()) {
return true;
}
if ($this->shouldRenderMountedActionOnly()) {
return true;
}
if ($this->shouldRenderMountedActionsOnly()) {
return true;
}
return false;
}
public function update(): Closure
{
$this->storeSet('updatesCount', ($this->storeGet('updatesCount') ?? 0) + 1);
// Defer setting `isPendingPartialRender` to true until after all `updating` hooks have run,
// before any `updated` hooks run, and before the actual property is updated. This ensures
// that multiple partial renders that are recorded from the `updated` hook each have
// their own `isPendingPartialRender` state.
return fn () => $this->storeSet('isPendingPartialRender', true);
}
public function call(?string $method = null): void
{
if (str_starts_with((string) $method, '$')) {
return;
}
$this->storeSet('callsCount', ($this->storeGet('callsCount') ?? 0) + 1);
$this->storeSet('isPendingPartialRender', true);
}
public function isLackingPartialRendersToCoverAllCallsAndUpdates(): bool
{
$updatesCount = intval($this->storeGet('updatesCount') ?? 0);
$callsCount = intval($this->storeGet('callsCount') ?? 0);
if (($updatesCount + $callsCount) === 0) {
return true;
}
return ($updatesCount + $callsCount) !== intval($this->storeGet('partialRendersCount') ?? 0);
}
public function shouldForceRender(): bool
{
return store($this->component)->get('forceRender', false);
}
public function shouldRenderMountedActionOnly(): bool
{
if (! property_exists($this->component, 'mountedActions')) {
return false;
}
$originallyMountedActionIndex = $this->component->getOriginallyMountedActionIndex();
if (blank($originallyMountedActionIndex)) {
return false;
}
$mountedActionIndex = array_key_last($this->component->mountedActions);
if (blank($mountedActionIndex)) {
return false;
}
return $originallyMountedActionIndex === $mountedActionIndex;
}
public function shouldRenderMountedActionsOnly(bool $whenActionMounted = true): bool
{
if (! property_exists($this->component, 'mountedActions')) {
return false;
}
$mountedActionIndex = array_key_last($this->component->mountedActions);
if ($whenActionMounted && blank($mountedActionIndex)) {
return false;
}
return $this->component->getOriginallyMountedActionIndex() !== $mountedActionIndex;
}
public function dehydrate(ComponentContext $context): void
{
if ($this->shouldForceRender()) {
return;
}
$partials = [];
$renderAndQueuePartials = function (Closure $getPartialsUsing) use (&$partials): void {
foreach ($getPartialsUsing() as $partialName => $view) {
if (! ($view instanceof View)) {
$view = view('filament::anonymous-partial', ['html' => $view]);
}
$finish = trigger('render', $this->component, $view, []);
$revertSharingComponentWithViews = Utils::shareWithViews('__livewire', $this->component);
$viewContext = app(ViewContext::class);
$html = $view->render(function (View $view) use ($viewContext): void {
$viewContext->extractFromEnvironment($view->getFactory());
});
$revertSharingComponentWithViews();
if (! str_contains($html, "wire:partial=\"{$partialName}\"")) {
$html = Utils::insertAttributesIntoHtmlRoot($html, [
'wire:partial' => $partialName,
]);
}
$replaceHtml = function ($newHtml) use (&$html): void {
$html = $newHtml;
};
$html = $finish($html, $replaceHtml, $viewContext);
$partials[$partialName] = $html;
}
};
$isLackingPartialRendersToCoverAllCallsAndUpdates = $this->isLackingPartialRendersToCoverAllCallsAndUpdates();
if (! $isLackingPartialRendersToCoverAllCallsAndUpdates) {
$renderAndQueuePartials(function (): array {
$partials = [];
foreach ($this->storeGet('partials') ?? [] as $renderPartials) {
$partials = [
...$partials,
...$renderPartials(),
];
}
return $partials;
});
} elseif ($this->shouldRenderMountedActionOnly()) {
$action = $this->component->getMountedAction();
if ($action !== null) {
$renderAndQueuePartials(fn (): array => [
"action-modals.{$action->getNestingIndex()}" => $action->renderModal(),
]);
}
}
if ($this->shouldRenderMountedActionsOnly(whenActionMounted: $isLackingPartialRendersToCoverAllCallsAndUpdates)) {
$renderAndQueuePartials(fn (): array => [
'action-modals' => view('filament-actions::components.modals'),
]);
}
$discoveredChildren = store($this->component)->get('children', []);
if (! empty($discoveredChildren)) {
$previousChildren = store($this->component)->get('previousChildren', []);
store($this->component)->set('previousChildren', array_merge($previousChildren, $discoveredChildren));
}
$context->addEffect('partials', $partials);
}
public function skipPartialRender(Component $component): void
{
$this->recordPartialRender($component);
}
public function forceRender(Component $component, bool $forceRender = true): void
{
store($component)->set('forceRender', $forceRender);
}
public function renderPartial(Component $component, Closure $renderUsing): void
{
store($component)->push('partials', $renderUsing);
$this->recordPartialRender($component);
}
protected function recordPartialRender(Component $component): void
{
if (! store($component)->get('isPendingPartialRender')) {
return;
}
store($component)->set('partialRendersCount', (store($component)->get('partialRendersCount') ?? 0) + 1);
store($component)->set('isPendingPartialRender', false);
}
}