Skip to content

Show the audit log as a full-width, filterable table - #853

Merged
guidovizoso merged 7 commits into
mainfrom
guido/audit-table
Oct 28, 2026
Merged

guidovizoso merged 7 commits into
mainfrom
guido/audit-table

Conversation

@guidovizoso

Copy link
Copy Markdown
Collaborator

What this changes

Admin → Audit reads like a log viewer instead of a list of cards.

  • Fits the window. The page is one viewport tall. The title, the views and the search stay put; only the table's rows scroll, under a column header that stays pinned. A table wider than the pane scrolls sideways inside its own container.
  • A real table (@tanstack/react-table v9, new components/ui/table.tsx). Columns: outcome mark, When, What, On, Bot, Started by, Decision. Rows show the full date and time, newest first; a press on When flips the order. Blocked rows are tinted red, actions that did not happen amber.
  • A data-table toolbar. The saved views (Everything, Computer actions, Blocked, Did not happen, Nobody watching) are a segmented "View" control and still ask the server for a different set. Under them: a search box, dashed filter buttons for Outcome, Bot and Started by (tick any number of values, with counts), the "N of M events" count, then Refresh and Export CSV. Search and the filter buttons narrow the events already loaded.
  • The Bot column names the Bot an event is about. Events done to a Bot (routed to it, started, handed work) record it as the target, not in the payload, so a routing row showed the Bot under On and "-" under Bot. Bot now falls back to an agent target.
  • PageShell's wide width (used only here) is replaced by full. Admin's <main> gains min-w-0 so a wide table can't push the pane past the window.
  • Cell rendering moved from the route into components/audit/audit-cells.tsx, each with a plain-text form that search uses.

Where it runs

  • New state that outlives a request? None. Sorting, search and filters are component state in the browser.
  • What happens on the second replica? Nothing different; no server change.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • No acting calls change; this only reads the existing audit endpoints.
  • No new refusals or failures.
  • Nothing new trusted from the client.

Changelog

  • "The audit log reads like a log" under Unreleased.

Proof

  • bun test app/tests: 1540 pass, 0 fail. app/tests/audit-table.test.tsx covers the one-viewport layout, sorting, the search count, outcome colouring, the Outcome filter, and the Bot column for a routing row; the existing audit tests pass unchanged.
  • App typecheck, typecheck:tests and biome check on the changed files are clean.
  • Checked by hand against a local deployment at 1440×800: the header and toolbar stay put while rows scroll, the toolbar doesn't clip, and a routed message shows "General Assistant" under Bot.

Not included: the example's date-range filter and histogram.

@guidovizoso
guidovizoso merged commit cd161d0 into main Oct 28, 2026
19 checks passed
@guidovizoso
guidovizoso deleted the guido/audit-table branch October 28, 2026 11:11
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.

1 participant