From e2bd57d5a51af5f8aa48388cd34a1fb505c328bf Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Wed, 19 Nov 2025 00:27:08 +0530 Subject: [PATCH] SimpleChatTCRV:UICleanup+: Fix oversight wrt Auto ObjPropsEdit Had forgotten to use ${} for variable within a literal template string. Had forgotten to use the full hierarchy of props when setting the id of elements, which is useful to map a label to a button and so. This would have led to the wrong button being clicked when a label with duplicated id was clicked. Ie if two different objects within a object, have properties/fields with the same name, then previously this would have led to a bunch of labels and buttons or so having the same id, bcas their hierarchy was not being accounted for. This is fixed now. --- tools/server/public_simplechat/readme.md | 11 ++++++++--- tools/server/public_simplechat/ui.mjs | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/server/public_simplechat/readme.md b/tools/server/public_simplechat/readme.md index 1e497215e5..10c20e6cc8 100644 --- a/tools/server/public_simplechat/readme.md +++ b/tools/server/public_simplechat/readme.md @@ -800,15 +800,20 @@ Cleanup in general * avoid borders and instead give a box effect through light shadows * also avoid allround border around chat message role block and instead have to only one side * timeout close popover menu - * update usage notes wrt vision and toggling of sessions and system prompt through main title area + * usage notes + * update wrt vision and toggling of sessions and system prompt through main title area + * fix issue with sliding window size not reflecting properly in context window entry * make restore block into details based block, and anchor its position independent of db check. * avoid unneeded outer overall scrollbar by adjusting fullbody height in screen mode. * user css variable to define the overall background color and inturn use same to merge gradients to the background, as well as to help switch the same seemlessly between screen and print modes. * make the scrollbars more subtle and in the background. * allow user input textarea to grow vertically to some extent. - * make things rounded across board by default. add some padding to toolcall details block. - * allow Auto ObjPropsEdit UI to be themed by assigning id to top level block. + * make things rounded across board by default. add some padding to toolcall details block, ... + * Auto ObjPropsEdit UI + * allow it to be themed by assigning id to top level block. + * fix a oversight (forgotten $) with use of templated literals and having variables in them. + * ensure full props hierarchy is accounted for when setting the id of elements. #### ToDo diff --git a/tools/server/public_simplechat/ui.mjs b/tools/server/public_simplechat/ui.mjs index 9605208bad..ed05b91315 100644 --- a/tools/server/public_simplechat/ui.mjs +++ b/tools/server/public_simplechat/ui.mjs @@ -329,8 +329,9 @@ export function ui_show_obj_props_edit(elParent, propsTreeRoot, oObj, lProps, sL } let val = oObj[k]; let type = typeof(val); + let id = `Set${propsTreeRootNew.replaceAll(':','-')}` if (((type == "string") || (type == "number"))) { - let inp = el_creatediv_input(`Set${k}`, k, typeDict[type], oObj[k], (val)=>{ + let inp = el_creatediv_input(`${id}`, k, typeDict[type], oObj[k], (val)=>{ if (type == "number") { val = Number(val); } @@ -341,7 +342,7 @@ export function ui_show_obj_props_edit(elParent, propsTreeRoot, oObj, lProps, sL } elFS.appendChild(inp.div); } else if (type == "boolean") { - let bbtn = el_creatediv_boolbutton(`Set{k}`, k, {true: "true", false: "false"}, val, (userVal)=>{ + let bbtn = el_creatediv_boolbutton(`${id}`, k, {true: "true", false: "false"}, val, (userVal)=>{ oObj[k] = userVal; }); if (fRefiner) {