Notes textarea automatically fills space.

- Adjust spacing of model info tab content headers.
This commit is contained in:
Christian Bastian
2024-07-21 01:37:19 -04:00
parent 045dc0a8a7
commit 5513fd9890
2 changed files with 44 additions and 32 deletions

View File

@@ -230,6 +230,18 @@
overflow-x: auto; overflow-x: auto;
} }
.model-manager .model-manager-body .tab-contents {
display: flex;
flex-direction: column;
height: 100%;
}
.model-manager .model-manager-body .tab-content {
display: flex;
flex-direction: column;
height: 100%;
}
/* model info view */ /* model info view */
.model-manager .model-info-view { .model-manager .model-info-view {
background-color: var(--bg-color); background-color: var(--bg-color);

View File

@@ -302,7 +302,7 @@ function $radioGroup(attr) {
function GenerateTabGroup(tabData) { function GenerateTabGroup(tabData) {
/** @type {HTMLDivElement[]} */ /** @type {HTMLDivElement[]} */
const tabContents = tabData.map((data) => { const tabContents = tabData.map((data) => {
return $el("div", { return $el("div.tab-content", {
dataset: { dataset: {
name: data.name, name: data.name,
icon: data.icon, // TODO: remove this; not needed icon: data.icon, // TODO: remove this; not needed
@@ -2290,7 +2290,7 @@ class ModelInfo {
const isMetadata = typeof metadata === 'object' && metadata !== null && Object.keys(metadata).length > 0; const isMetadata = typeof metadata === 'object' && metadata !== null && Object.keys(metadata).length > 0;
metadataElement.innerHTML = ""; metadataElement.innerHTML = "";
metadataElement.append.apply(metadataElement, [ metadataElement.append.apply(metadataElement, [
$el("h1", ["Metadata"]), $el("h1", { style: { "margin-top": "0px" } }, ["Metadata"]),
$el("div", (() => { $el("div", (() => {
const tableRows = []; const tableRows = [];
if (isMetadata) { if (isMetadata) {
@@ -2318,7 +2318,7 @@ class ModelInfo {
const isTags = Array.isArray(tags) && tags.length > 0; const isTags = Array.isArray(tags) && tags.length > 0;
tagsElement.innerHTML = ""; tagsElement.innerHTML = "";
tagsElement.append.apply(tagsElement, [ tagsElement.append.apply(tagsElement, [
$el("h1", ["Tags"]), $el("h1", { style: { "margin-top": "0px", "margin-bottom": "0px" } }, ["Tags"]),
$el("div", (() => { $el("div", (() => {
const elements = []; const elements = [];
if (isTags) { if (isTags) {
@@ -2337,33 +2337,33 @@ class ModelInfo {
/** @type {HTMLDivElement} */ /** @type {HTMLDivElement} */
const notesElement = this.elements.tabContents[3]; // TODO: remove magic value const notesElement = this.elements.tabContents[3]; // TODO: remove magic value
notesElement.innerHTML = ""; notesElement.innerHTML = "";
notesElement.append.apply(notesElement, [ notesElement.append.apply(notesElement,
$el("div", (() => { (() => {
const notes = $el("textarea.comfy-multiline-input", { const notes = $el("textarea.comfy-multiline-input", {
name: "model notes", name: "model notes",
value: noteText, value: noteText,
rows: 14, });
}); this.elements.notes = notes;
this.elements.notes = notes; this.#savedNotesValue = noteText;
this.#savedNotesValue = noteText; return [
return [ $el("div.row", {
$el("div.row", { style: { margin: "0px 0px 16px" },
style: { margin: "8px 0px 16px" }, }, [
}, [ $el("h1", { style: { "margin-top": "0px", "margin-bottom": "0px" } }, ["Notes"]),
$el("h1", { style: { margin: "0px" } }, ["Notes"]), $el("button.icon-button", {
$el("button.icon-button", { textContent: "💾",
textContent: "💾", onclick: async (e) => {
onclick: async (e) => { const saved = await this.trySave(false);
const saved = await this.trySave(false); buttonAlert(e.target, saved);
buttonAlert(e.target, saved); },
}, }),
}), ]),
]), $el("div", {
notes, style: { "display": "flex", "height": "100%", "min-height": "60px" },
]; }, notes),
})(), ];
), })()
]); );
} }
} }
@@ -3615,9 +3615,9 @@ class ModelManager extends ComfyDialog {
]), ]),
$el("div.model-manager-body", [ $el("div.model-manager-body", [
$el("div", { $el("div", {
$: (el) => (this.#tabManagerContents = el) $: (el) => (this.#tabManagerContents = el),
}, tabManagerContents), }, tabManagerContents),
$el("div", { $el("div.tab-contents", {
$: (el) => (this.#tabInfoContents = el), $: (el) => (this.#tabInfoContents = el),
style: { display: "none"}, style: { display: "none"},
}, tabInfoContents), }, tabInfoContents),