Skip to content

Commit 1aadae5

Browse files
arjansinghgithub-actions[bot]
authored andcommitted
feat(AssetCard): remove model size (#6227)
## Summary Remove model file sizes. It was confusing some users who thought that was they were being asked to download them locally. ## Changes - Remove `formattedSize` from `AssetDisplayItem`. - Remove associated code. - ## Screenshots <img width="1299" height="512" alt="Screenshot 2025-10-23 at 11 22 06 AM" src="https://github.com/user-attachments/assets/625b588b-a605-49dd-97a2-16bcd604aef2" /> <!-- Add screenshots or video recording to help explain your changes --> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6227-feat-AssetCard-remove-model-size-2956d73d36508155930fdb4d2db2522a) by [Unito](https://www.unito.io)
1 parent dd1af64 commit 1aadae5

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

src/platform/assets/components/AssetCard.stories.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const createAssetData = (
1212
...baseAsset,
1313
description:
1414
'High-quality realistic images with perfect detail and natural lighting effects for professional photography',
15-
formattedSize: '2.1 GB',
1615
badges: [
1716
{ label: 'checkpoints', type: 'type' },
1817
{ label: '2.1 GB', type: 'size' }

src/platform/assets/composables/useAssetBrowser.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
getAssetBaseModel,
88
getAssetDescription
99
} from '@/platform/assets/utils/assetMetadataUtils'
10-
import { formatSize } from '@/utils/formatUtil'
1110

1211
function filterByCategory(category: string) {
1312
return (asset: AssetItem) => {
@@ -54,7 +53,6 @@ type AssetBadge = {
5453
// Display properties for transformed assets
5554
export interface AssetDisplayItem extends AssetItem {
5655
description: string
57-
formattedSize: string
5856
badges: AssetBadge[]
5957
stats: {
6058
formattedDate?: string
@@ -85,9 +83,6 @@ export function useAssetBrowser(assets: AssetItem[] = []) {
8583
getAssetDescription(asset) ||
8684
`${typeTag || t('assetBrowser.unknown')} model`
8785

88-
// Format file size
89-
const formattedSize = formatSize(asset.size)
90-
9186
// Create badges from tags and metadata
9287
const badges: AssetBadge[] = []
9388

@@ -105,9 +100,6 @@ export function useAssetBrowser(assets: AssetItem[] = []) {
105100
})
106101
}
107102

108-
// Size badge
109-
badges.push({ label: formattedSize, type: 'size' })
110-
111103
// Create display stats from API data
112104
const stats = {
113105
formattedDate: d(new Date(asset.created_at), { dateStyle: 'short' }),
@@ -118,7 +110,6 @@ export function useAssetBrowser(assets: AssetItem[] = []) {
118110
return {
119111
...asset,
120112
description,
121-
formattedSize,
122113
badges,
123114
stats
124115
}

tests-ui/platform/assets/composables/useAssetBrowser.test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ describe('useAssetBrowser', () => {
7070
describe('Asset Transformation', () => {
7171
it('transforms API asset to include display properties', () => {
7272
const apiAsset = createApiAsset({
73-
size: 2147483648, // 2GB
7473
user_metadata: { description: 'Test model' }
7574
})
7675

@@ -83,12 +82,10 @@ describe('useAssetBrowser', () => {
8382

8483
// Adds display properties
8584
expect(result.description).toBe('Test model')
86-
expect(result.formattedSize).toBe('2 GB')
8785
expect(result.badges).toContainEqual({
8886
label: 'checkpoints',
8987
type: 'type'
9088
})
91-
expect(result.badges).toContainEqual({ label: '2 GB', type: 'size' })
9289
})
9390

9491
it('creates fallback description from tags when metadata missing', () => {
@@ -102,22 +99,6 @@ describe('useAssetBrowser', () => {
10299

103100
expect(result.description).toBe('loras model')
104101
})
105-
106-
it('formats various file sizes correctly', () => {
107-
const testCases = [
108-
{ size: 512, expected: '512 B' },
109-
{ size: 1536, expected: '1.5 KB' },
110-
{ size: 2097152, expected: '2 MB' },
111-
{ size: 3221225472, expected: '3 GB' }
112-
]
113-
114-
testCases.forEach(({ size, expected }) => {
115-
const asset = createApiAsset({ size })
116-
const { filteredAssets } = useAssetBrowser([asset])
117-
const result = filteredAssets.value[0]
118-
expect(result.formattedSize).toBe(expected)
119-
})
120-
})
121102
})
122103

123104
describe('Tag-Based Filtering', () => {

0 commit comments

Comments
 (0)