ReqoreCollection: add customFilter hook and pinned-group ordering
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start with src/components/Collection/index.tsx, especially the built-in filter at lines 241–255 and group ordering at lines 471–481; then inspect the existing collection props and stories. Implement the agreed custom-filter and pinned-group API, preserving current default filtering and the stated Ungrouped behavior. Add a story for each feature and verify the acceptance criteria; virtualization is optional and lower priority.
Written by the indexing model from the issue text.
Description
Two related gaps surfaced while fixing qorus-ide app-catalogue issues (qorus-ide#235, #236, #237). Both have IDE-side workarounds today, but the upstream fix belongs here so every consumer benefits.
1. customFilter (or filterFn) prop on ReqoreCollection
Why we need it. Reqore's built-in filter is a single contiguous-substring check on each item's label + content + searchString (Collection/index.tsx:241-255). For larger catalogues this is too restrictive:
- Multi-word queries match only when the words appear contiguously and in order.
email watch customerreturns nothing even when an action labelled "Customer.io: Watch email" exists. The fix is tokenise + AND across tokens, but there's no hook to override the matcher. - A consumer that does its own filtering upstream (e.g. relevance-scoring across joined apps + actions) then re-renders the Collection with the already-approved items has no way to disable Reqore's second pass. Today the qorus-ide AppCatalogue smuggles the raw query into each item's
searchStringso Reqore's.includes(query)trivially succeeds — a hack we'd rather not need.
Shape.
```ts
interface IReqoreCollectionProps {
// ...existing props
/** Replaces the built-in substring matcher when present.
- Receives the item and the current query (already lowercased and
- trimmed in the same way as the default matcher) and returns
- true to keep the item. Skipped entirely when there is no query. */
customFilter?: (item: IReqoreCollectionItemProps, query: string) => boolean;
}
```
Default behaviour unchanged when omitted. Pairs cleanly with the existing `searchDelay` debounce.
2. Pinned-group ordering
Why we need it. Group ordering in Collection/index.tsx:471-481 is alphabetical via `localeCompare`, with only `'Ungrouped'` special-cased to the start. There is no API for a consumer to pin its own group at the top.
The qorus-ide app catalogue (qorus-ide#237) wants a synthetic "★ Favorites" group at the top of the apps list, above the alphabetically-sorted category groups. Today there is no clean way to do this — the closest workaround is naming the favorites group with a leading whitespace so it sorts before any letter, which reads like a bug and is locale-fragile.
Shape (proposal A — bulk).
```ts
interface IReqoreCollectionProps {
/** Group names to render at the top of the list, in the given
- order, before the alphabetically-sorted groups. `'Ungrouped'`
- remains pinned to the very start of the result unless explicitly
- included here. */
pinnedGroups?: string[];
}
```
Shape (proposal B — per-group). Already supported types make this cleaner: extend the existing `IReqoreCollectionGroup` (already addressable via the `groups` prop) with an optional `order: number` field. Groups with an `order` sort by it ascending before the unordered groups, which then fall back to alphabetical.
```ts
interface IReqoreCollectionGroup extends IReqorePanelProps {
/** When set, this group is placed at this index in the sorted list
- before alphabetical sorting kicks in for the remaining groups.
- Lower numbers render higher. */
order?: number;
}
```
Either shape works. Proposal A is the smallest API surface; proposal B reuses the existing `groups` config prop and lets a consumer mix per-group styling with ordering without duplicating the group name across two props.
3. (Optional) Item virtualization
Not blocking — flagging because qorus-ide#235 found the app catalogue rendering 636 items in one shot on a single-letter query. Adding row-level virtualization to ReqoreCollection (similar to `react-virtual`) would let the IDE skip its workaround for the per-render cost. Lower priority than the two above.
Acceptance criteria
- A consumer that passes `customFilter` replaces the built-in matcher cleanly (returns false → item hidden).
- A consumer that omits `customFilter` sees identical behaviour to today (no regression).
- Pinned groups render in the supplied order, above the alphabetically-sorted ones; `'Ungrouped'` remains first unless explicitly overridden.
- A story demonstrating each feature lands alongside the prop.
Context
- IDE-side workarounds and the issues that motivated this: qorus-ide#235, qorus-ide#236, qorus-ide#237.
- Filed by Claude on Filip's behalf while shipping the IDE fixes; assign to whoever owns Reqore's Collection component.
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 0
- Avg merge
- 16h 28m
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qoretechnologies/reqore
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
qoretechnologies/reqore#725 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
qoretechnologies/reqore#711 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
qoretechnologies/reqore#675 ·
Maintainers usually reply within 1 day
-
Checkbox: a long description pushes the control out of its container — the label column cannot shrinkPossibly taken @Foxhoundn claimed this 53 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
qoretechnologies/reqore#662 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
qoretechnologies/reqore#745 ·
Maintainers usually reply within 1 day
All issues in qoretechnologies/reqore
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zabuton-app/meguri#875 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
area:api area:web wave wave:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day