Conversation
There was a problem hiding this comment.
Pull request overview
Adds an explicit “no results” empty state for cell line tables (including hiding the table header when empty) and introduces responsive styling for that empty-state message to address the “dead end” UX for null search results.
Changes:
- Add a custom Ant Design Table
locale.emptyTextJSX block and hide headers when the table has no rows. - Add CSS module styles (with responsive adjustments) for the empty-state message and links.
- Render category sections even when a category has zero results (instead of returning
null).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/style/table.module.css | Adds .empty-message and .link styles plus responsive tweaks for empty-state UI. |
| src/components/CellLineTable/index.tsx | Implements custom empty-state message via locale.emptyText and hides table headers when empty. |
| src/components/CategorySections.tsx | Stops skipping categories with no results so empty-state can display per category. |
Comments suppressed due to low confidence (1)
src/components/CategorySections.tsx:75
- Issue #266 acceptance criteria says categories with no results should be pushed to the bottom. This component still renders tables in the original
selectedCategoriesorder, so empty categories won’t move. Consider deriving a sorted categories list based onbuckets[cat]?.length(stable sort: non-empty first, preserve relative order within the non-empty and empty groups) and mapping over that instead.
{selectedCategories.map((cat) => {
const data = buckets[cat] || [];
return (
<CellLineTable
key={cat}
tableName={cat}
tableDescription={LABEL_COPY[cat] || ""}
cellLines={data}
released={released}
columns={getNormalTableColumns(!released)}
mobileConfig={getNormalTableMobileConfig(isPhone)}
/>
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Deploy Preview for cell-catalog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
tiny nit: the horizontal bar isn't needed when it's showing this message, could do overflow hidden |
Fixed it, needs the |
src/components/CategorySections.tsx
Outdated
| const nonEmpty = selectedCategories.filter( | ||
| (cat) => buckets[cat]?.length, | ||
| ); | ||
| const empty = selectedCategories.filter((cat) => !buckets[cat]?.length); |
There was a problem hiding this comment.
nit: not a big deal for small arrays, but we're iterating selectedCategories twice which can be DRYed
something like:
const nonEmpty = []
const empty = []
for (const cat of selectedCategories) {
(buckets[cat]?.length ? nonEmpty : empty).push(cat);
}
...
Problem
Closes #266
Solution
Sort the categories so empty results move to the bottom.
Define a small block of JSX to pass to the table when data is empty, and also hide the header with the
showHeaderprop.Defined what I felt were reasonable reductions in margins, padding and font for smaller screen situations, as the designs are for a very wide screen.