Skip to content

[FE-62] Implement dashboard widget customisation — drag-to-reorder and show/hide cards #1050

Description

@yusuftomilola

Overview

The dashboard currently shows a fixed set of summary cards and charts. Different users care about different metrics — a MANAGER wants to see their department's maintenance schedule while a USER wants quick access to their assigned assets. Allowing personalisation improves the relevance of the dashboard for every role.

Context

  • Dashboard page: frontend/app/(dashboard)/dashboard/page.tsx
  • dnd-kit is already installed and can power drag-and-drop card reordering
  • User preferences (widget order and visibility) should be stored in localStorage keyed by user.id
  • The set of available widgets: Summary Stats, Assets by Status chart, Assets by Category chart, Recent Assets table, Upcoming Maintenance, My Assigned Assets, Low Stock Alerts, Overdue Checkouts

Acceptance Criteria

  • Add a "Customise Dashboard" button to the dashboard header
  • Clicking enters "edit mode": widgets display a drag handle and an eye/hide toggle
  • Drag-and-drop reordering using dnd-kit useSortable; the layout updates live as cards are dragged
  • Hiding a widget removes it from the dashboard but adds it to a "hidden" list in the customise panel
  • "Done" saves the layout and visibility to localStorage and exits edit mode
  • "Reset to Default" restores the original widget order and visibility
  • The saved layout is loaded on every dashboard visit; the dashboard renders in the user's last configured order

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions