feat(resources): add sort and filter to all resource list pages#3834
feat(resources): add sort and filter to all resource list pages#3834waleedlatif1 wants to merge 27 commits intostagingfrom
Conversation
- Replace popover filter with persistent inline panel below toolbar - Add AND/OR toggle between filter rules (shown in Where label slot) - Sync filter panel state from applied filter on open - Show filter button active state when filter is applied or panel is open - Use readable operator labels matching dropdown options - Add Clear filters button (shown only when filter is active) - Close filter panel when last rule is removed via X - Fix empty gap rows appearing in filtered results by skipping position gap rendering when filter is active - Add toggle mode to ResourceOptionsBar for inline panel pattern - Memoize FilterRuleRow for perf, fix filterTags key collision, remove dead filterActiveCount prop
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates Tables get an updated filter UX: the filter button toggles an inline Written by Cursor Bugbot for commit c8672f7. Configure here. |
Greptile SummaryThis PR adds consistent sort and multi-select filter capabilities to all resource list pages (Knowledge Bases, Files, Tables, Scheduled Tasks, Logs, Recently Deleted, KB Documents, and Document Chunks). The architecture shifts from server/table-internal Key changes:
Confidence Score: 5/5Safe to merge — all remaining findings are P2 style/polish items with no data-integrity or runtime risk. The PR is a large but well-structured feature addition. The core sort/filter logic is correct, dependency arrays are properly fixed, and the previous FilterRuleRow memoization issue has been addressed. The three open findings are: an unconditional draggable attribute that may allow drag-ghost in read-only mode (no data impact), a hardcoded '2 selected' string in a 2-option filter (cosmetic), and a dead 'updated' case in the files sort switch (dead code). None of these block correct functionality. table/table.tsx (drag handle readOnly check), knowledge/[id]/base.tsx (hardcoded display label), files/files.tsx (dead sort case) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User Input] --> B[Search Input]
A --> C[Filter Comboboxes]
A --> D[Sort Dropdown]
B --> E[useDebounce 200-300ms]
C --> F[Filter State arrays]
D --> G[activeSort]
E --> H[processedItems useMemo]
F --> H
G --> H
H --> I[Text search]
I --> J[Dimension filters]
J --> K[Client-side sort]
K --> L[rows useMemo ResourceRow]
L --> M[Resource Component]
Reviews (3): Last reviewed commit: "fix(resources): fix filter/sort correctn..." | Re-trigger Greptile |
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx
Outdated
Show resolved
Hide resolved
…backs Reading rules via ref instead of closure eliminates rules from useCallback dependency arrays, keeping callbacks stable across rule edits and preserving the memo() benefit on FilterRuleRow.
…width - Remove non-TSDoc comment from table-filter (rulesRef pattern is self-evident) - Simplify SearchSection: remove setState-during-render anti-pattern; controlled input binds directly to search.value/onChange (simpler and correct) - Reduce KB filter popover from w-[320px] to w-[200px]; tag filter uses vertical layout so narrow width works; Status-only case is now appropriately compact
|
@greptile |
|
@cursor review |
Sort dropdown: name, documents, tokens, created, last updated — pre-sorted externally before passing rows to Resource. Active sort highlights the Sort button; clear resets to default (created desc). Filter popover: filter by connector status (All / With connectors / Without connectors). Active filter shown as a removable tag in the toolbar.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table/table.tsx
Outdated
Show resolved
Hide resolved
…e hook and use type guards for file filtering
Replaces button-list filters with Combobox-based multi-select sections for file type, size, and uploaded-by filters, aligning the panel with the logs page filter UI.
Add a sort dropdown next to the search bar allowing users to sort by deletion date (default, newest first), name (A–Z), or type (A–Z).
…ss resource pages
|
@cursor review |
|
@greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
Outdated
Show resolved
Hide resolved
Chunk sort was previously done client-side on a single page of server-paginated data, which only reordered the current page. Now sort params (sortBy, sortOrder) flow through the full stack: types → service → API route → query hook → useDocumentChunks → document.tsx.
apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/document.tsx
Show resolved
Hide resolved
Resource is wrapped in React.memo, so an unstable filterContent reference on every parent re-render defeats the memo. Wrap filterContent in useMemo with correct deps in all 6 pages (files, tables, scheduled-tasks, knowledge, base, document).
Every column visible in a resource table should be sortable. Three pages had visible columns with no sort support: - files.tsx: add 'owner' sort (member name lookup) - scheduled-tasks.tsx: add 'schedule' sort (localeCompare on description) - knowledge.tsx: add 'connectors' (count) and 'owner' (member name) sorts Also add 'members' to processedKBs deps in knowledge.tsx since owner sort now reads member names inside the memo.

Summary
Type of Change
Testing
Tested manually
Checklist