DiamondLightSource / DiamondLightSource/smartem-frontend
Command palette caps each group at 25 items before search, hiding later items
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 13h 22m
- Merged PRs (30d)
- 4
Description
## Summary
The command palette silently limits each result group (Acquisitions, Grids, Models) to the first 25 items, and the limit is applied to the **source** list *before* the palette's search runs. As a result, any item beyond the 25th in a group is never passed to the palette and cannot be found — even by typing its exact name.
## Where
`apps/smartem/src/components/shell/Header.tsx` builds the palette groups with `.slice(0, PALETTE_GROUP_LIMIT)` (currently 25) on each source list:
```ts
items: acquisitions.slice(0, PALETTE_GROUP_LIMIT).map(...)
items: grids.slice(0, PALETTE_GROUP_LIMIT).flatMap(...)
items: models.slice(0, PALETTE_GROUP_LIMIT).map(...)
```
`CommandPalette` (`components/widgets/CommandPalette/CommandPalette.tsx`) then fuzzy-filters only the items it was handed, so the cut happens *before* search rather than after.
## Impact
- Items past the 25th in a group are unreachable via the palette, with no "+N more" affordance to indicate anything is hidden.
- The cut is by API order, which is arbitrary from the user's point of view.
- Models are unaffected today (only a handful exist), but Grids and Acquisitions can easily exceed 25, so this already undermines the palette's "jump to anything" promise for those groups.
## Suggested fix
Move the cap from the source list to the **displayed** results: pass the full lists to `CommandPalette` and have it cap what it *renders* per group (top-N by score) after filtering. Everything then becomes findable while the rendered list stays bounded. Fuzzy-scoring a few hundred items per keystroke is negligible; only if these lists could realistically reach thousands would debounce/virtualisation be worth adding.
## Notes
Surfaced during the issue #68 atlas dual-view work, where the same "doesn't scale to many" concern was fixed for the model-selector control (replaced inline buttons with a dropdown). This palette cap is a separate, pre-existing item, deferred for later.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in apps/smartem/src/components/shell/Header.tsx, where the palette groups are capped, then read components/widgets/CommandPalette/CommandPalette.tsx to follow its fuzzy filtering and rendering. Verify that acquisitions and grids beyond the first 25 can be found by name while each group remains bounded in the displayed results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100