Skip to content

AuditLogViewer with filtering, sorting, and export - #21

Open
gadyrcdz wants to merge 1 commit into
redux-space:mainfrom
gadyrcdz:feature/EventsUI
Open

AuditLogViewer with filtering, sorting, and export#21
gadyrcdz wants to merge 1 commit into
redux-space:mainfrom
gadyrcdz:feature/EventsUI

Conversation

@gadyrcdz

@gadyrcdz gadyrcdz commented Aug 1, 2026

Copy link
Copy Markdown

Overview

Implements the Audit Log Viewer UI described in the issue — a comprehensive interface for tracking portfolio events, changes, and actions with filtering, sorting, and export capabilities.

##closes #8

Changes

  • AuditLogViewer — main container managing filter state (date range, event types, search) and rendering the table + modal
  • AuditLogTable — table built with @tanstack/react-table, includes client-side sorting and pagination (10 items/page); switches to a card-based layout on mobile (<md)
  • DateRangeFilter — native date inputs for from/to filtering
  • EventTypeFilter — multi-select dropdown with checkboxes, closes on outside click
  • EventDetailModal — shows full event details on row/card click; closes on Escape, backdrop click, or the close button
  • StateComparison — before/after diff view, used inside the modal for events with state changes (e.g. settings_changed)
  • ExportButton — exports the currently filtered event set as JSON or CSV
  • AuditEvent type added to src/types/, following the existing pattern (Asset, RiskScore, etc.) and re-exported from index.ts
  • Mock dataset (examples/mockAuditEvents.ts) with 1200 events for development and to validate rendering performance
  • New dependency: @tanstack/react-table (added to package.json)

Acceptance Criteria

  • Audit log table displays events with all required columns (timestamp, event type, action, result)
  • Date range filtering works correctly and updates results
  • Event type multi-select filter functions as expected
  • Search finds events by action, type, or result
  • Sorting works on all columns
  • Export produces valid JSON and CSV files with complete (filtered) data
  • Event detail modal shows comprehensive event information
  • State comparison clearly highlights changes (before/after)
  • Performance: table renders 1000+ events smoothly (tested with 1200 mock events)
  • Mobile view provides usable experience (dedicated card layout, stacked filters)

Notes for reviewers

  • The component currently reads from mockAuditEvents — there's a TODO marking where this should be swapped for a real API call once the audit events endpoint exists (see AuditLogViewer.tsx).
  • No dedicated tests were added, as the issue didn't specify test requirements. Happy to add coverage for AuditLogTable, AuditLogViewer, and the CSV export logic if desired — let me know.
  • Sorting by column header is desktop-only (mobile uses cards to prioritize a simpler tap-friendly layout); pagination controls are shared between both views.

Screenshots

Mobile
image

Desktop
image

- Add AuditLogViewer, AuditLogTable, DateRangeFilter, EventTypeFilter, EventDetailModal, StateComparison, and ExportButton components
- Implement client-side pagination and sorting via @tanstack/react-table
- Support JSON/CSV export respecting active filters
- Add responsive mobile card view for the audit log table
- Add AuditEvent type and mock data for development pending API integration
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.

[Events UI] Create Audit Log Viewer with Filtering and Export

1 participant