File tree Expand file tree Collapse file tree 3 files changed +24
-20
lines changed
components/rightSidePanel/parameters
renderer/extensions/vueNodes Expand file tree Collapse file tree 3 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2+ import { cn } from ' @comfyorg/tailwind-utils'
23import { provide } from ' vue'
34
45import type { LGraphNode } from ' @/lib/litegraph/src/litegraph'
56import type { IBaseWidget } from ' @/lib/litegraph/src/types/widgets'
67import { useCanvasStore } from ' @/renderer/core/canvas/canvasStore'
78import WidgetLegacy from ' @/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue'
8- import { getComponent } from ' @/renderer/extensions/vueNodes/widgets/registry/widgetRegistry'
9+ import {
10+ getComponent ,
11+ shouldExpand
12+ } from ' @/renderer/extensions/vueNodes/widgets/registry/widgetRegistry'
913
1014import PropertiesAccordionItem from ' ../layout/PropertiesAccordionItem.vue'
1115
@@ -58,7 +62,7 @@ function onWidgetValueChange(
5862 :model-value =" widget.value"
5963 :node-id =" String(node.id)"
6064 :node-type =" node.type"
61- class =" col-span-1"
65+ : class =" cn(' col-span-1', shouldExpand(widget.type) && 'min-h-36') "
6266 @update:model-value ="
6367 (value: string | number | boolean | object) =>
6468 onWidgetValueChange(widget, value)
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ import WidgetDOM from '@/renderer/extensions/vueNodes/widgets/components/WidgetD
8383import WidgetLegacy from ' @/renderer/extensions/vueNodes/widgets/components/WidgetLegacy.vue'
8484import {
8585 getComponent ,
86+ shouldExpand ,
8687 shouldRenderAsVue
8788} from ' @/renderer/extensions/vueNodes/widgets/registry/widgetRegistry'
8889import type { SimplifiedWidget , WidgetValue } from ' @/types/simplifiedWidget'
@@ -192,28 +193,11 @@ const processedWidgets = computed((): ProcessedWidget[] => {
192193 return result
193194})
194195
195- // TODO: Derive from types in widgetRegistry
196- const EXPANDING_TYPES = [
197- ' textarea' ,
198- ' TEXTAREA' ,
199- ' multiline' ,
200- ' customtext' ,
201- ' markdown' ,
202- ' MARKDOWN' ,
203- ' progressText' ,
204- ' load3D' ,
205- ' LOAD_3D'
206- ] as const
207-
208196const gridTemplateRows = computed ((): string => {
209197 const widgets = toValue (processedWidgets )
210198 return widgets
211199 .filter ((w ) => ! w .simplified .options ?.hidden )
212- .map ((w ) =>
213- EXPANDING_TYPES .includes (w .type as (typeof EXPANDING_TYPES )[number ])
214- ? ' auto'
215- : ' min-content'
216- )
200+ .map ((w ) => (shouldExpand (w .type ) ? ' auto' : ' min-content' ))
217201 .join (' ' )
218202})
219203 </script >
Original file line number Diff line number Diff line change @@ -197,3 +197,19 @@ export const isEssential = (type: string): boolean => {
197197export const shouldRenderAsVue = ( widget : Partial < SafeWidgetData > ) : boolean => {
198198 return ! widget . options ?. canvasOnly && ! ! widget . type
199199}
200+
201+ const EXPANDING_TYPES = [
202+ 'textarea' ,
203+ 'TEXTAREA' ,
204+ 'multiline' ,
205+ 'customtext' ,
206+ 'markdown' ,
207+ 'MARKDOWN' ,
208+ 'progressText' ,
209+ 'load3D' ,
210+ 'LOAD_3D'
211+ ] as const
212+
213+ export function shouldExpand ( type : string ) : boolean {
214+ return EXPANDING_TYPES . includes ( type as ( typeof EXPANDING_TYPES ) [ number ] )
215+ }
You can’t perform that action at this time.
0 commit comments