Skip to content

Commit f831a92

Browse files
committed
fix: header toolbar spacing, search URL persistence, and filter cleanup
- Remove nested fi-page-header-main-ctn wrapper that caused double padding on board page headers vs resource list pages - Persist search query in URL via queryString() method on BoardPage and BoardResourcePage (matches existing filter URL persistence) - Remove redundant "remove all filters" button from indicator row since the filter dropdown already provides a Reset action - Use gap-x-5 instead of gap-5 on board column container
1 parent 3cfd31e commit f831a92

4 files changed

Lines changed: 38 additions & 41 deletions

File tree

resources/views/filament/pages/board-header.blade.php

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
@php
2-
use Filament\Support\Enums\IconSize;
32
use Filament\Support\Enums\Width;
43
use Filament\Support\Facades\FilamentView;
5-
use Filament\Support\Icons\Heroicon;
64
use Filament\Tables\Enums\FiltersLayout;
75
use Filament\Tables\Filters\Indicator;
8-
use Filament\Tables\View\TablesIconAlias;
96
use Filament\Tables\View\TablesRenderHook;
107
11-
use function Filament\Support\generate_icon_html;
12-
138
$table = $this->getTable();
149
$isFilterable = $table->isFilterable();
1510
$isSearchable = $table->isSearchable();
@@ -32,7 +27,7 @@
3227
$isModalLayout = ($filtersLayout === FiltersLayout::Modal) || ($hasFiltersDialog && $filtersTriggerAction->isModalSlideOver());
3328
@endphp
3429

35-
<div class="fi-page-header-main-ctn !gap-y-2 !pt-4 !pb-0">
30+
<div class="flex flex-col gap-y-1">
3631
{{-- Breadcrumbs --}}
3732
@if (filled($breadcrumbs))
3833
<x-filament::breadcrumbs :breadcrumbs="$breadcrumbs" class="mb-2" />
@@ -144,40 +139,22 @@ class="fi-ta-filters-dropdown"
144139
@if (filled($filterIndicatorsView = FilamentView::renderHook(TablesRenderHook::FILTER_INDICATORS, scopes: static::class, data: ['filterIndicators' => $filterIndicators])))
145140
{{ $filterIndicatorsView }}
146141
@else
147-
<div class="fi-ta-filter-indicators flex items-center gap-x-2">
148-
<div class="flex flex-wrap items-center gap-1">
149-
@foreach ($filterIndicators as $indicator)
150-
<x-filament::badge :color="$indicator->getColor()">
151-
{{ $indicator->getLabel() }}
152-
153-
@if ($indicator->isRemovable())
154-
<x-slot
155-
name="deleteButton"
156-
:label="__('filament-tables::table.filters.actions.remove.label')"
157-
:wire:click="$indicator->getRemoveLivewireClickHandler()"
158-
wire:loading.attr="disabled"
159-
wire:target="removeTableFilter"
160-
></x-slot>
161-
@endif
162-
</x-filament::badge>
163-
@endforeach
164-
</div>
165-
166-
@if (collect($filterIndicators)->contains(fn (Indicator $indicator): bool => $indicator->isRemovable()))
167-
<button
168-
type="button"
169-
x-tooltip="{
170-
content: @js(__('filament-tables::table.filters.actions.remove_all.tooltip')),
171-
theme: $store.theme,
172-
}"
173-
wire:click="removeTableFilters"
174-
wire:loading.attr="disabled"
175-
wire:target="removeTableFilters,removeTableFilter"
176-
class="fi-icon-btn fi-size-sm"
177-
>
178-
{{ generate_icon_html(Heroicon::XMark, alias: TablesIconAlias::FILTERS_REMOVE_ALL_BUTTON, size: IconSize::Small) }}
179-
</button>
180-
@endif
142+
<div class="fi-ta-filter-indicators flex flex-wrap items-center gap-1 mt-1">
143+
@foreach ($filterIndicators as $indicator)
144+
<x-filament::badge :color="$indicator->getColor()">
145+
{{ $indicator->getLabel() }}
146+
147+
@if ($indicator->isRemovable())
148+
<x-slot
149+
name="deleteButton"
150+
:label="__('filament-tables::table.filters.actions.remove.label')"
151+
:wire:click="$indicator->getRemoveLivewireClickHandler()"
152+
wire:loading.attr="disabled"
153+
wire:target="removeTableFilter"
154+
></x-slot>
155+
@endif
156+
</x-filament::badge>
157+
@endforeach
181158
</div>
182159
@endif
183160
@endif

resources/views/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class="w-full h-full flex flex-col relative"
2222

2323
<!-- Board Content -->
2424
<div class="flex-1 overflow-hidden h-full">
25-
<div class="flex flex-row h-full overflow-x-auto overflow-y-hidden gap-5">
25+
<div class="flex flex-row h-full overflow-x-auto overflow-y-hidden gap-x-5">
2626
@foreach($columns as $columnId => $column)
2727
<x-flowforge::column
2828
:columnId="$columnId"

src/BoardPage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,14 @@ abstract class BoardPage extends Page implements HasActions, HasBoard, HasForms
3232
*/
3333
#[Url(as: 'filters')]
3434
public ?array $tableFilters = null;
35+
36+
/**
37+
* @return array<string, array<string, mixed>>
38+
*/
39+
protected function queryString(): array
40+
{
41+
return [
42+
'tableSearch' => ['as' => 'search', 'except' => ''],
43+
];
44+
}
3545
}

src/BoardResourcePage.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ abstract class BoardResourcePage extends Page implements HasActions, HasBoard, H
4040
#[Url(as: 'filters')]
4141
public ?array $tableFilters = null;
4242

43+
/**
44+
* @return array<string, array<string, mixed>>
45+
*/
46+
protected function queryString(): array
47+
{
48+
return [
49+
'tableSearch' => ['as' => 'search', 'except' => ''],
50+
];
51+
}
52+
4353
/**
4454
* Override Filament's action resolution to detect and route board actions.
4555
*

0 commit comments

Comments
 (0)