Work through support tickets without leaving the list, in Filament
Monday morning, 40 new tickets. The support agent opens the first one, reads it, clicks Edit, assigns it to a colleague, saves, presses Back, finds their place in the list again, opens the second one. Every ticket is three page loads and a moment of "where was I?". By the tenth ticket the list has scrolled back to the top twice.
Mail apps solved this long ago: the list on the left, the message on the right. This article shows the same for a Filament resource with Warp Split View. The right side is not a new preview to build: it is the resource's own View and Edit pages. All pictures are from the live demo.
The scene: the list and the ticket side by side
Click a ticket, and its View page opens on the right. The row stays marked in the list.
Step 1: one line on the List page
This is the demo's List page, without its "View code" button:
use Filament\Resources\Pages\ListRecords;
use Qalainau\FilamentWarpSplitView\Concerns\HasSplitView;
class ListTickets extends ListRecords
{
use HasSplitView;
protected static string $resource = TicketResource::class;
}
That is all. The resource is an ordinary Filament resource with index, view and edit pages. The View and Edit pages are not changed: their header actions, relation managers and save hooks work in the pane as they do on a full page.
To choose which pages open on the right and how wide the list is, add a static splitView() to the List page:
use Qalainau\FilamentWarpSplitView\SplitView;
public static function splitView(SplitView $split): SplitView
{
return $split
->pages(['view', 'edit'])
->listColumns(['subject', 'status', 'created_at'])
->listWidth('26rem');
}
Step 2: edit in place
Press Edit, and the Edit page replaces the View page on the right. The agent assigns the ticket to Priya and sets it to Pending.
Save, and the list on the left shows the new status at once, without a reload.
If the agent tries to move on with unsaved changes, the split view asks first: Discard unsaved changes?
Step 3: next ticket with ↓
In the list, ↓ (or j) opens the next ticket and ↑ (or k) the previous one. Enter moves into the pane, Esc goes back to the list. The toolbar above the pane has the same moves as buttons, plus "open in full page".
The URL keeps the open ticket (?record=12&pane=edit), so a link to it, or a reload, opens the same ticket in the same place. Moving between tickets does not add history entries, so the Back button leaves the list instead of walking through every ticket.
Other scenes
- Orders: a small Livewire component of your own on the right instead of a page, with a "Mark as shipped" button (
->component()). - Customers: the View page with its relation manager tabs, so the customer's tickets are in the pane too.
- The detail under the list instead of beside it, for wide tables.
- Phones: under 48rem the screen becomes one column with a "back to the list" button.
Limits worth knowing
- The split view is for resource List pages. It does not split inside a relation manager. (The package's
Splittersplits any other page into panes.) - The Cancel button of Edit and Create pages is not shown in the pane, because it goes back in the browser history and would leave the whole screen.
- Breadcrumbs of the pages are hidden in the pane, and the heading is a little smaller.
Try it
Open the tickets demo, click a ticket, press Edit, change the status and save. Then click a row and press ↓. No sign-up, and the data is reset every hour.