ReqoreCollection: add customFilter hook and pinned-group ordering
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 0
- Merge medio
- 16h 28m
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di qoretechnologies/reqore
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qoretechnologies/reqore#725 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
qoretechnologies/reqore#711 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
qoretechnologies/reqore#675 ·
I maintainer di solito rispondono entro 1 giorno
-
Checkbox: a long description pushes the control out of its container — the label column cannot shrinkForse già presa @Foxhoundn l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
qoretechnologies/reqore#662 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
qoretechnologies/reqore#745 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di qoretechnologies/reqore
Issue simili
-
area: documentation status: in progress type: documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
Oddmash/oddmash-ui#222 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
appium/appium-wincore-driver#169 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
india-ultimate/hub#715 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation Entwickler
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
I maintainer di solito rispondono entro 1 giorno