Conversation
There was a problem hiding this comment.
Pull request overview
Adds sorting and richer filtering controls for the workspace Projects list, wiring UI query params in the header to client-side filtering/sorting on the list page (Issue #79).
Changes:
- Add query-param driven filtering (access, lead, members, created-date, “my projects”, favorites) and sorting logic to the projects list.
- Replace placeholder header buttons with functional Sort and Filters dropdowns (including workspace member lookups for lead/member filters).
- Improve empty-state messaging when filters are active.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ui/src/pages/ProjectsListPage.tsx | Parses filter/sort params from the URL and applies filtering + sorting to the projects collection. |
| ui/src/components/layout/PageHeader.tsx | Implements “Sort projects” and “Filter projects” dropdowns that write filter/sort state into URL search params. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
consider copilot comments, and re-request review from me |
nazarli-shabnam
left a comment
There was a problem hiding this comment.
improve search query.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const sortFieldParam = searchParams.get('sortField'); | ||
| const sortDirParam = searchParams.get('sortDir'); | ||
| const legacySortParam = searchParams.get('sort'); | ||
| const sortField = | ||
| sortFieldParam === 'manual' || | ||
| sortFieldParam === 'name' || | ||
| sortFieldParam === 'created_date' || | ||
| sortFieldParam === 'member_count' | ||
| ? sortFieldParam | ||
| : legacySortParam === 'name_asc' || legacySortParam === 'name_desc' | ||
| ? 'name' | ||
| : 'created_date'; | ||
| const sortDir = | ||
| sortDirParam === 'asc' || sortDirParam === 'desc' | ||
| ? sortDirParam | ||
| : legacySortParam === 'created_asc' || legacySortParam === 'name_asc' | ||
| ? 'asc' | ||
| : 'asc'; | ||
| const parseCsvParam = (key: string) => | ||
| (searchParams.get(key) ?? '') | ||
| .split(',') | ||
| .map((v) => v.trim()) | ||
| .filter(Boolean); | ||
| const selectedAccess = parseCsvParam('access').filter( | ||
| (value): value is 'private' | 'public' => value === 'private' || value === 'public', | ||
| ); | ||
| const selectedLeadIds = parseCsvParam('lead'); | ||
| const selectedMemberIds = parseCsvParam('members'); | ||
| const myProjectsOnly = searchParams.get('myProjects') === '1'; | ||
| const createdDateFilter = | ||
| searchParams.get('createdDate') === 'today' || | ||
| searchParams.get('createdDate') === 'last7' || | ||
| searchParams.get('createdDate') === 'last30' | ||
| ? (searchParams.get('createdDate') as 'today' | 'last7' | 'last30') | ||
| : ''; |
There was a problem hiding this comment.
There is duplicated URL-param parsing logic here (CSV parsing, access/lead/members, createdDate, sortField/sortDir incl. legacy sort) that must stay perfectly in sync with ProjectsListPage. The current duplication already caused drift (e.g., the legacy sort → sortDir mapping bug). Consider extracting a shared helper/hook (e.g., useProjectsListSearchParams) used by both the header controls and the list filtering/sorting to prevent future mismatches.
This pull request significantly enhances the filtering, sorting, and user experience of the
ProjectsListPagecomponent. The changes introduce support for multiple URL-based filters (such as access, lead, member, date, and favorites), add sorting options, and improve the empty state messaging to better reflect the user's filter selections.Filtering and Sorting Improvements:
private/public), project lead, members, creation date, favorites, and "my projects only". These filters are now applied in sequence to the project list. [1] [2]User Experience Enhancements:
Authentication Context Usage:
useAuthcontext to enable filtering projects by the currently authenticated user (for "my projects only" filter). [1] [2] [3]closes Feat: projects order and filter buttons #79