From eee254da60a97b5ae3fce65a4a20796742c3c87e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 22 Apr 2026 16:34:06 +0800 Subject: [PATCH] Fix new_session.ui: correct Form structure using options.fields instead of subwidgets --- wwwroot/new_session.ui | 119 +++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 64 deletions(-) diff --git a/wwwroot/new_session.ui b/wwwroot/new_session.ui index a595831..4e2db9d 100644 --- a/wwwroot/new_session.ui +++ b/wwwroot/new_session.ui @@ -22,36 +22,27 @@ "id": "new-session-form", "options": { "width": "100%", - "maxWidth": "600px" - }, - "subwidgets": [ - { - "widgettype": "UiStr", - "id": "session-name", - "options": { + "maxWidth": "600px", + "fields": [ + { + "widgettype": "UiStr", "name": "session-name", "label": "Session Name", "placeholder": "Enter session name...", "width": "100%", "marginBottom": "16px" - } - }, - { - "widgettype": "UiCode", - "id": "model-select", - "options": { + }, + { + "widgettype": "UiCode", "name": "model-select", "label": "AI Model", "placeholder": "Select model...", "width": "100%", "marginBottom": "16px", "items": [] - } - }, - { - "widgettype": "UiText", - "id": "initial-prompt", - "options": { + }, + { + "widgettype": "UiText", "name": "initial-prompt", "label": "Initial Prompt (Optional)", "placeholder": "Enter initial context or instructions...", @@ -59,58 +50,58 @@ "height": "100px", "marginBottom": "24px" } + ] + } + }, + { + "widgettype": "HBox", + "options": { + "width": "100%", + "gap": "12px" + }, + "subwidgets": [ + { + "widgettype": "Button", + "options": { + "label": "Create Session", + "bgcolor": "#22C55E", + "color": "#FFFFFF", + "border": "none", + "borderRadius": "6px", + "padding": "10px 20px", + "fontWeight": "600" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "registerfunction", + "target": "app.new-session-container", + "rfname": "create_session", + "params": {} + } + ] }, { - "widgettype": "HBox", + "widgettype": "Button", "options": { - "width": "100%", - "gap": "12px" + "label": "Cancel", + "bgcolor": "#64748B", + "color": "#FFFFFF", + "border": "none", + "borderRadius": "6px", + "padding": "10px 20px" }, - "subwidgets": [ + "binds": [ { - "widgettype": "Button", + "wid": "self", + "event": "click", + "actiontype": "urlwidget", + "target": "app.main-content", "options": { - "label": "Create Session", - "bgcolor": "#22C55E", - "color": "#FFFFFF", - "border": "none", - "borderRadius": "6px", - "padding": "10px 20px", - "fontWeight": "600" + "url": "{{entire_url('index.ui')}}" }, - "binds": [ - { - "wid": "self", - "event": "click", - "actiontype": "registerfunction", - "target": "app.new-session-container", - "rfname": "create_session", - "params": {} - } - ] - }, - { - "widgettype": "Button", - "options": { - "label": "Cancel", - "bgcolor": "#64748B", - "color": "#FFFFFF", - "border": "none", - "borderRadius": "6px", - "padding": "10px 20px" - }, - "binds": [ - { - "wid": "self", - "event": "click", - "actiontype": "urlwidget", - "target": "app.main-content", - "options": { - "url": "{{entire_url('index.ui')}}" - }, - "mode": "replace" - } - ] + "mode": "replace" } ] }