File tree Expand file tree Collapse file tree 4 files changed +27
-6
lines changed
composables/useMediaAssets Expand file tree Collapse file tree 4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const {
5454}>()
5555
5656const topStyle = computed (() => {
57- const baseClasses = ' relative p-0'
57+ const baseClasses = ' relative p-0 overflow-hidden '
5858
5959 const ratioClasses = {
6060 square: ' aspect-square' ,
Original file line number Diff line number Diff line change 6262 </template >
6363
6464 <!-- Duration/Format chips (bottom-left) - show on hover even when playing -->
65- <template v-if =" showDurationChips " #bottom-left >
65+ <template v-if =" showDurationChips || showFileFormatChip " #bottom-left >
6666 <div
6767 class =" flex flex-wrap items-center gap-1"
6868 @mouseenter =" handleOverlayMouseEnter"
6969 @mouseleave =" handleOverlayMouseLeave"
7070 >
71- <SquareChip variant =" light" :label =" formattedDuration" />
71+ <SquareChip
72+ v-if =" formattedDuration"
73+ variant =" light"
74+ :label =" formattedDuration"
75+ />
7276 <SquareChip v-if =" fileFormat" variant =" light" :label =" fileFormat" />
7377 </div >
7478 </template >
@@ -291,6 +295,14 @@ const showDurationChips = computed(
291295 (! isVideoPlaying .value || isCardOrOverlayHovered .value )
292296)
293297
298+ const showFileFormatChip = computed (
299+ () =>
300+ ! loading &&
301+ !! asset &&
302+ !! fileFormat .value &&
303+ (! isVideoPlaying .value || isCardOrOverlayHovered .value )
304+ )
305+
294306const showOutputCount = computed (
295307 () => false // Remove output count for simplified version
296308)
Original file line number Diff line number Diff line change 77 {{ fileName }}
88 </h3 >
99 <div class =" flex items-center text-xs text-zinc-400" >
10- <span >{{ asset.dimensions?.width }}x{{ asset.dimensions?.height }}</span >
10+ <span >{{ formatSize( asset.size) }}</span >
1111 </div >
1212 </div >
1313</template >
1414
1515<script setup lang="ts">
1616import { computed } from ' vue'
1717
18- import { getFilenameDetails } from ' @/utils/formatUtil'
18+ import { formatSize , getFilenameDetails } from ' @/utils/formatUtil'
1919
2020import type { AssetContext , AssetMeta } from ' ../schemas/mediaAssetSchema'
2121
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { assetService } from '@/platform/assets/services/assetService'
55import type { HistoryTaskItem } from '@/schemas/apiSchema'
66import { api } from '@/scripts/api'
77import { TaskItemImpl } from '@/stores/queueStore'
8+ import { truncateFilename } from '@/utils/formatUtil'
89
910import { mapTaskOutputToAssetItem } from './assetMappers'
1011
@@ -31,7 +32,15 @@ export function useAssetsApi() {
3132 // For input directory, just return assets without history
3233 if ( directory === 'input' ) {
3334 const assets = await assetService . getAssetsByTag ( directory )
34- return assets
35+ // Process assets to truncate long filenames for display
36+ return assets . map ( ( asset ) => ( {
37+ ...asset ,
38+ name : truncateFilename ( asset . name , 20 ) ,
39+ user_metadata : {
40+ ...asset . user_metadata ,
41+ originalFilename : asset . name . length > 20 ? asset . name : undefined
42+ }
43+ } ) )
3544 }
3645
3746 // For output directory, fetch history data and convert to AssetItem format
You can’t perform that action at this time.
0 commit comments