Feat/proposal sorting controls#271
Merged
Merged
Conversation
Active proposals are sorted by ascending createdAt so the oldest open proposals (closest to their implicit deadline) appear first. Executed proposals are pushed to the end of the list.
Remove the locally duplicated type and use the canonical definition from proposal-params to keep sort options in sync.
- Import SortOption from proposal-params instead of local type - Move SORT_OPTIONS and SORT_DESCRIPTIONS to module-level constants - Add ending-soon as a selectable sort option - Show description for each option inside the dropdown menu - Show active sort description beneath the trigger when not default - Add Escape key listener to close and restore focus to trigger - Add aria-haspopup, aria-expanded, role=listbox for screen readers - Use useCallback to keep close reference stable across effects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Highlighted Features:
ending-soon Sorting: Prioritizes older active proposals (proxying for implicitly approaching deadlines) and naturally pushes executed proposals to the end of the list.
Robust Dropdown: SortDropdown.tsx now supports arrow-key navigation, ARIA listbox attributes, aria-activedescendant focus management, and aria-live descriptive updates for screen readers.
Comprehensive Tests: Tests in both proposal-params.test.ts and proposal-utils.test.ts are 100% green, validating serialization, filter counting, sorting logic, and edge cases. All 71 assertions pass.
Closes #257