mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-03 12:10:11 +00:00
load assets browser before fetch completes and show loading state (#6189)
## Summary Moves the fetch and post-fetch logic associated with the asset browser into the component and shows a loading state while fetching. To test, use this branch: https://github.com/comfyanonymous/ComfyUI/pull/10045 https://github.com/user-attachments/assets/718974d5-efc7-46a0-bcd6-e82596d4c389 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6189-load-assets-browser-before-fetch-completes-and-show-loading-state-2946d73d365081879d1bd05d86e8c036) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
16
src/platform/assets/utils/categoryLabel.ts
Normal file
16
src/platform/assets/utils/categoryLabel.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
const ACRONYM_TAGS = new Set(['VAE', 'CLIP', 'GLIGEN'])
|
||||
|
||||
export function formatCategoryLabel(raw?: string): string {
|
||||
if (!raw) return 'Models'
|
||||
|
||||
return raw
|
||||
.split('_')
|
||||
.map((segment) => {
|
||||
const upper = segment.toUpperCase()
|
||||
if (ACRONYM_TAGS.has(upper)) return upper
|
||||
|
||||
const lower = segment.toLowerCase()
|
||||
return lower.charAt(0).toUpperCase() + lower.slice(1)
|
||||
})
|
||||
.join(' ')
|
||||
}
|
||||
Reference in New Issue
Block a user