From e1b082796b3aa98d3daf1a03623fceb6993c5b5b Mon Sep 17 00:00:00 2001 From: Aisland Date: Tue, 18 Aug 2026 12:37:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=88=B6=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E2=80=94=E2=80=94=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E5=88=86=E7=BB=84=E6=A0=87=E9=A2=98(=F0=9F=93=81+=E5=B0=8F?= =?UTF-8?q?=E5=AD=97)=E4=B8=8E1px=E7=BB=86=E5=88=86=E9=9A=94=E7=BA=BF,?= =?UTF-8?q?=E5=BC=83=E7=94=A8=E5=8E=9F=E7=94=9Fselect/optgroup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 01_content/src/client/split.tsx | 89 +++++++++++++------ 01_content/src/client/styles.ts | 15 ++++ .../worklogs/2026-08-16_worktable-v2.md | 24 +++-- 04_test/functional-diag.cjs | 27 +++--- 4 files changed, 101 insertions(+), 54 deletions(-) diff --git a/01_content/src/client/split.tsx b/01_content/src/client/split.tsx index 23d20bc..dbd4d82 100644 --- a/01_content/src/client/split.tsx +++ b/01_content/src/client/split.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from 'react' +import { Fragment, useCallback, useEffect, useRef, useState } from 'react' import { Terminal } from 'xterm' import 'xterm/css/xterm.css' import MarkdownIt from 'markdown-it' @@ -1245,6 +1245,51 @@ function TextViewer(props: { path: string; fileUrl: string; isMd: boolean }) { ) } +/** 自制下拉列表(原生 select 无法美化):文件夹分组标题 + 1px 细分隔线 + 选项列表 */ +function SelectPop(props: { + value: string | null + groups: { title: string; items: { id: string; label: string; isCurrent?: boolean }[] }[] + placeholder?: string + onChange: (id: string) => void +}) { + const [open, setOpen] = useState(false) + const flat = props.groups.flatMap((g) => g.items) + const selected = flat.find((i) => i.id === props.value) + return ( +
+ + {open && ( +
+ {props.groups.map((g, gi) => ( + + {g.title && ( + <> +
+
📁 {g.title}
+ + )} + {g.items.map((it) => ( + + ))} + + ))} +
+ )} +
+ ) +} + /** 自定义窗口:居中对话框。两种模式:新建专属会话 / 发送到已有会话(默认当前会话)。 */ function CustomPane() { const custom = splitEnv?.custom @@ -1320,37 +1365,25 @@ function CustomPane() { {mode === 'existing' && (
{T('custom.session')} - + ({ + title: g.title, + items: g.sessions.map((s) => ({ id: s.id, label: s.title, isCurrent: s.isCurrent })), + }))} + placeholder={T('custom.session')} + onChange={setSessionId} + />
)}
{T('custom.project')} - + ({ id: p.id, label: p.name })) }]} + placeholder={T('custom.project')} + onChange={setProjectId} + />