fix(core): improve tag list performance (#11353)

This commit is contained in:
EYHN
2025-04-01 08:48:09 +00:00
parent ab60203849
commit 275098abe2
6 changed files with 40 additions and 20 deletions
@@ -407,7 +407,6 @@ function tagMetaToListItemProp(
to: props.rowAsLink && !props.selectable ? `/tag/${item.id}` : undefined,
onClick: toggleSelection,
color: item.color,
pageCount: item.pageCount,
operations: props.operationsRenderer?.(item),
selectable: props.selectable,
selected: props.selectedIds?.includes(item.id),
@@ -11,9 +11,7 @@ import type { TagListItemProps } from '../types';
import { ColWrapper } from '../utils';
import * as styles from './tag-list-item.css';
const TagListTitleCell = ({
title,
}: Pick<TagListItemProps, 'title' | 'pageCount'>) => {
const TagListTitleCell = ({ title }: Pick<TagListItemProps, 'title'>) => {
const t = useI18n();
return (
<div data-testid="tag-list-item-title" className={styles.titleCell}>
@@ -119,7 +117,7 @@ export const TagListItem = (props: TagListItemProps) => {
/>
<ListIconCell color={props.color} />
</div>
<TagListTitleCell title={props.title} pageCount={props.pageCount} />
<TagListTitleCell title={props.title} />
</ColWrapper>
<ColWrapper
flex={4}
@@ -147,7 +145,7 @@ export const TagListItem = (props: TagListItemProps) => {
/>
<ListIconCell color={props.color} />
</div>
<TagListTitleCell title={props.title} pageCount={props.pageCount} />
<TagListTitleCell title={props.title} />
</div>
</CustomDragPreview>
</>
@@ -59,7 +59,6 @@ export type TagListItemProps = {
tagId: string;
color: string;
title: ReactNode; // using ReactNode to allow for rich content rendering
pageCount?: number;
createDate?: Date | number;
updatedDate?: Date | number;
to?: To; // whether or not to render this item as a Link