SimpleChatTCRV:UI Cleanup: DetailsNotDiv Current settings info

So that we dont overload users with the details by default, but
user can open or close the block of current settings info details.
This commit is contained in:
hanishkvc 2025-11-11 12:52:25 +05:30
parent c94471a56f
commit dac97c1e8f
2 changed files with 20 additions and 10 deletions

View File

@ -1677,7 +1677,7 @@ export class Me {
modelPath: json["model_path"],
ctxSize: json["default_generation_settings"]["n_ctx"]
}
ui.ui_show_obj_props_info(elDiv, this, props, "Settings/Info (devel-tools-console document[gMe])", "", { legend: 'role-system' })
ui.ui_show_obj_props_info(elDiv, this, props, "Current Settings/Info (dev console document[gMe])", "", { legend: 'role-system' })
}).catch(err=>console.log(`WARN:ShowInfo:${err}`))
}

View File

@ -356,27 +356,37 @@ export function ui_show_obj_props_edit(elParent, propsTreeRoot, oObj, lProps, sL
/**
* Show the specified properties and their values wrt the given object,
* with in the elParent provided.
* Uses recursion to show embedded objects.
*
* @param {HTMLDivElement | HTMLElement} elParent
* @param {any} oObj
* @param {Array<string>} lProps
* @param {string} sLegend
* @param {string} sLegend - the legend/title for the currrent block of properties
* @param {string} sOffset - can be used to prefix each of the prop entries
* @param {any | undefined} dClassNames - can specify class for top level div and legend
* @param {any | undefined} dClassNames - can specify class for top level parent and legend
*/
export function ui_show_obj_props_info(elParent, oObj, lProps, sLegend, sOffset="", dClassNames=undefined) {
if (sOffset.length == 0) {
let div = document.createElement("div");
div.classList.add(`DivObjPropsInfoL${sOffset.length}`)
elParent.appendChild(div)
elParent = div
let elDet = document.createElement("details");
let elSum = document.createElement("summary")
if (dClassNames['legend']) {
elSum.classList.add(dClassNames['legend'])
dClassNames['legend'] = undefined
}
elSum.appendChild(document.createTextNode(sLegend))
sLegend = ""
elDet.appendChild(elSum)
elDet.classList.add(`DivObjPropsInfoL${sOffset.length}`)
elParent.appendChild(elDet)
elParent = elDet
}
let elPLegend = el_create_append_p(sLegend, elParent)
if (dClassNames) {
if (dClassNames['div']) {
elParent.className = dClassNames['div']
if (dClassNames['parent']) {
elParent.classList.add(dClassNames['parent'])
}
if (dClassNames['legend']) {
elPLegend.className = dClassNames['legend']
elPLegend.classList.add(dClassNames['legend'])
}
}
let elS = document.createElement("section");