PR: #316: [Story-1249] Audit Log interface pass — real subject/avatar, one-row filters, member filter by @ankitmaheshwari-com
View PR →
Story-1249 · pramaan-app

Audit Log — interface pass

Settings → Audit Log. Real actor/subject data, an avatar column, and a consolidated single-row filter — replacing three stacked filter bars.

The Audit Log surface was functionally wired (Story-1164) but had not had a design pass and was rendering placeholder text where backend data was missing. This Story brings it to the design bar and consumes the new backend fields (subjectLabel, actorImageUrl) shipped by pramaan-functions Bug-1250 / Bug-1253.

1 · Render the real subject, kill "an item"

Before

Member rows read Sandeep Ghai DEACTIVATED the member an item — a hardcoded placeholder for the null subject label.

After

Rows render subjectLabel when present (… the member Ankit Keshri); when the backend sends null, the row falls back to the friendly subject kind (the member) — never "an item".

The "an item" literal is removed from the codebase (also the snapshot filename fallback, now Unnamed file). Missing friendly subject keys added: proceeding, firm, firm_role (en + hi).

2 · Actor avatar photo, initials fallback

ActorBadge now renders <img src={actorImageUrl}> for human actors when the event carries an avatar URL, falling back to the round initials badge when it is null (agents, system, deleted users, or no photo). Agent and system glyphs are unchanged. The URL is used as returned each load — never cached or stored.

Requires AuditEventView.actorImageUrl, pulled in by syncing the vendored OpenAPI mirror from pramaan-functions da8a78b and regenerating src/gen (HR-22).

3 · One filter row, not three

Before — three stacked segmented bars

Humans Agents

All Settings Matter Firm + matter dropdown

All Lifecycle Content Records & Files Decisions Execution Access & Security

After — single toolbar

Humans | Agents   All areas ▾ All categories ▾ All matters ▾ All members ▾

Consistent with every other list page (clients, matters). The 7-wide category bar collapses into a dropdown.

Rationale: the UX doctrine "less is more" and §7 ("cut chrome that steals prime real estate"). The Humans/Agents toggle stays a high-contrast binary toggle (two separate backend feeds — it routes between tabs) but moves into the toolbar; the now-orphaned AuditTabs is deleted.

4 · Member (actor) filter

A fourth dropdown — All members — scopes the Humans feed to a single acting member via the backend actor (user uuid) param. Gated to the Humans tab only (agents are not firm members); the member fetch is skipped on the Agents tab. Options come from useAppListMembers (status: "all", so deactivated members with history are selectable).

Files changed

AreaChange
audit-entry.tsxrender subjectLabel; pass actorImageUrl
actor-badge.tsxavatar <img> + initials fallback
audit-filters.tsxsingle toolbar; Area/Category/Matter/Member dropdowns
audit-snapshot.tsxfilename fallback → "Unnamed file"
use-audit-feed.tsthread actor param
audit/layout.tsxdrop AuditTabs (moved into toolbar)
messages/{en,hi}.jsonsubject keys, dropdown labels, member filter, "Pramaan" title-case
openapi/app-api.json + src/genmirror sync — actorImageUrl

Verification

Files changed

10 file(s), +184 / -117 lines

Path Role + -
messages/en.jsonConfig+11-4
messages/hi.jsonConfig+11-4
src/app/[locale]/(workspace)/settings/audit/layout.tsxApp route+3-4
src/components/settings/audit-log/actor-badge.tsxComponent+17-4
src/components/settings/audit-log/audit-entry.tsxComponent+11-5
src/components/settings/audit-log/audit-filters.tsxComponent+126-60
src/components/settings/audit-log/audit-log-view.tsxComponent+2-1
src/components/settings/audit-log/audit-snapshot.tsxComponent+1-1
src/components/settings/audit-log/audit-tabs.tsxComponent+0-34
src/components/settings/audit-log/use-audit-feed.tsComponent+2-0