Skip to content

Header toolbar: fix spacing, persist search in URL, clean up filters#96

Merged
ManukMinasyan merged 4 commits into4.xfrom
feat/header-toolbar
Mar 16, 2026
Merged

Header toolbar: fix spacing, persist search in URL, clean up filters#96
ManukMinasyan merged 4 commits into4.xfrom
feat/header-toolbar

Conversation

@ManukMinasyan
Copy link
Contributor

Summary

  • Fix nested fi-page-header-main-ctn wrapper causing board page headings to sit 18px lower than resource list pages
  • Persist search query in URL (?search=term) matching existing filter URL persistence
  • Remove redundant "remove all filters" button from indicator row (Reset in dropdown handles this)

Changes

Header spacing fix

The board-header.blade.php was wrapping content in <div class="fi-page-header-main-ctn"> which created a nested container inside Filament's own .fi-page-header-main-ctn from <x-filament-panels::page>. This caused double padding (32px outer + 16px inner = heading at 106px vs 88px on resource pages). Replaced with a plain flex flex-col.

Search URL persistence

Added queryString() method to BoardPage and BoardResourcePage that maps $tableSearch to ?search= URL parameter. Uses Livewire's queryString() method (not #[Url] attribute) to avoid type conflict with Filament's untyped $tableSearch property in CanSearchRecords trait.

Filter indicator cleanup

Removed the standalone "remove all" X icon button from the filter indicators row. The filter dropdown already has a "Reset" action, making the button redundant. Individual filter badge dismiss buttons are preserved.

Test plan

  • Board page heading aligns with resource list page heading
  • Search query persists in URL when typing in search field
  • Filter indicators show with individual dismiss buttons
  • Filter dropdown Reset still clears all filters

Copilot AI review requested due to automatic review settings March 16, 2026 19:59
When `->headerToolbar()` is enabled on a Board, the filter trigger
and search field render inline with the page heading instead of in
a separate row between the title and columns.

This uses Filament's native `getHeader()` override in the BaseBoard
trait to render a custom header view that combines:
- Page heading + subheading
- Filter dropdown (right-aligned)
- Search field (right-aligned)
- Active filter indicator badges (below heading)

Usage:
```php
return $board
    ->headerToolbar()
    ->query(...)
    ->columns(...)
```

The default behavior (no headerToolbar) is unchanged — filters
render in their own row above the board columns.
Inline filter/search in the page header is now the default for all
boards. Opt out with `->headerToolbar(false)` for the classic
stacked layout.

This is a breaking change appropriate for the 4.x major version.
- 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
@ManukMinasyan ManukMinasyan merged commit d4d2d6e into 4.x Mar 16, 2026
4 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional “header toolbar” mode for Flowforge boards in Filament pages, moving the filters/search UI into the page header and introducing a cleaner search query-string key for board search state.

Changes:

  • Introduces Board::headerToolbar() / hasHeaderToolbar() and passes the flag into the board view config.
  • Overrides Filament page header rendering (when enabled) via a new board-header Blade view that renders heading + inline filters/search.
  • Adds query-string mapping so board table search state uses ?search= (and updates docs accordingly).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Concerns/BaseBoard.php Adds getHeader() override to swap header rendering when header toolbar is enabled.
src/Board.php Adds headerToolbar() API + exposes flag to the board view config.
src/BoardPage.php Adds query-string mapping for board search (tableSearchsearch).
src/BoardResourcePage.php Same query-string mapping for resource-based board pages.
resources/views/index.blade.php Skips rendering the existing filters partial when header toolbar mode is enabled.
resources/views/filament/pages/board-page.blade.php Adjusts container stacking context (relative + z-index).
resources/views/filament/pages/board-header.blade.php New header layout rendering title + inline filters/search + indicators.
docs/content/2.essentials/4.api-reference.md Documents the new headerToolbar() method.
docs/content/2.essentials/2.customization.md Adds customization guidance and layout constraints for header toolbar.
Comments suppressed due to low confidence (1)

resources/views/index.blade.php:21

  • When headerToolbar is enabled this skips rendering the full filters view entirely. The new board-header view only renders filter UI for Dropdown/Modal layouts, so enabling headerToolbar() with any other FiltersLayout will result in filters not being rendered anywhere. Consider enforcing compatibility in code (e.g., have Board::hasHeaderToolbar() return false unless the current filters layout is supported, or render the standard filters partial as a fallback for unsupported layouts) so users can’t accidentally lose filter controls.
    @unless($config['headerToolbar'] ?? false)
        @include('flowforge::components.filters')
    @endunless

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +44
/**
* @return array<string, array<string, mixed>>
*/
protected function queryString(): array
{
return [
'tableSearch' => ['as' => 'search', 'except' => ''],
];
}
Comment on lines +44 to 53
* @return array<string, array<string, mixed>>
*/
protected function queryString(): array
{
return [
'tableSearch' => ['as' => 'search', 'except' => ''],
];
}

/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants