mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-23 00:04:06 +00:00
chore: remove unnecessary comments from PR files
Amp-Thread-ID: https://ampcode.com/threads/T-019c10ff-a769-744c-a6dd-367eaa79f98b Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -126,19 +126,16 @@ const emit = defineEmits<{
|
||||
|
||||
provide(OnCloseKey, props.onClose ?? (() => {}))
|
||||
|
||||
// Compute the cache key based on nodeType or assetType
|
||||
const cacheKey = computed(() => {
|
||||
if (props.nodeType) return props.nodeType
|
||||
if (props.assetType) return `tag:${props.assetType}`
|
||||
return ''
|
||||
})
|
||||
|
||||
// Read directly from store cache - reactive to any store updates
|
||||
const fetchedAssets = computed(() => assetStore.getAssets(cacheKey.value))
|
||||
|
||||
const isStoreLoading = computed(() => assetStore.isModelLoading(cacheKey.value))
|
||||
|
||||
// Only show loading spinner when loading AND no cached data
|
||||
const isLoading = computed(
|
||||
() => isStoreLoading.value && fetchedAssets.value.length === 0
|
||||
)
|
||||
@@ -151,10 +148,8 @@ async function refreshAssets(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger background refresh on mount
|
||||
void refreshAssets()
|
||||
|
||||
// Eagerly fetch model types so they're available when ModelInfoPanel loads
|
||||
const { fetchModelTypes } = useModelTypes()
|
||||
void fetchModelTypes()
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ function updateSelectedItems(selectedItems: Set<OptionId>) {
|
||||
modelValue.value = name
|
||||
}
|
||||
|
||||
// Upload file function (copied from useNodeImageUpload.ts)
|
||||
const uploadFile = async (
|
||||
file: File,
|
||||
isPasted: boolean = false,
|
||||
@@ -376,7 +375,6 @@ const uploadFile = async (
|
||||
return data.subfolder ? `${data.subfolder}/${data.name}` : data.name
|
||||
}
|
||||
|
||||
// Handle multiple file uploads
|
||||
const uploadFiles = async (files: File[]): Promise<string[]> => {
|
||||
const folder = props.uploadFolder ?? 'input'
|
||||
const uploadPromises = files.map((file) =>
|
||||
|
||||
@@ -129,7 +129,6 @@ function handleFileChange(event: Event) {
|
||||
if (input.files) {
|
||||
files.value = Array.from(input.files)
|
||||
}
|
||||
// Clear the input value to allow re-selecting the same file
|
||||
input.value = ''
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ const theButtonStyle = computed(() =>
|
||||
})
|
||||
"
|
||||
>
|
||||
<!-- Dropdown -->
|
||||
<button
|
||||
:class="
|
||||
cn(
|
||||
@@ -83,7 +82,6 @@ const theButtonStyle = computed(() =>
|
||||
"
|
||||
/>
|
||||
</button>
|
||||
<!-- Open File -->
|
||||
<label
|
||||
v-if="uploadable"
|
||||
:class="
|
||||
|
||||
@@ -34,27 +34,22 @@ const emit = defineEmits<{
|
||||
(e: 'item-click', item: FormDropdownItem, index: number): void
|
||||
}>()
|
||||
|
||||
// Define models for two-way binding
|
||||
const filterSelected = defineModel<OptionId>('filterSelected')
|
||||
const layoutMode = defineModel<LayoutMode>('layoutMode')
|
||||
const sortSelected = defineModel<OptionId>('sortSelected')
|
||||
const searchQuery = defineModel<string>('searchQuery')
|
||||
const ownershipSelected = defineModel<OwnershipOption>('ownershipSelected')
|
||||
|
||||
// Handle item selection
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="flex max-h-[640px] w-103 flex-col rounded-lg bg-component-node-background pt-4 outline outline-offset-[-1px] outline-node-component-border"
|
||||
>
|
||||
<!-- Filter -->
|
||||
<FormDropdownMenuFilter
|
||||
v-if="filterOptions.length > 0"
|
||||
v-model:filter-selected="filterSelected"
|
||||
:filter-options="filterOptions"
|
||||
/>
|
||||
<!-- Actions -->
|
||||
<FormDropdownMenuActions
|
||||
v-model:layout-mode="layoutMode"
|
||||
v-model:sort-selected="sortSelected"
|
||||
@@ -66,7 +61,6 @@ const ownershipSelected = defineModel<OwnershipOption>('ownershipSelected')
|
||||
:show-ownership-filter="showOwnershipFilter"
|
||||
:ownership-options="ownershipOptions"
|
||||
/>
|
||||
<!-- List -->
|
||||
<div class="relative flex h-full mt-2 overflow-y-scroll">
|
||||
<div
|
||||
:class="
|
||||
@@ -91,7 +85,6 @@ const ownershipSelected = defineModel<OwnershipOption>('ownershipSelected')
|
||||
class="icon-[lucide--circle-off] size-30 text-zinc-500/20"
|
||||
/>
|
||||
</div>
|
||||
<!-- Item -->
|
||||
<FormDropdownMenuItem
|
||||
v-for="(item, index) in items"
|
||||
:key="item.id"
|
||||
|
||||
@@ -117,7 +117,6 @@ function handleOwnershipSelected(item: OwnershipFilterOption) {
|
||||
/>
|
||||
<i class="icon-[lucide--arrow-up-down] size-4" />
|
||||
</button>
|
||||
<!-- Sort Popover -->
|
||||
<Popover
|
||||
ref="sortPopoverRef"
|
||||
:dismissable="true"
|
||||
@@ -163,7 +162,6 @@ function handleOwnershipSelected(item: OwnershipFilterOption) {
|
||||
</div>
|
||||
</Popover>
|
||||
|
||||
<!-- Ownership Filter -->
|
||||
<button
|
||||
v-if="showOwnershipFilter && ownershipOptions?.length"
|
||||
ref="ownershipTriggerRef"
|
||||
@@ -185,7 +183,6 @@ function handleOwnershipSelected(item: OwnershipFilterOption) {
|
||||
/>
|
||||
<i class="icon-[lucide--user] size-4" />
|
||||
</button>
|
||||
<!-- Ownership Popover -->
|
||||
<Popover
|
||||
ref="ownershipPopoverRef"
|
||||
:dismissable="true"
|
||||
@@ -231,7 +228,6 @@ function handleOwnershipSelected(item: OwnershipFilterOption) {
|
||||
</div>
|
||||
</Popover>
|
||||
|
||||
<!-- Layout Switch -->
|
||||
<div
|
||||
:class="
|
||||
cn(
|
||||
|
||||
@@ -17,7 +17,6 @@ const filterSelected = defineModel<OptionId>('filterSelected')
|
||||
|
||||
const { isUploadButtonEnabled, showUploadDialog } = useModelUpload()
|
||||
|
||||
// TODO: Add real check to differentiate between the Model dialogs and Load Image
|
||||
const singleFilterOption = computed(() => filterOptions.length === 1)
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user