feat(client): 部门卡统一蓝色边框;新增「全部汇报职责」并连跑3轮冒烟
This commit is contained in:
parent
46a02ccc97
commit
f917dd3970
|
|
@ -55,7 +55,8 @@ HTTP 处理器端到端;systemPrompt 只注入十席;Web 纯视图模型(
|
|||
- 当前项目 default-workspace 正确识别,显示「10 个角色 · 0 个会话」「启用此项目的十席」。✅
|
||||
- 点「启用此项目的十席」→ 宿主真实建成 10 个独立 root session:项目 ready、10 席 bound、failed=0、无报错。✅
|
||||
- 重启 DSH 进程后重开:仍「10 个角色 · 10 个会话」、无「启用」按钮、10 个会话 ID 互不相同 → 持久化与幂等通过,重启不重复建会话。✅
|
||||
- 入口按用户要求移到“新会话”行右侧(`sidebar.session.action`),不再占底部;每个部门卡片各自加清晰边框,三省/六部仅保留文字分组标题。✅
|
||||
- 入口按用户要求移到“新会话”行右侧(`sidebar.session.action`),不再占底部;每个部门卡片统一为与丞相一致的蓝色边框,三省/六部仅保留文字分组标题。✅
|
||||
- 新增「全部汇报职责」入口:点开逐条列出十席各自职责;冒烟测试连跑 3 轮,每轮十席 10/10 职责正常汇报、0 console 报错。✅
|
||||
- 工作台进入真实右侧 dock(`inDock=true`、非浮动面板),无 console 报错。✅
|
||||
- 点角色(工部)→ 真机切到该席独立会话(提示“已切换到工部会话”),无报错。✅
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,21 @@ async function main() {
|
|||
})()`)
|
||||
await shot('live-02-workbench.png')
|
||||
|
||||
if (process.argv.includes('--report')) {
|
||||
const toggled = await evaluate("(() => { const b = document.querySelector('.ssw-report-toggle'); if (!b) return false; b.click(); return true })()")
|
||||
await sleep(700)
|
||||
result.report = await evaluate(`(() => ({
|
||||
toggled: ${toggled},
|
||||
count: document.querySelectorAll('.ssw-report-item').length,
|
||||
items: Array.from(document.querySelectorAll('.ssw-report-item')).map(el => ({
|
||||
seat: el.getAttribute('data-seat'),
|
||||
name: el.querySelector('strong')?.innerText?.trim() ?? null,
|
||||
text: el.querySelector('.ssw-report-text')?.innerText?.trim() ?? null,
|
||||
})),
|
||||
}))()`)
|
||||
await shot('live-05-report.png')
|
||||
}
|
||||
|
||||
if (process.argv.includes('--seat')) {
|
||||
const clicked = await evaluate("(() => { const s = document.querySelectorAll('.ssw-seat'); if (s.length >= 10) { s[9].click(); return true } return false })()")
|
||||
await sleep(1500)
|
||||
|
|
@ -114,7 +129,8 @@ async function main() {
|
|||
await shot('live-03-enabled.png')
|
||||
}
|
||||
}
|
||||
result.pass = !!(result.entry?.found && result.workbench?.found && (result.workbench?.seatCount === 10 || result.workbench?.enableText))
|
||||
result.pass = !!(result.entry?.found && result.workbench?.found && (result.workbench?.seatCount === 10 || result.workbench?.enableText)
|
||||
&& (!process.argv.includes('--report') || (result.report?.count === 10 && result.report.items.every(it => it.name && it.text))))
|
||||
}
|
||||
|
||||
try { await main() } catch (error) { result.fatal = String(error?.stack ?? error) } finally { try { ws?.close() } catch {}; try { browser?.kill() } catch {} }
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 73 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
|
|
@ -0,0 +1,14 @@
|
|||
import fs from 'node:fs'
|
||||
const runs = [1, 2, 3].map(i => {
|
||||
try { return JSON.parse(fs.readFileSync('preview/smoke' + i + '.json', 'utf8')) }
|
||||
catch (e) { return { parseError: String(e) } }
|
||||
})
|
||||
const summary = runs.map((r, i) => ({
|
||||
run: i + 1,
|
||||
pass: r.pass,
|
||||
seats: r.workbench?.seatCount,
|
||||
inDock: r.workbench?.inDock,
|
||||
reportCount: r.report?.count,
|
||||
consoleErrors: (r.consoleErrors || []).length,
|
||||
}))
|
||||
console.log(JSON.stringify({ runs: summary, items: runs[0]?.report?.items ?? runs[0]?.parseError }, null, 2))
|
||||
|
|
@ -369,12 +369,12 @@ var transport_default = request;
|
|||
|
||||
// src/client/styles.js
|
||||
var CSS = `
|
||||
.ssw-scope{--ssw-bg:#ffffff;--ssw-side:#f8f9fa;--ssw-rail:#f7f9fc;--ssw-card:#ffffff;--ssw-line:#e3e8ef;--ssw-strong:#c7d8f5;--ssw-ink:#0f172a;--ssw-muted:#667085;--ssw-faint:#98a2b3;--ssw-blue:#3b82f6;--ssw-wash:#eff6ff;--ssw-frame:#93a7c2;--ssw-wire:#c9d6ea;--ssw-danger:#dc2626;--ssw-ok:#16a34a;box-sizing:border-box;color:var(--ssw-ink);font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:1.5}
|
||||
.ssw-scope{--ssw-bg:#ffffff;--ssw-side:#f8f9fa;--ssw-rail:#f7f9fc;--ssw-card:#ffffff;--ssw-line:#e3e8ef;--ssw-strong:#c7d8f5;--ssw-ink:#0f172a;--ssw-muted:#667085;--ssw-faint:#98a2b3;--ssw-blue:#3b82f6;--ssw-wash:#eff6ff;--ssw-frame:#3b82f6;--ssw-wire:#c9d6ea;--ssw-danger:#dc2626;--ssw-ok:#16a34a;box-sizing:border-box;color:var(--ssw-ink);font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:1.5}
|
||||
.ssw-scope *,.ssw-scope *::before,.ssw-scope *::after{box-sizing:border-box}
|
||||
.ssw-scope button{font:inherit;color:inherit;background:transparent;border:0;cursor:pointer}
|
||||
.ssw-scope button:disabled{cursor:default;opacity:.55}
|
||||
.ssw-scope :focus-visible{outline:2px solid var(--ssw-blue);outline-offset:2px}
|
||||
body[data-ds-dark-theme] .ssw-scope,html[data-theme=dark] .ssw-scope,.ssw-scope[data-ssw-theme=dark]{--ssw-bg:#14171c;--ssw-side:#171b21;--ssw-rail:#161a20;--ssw-card:#1e232b;--ssw-line:#2c333d;--ssw-strong:#3b4a63;--ssw-frame:#4c5a6e;--ssw-ink:#e6ebf2;--ssw-muted:#a9b4c2;--ssw-faint:#7b8797;--ssw-blue:#6ea8ff;--ssw-wash:#1d2b40;--ssw-wire:#3a4350;--ssw-danger:#f87171;--ssw-ok:#4ade80}
|
||||
body[data-ds-dark-theme] .ssw-scope,html[data-theme=dark] .ssw-scope,.ssw-scope[data-ssw-theme=dark]{--ssw-bg:#14171c;--ssw-side:#171b21;--ssw-rail:#161a20;--ssw-card:#1e232b;--ssw-line:#2c333d;--ssw-strong:#3b4a63;--ssw-frame:#6ea8ff;--ssw-ink:#e6ebf2;--ssw-muted:#a9b4c2;--ssw-faint:#7b8797;--ssw-blue:#6ea8ff;--ssw-wash:#1d2b40;--ssw-wire:#3a4350;--ssw-danger:#f87171;--ssw-ok:#4ade80}
|
||||
.ssw-float{position:fixed;right:14px;bottom:70px;z-index:2147483000;width:min(374px,calc(100vw - 28px));max-height:calc(100vh - 96px);display:flex;flex-direction:column;background:#ffffff;border:1px solid #e3e8ef;border-radius:12px;box-shadow:0 18px 50px -12px rgba(16,24,40,.28),0 4px 12px -2px rgba(16,24,40,.12);overflow:hidden}
|
||||
body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:#161a20;border-color:#2c333d}
|
||||
.ssw-root{display:flex;flex-direction:column;min-height:0;height:100%;overflow:auto;background:var(--ssw-rail);color:var(--ssw-ink)}
|
||||
|
|
@ -413,6 +413,14 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-group-label{display:block;margin:0 2px 8px;font-size:11px;font-weight:600;letter-spacing:.5px;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-report{padding:0 16px;margin-top:4px}
|
||||
.ssw-report-toggle{font-size:12px;color:var(--ssw-blue);padding:7px 2px;font-weight:500}
|
||||
.ssw-report-list{display:flex;flex-direction:column;gap:8px;margin-top:4px}
|
||||
.ssw-report-item{border:1px solid var(--ssw-line);border-radius:9px;padding:9px 11px;background:var(--ssw-card)}
|
||||
.ssw-report-head{display:flex;gap:8px;align-items:baseline}
|
||||
.ssw-report-head strong{font-size:13px;letter-spacing:1px}
|
||||
.ssw-report-head span{font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-report-text{margin:5px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
.ssw-current-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
|
||||
.ssw-current-name{font-size:13px;font-weight:600}
|
||||
|
|
@ -1083,6 +1091,7 @@ function apply(ctx) {
|
|||
const [draft, setDraft] = (0, import_react.useState)({});
|
||||
const [busy, setBusy] = (0, import_react.useState)(false);
|
||||
const [configOpen, setConfigOpen] = (0, import_react.useState)(false);
|
||||
const [reportOpen, setReportOpen] = (0, import_react.useState)(false);
|
||||
const alive = (0, import_react.useRef)(true);
|
||||
(0, import_react.useEffect)(() => () => {
|
||||
alive.current = false;
|
||||
|
|
@ -1322,6 +1331,31 @@ function apply(ctx) {
|
|||
)
|
||||
) : null
|
||||
);
|
||||
const report = (0, import_react.createElement)(
|
||||
"section",
|
||||
{ className: "ssw-report" },
|
||||
(0, import_react.createElement)("button", {
|
||||
type: "button",
|
||||
className: "ssw-report-toggle",
|
||||
"aria-expanded": reportOpen ? "true" : "false",
|
||||
onClick: () => setReportOpen((value) => !value)
|
||||
}, reportOpen ? "收起职责汇报" : "全部汇报职责"),
|
||||
reportOpen ? (0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-report-list" },
|
||||
SEAT_IDS.map((id) => (0, import_react.createElement)(
|
||||
"div",
|
||||
{ key: id, className: "ssw-report-item", "data-seat": id },
|
||||
(0, import_react.createElement)(
|
||||
"div",
|
||||
{ className: "ssw-report-head" },
|
||||
(0, import_react.createElement)("strong", null, SEATS[id].label),
|
||||
(0, import_react.createElement)("span", null, SEATS[id].duty)
|
||||
),
|
||||
(0, import_react.createElement)("p", { className: "ssw-report-text" }, SEATS[id].responsibility)
|
||||
))
|
||||
) : null
|
||||
);
|
||||
const statusEl = error ? (0, import_react.createElement)("p", { className: "ssw-error", role: "alert" }, error) : notice ? (0, import_react.createElement)("p", { className: "ssw-notice", role: "status" }, notice) : null;
|
||||
let body;
|
||||
if (phase === "loading") body = (0, import_react.createElement)("div", { className: "ssw-loading" }, "正在加载工作台…");
|
||||
|
|
@ -1337,7 +1371,7 @@ function apply(ctx) {
|
|||
(0, import_react.createElement)("p", { className: "ssw-error" }, error || "加载失败"),
|
||||
(0, import_react.createElement)("button", { type: "button", className: "ssw-primary", onClick: loadProject }, "重试")
|
||||
);
|
||||
else body = (0, import_react.createElement)(import_react.Fragment, null, projectInfo, enableBlock, tree, currentCard, config, statusEl);
|
||||
else body = (0, import_react.createElement)(import_react.Fragment, null, projectInfo, enableBlock, tree, report, currentCard, config, statusEl);
|
||||
return (0, import_react.createElement)("div", { className: "ssw-root ssw-scope" }, head, body);
|
||||
}
|
||||
function SanshengEntry(props) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import { createElement as h, Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { SEAT_IDS } from '../shared/roles.js'
|
||||
import { SEAT_IDS, SEATS } from '../shared/roles.js'
|
||||
import {
|
||||
buildWorkbenchView,
|
||||
findModelOption,
|
||||
|
|
@ -258,6 +258,7 @@ export function apply(ctx) {
|
|||
const [draft, setDraft] = useState({})
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [configOpen, setConfigOpen] = useState(false)
|
||||
const [reportOpen, setReportOpen] = useState(false)
|
||||
const alive = useRef(true)
|
||||
|
||||
useEffect(() => () => { alive.current = false }, [])
|
||||
|
|
@ -461,6 +462,24 @@ export function apply(ctx) {
|
|||
: null,
|
||||
)
|
||||
|
||||
const report = h('section', { className: 'ssw-report' },
|
||||
h('button', {
|
||||
type: 'button', className: 'ssw-report-toggle', 'aria-expanded': reportOpen ? 'true' : 'false',
|
||||
onClick: () => setReportOpen(value => !value),
|
||||
}, reportOpen ? '收起职责汇报' : '全部汇报职责'),
|
||||
reportOpen
|
||||
? h('div', { className: 'ssw-report-list' },
|
||||
SEAT_IDS.map(id => h('div', { key: id, className: 'ssw-report-item', 'data-seat': id },
|
||||
h('div', { className: 'ssw-report-head' },
|
||||
h('strong', null, SEATS[id].label),
|
||||
h('span', null, SEATS[id].duty),
|
||||
),
|
||||
h('p', { className: 'ssw-report-text' }, SEATS[id].responsibility),
|
||||
)),
|
||||
)
|
||||
: null,
|
||||
)
|
||||
|
||||
const statusEl = error
|
||||
? h('p', { className: 'ssw-error', role: 'alert' }, error)
|
||||
: (notice ? h('p', { className: 'ssw-notice', role: 'status' }, notice) : null)
|
||||
|
|
@ -475,7 +494,7 @@ export function apply(ctx) {
|
|||
h('p', { className: 'ssw-error' }, error || '加载失败'),
|
||||
h('button', { type: 'button', className: 'ssw-primary', onClick: loadProject }, '重试'),
|
||||
)
|
||||
else body = h(Fragment, null, projectInfo, enableBlock, tree, currentCard, config, statusEl)
|
||||
else body = h(Fragment, null, projectInfo, enableBlock, tree, report, currentCard, config, statusEl)
|
||||
|
||||
return h('div', { className: 'ssw-root ssw-scope' }, head, body)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
// 不依赖任何构建工具,作为普通字符串导出,由入口注入 <style>。
|
||||
|
||||
export const CSS = `
|
||||
.ssw-scope{--ssw-bg:#ffffff;--ssw-side:#f8f9fa;--ssw-rail:#f7f9fc;--ssw-card:#ffffff;--ssw-line:#e3e8ef;--ssw-strong:#c7d8f5;--ssw-ink:#0f172a;--ssw-muted:#667085;--ssw-faint:#98a2b3;--ssw-blue:#3b82f6;--ssw-wash:#eff6ff;--ssw-frame:#93a7c2;--ssw-wire:#c9d6ea;--ssw-danger:#dc2626;--ssw-ok:#16a34a;box-sizing:border-box;color:var(--ssw-ink);font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:1.5}
|
||||
.ssw-scope{--ssw-bg:#ffffff;--ssw-side:#f8f9fa;--ssw-rail:#f7f9fc;--ssw-card:#ffffff;--ssw-line:#e3e8ef;--ssw-strong:#c7d8f5;--ssw-ink:#0f172a;--ssw-muted:#667085;--ssw-faint:#98a2b3;--ssw-blue:#3b82f6;--ssw-wash:#eff6ff;--ssw-frame:#3b82f6;--ssw-wire:#c9d6ea;--ssw-danger:#dc2626;--ssw-ok:#16a34a;box-sizing:border-box;color:var(--ssw-ink);font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif;font-size:13px;line-height:1.5}
|
||||
.ssw-scope *,.ssw-scope *::before,.ssw-scope *::after{box-sizing:border-box}
|
||||
.ssw-scope button{font:inherit;color:inherit;background:transparent;border:0;cursor:pointer}
|
||||
.ssw-scope button:disabled{cursor:default;opacity:.55}
|
||||
.ssw-scope :focus-visible{outline:2px solid var(--ssw-blue);outline-offset:2px}
|
||||
body[data-ds-dark-theme] .ssw-scope,html[data-theme=dark] .ssw-scope,.ssw-scope[data-ssw-theme=dark]{--ssw-bg:#14171c;--ssw-side:#171b21;--ssw-rail:#161a20;--ssw-card:#1e232b;--ssw-line:#2c333d;--ssw-strong:#3b4a63;--ssw-frame:#4c5a6e;--ssw-ink:#e6ebf2;--ssw-muted:#a9b4c2;--ssw-faint:#7b8797;--ssw-blue:#6ea8ff;--ssw-wash:#1d2b40;--ssw-wire:#3a4350;--ssw-danger:#f87171;--ssw-ok:#4ade80}
|
||||
body[data-ds-dark-theme] .ssw-scope,html[data-theme=dark] .ssw-scope,.ssw-scope[data-ssw-theme=dark]{--ssw-bg:#14171c;--ssw-side:#171b21;--ssw-rail:#161a20;--ssw-card:#1e232b;--ssw-line:#2c333d;--ssw-strong:#3b4a63;--ssw-frame:#6ea8ff;--ssw-ink:#e6ebf2;--ssw-muted:#a9b4c2;--ssw-faint:#7b8797;--ssw-blue:#6ea8ff;--ssw-wash:#1d2b40;--ssw-wire:#3a4350;--ssw-danger:#f87171;--ssw-ok:#4ade80}
|
||||
.ssw-float{position:fixed;right:14px;bottom:70px;z-index:2147483000;width:min(374px,calc(100vw - 28px));max-height:calc(100vh - 96px);display:flex;flex-direction:column;background:#ffffff;border:1px solid #e3e8ef;border-radius:12px;box-shadow:0 18px 50px -12px rgba(16,24,40,.28),0 4px 12px -2px rgba(16,24,40,.12);overflow:hidden}
|
||||
body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:#161a20;border-color:#2c333d}
|
||||
.ssw-root{display:flex;flex-direction:column;min-height:0;height:100%;overflow:auto;background:var(--ssw-rail);color:var(--ssw-ink)}
|
||||
|
|
@ -47,6 +47,14 @@ body[data-ds-dark-theme] .ssw-float,html[data-theme=dark] .ssw-float{background:
|
|||
.ssw-group-label{display:block;margin:0 2px 8px;font-size:11px;font-weight:600;letter-spacing:.5px;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-report{padding:0 16px;margin-top:4px}
|
||||
.ssw-report-toggle{font-size:12px;color:var(--ssw-blue);padding:7px 2px;font-weight:500}
|
||||
.ssw-report-list{display:flex;flex-direction:column;gap:8px;margin-top:4px}
|
||||
.ssw-report-item{border:1px solid var(--ssw-line);border-radius:9px;padding:9px 11px;background:var(--ssw-card)}
|
||||
.ssw-report-head{display:flex;gap:8px;align-items:baseline}
|
||||
.ssw-report-head strong{font-size:13px;letter-spacing:1px}
|
||||
.ssw-report-head span{font-size:10px;color:var(--ssw-muted)}
|
||||
.ssw-report-text{margin:5px 0 0;font-size:12px;line-height:1.7;color:var(--ssw-muted)}
|
||||
.ssw-current{margin:16px 16px 0;padding:13px;border:1px solid var(--ssw-line);border-radius:11px;background:var(--ssw-card)}
|
||||
.ssw-current-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:9px}
|
||||
.ssw-current-name{font-size:13px;font-weight:600}
|
||||
|
|
|
|||
Loading…
Reference in New Issue