mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-24 06:32:12 -03:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user