mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-08-23 03:26:37 +00:00
feat(frontend): extend Flows search to provider and terminals
Switch the `provider` and `terminals` columns from `accessorKey` to `accessorFn` so the global filter receives plain strings — the provider name and the joined list of terminal images — instead of the raw object or array, which the predicate would just stringify to `[object Object]`. The cell renderers keep reading `row.original` directly, so the visible output is unchanged. Dates stay excluded: substring matching against formatted timestamps gives unpredictable hits (e.g. typing "3" suddenly matches every row whose ISO contains 03) and date filtering belongs in a range picker. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
63d059834f
commit
fd0edebf83
@@ -262,7 +262,12 @@ const Flows = () => {
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
accessorKey: 'provider',
|
||||
// accessorFn returns the provider name as a plain string so it
|
||||
// participates in the DataTable global filter (search input).
|
||||
// The cell renderer still reads the original provider object
|
||||
// directly through `row.original`, so the icon + label stay
|
||||
// intact.
|
||||
accessorFn: (row) => row.provider?.name ?? '',
|
||||
cell: ({ row }) => {
|
||||
const flow = row.original;
|
||||
|
||||
@@ -282,7 +287,9 @@ const Flows = () => {
|
||||
title="Provider"
|
||||
/>
|
||||
),
|
||||
id: 'provider',
|
||||
maxSize: 150,
|
||||
meta: { searchable: true },
|
||||
minSize: 80,
|
||||
size: 100,
|
||||
sortingFn: (rowA, rowB) => {
|
||||
@@ -293,7 +300,11 @@ const Flows = () => {
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorKey: 'terminals',
|
||||
// accessorFn joins all terminal images into one string for the
|
||||
// global search; the cell still derives its presentation from
|
||||
// the original array on `row.original`, and sortingFn keeps
|
||||
// ordering by count (more intuitive than alphabetical).
|
||||
accessorFn: (row) => (row.terminals ?? []).map((t) => t.image).join(' '),
|
||||
cell: ({ row }) => {
|
||||
const flow = row.original;
|
||||
const terminals = flow.terminals || [];
|
||||
@@ -341,7 +352,9 @@ const Flows = () => {
|
||||
title="Terminals"
|
||||
/>
|
||||
),
|
||||
id: 'terminals',
|
||||
maxSize: 220,
|
||||
meta: { searchable: true },
|
||||
minSize: 160,
|
||||
size: 180,
|
||||
sortingFn: (rowA, rowB) => {
|
||||
|
||||
Reference in New Issue
Block a user