mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
feat: Add generation time sort options to Media Asset Panel (#6698)
## Summary Add generation time-based sorting options to the Media Asset Panel ## Changes - **New sorting options**: - Generation time (longest first) - Sort by longest execution time - Generation time (fastest first) - Sort by shortest execution time - **Show only in Generated tab**: - Generation time sorting is only meaningful for output assets with `executionTimeInSeconds` metadata - Implemented conditional rendering via `showGenerationTimeSort` prop ## Technical Details - `useMediaAssetFiltering.ts`: - Added `'longest'` and `'fastest'` to `SortOption` type - Added `getAssetExecutionTime` helper function - Implemented sorting logic using switch-case pattern - `MediaAssetSortMenu.vue`: - Added `showGenerationTimeSort` prop - Generation time sort buttons placed inside `<template v-if="showGenerationTimeSort">` - `MediaAssetFilterBar.vue`: - Receives `showGenerationTimeSort` prop and passes it to `MediaAssetSortMenu` - `AssetsSidebarTab.vue`: - Passes `showGenerationTimeSort` prop based on `activeTab === 'output'` - `src/locales/en/main.json`: - Added `sortLongestFirst`: "Generation time (longest first)" - Added `sortFastestFirst`: "Generation time (fastest first)" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -36,13 +36,14 @@
|
||||
</div>
|
||||
<!-- Normal Tab View -->
|
||||
<TabList v-else v-model="activeTab" class="pt-4 pb-1">
|
||||
<Tab value="input">{{ $t('sideToolbar.labels.imported') }}</Tab>
|
||||
<Tab value="output">{{ $t('sideToolbar.labels.generated') }}</Tab>
|
||||
<Tab value="input">{{ $t('sideToolbar.labels.imported') }}</Tab>
|
||||
</TabList>
|
||||
<!-- Filter Bar -->
|
||||
<MediaAssetFilterBar
|
||||
v-model:search-query="searchQuery"
|
||||
v-model:sort-by="sortBy"
|
||||
:show-generation-time-sort="activeTab === 'output'"
|
||||
/>
|
||||
</template>
|
||||
<template #body>
|
||||
|
||||
Reference in New Issue
Block a user