fix(catalog): stop virtualizing single-board catalogs (#1121)

* fix(catalog): defer pretext row work and trim multiboard append batches

* fix(catalog): stop virtualizing single-board catalogs
This commit is contained in:
Tommaso Casaburi
2026-04-03 15:08:22 +07:00
committed by GitHub
parent 251e103db3
commit 7ba28becc5
4 changed files with 210 additions and 49 deletions
+31 -9
View File
@@ -357,14 +357,36 @@ interface CatalogRowProps {
row: Comment[];
}
const CatalogRow = memo(({ estimatedHeight, matchedFilterColors, row }: CatalogRowProps) => {
return (
<div className={styles.row} data-pretext-height={estimatedHeight}>
{row.map((post, index) => (
<CatalogPost key={post?.cid || index} matchedFilterColor={matchedFilterColors?.get(post?.cid || '')} post={post} />
))}
</div>
);
});
const CatalogRow = memo(
({ estimatedHeight, matchedFilterColors, row }: CatalogRowProps) => {
return (
<div className={styles.row} data-pretext-height={estimatedHeight}>
{row.map((post, index) => (
<CatalogPost key={post?.cid || index} matchedFilterColor={matchedFilterColors?.get(post?.cid || '')} post={post} />
))}
</div>
);
},
(prevProps, nextProps) => {
if (prevProps.estimatedHeight !== nextProps.estimatedHeight || prevProps.row.length !== nextProps.row.length) {
return false;
}
for (let index = 0; index < prevProps.row.length; index += 1) {
const prevPost = prevProps.row[index];
const nextPost = nextProps.row[index];
if (prevPost !== nextPost) {
return false;
}
const cid = prevPost?.cid || '';
if (prevProps.matchedFilterColors?.get(cid) !== nextProps.matchedFilterColors?.get(cid)) {
return false;
}
}
return true;
},
);
export default CatalogRow;