feat(vue-widgets): add max height constraint for LoRA autocomplete widgets

Introduce AUTOCOMPLETE_TEXT_WIDGET_MAX_HEIGHT constant and apply it to autocomplete text widgets when modelType is 'loras'. This ensures LoRA-specific widgets have a consistent maximum height of 100px, improving UI consistency and preventing excessive widget expansion.
This commit is contained in:
Will Miao
2026-01-25 09:59:04 +08:00
parent d655fb8008
commit b71b3f99dc
3 changed files with 14 additions and 12 deletions

View File

@@ -23,6 +23,7 @@ const LORA_CYCLER_WIDGET_MAX_HEIGHT = LORA_CYCLER_WIDGET_MIN_HEIGHT
const JSON_DISPLAY_WIDGET_MIN_WIDTH = 300
const JSON_DISPLAY_WIDGET_MIN_HEIGHT = 200
const AUTOCOMPLETE_TEXT_WIDGET_MIN_HEIGHT = 60
const AUTOCOMPLETE_TEXT_WIDGET_MAX_HEIGHT = 100
// @ts-ignore - ComfyUI external module
import { app } from '../../../scripts/app.js'
@@ -441,7 +442,12 @@ function createAutocompleteTextWidgetFactory(
serialize: true,
getMinHeight() {
return AUTOCOMPLETE_TEXT_WIDGET_MIN_HEIGHT
}
},
...(modelType === 'loras' && {
getMaxHeight() {
return AUTOCOMPLETE_TEXT_WIDGET_MAX_HEIGHT
}
})
}
)
@@ -467,12 +473,6 @@ function createAutocompleteTextWidgetFactory(
const appKey = node.id * 100000 + widgetName.charCodeAt(0)
vueApps.set(appKey, vueApp)
widget.computeLayoutSize = () => {
const minHeight = AUTOCOMPLETE_TEXT_WIDGET_MIN_HEIGHT
return { minHeight }
}
widget.onRemove = () => {
const vueApp = vueApps.get(appKey)
if (vueApp) {