Skip to content

Improve owner dropdown sorting in forms #751

@timothyfroehlich

Description

@timothyfroehlich

Feature Request

Currently, the owner dropdown in forms (e.g., when adding/editing machines) doesn't have an optimized sort order. We should implement a smarter sorting algorithm to make it easier for users to find owners.

Proposed Sort Order

Sort owners in the dropdown using the following priority:

  1. Confirmed vs Unconfirmed: Confirmed users (from user_profiles) should appear before unconfirmed users (from unconfirmed_users)
  2. Number of Owned Machines: Within each group, sort by number of owned machines (descending)
  3. Alphabetically by Last Name: Finally, sort alphabetically by last name

Example Output

Confirmed Users:
  - Chris Engberg (8 machines)
  - Summer Ellington (4 machines)
  - Jordan Burgar (2 machines)
  - Tim Froehlich (1 machine)
  
Unconfirmed Users:
  - Chris Welch (3 machines)
  - Ted Gaunt (4 machines)
  - Neil Wilson (3 machines)

Implementation Notes

  • This affects owner selection dropdowns across the application
  • May want to add visual separators between confirmed/unconfirmed groups
  • Consider showing machine count in parentheses next to owner name in dropdown

Related Files

  • Owner selection components/forms
  • Owner query/sorting logic in services or server actions

Labels: enhancement, ux
Priority: Low (nice-to-have improvement)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions