Skip to content

Commit

Permalink
Fix(ui): The file tree elements have problems with keyword searches. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
easy1090 authored Feb 21, 2025
1 parent ec52ef5 commit f0ccc86
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
7 changes: 2 additions & 5 deletions packages/components/src/components/Loader/Analysis/files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ export const LoaderFiles: React.FC<{
}}
>
<div className={styles.keywords}>
<Keyword
text={basename.replace(/\[.*?\]/g, '')}
keyword={props.filename}
/>
<Keyword text={basename.replace(/\[.*?\]/g, '')} keyword={''} />
</div>
<div className={styles.dividerDiv}>
<Divider className={styles.divider} dashed />
Expand Down Expand Up @@ -209,7 +206,7 @@ export const LoaderFiles: React.FC<{
);
},
dirTitle(_dir, defaultTitle) {
return <Keyword text={defaultTitle} keyword={props.filename} />;
return <Keyword text={defaultTitle} keyword={''} />;
},
});
}, [filteredFiles]);
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/pages/BundleSize/components/asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export const AssetDetail: React.FC<{
<div className={styles['bundle-tree']}>
<div className={styles.box}>
<div className={styles.keywords}>
<Keyword ellipsis text={basename} keyword={moduleKeyword} />
<Keyword ellipsis text={basename} keyword={''} />
</div>

<div className={styles.dividerDiv}>
Expand Down Expand Up @@ -563,7 +563,7 @@ export const AssetDetail: React.FC<{
<Card
className={styles.bundle}
title={`Modules of "${asset.path}"`}
bodyStyle={{ overflow: 'scroll', height }}
bodyStyle={{ minHeight: height }}
size="small"
>
{includeModules.length ? (
Expand Down Expand Up @@ -610,7 +610,8 @@ export const AssetDetail: React.FC<{
}
treeData={fileStructures as AntdDataNode[]}
rootStyle={{
minHeight: '800px',
maxHeight: '500px',
overflow: 'auto',
border: '1px solid rgba(235, 237, 241)',
padding: '14px 20px',
}}
Expand Down
8 changes: 2 additions & 6 deletions packages/components/src/pages/BundleSize/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { GraphType } from '../constants';

const { Option } = Select;

const cardBodyHeight = 410;
const cardBodyHeight = 600;

const largeCardBodyHeight = 800;

Expand Down Expand Up @@ -241,11 +241,7 @@ export const WebpackModulesOverallBase: React.FC<
setAssetPath(path);
}}
>
<Keyword
text={basename}
keyword={inputAssetName}
className={styles.fileText}
/>
<Keyword text={basename} keyword={''} className={styles.fileText} />
<Space size="small" className={styles.assetsTag}>
<Divider type="vertical" />
<Typography.Text style={{ color: '#4FD233' }}>
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/rules/rules/duplicate-package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export const rule = defineRule<typeof title, Config>(() => ({
gt(_packA.version, _packB.version) ? 1 : -1,
);
})
.filter((pkgs) => pkgs.length > 1);
.filter(
(pkgs) =>
pkgs.length > 1 &&
pkgs.filter((pkg) => pkg.getSize().parsedSize > 0).length > 1,
);

for (const pkg of packages) {
const message = getErrorMsg(pkg, root);
Expand Down

0 comments on commit f0ccc86

Please sign in to comment.