Hide suspended members in assignee dropdown
Summary
- hide suspended members from the member selection dropdown unless they are already assigned
- surface assigned members first in the dropdown list to reduce scrolling
- pass selected member ids into the dropdown options so ordering and filtering can be computed
Testing
- pnpm lint --filter web (fails: Command "lint" not found)
https://chatgpt.com/codex/tasks/task_e_68fa0d42d260832a88154355df1f4f58
Summary by CodeRabbit
- New Features
- Member dropdown lists now prioritize previously selected members by displaying them at the top for quicker re-access.
- Suspended members are filtered from availability except when already selected, improving list clarity and usability.
Walkthrough
The changes extend the member dropdown component to accept a new selectedMemberIds prop, which enables filtering of suspended users (keeping only those previously selected) and prioritizes selected members at the top of the list. The base component derives this prop from its existing value, and the options component implements the filtering and sorting logic.
Changes
| Cohort / File(s) | Summary |
|---|---|
Member Dropdown Enhancement apps/web/core/components/dropdowns/member/base.tsx, apps/web/core/components/dropdowns/member/member-options.tsx |
Added selectedMemberIds prop to MemberOptions; base component computes it from value prop. MemberOptions now filters suspended users (excluding those in selectedMemberIdsSet), adds isSuspended flag to options, implements prioritization sort placing previously selected members first, strengthens type safety with type-guard filter, and updates UI styling based on suspension and selection state. |
Sequence Diagram
sequenceDiagram
participant Base as MemberDropdownBase
participant Options as MemberOptions
participant UI as Render
Base->>Base: Derive selectedMemberIds from value
Base->>Options: Pass selectedMemberIds prop
Options->>Options: Create Set<selectedMemberIds> for O(1) lookup
Options->>Options: Map member list, compute isSuspended flag
Options->>Options: Filter: remove suspended (except if in selectedMemberIdsSet)
Options->>Options: Prioritize: sort selected members to top
Options->>UI: Render with updated option.isSuspended & disabled states
Estimated code review effort
π― 3 (Moderate) | β±οΈ ~22 minutes
The changes span two related files with new filtering logic, Set-based optimization, type-guarding improvements, and prioritization sorting. While individual pieces are straightforward, the combination of suspension handling, conditional inclusion, and list reordering requires careful verification of the filtering and sorting behavior.
Poem
π° With whiskers twitched and ears held high,
We filter out the suspended fry,
The chosen few now shine up top,
Their selections set to never drop!
A sorted list, both clean and tightβ
The dropdown dances left and right! β¨
Pre-merge checks and finishing touches
β Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Description Check | β οΈ Warning | The pull request description is incomplete relative to the provided template. While the author provided a Summary section with clear bullet points describing the changes and included a reference link, critical template sections are missing or inadequately addressed. Specifically, the "Type of Change" section with checkboxes is completely unfilled (the template requires selecting one or more options like Bug fix, Feature, Improvement, etc.), and the "Test Scenarios" section only documents a failed lint command without describing actual test cases or verification steps. The "Screenshots and Media" section is also not addressed, even though it could note if it's not applicable. | To meet the repository's description requirements, please: (1) Select the appropriate "Type of Change" checkbox(es) that best categorize this PR (appears to be a Feature or Improvement), (2) Provide detailed test scenarios describing what was tested and how verification was performed, noting why the lint command failed and what other tests passed, and (3) Clarify the "Screenshots and Media" section by noting it's not applicable if no visual changes are present. Ensure the description follows the complete template structure before merging. |
β Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title Check | β Passed | The pull request title "Hide suspended members in assignee dropdown" directly and clearly summarizes the primary objective of the changeset. It accurately reflects the main functionality being introduced: filtering out suspended members from the dropdown unless they are already selected. The title is concise, specific, and uses clear language that allows a reviewer scanning PR history to immediately understand the core change without confusion or ambiguity. |
| Docstring Coverage | β Passed | No functions found in the changes. Docstring coverage check skipped. |
β¨ Finishing touches
- [ ] π Generate docstrings
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
codex/fix-user-assignment-dropdown-behavior
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.