Skip to content

feat(all-users): add Last Action column showing most recent activity#780

Merged
ismaeldosil merged 1 commit intostagingfrom
feature/last-action-column
Jan 27, 2026
Merged

feat(all-users): add Last Action column showing most recent activity#780
ismaeldosil merged 1 commit intostagingfrom
feature/last-action-column

Conversation

@ismaeldosil
Copy link
Collaborator

@ismaeldosil ismaeldosil commented Jan 27, 2026

Summary

  • Add "Last Action" column to All Users table showing most recent user activity
  • Optimized batch queries: 5 queries total instead of 2,995 (599 users × 5 collections)
  • Sources: observations, knowledgeChecks, conferencePlans, actionPlans, emails

Changes

  • Firebase.tsx: New getUsersLastAction() method with optimized batch queries
  • AllUsersTable.tsx: Added sortable "Last Action" column, updated CSV export
  • Types.tsx: Added lastAction?: Date to User interface

Performance

  • Query strategy: 5 parallel queries using Promise.all()
  • Memory: Map<userId, lastDate> for O(1) lookups
  • Expected response: < 5 seconds for ~29K records

Test plan

  • Verify "Last Action" column displays dates for active users
  • Test sorting by Last Action (ascending/descending)
  • Verify CSV export includes Last Action column
  • Check users with no activity show "Never"

- Add getUsersLastAction() method with optimized batch queries
- Query 5 collections in parallel (observations, knowledgeChecks,
  conferencePlans, actionPlans, emails)
- Build Map<userId, lastDate> in memory for O(1) lookups
- Add lastAction to User interface and getAllUsers() result
- Add sortable "Last Action" column to AllUsersTable
- Include Last Action in CSV export

Performance: 5 queries total instead of 2,995 (599 users × 5 collections)

Closes CHALK-090
Closes CHALK-091
Closes CHALK-092
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