Skip to content

feat(audit-log): day headings, a red edge on refusals, quieter reads - #2424

Merged
Makisuo merged 20 commits into
mainfrom
audit-log-ui/c-rows-layout
Nov 10, 2026
Merged

Makisuo merged 20 commits into
mainfrom
audit-log-ui/c-rows-layout

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Part 3 of 3 of the audit log UI polish. Stacked on #2423.

The list was one long column of relative times. Now:

  • Rows sit under Today / Yesterday / Sat 7 Nov headings, with days counted in the viewer's time zone.
  • A denied entry has a red left edge, so refusals stand out while scrolling.
  • In the All view, allowed reads, tool calls and SQL runs are muted so changes stand out.
  • The Source column shows from a narrower width.
  • dayLabel and dayKey move from the users detail into page/kit/day-label, so both pages share them. The DST test moves with them, and a test for midnight in the viewer's zone is added.
  • The audit log list clears its last 3 ui-kit baseline violations (733 → 724 across the stack).

Not included: j/k keyboard navigation. It needs a document-wide key subscription on the settings page and could clash with the shell's shortcuts, so it's left for a follow-up. Rows can still be tabbed to and opened with Enter.

Before / after

Before (main) After (All view)
Data access Phone, before Phone, after

Error state (unchanged, still renders):

Verification

  • audit-log.scene.test.ts: rows sit under Today and Yesterday headings (18 pass). day-label.test.ts: DST and zone-midnight cases. The users detail tests still pass (57 across both).
  • apps/web typechecks; oxlint is clean; ui:patterns:check OK; ui:index regenerated.

Stack: #2422 → #2423 → #2424 (this)

🤖 Generated with Claude Code

…lookup filters

The audit log listed every telemetry read and MCP tool call beside the
changes, so the entries an admin opens the page for were buried. The list
now opens on Changes (data access hidden unless it was denied), with Data
access and All one click away, backed by a new kind param on
GET /v2/audit_log.

Also: resource type, action and affected user filters, a lookup field
that turns a pasted id or action into its filter, chips for filters with
no control of their own, a working Custom range, and a /lab/audit-log
page over fixtures.
…ere it came from

Following a trail meant copying an id and pasting it back as a filter.
Every actor, action, resource, affected user and request in an entry's
detail now has a Filter action that lists every entry with that value.

Also: unnamed actors and membership changes show the member's name, a
new Origin section shows surface, IP, country and request, metadata keys
read as labels, and each entry has a link that opens the log on it
(?entry=alog_...) and scrolls it into view.

inlineCode gains size and tone options; the audit log detail and the
alerts hub empty state move onto them, clearing 6 ui-kit baseline
violations.
The list was one undifferentiated column of relative times. Rows now sit
under Today / Yesterday / date headings counted in the viewer's zone,
a denied entry carries a red left edge, and in the All view allowed
reads, tool calls and SQL runs are muted so changes stand out. The
Source column shows from a narrower width.

dayLabel/dayKey move from the users detail into page/kit/day-label so
both pages share them. The audit log list clears its last 3 ui-kit
baseline violations.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1bff108f-2106-493d-8ae7-b94250a92c73
Commits

Reviewing files that changed from the base of the PR and between e1bb61a and 33f2691.

Files selected for processing: 12

  • apps/web/src/lab/audit-log-fixture.ts
  • apps/web/src/lab/audit-log-lab.ts
  • apps/web/src/page/kit/day-label.test.ts
  • apps/web/src/page/kit/day-label.ts
  • apps/web/src/page/settings/audit-log/audit-log.scene.test.ts
  • apps/web/src/page/settings/audit-log/view.ts
  • apps/web/src/page/users/view-detail.test.ts
  • apps/web/src/page/users/view-detail.ts
  • packages/backend/src/services/audit/AuditLogService.ts
  • packages/domain/src/audit-actions.ts
  • packages/views/src/ui/INDEX.md
  • scripts/oxlint-plugins/ui-kit-baseline.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

This comment has been minimized.

@maple-review-bot maple-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 inline note from Maple's review. The score and summary are in the review comment above.

In Data access every row is a read, so muting allowed ones dimmed the
whole list. The tone now depends on the view as well as the entry.
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🍁 Maple PR preview

Note

Preview resources were removed when this pull request closed.

Final commit 33f2691 · View workflow run

… minute was

The link listed the minute around the entry, newest first, so 50 newer
entries pushed it to page 2 where it never opened. The window now ends
at the entry, which therefore heads the first page, and a later page
holding it reveals it too.
…layout

# Conflicts:
#	apps/web/src/page/settings/audit-log/audit-log.scene.test.ts
@maple-review-bot

This comment has been minimized.

The web muted reads with its own copy of the server's access suffixes,
so a new access action would be filtered but not muted. The list and an
isAuditAccessAction helper move to @maple/domain/audit-actions; the
backend re-exports it for existing importers.
@Makisuo
Makisuo deployed to preview-tinybird November 9, 2026 19:59 — with GitHub Actions Active
@Makisuo

Makisuo commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

F2 (duplicated access suffix list) fixed in aba17d0: AUDIT_ACCESS_ACTION_SUFFIXES and an isAuditAccessAction helper now live in @maple/domain/audit-actions. The backend service, the list view and the lab all import them, and the backend re-exports the constant for its existing importers.

@maple-review-bot

Copy link
Copy Markdown

Checked the head commit (aba17d0), not just the diff. AUDIT_ACCESS_ACTION_SUFFIXES and isAuditAccessAction are declared once, at packages/domain/src/audit-actions.ts:424-428, and a grep for sql_executed|AUDIT_ACCESS_ACTION_SUFFIXES|isAuditAccessAction|isAccessAction|ACCESS_SUFFIXES across the repo finds no second copy: the old ACCESS_SUFFIXES/isAccess pair in apps/web/src/lab/audit-log-lab.ts is gone (line 1 now imports the domain helper) and view.ts:369 uses isAuditAccessAction, so the web no longer has a list of its own. The backend re-export at AuditLogService.ts:106 covers CancellationReviewService.ts:58, AuditLogService.test.ts:15, and the service's own two uses at lines 186/195 and 401/403, and Arr/Str are still used at lines 345, 378 and 397-398, so nothing was left dangling by removing the local copy. F2 is resolved and can be dismissed.

Two cosmetic leftovers from the move, neither blocking:

418: /** Label for an action string read off a row; null for one this build does not know. */
419: /**
420:  * Actions that record access rather than a change: ...
424: export const AUDIT_ACCESS_ACTION_SUFFIXES = ...
430: export const auditActionLabel = (action: string): string | null =>

The auditActionLabel doc comment stayed behind and now sits above the suffix list, while auditActionLabel itself has none — worth moving back down. And packages/domain/src/http/v2/audit-log.ts:161 still spells the four suffixes out in the OpenAPI description; it's prose so it can't break anything, but it's the one place left that can drift from the constant.

@Makisuo
Makisuo deployed to preview-tinybird November 9, 2026 20:01 — with GitHub Actions Active
@Makisuo

Makisuo commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the open note in 9eea2ea: the doc comment for auditActionLabel is back on its function, and the access suffix list keeps its own. Merged up into #2433.

@maple-review-bot

This comment has been minimized.

The Origin section was skipped when an entry had no IP, country or request id, which also hid the
surface it always has. Adds a test for that, and one for the window an entry's link opens.
@maple-review-bot

This comment has been minimized.

…e-minute window

An entry link lists the minute ending at its entry. A pivot kept that custom range, so "every
entry with this actor" listed only that minute.
Base automatically changed from audit-log-ui/b-detail-pivots to main November 10, 2026 10:20
@maple-review-bot

maple-review-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. Contained UI change; the new heading and day-label behaviour is pinned by a scene test plus the moved DST and zone-midnight cases.
no findings · tests covered · risk low

Groups audit log rows under day headings, gives denied rows a red left edge, mutes allowed reads in the All view only, and shares dayKey/dayLabel from page/kit. Safe to merge.

  • withDayHeadings renders a Today/Yesterday/date heading wherever the viewer's local day changes
  • dayKey and dayLabel move to page/kit/day-label, used by the users detail too
  • isQuietAccess mutes allowed read, tool, SQL and API actions, gated on the All view
  • Denied rows carry a border-l-severity-error edge; the Source column shows from @xl

33f2691 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 85486ef into main Nov 10, 2026
42 checks passed
@Makisuo
Makisuo deleted the audit-log-ui/c-rows-layout branch November 10, 2026 10:50
@Makisuo
Makisuo deployed to preview-tinybird November 10, 2026 10:50 — with GitHub Actions Active
@Makisuo

Makisuo commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Preview test of https://app-pr-2424.maple.dev (headless browser, signed in as the shared reviewer, at 1440, 1024 and 390px).

Passed: the list loads with no page errors, console errors or failed API calls; the Changes / Data access / All switch; date presets, person, resource type and action, actor type, outcome and lookup filters, each updating the URL and list; the filtered empty state and its clear action; day headings split at local midnight; entry detail with copy buttons and the actor, action and request filters; an entry link opening its entry in a fresh page, and a filter from there leaving the link's window; Reload and Load more (50 to 72 rows).

Not exercised: the preview org holds only allowed telemetry reads, so denied rows, the Changes table, the resource filter and non-user actors were covered by the scene tests and the lab only.

Found:

@Makisuo

Makisuo commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up: the Escape finding above is now fixed in #2453 as well.

This branch was successfully deployed

1 active and 1 inactive deployments
preview-tinybird — 33f26918 Deployed Nov 10, 2026 by Makisuo via branch #746
pr-preview — 33f26918 Deployed Nov 10, 2026 by Makisuo via deploy-pr-preview #11179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview:web Deploy a Workers-only PR preview (no ingest/Electric); see docs/pr-previews.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant