Skip to content

Resident Profile Overview > Add Filter for Days Active in Resident Profile Overview #752

@chrissantillan

Description

@chrissantillan

User Story

As an Administrator, I want to filter the "Days Active" metric in a Resident's Profile Overview between the last 7 days and the last 30 days, so that I can better understand short-term and long-term engagement patterns.

Description

The Resident Profile Overview currently shows the Days Active metric as the total number of days the Resident was active in the past 30 days. This issue introduces a filter toggle that allows administrators to switch between two time ranges:

  1. Last 7 Days — Displays the number of days the Resident has been active in the last 7 days.
  2. Last 30 Days — Displays the number of days the Resident has been active in the past 30 days (current implementation).

The filter will be implemented as a toggle pill component positioned to the right of the Days Active value.

Tasks

  • Add Filter UI
    • Implement a toggle pill with options for "Last 7 Days" and "Last 30 Days".
    • Set "Last 30 Days" as the default selection.
  • Backend Query Adjustments
    • Update the backend queries to calculate Days Active based on the selected time range.
  • UI Display Update
    • Update the Days Active display to show the correct number of days based on the selected time filter.
    • Adjust styling so that the toggle pill is consistent with the UnlockEd design system.

User Flow

  1. Admin logs into UnlockEd.
  2. Admin navigates to the Residents page.
  3. Admin clicks on a Resident's name to open the Resident Profile Overview.
  4. In the Engagement Metrics section, Admin sees the Days Active value with a toggle pill labeled:
    • "Last 7 Days"
    • "Last 30 Days" (default selection)
  5. Admin clicks the "Last 7 Days" pill.
    • The Days Active metric updates to show the number of active days in the past 7 days.
  6. Admin clicks "Last 30 Days".
    • The Days Active metric returns to the monthly total (last 30 days).

Acceptance Criteria

  • The Days Active metric displays correctly for both last 7 days and last 30 days.
  • "Last 30 Days" is the default selection when loading the Resident Profile Overview.
  • Switching between "Last 7 Days" and "Last 30 Days" updates the metric without refreshing the page.
  • The toggle pill is visually consistent with the rest of the UnlockEd UI.

Technical Considerations

  • Use the existing date-tracking logic but extend it to support filtering by "last 7 days".
  • Test performance when toggling between "Last 7 Days" and "Last 30 Days" to ensure no lag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementUpdates to an existing feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions