From a412c9d2c9d638aa4e6c079e0757463d881ab72e Mon Sep 17 00:00:00 2001 From: root Date: Thu, 29 Jan 2026 05:52:25 +0200 Subject: [PATCH] Fix file manager navigation and bulk select --- README.md | 3 ++- VERSION | 2 +- app/Filament/Jabali/Pages/Files.php | 18 +++++++++++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 395e22a..e1b1fe1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A modern web hosting control panel for WordPress and general PHP hosting. Built with Laravel 12, Filament v5, Livewire 4, and Tailwind CSS v4. -Version: 0.9-rc30 (release candidate) +Version: 0.9-rc31 (release candidate) This is a release candidate. Expect rapid iteration and breaking changes until 1.0. @@ -156,6 +156,7 @@ php artisan test --compact ## Initial Release +- 0.9-rc31: File manager navigation uses Livewire actions; parent row excluded from bulk select. - 0.9-rc30: Avoid IncludeOptional in ModSecurity CRS includes. - 0.9-rc29: Ensure ModSecurity unicode mapping is installed automatically. - 0.9-rc28: ModSecurity unicode mapping setup fixes. diff --git a/VERSION b/VERSION index aafe97c..c78ca2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -VERSION=0.9-rc30 +VERSION=0.9-rc31 diff --git a/app/Filament/Jabali/Pages/Files.php b/app/Filament/Jabali/Pages/Files.php index 98a1fa2..56725ad 100644 --- a/app/Filament/Jabali/Pages/Files.php +++ b/app/Filament/Jabali/Pages/Files.php @@ -232,6 +232,7 @@ class Files extends Page implements HasActions, HasForms, HasTable try { $this->currentPath = $this->sanitizePath($path); $this->loadDirectory(); + $this->resetTable(); } catch (Exception $e) { Notification::make() ->title('Invalid path') @@ -280,7 +281,15 @@ class Files extends Page implements HasActions, HasForms, HasTable public function table(Table $table): Table { return $table - ->records(fn () => $this->items) + ->records(function () { + return collect($this->items) + ->mapWithKeys(function (array $item, int $index): array { + $key = $item['path'] ?? $item['name'] ?? (string) $index; + + return [$key => $item]; + }) + ->all(); + }) ->columns([ TextColumn::make('name') ->label(__('Name')) @@ -294,10 +303,8 @@ class Files extends Page implements HasActions, HasForms, HasTable $record['is_dir'] => 'warning', default => 'info', }) - ->url(fn (array $record): ?string => $record['is_dir'] - ? route('filament.jabali.pages.files', ['path' => $record['path']]) - : null) - ->openUrlInNewTab(false) + ->action(fn (array $record) => $this->navigateTo($record['path'])) + ->disabledClick(fn (array $record): bool => ! $record['is_dir']) ->weight('medium') ->searchable(), TextColumn::make('size') @@ -619,6 +626,7 @@ class Files extends Page implements HasActions, HasForms, HasTable $this->resetTable(); }), ]) + ->checkIfRecordIsSelectableUsing(fn (array $record): bool => ! ($record['is_parent'] ?? false)) ->headerActions([ $this->newFolderAction(), $this->newFileAction(),