feat(client): 入口上移至新会话行;三省/六部分组加边框
This commit is contained in:
parent
8709672863
commit
5f08900a75
|
|
@ -55,6 +55,7 @@ HTTP 处理器端到端;systemPrompt 只注入十席;Web 纯视图模型(
|
|||
- 当前项目 default-workspace 正确识别,显示「10 个角色 · 0 个会话」「启用此项目的十席」。✅
|
||||
- 点「启用此项目的十席」→ 宿主真实建成 10 个独立 root session:项目 ready、10 席 bound、failed=0、无报错。✅
|
||||
- 重启 DSH 进程后重开:仍「10 个角色 · 10 个会话」、无「启用」按钮、10 个会话 ID 互不相同 → 持久化与幂等通过,重启不重复建会话。✅
|
||||
- 入口按用户要求移到“新会话”行右侧(`sidebar.session.action`),不再占底部;三省、六部分组各加清晰边框与分组标题。✅
|
||||
- 工作台进入真实右侧 dock(`inDock=true`、非浮动面板),无 console 报错。✅
|
||||
- 点角色(工部)→ 真机切到该席独立会话(提示“已切换到工部会话”),无报错。✅
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ async function main() {
|
|||
await call('Emulation.setDeviceMetricsOverride', { width: 1440, height: 900, deviceScaleFactor: 1, mobile: false })
|
||||
await call('Page.navigate', { url })
|
||||
await waitFor("document.readyState === 'complete'", 30000)
|
||||
// 关掉 DSH 自身“预览版说明”首启弹层,避免遮挡截图
|
||||
try { await evaluate("(() => { const b = [...document.querySelectorAll('button')].find(x => (x.innerText || '').trim() === '继续'); if (b) { b.click(); return true } return false })()") } catch {}
|
||||
await sleep(500)
|
||||
try { await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }); await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }) } catch {}
|
||||
await sleep(800)
|
||||
const foundEntry = await waitFor("!!document.querySelector('.ssw-entry')", 60000)
|
||||
result.entry = await evaluate(`(() => ({ found: !!document.querySelector('.ssw-entry'), text: document.querySelector('.ssw-entry')?.innerText?.trim() ?? null, title: document.title }))()`)
|
||||
await shot('live-01-entry.png')
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 74 KiB |
|
|
@ -396,9 +396,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-tree{padding:14px 16px 4px;position:relative}
|
||||
.ssw-lead{width:150px;margin:0 auto;position:relative}
|
||||
.ssw-lead::after{content:"";position:absolute;left:50%;top:100%;height:20px;border-left:1px solid var(--ssw-wire)}
|
||||
.ssw-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:34px;position:relative}
|
||||
.ssw-trio::before{content:"";position:absolute;left:16.66%;right:16.66%;top:-15px;border-top:1px solid var(--ssw-wire)}
|
||||
.ssw-trio .ssw-seat::before{content:"";position:absolute;left:50%;bottom:100%;height:15px;border-left:1px solid var(--ssw-wire)}
|
||||
.ssw-sansheng{position:relative;border:1px solid var(--ssw-strong);background:var(--ssw-card);border-radius:12px;margin-top:28px;padding:16px 8px 9px}
|
||||
.ssw-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
|
||||
.ssw-seat{position:relative;width:100%;display:flex;flex-direction:column;gap:6px;padding:10px 9px 8px;border:1px solid var(--ssw-line);border-radius:10px;background:var(--ssw-card);text-align:left;min-height:70px;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:border-color .15s,box-shadow .15s,transform .15s}
|
||||
.ssw-seat:hover{border-color:var(--ssw-strong);transform:translateY(-1px);box-shadow:0 3px 8px rgba(16,24,40,.06)}
|
||||
.ssw-seat[aria-pressed=true]{border-color:var(--ssw-blue);background:var(--ssw-wash);box-shadow:0 0 0 2px rgba(59,130,246,.12)}
|
||||
|
|
@ -410,9 +409,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-dot[data-status=bound]{background:var(--ssw-ok);border-color:var(--ssw-ok)}
|
||||
.ssw-dot[data-status=failed],.ssw-dot[data-status=missing]{background:var(--ssw-danger);border-color:var(--ssw-danger)}
|
||||
.ssw-dot[data-status=creating]{background:var(--ssw-blue);border-color:var(--ssw-blue)}
|
||||
.ssw-ministries{position:relative;border:1px dashed var(--ssw-wire);border-radius:12px;margin-top:26px;padding:14px 8px 9px}
|
||||
.ssw-ministries::before{content:"";position:absolute;bottom:100%;height:26px;border-left:1px solid var(--ssw-wire);left:50%}
|
||||
.ssw-group-label{position:absolute;top:-8px;left:10px;padding:0 5px;background:var(--ssw-rail);font-size:10px;color:var(--ssw-faint)}
|
||||
.ssw-ministries{position:relative;border:1px solid var(--ssw-strong);background:var(--ssw-card);border-radius:12px;margin-top:14px;padding:16px 8px 9px}
|
||||
.ssw-group-label{position:absolute;top:-9px;left:12px;padding:1px 7px;background:var(--ssw-card);border:1px solid var(--ssw-strong);border-radius:6px;font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-six{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
|
||||
.ssw-six .ssw-seat{min-height:66px;padding:9px 8px}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
|
|
@ -441,6 +439,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-entry[aria-expanded=true]{color:#2563eb;background:#eaf1fe;font-weight:600}
|
||||
.ssw-entry svg{width:16px;height:16px;flex:none}
|
||||
.ssw-entry-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.ssw-entry-compact{width:auto;max-width:100%;height:28px;padding:0 8px;gap:6px;border:1px solid var(--ssw-line);border-radius:7px;background:var(--ssw-card);font-size:12px}
|
||||
.ssw-entry-compact:hover{background:var(--ssw-wash)}
|
||||
body[data-ds-dark-theme] .ssw-entry:hover{background:#1d2b40}
|
||||
body[data-ds-dark-theme] .ssw-entry[aria-expanded=true]{color:#91bafa;background:#1d2b40}
|
||||
@media (prefers-reduced-motion:reduce){.ssw-scope *{transition:none!important}}
|
||||
|
|
@ -1217,7 +1217,12 @@ function apply(ctx) {
|
|||
"section",
|
||||
{ className: "ssw-tree", "aria-label": "切换角色" },
|
||||
(0, import_react.createElement)("div", { className: "ssw-lead" }, pickList(wb.groups.lead).map(seatCard)),
|
||||
(0, import_react.createElement)("div", { className: "ssw-trio" }, pickList(wb.groups.sansheng).map(seatCard)),
|
||||
(0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-sansheng" },
|
||||
(0, import_react.createElement)("span", { className: "ssw-group-label" }, "三省"),
|
||||
(0, import_react.createElement)("div", { className: "ssw-trio" }, pickList(wb.groups.sansheng).map(seatCard))
|
||||
),
|
||||
(0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-ministries" },
|
||||
|
|
@ -1335,7 +1340,8 @@ function apply(ctx) {
|
|||
else body = (0, import_react.createElement)(import_react.Fragment, null, projectInfo, enableBlock, tree, currentCard, config, statusEl);
|
||||
return (0, import_react.createElement)("div", { className: "ssw-root ssw-scope" }, head, body);
|
||||
}
|
||||
function SanshengEntry() {
|
||||
function SanshengEntry(props) {
|
||||
const compact = !!(props && props.compact);
|
||||
const [floating, setFloating] = (0, import_react.useState)(false);
|
||||
const onClick = () => {
|
||||
if (tryOpenRightTab()) {
|
||||
|
|
@ -1361,7 +1367,7 @@ function apply(ctx) {
|
|||
"button",
|
||||
{
|
||||
type: "button",
|
||||
className: "ssw-entry",
|
||||
className: compact ? "ssw-entry ssw-entry-compact" : "ssw-entry",
|
||||
title: "三省六部",
|
||||
"aria-expanded": floating ? "true" : "false",
|
||||
onClick
|
||||
|
|
@ -1372,13 +1378,16 @@ function apply(ctx) {
|
|||
panel
|
||||
);
|
||||
}
|
||||
function SanshengSessionAction(props) {
|
||||
const children = props && props.children;
|
||||
return (0, import_react.createElement)(import_react.Fragment, null, children, (0, import_react.createElement)(SanshengEntry, { compact: true }));
|
||||
}
|
||||
try {
|
||||
if (ctx.slots && isFn(ctx.slots.inject) && isFn(ctx.slots.register)) {
|
||||
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
||||
name: "sidebar.footer.action",
|
||||
id: "sansheng-entry",
|
||||
order: 40
|
||||
}, SanshengEntry));
|
||||
ctx.slots.inject("sidebar.session.action", () => ctx.slots.register({
|
||||
name: "sidebar.session.action",
|
||||
id: "sansheng-entry"
|
||||
}, SanshengSessionAction));
|
||||
} else {
|
||||
console.warn("[sansheng] 宿主未提供 slots.inject / slots.register,无法注册侧栏入口");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -380,7 +380,10 @@ export function apply(ctx) {
|
|||
const pickList = (ids) => ids.map(id => seatById[id]).filter(Boolean)
|
||||
const tree = h('section', { className: 'ssw-tree', 'aria-label': '切换角色' },
|
||||
h('div', { className: 'ssw-lead' }, pickList(wb.groups.lead).map(seatCard)),
|
||||
h('div', { className: 'ssw-trio' }, pickList(wb.groups.sansheng).map(seatCard)),
|
||||
h('div', { className: 'ssw-sansheng' },
|
||||
h('span', { className: 'ssw-group-label' }, '三省'),
|
||||
h('div', { className: 'ssw-trio' }, pickList(wb.groups.sansheng).map(seatCard)),
|
||||
),
|
||||
h('div', { className: 'ssw-ministries' },
|
||||
h('span', { className: 'ssw-group-label' }, '六部 · 尚书统筹'),
|
||||
h('div', { className: 'ssw-six' }, pickList(wb.groups.liubu).map(seatCard)),
|
||||
|
|
@ -478,7 +481,8 @@ export function apply(ctx) {
|
|||
}
|
||||
|
||||
// ---------- 左侧入口 ----------
|
||||
function SanshengEntry() {
|
||||
function SanshengEntry(props) {
|
||||
const compact = !!(props && props.compact)
|
||||
const [floating, setFloating] = useState(false)
|
||||
const onClick = () => {
|
||||
if (tryOpenRightTab()) { setFloating(false); return }
|
||||
|
|
@ -493,7 +497,7 @@ export function apply(ctx) {
|
|||
}
|
||||
return h(Fragment, null,
|
||||
h('button', {
|
||||
type: 'button', className: 'ssw-entry', title: '三省六部',
|
||||
type: 'button', className: compact ? 'ssw-entry ssw-entry-compact' : 'ssw-entry', title: '三省六部',
|
||||
'aria-expanded': floating ? 'true' : 'false', onClick,
|
||||
},
|
||||
h(TreeIcon),
|
||||
|
|
@ -503,14 +507,18 @@ export function apply(ctx) {
|
|||
)
|
||||
}
|
||||
|
||||
// 追加型入口:只在 sidebar.footer.action 里加一个 action,不替换工作区/项目树。
|
||||
function SanshengSessionAction(props) {
|
||||
const children = props && props.children
|
||||
return h(Fragment, null, children, h(SanshengEntry, { compact: true }))
|
||||
}
|
||||
|
||||
// 顶部入口:包住「新会话」行(HOC 槽位),在原按钮后追加「三省六部」,不替换原按钮/项目树。
|
||||
try {
|
||||
if (ctx.slots && isFn(ctx.slots.inject) && isFn(ctx.slots.register)) {
|
||||
ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register({
|
||||
name: 'sidebar.footer.action',
|
||||
ctx.slots.inject('sidebar.session.action', () => ctx.slots.register({
|
||||
name: 'sidebar.session.action',
|
||||
id: 'sansheng-entry',
|
||||
order: 40,
|
||||
}, SanshengEntry))
|
||||
}, SanshengSessionAction))
|
||||
} else {
|
||||
console.warn('[sansheng] 宿主未提供 slots.inject / slots.register,无法注册侧栏入口')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-tree{padding:14px 16px 4px;position:relative}
|
||||
.ssw-lead{width:150px;margin:0 auto;position:relative}
|
||||
.ssw-lead::after{content:"";position:absolute;left:50%;top:100%;height:20px;border-left:1px solid var(--ssw-wire)}
|
||||
.ssw-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:34px;position:relative}
|
||||
.ssw-trio::before{content:"";position:absolute;left:16.66%;right:16.66%;top:-15px;border-top:1px solid var(--ssw-wire)}
|
||||
.ssw-trio .ssw-seat::before{content:"";position:absolute;left:50%;bottom:100%;height:15px;border-left:1px solid var(--ssw-wire)}
|
||||
.ssw-sansheng{position:relative;border:1px solid var(--ssw-strong);background:var(--ssw-card);border-radius:12px;margin-top:28px;padding:16px 8px 9px}
|
||||
.ssw-trio{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
|
||||
.ssw-seat{position:relative;width:100%;display:flex;flex-direction:column;gap:6px;padding:10px 9px 8px;border:1px solid var(--ssw-line);border-radius:10px;background:var(--ssw-card);text-align:left;min-height:70px;box-shadow:0 1px 2px rgba(16,24,40,.04);transition:border-color .15s,box-shadow .15s,transform .15s}
|
||||
.ssw-seat:hover{border-color:var(--ssw-strong);transform:translateY(-1px);box-shadow:0 3px 8px rgba(16,24,40,.06)}
|
||||
.ssw-seat[aria-pressed=true]{border-color:var(--ssw-blue);background:var(--ssw-wash);box-shadow:0 0 0 2px rgba(59,130,246,.12)}
|
||||
|
|
@ -44,9 +43,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-dot[data-status=bound]{background:var(--ssw-ok);border-color:var(--ssw-ok)}
|
||||
.ssw-dot[data-status=failed],.ssw-dot[data-status=missing]{background:var(--ssw-danger);border-color:var(--ssw-danger)}
|
||||
.ssw-dot[data-status=creating]{background:var(--ssw-blue);border-color:var(--ssw-blue)}
|
||||
.ssw-ministries{position:relative;border:1px dashed var(--ssw-wire);border-radius:12px;margin-top:26px;padding:14px 8px 9px}
|
||||
.ssw-ministries::before{content:"";position:absolute;bottom:100%;height:26px;border-left:1px solid var(--ssw-wire);left:50%}
|
||||
.ssw-group-label{position:absolute;top:-8px;left:10px;padding:0 5px;background:var(--ssw-rail);font-size:10px;color:var(--ssw-faint)}
|
||||
.ssw-ministries{position:relative;border:1px solid var(--ssw-strong);background:var(--ssw-card);border-radius:12px;margin-top:14px;padding:16px 8px 9px}
|
||||
.ssw-group-label{position:absolute;top:-9px;left:12px;padding:1px 7px;background:var(--ssw-card);border:1px solid var(--ssw-strong);border-radius:6px;font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-six{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
|
||||
.ssw-six .ssw-seat{min-height:66px;padding:9px 8px}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
|
|
@ -75,6 +73,8 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-entry[aria-expanded=true]{color:#2563eb;background:#eaf1fe;font-weight:600}
|
||||
.ssw-entry svg{width:16px;height:16px;flex:none}
|
||||
.ssw-entry-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.ssw-entry-compact{width:auto;max-width:100%;height:28px;padding:0 8px;gap:6px;border:1px solid var(--ssw-line);border-radius:7px;background:var(--ssw-card);font-size:12px}
|
||||
.ssw-entry-compact:hover{background:var(--ssw-wash)}
|
||||
body[data-ds-dark-theme] .ssw-entry:hover{background:#1d2b40}
|
||||
body[data-ds-dark-theme] .ssw-entry[aria-expanded=true]{color:#91bafa;background:#1d2b40}
|
||||
@media (prefers-reduced-motion:reduce){.ssw-scope *{transition:none!important}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue