fabro/apps/fabro-web/app/lib/board-cache.ts
Bryan Helmkamp 4dfcbc0e03
feat(web): upgrade Children sub-tab to use the runs list view
The /runs/:id/children tab now gets server-side pagination, sortable
columns, column picker, search/time/archived filters, and bulk
archive/unarchive/delete — same affordances as the main runs list view.
Preferences persist to localStorage under a dedicated key so they don't
collide with the /runs page.

Repo and Workflow filter buttons are intentionally omitted (children
typically share these with the parent), but those columns remain visible
for the cases where workflows fan out across repos.

- New childRunsListPreferences in components/runs-list/preferences.ts
- run-children.tsx fetches via useRunsPage({parentId, ...}) with all
  list controls wired up
- Empty state retains the existing "Learn about parent links" CTA
- useChildRuns + queryKeys.runs.children removed (replaced by the
  generalized useRunsPage)
- useRetryRun broadcasts via mutateRunListCaches now that the dedicated
  children cache key is gone
- Revert board-cache children matcher added in the previous commit
  (no longer needed)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 12:48:18 -04:00

18 lines
459 B
TypeScript

import type { KeyMatcher, KeyOrMatcher } from "./sse";
type Mutator = (key: KeyOrMatcher) => unknown;
const isRunListKey: KeyMatcher = (key) =>
Array.isArray(key) &&
key[0] === "runs" &&
(key[1] === "all" || key[1] === "page");
export function runListCacheMatchers(): KeyOrMatcher[] {
return [isRunListKey];
}
export function mutateRunListCaches(mutate: Mutator) {
for (const matcher of runListCacheMatchers()) {
void mutate(matcher);
}
}