feat(ui): 控制室图标改内联 SVG,替代系统 emoji (v0.5.3-local.9)

emoji 的渲染完全取决于系统字体(Windows Segoe UI Emoji / macOS Apple Color
Emoji 的形状与配色都不同),同一份代码在不同机器上长得不一样,观感也偏旧
(截图里的 🖥️ 呈老式 CRT 显示器样式)。

- 新增 ICON_CONSOLE 内联 SVG(显示器 + 支架,stroke=currentColor)
- 侧栏控制室卡片改用该图标
- .dsh-wt_layoutIcon 改为定尺寸 flex 容器;新增 .dsh-wt_layoutSvg 跟随主题色,
  选中态取强调色

用户自定义图标选择器(EMOJI_SET)保留不动 —— 那是功能,不是默认值。

验证:npm run pack 全绿,双资产同源 sha256 888d4e8f…。
This commit is contained in:
wangheng
2026-12-02 17:43:58 +08:00
parent b917f0e0ed
commit 6aa0d3dce4
9 changed files with 44 additions and 19 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "dsh-worktable",
"description": "工作台:DSH 侧边栏的 agent 级项目容器,收纳如 TravelAtlas 等自装项目",
"version": "0.5.3-local.8",
"version": "0.5.3-local.9",
"entry": {
"name": "dsh-worktable",
"inject": []
+12 -4
View File
@@ -7986,7 +7986,10 @@ var css = xterm_default + "\n" + [
".dsh-wt_layout:hover{border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);background:var(--dsw-alias-fill-l1,rgba(255,255,255,.05))}",
".dsh-wt_layout[data-on=true]{border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);background:var(--dsw-alias-fill-l1,rgba(255,255,255,.05))}",
".dsh-wt_layout[data-on=true] .dsh-wt_layoutName{color:var(--dsw-alias-state-accent-primary,#4f8ef7)}",
".dsh-wt_layoutIcon{flex:none;font-size:15px}",
".dsh-wt_layoutIcon{flex:none;font-size:15px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px}",
// 内联 SVG 图标:跟随文字色,两平台渲染一致(emoji 依赖系统字体,形状/配色不统一)
".dsh-wt_layoutSvg{width:15px;height:15px;display:block;flex:none;color:var(--dsw-alias-label-secondary,#9aa4b2)}",
".dsh-wt_layout[data-on=true] .dsh-wt_layoutSvg{color:var(--dsw-alias-state-accent-primary,#4f8ef7)}",
".dsh-wt_layoutText{flex:1;min-width:0;display:flex;flex-direction:column;gap:0}",
".dsh-wt_layoutName{font-size:12px;font-weight:400;line-height:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
// 箭头与项目名同一行高 + 字面中心对齐;› 墨迹在字面框内偏下,整体上移 1px 使视觉居中
@@ -8967,7 +8970,7 @@ function hostPreviewUrl(path, surface = {
if (url.protocol !== "http:" && url.protocol !== "https:") throw new Error("Unsupported Host preview protocol");
return url.href;
}
var UPDATE_TGZ = "https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.8/dsh-worktable.tgz";
var UPDATE_TGZ = "https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.9/dsh-worktable.tgz";
function worktableUpgrade(protocol = typeof location === "undefined" ? "http:" : location.protocol) {
const desktop = protocol === "dsh-app:";
const command = "dsh plugin --profile " + (desktop ? "desktop" : "web") + ' add "' + UPDATE_TGZ + '"';
@@ -9200,7 +9203,7 @@ var CHANGELOG_V030 = `\u66F4\u65B0\u516C\u544A \xB7 v0.5.1
\u30103.1 \u6587\u5B57\u4E0E\u7EC6\u8282\u6253\u78E8\u3011\u5168\u5C40\u5B57\u4F53\u4E0E\u5B57\u53F7\u7EDF\u4E00\u4F18\u5316\u3001\u4E0B\u62C9\u9762\u677F\u73BB\u7483\u5316\u4E0E\u5BF9\u9F50\u3001\u83DC\u5355\u70B9\u9009\u540E\u4FDD\u6301\u6253\u5F00\u4FBF\u4E8E\u8FDE\u7EED\u9884\u89C8\u3001\u6309\u94AE\u63CF\u8FB9\u4E0E\u60AC\u505C\u53CD\u9988\u7B49\u4EA4\u4E92\u7EC6\u8282\uFF1B\u540C\u65F6\u4FEE\u590D\u4E86\u591A\u9879\u4F53\u9A8C\u95EE\u9898\uFF08\u7167\u7247\u4E0A\u4F20\u6E05\u6670\u5EA6\u3001\u80CC\u666F\u7F51\u683C\u7EBF\u5728\u7167\u7247\u6A21\u5F0F\u4E0B\u4E0D\u751F\u6548\u3001\u6D45\u8272\u4E3B\u9898\u4E0B\u5DE5\u4F5C\u72B6\u6001\u5149\u6548\u4E0D\u53EF\u89C1\u7B49\uFF09\u3002`;
// src/client/updateCheck.ts
var LOCAL_VERSION = false ? "dev" : "0.5.3-local.8";
var LOCAL_VERSION = false ? "dev" : "0.5.3-local.9";
var UPDATE_API = "/api/worktable/update-check";
var K_UPDATE_CHECK = "dsh.worktable.updateCheck.v1";
var K_LAST_CHECK = "dsh.worktable.lastUpdateCheck.v1";
@@ -21288,6 +21291,11 @@ async function ensureSessionModel(sessionId) {
}
var CONSOLE_ID = "wt-console";
var CONSOLE_ICON = "\u{1F5A5}\uFE0F";
var ICON_CONSOLE = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("svg", { className: "dsh-wt_layoutSvg", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("rect", { x: "1.6", y: "2.2", width: "12.8", height: "8.6", rx: "1.5", stroke: "currentColor", strokeWidth: "1.3" }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5.2 13.4h5.6", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M8 10.8v2.6", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
] });
function specHasConsoleTab(spec) {
return !!spec?.main?.[0]?.tabs?.some((t) => t.content?.kind === "builtin" && t.content.type === "console");
}
@@ -24046,7 +24054,7 @@ function WorktableSection(props) {
title: t("console.name"),
onClick: (e) => clickConsoleCard(e.currentTarget),
children: [
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_layoutIcon", children: CONSOLE_ICON }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_layoutIcon", children: ICON_CONSOLE }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_layoutText", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_layoutName", children: t("console.name") }) }),
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
"span",
+1 -1
View File
@@ -382,7 +382,7 @@ function resolveDshHomeSafe() {
cachedDshHome = baseDshHome();
return cachedDshHome;
}
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.8";
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.9";
var name = "dsh-worktable";
var inject = ["webServer", "sessions"];
var HEALTH_PATH = "/api/worktable/health";
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "dsh-worktable",
"description": "工作台 Worktable:DeepSeek Harness 侧边栏的 agent 级项目容器(应用抽屉)",
"version": "0.5.3-local.8",
"version": "0.5.3-local.9",
"repository": {
"type": "git",
"url": "https://github.com/Aisland-SJL/dsh-worktable.git",
+1 -1
View File
@@ -38,7 +38,7 @@ export function hostPreviewUrl(
/** Keep update instructions on the active profile; Desktop must use its bundled CLI. */
// 本仓发布在自建 Gitea:它不支持 GitHub 的 /releases/latest/download 简写,
// 安装命令必须带具体 tag。这里给固定 tag(随发布更新),避免给出 404 的命令。
const UPDATE_TGZ = 'https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.8/dsh-worktable.tgz'
const UPDATE_TGZ = 'https://gitea.ququclean.com/xiaoqu/dsh-worktable/releases/download/v0.5.3-local.9/dsh-worktable.tgz'
export function worktableUpgrade(protocol = typeof location === 'undefined' ? 'http:' : location.protocol) {
const desktop = protocol === 'dsh-app:'
+15 -1
View File
@@ -566,6 +566,20 @@ async function ensureSessionModel(sessionId: string): Promise<void> {
const CONSOLE_ID = 'wt-console'
const CONSOLE_ICON = '🖥️'
/**
* 控制室图标:内联 SVG 替代 emoji。
* emoji 的渲染完全取决于系统字体(Windows Segoe UI Emoji / macOS Apple Color Emoji
* 形状与配色都不同),同一份代码在不同机器上长得不一样,看起来也偏旧。
* 用 currentColor 描边图标可跟随主题色,两平台一致。
*/
const ICON_CONSOLE = (
<svg className="dsh-wt_layoutSvg" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<rect x="1.6" y="2.2" width="12.8" height="8.6" rx="1.5" stroke="currentColor" strokeWidth="1.3" />
<path d="M5.2 13.4h5.6" stroke="currentColor" strokeWidth="1.3" strokeLinecap="round" />
<path d="M8 10.8v2.6" stroke="currentColor" strokeWidth="1.3" strokeLinecap="round" />
</svg>
)
/** 控制室布局是否健全:主窗格首格存在 console 类型标签(旧版关标签的坏存档没有它) */
function specHasConsoleTab(spec: LayoutSpec | undefined): boolean {
return !!spec?.main?.[0]?.tabs?.some((t) => t.content?.kind === 'builtin' && t.content.type === 'console')
@@ -3241,7 +3255,7 @@ function buildCustomLayoutPrompt(req: string): string {
title={t('console.name')}
onClick={(e) => clickConsoleCard(e.currentTarget as HTMLElement)}
>
<span className="dsh-wt_layoutIcon">{CONSOLE_ICON}</span>
<span className="dsh-wt_layoutIcon">{ICON_CONSOLE}</span>
<span className="dsh-wt_layoutText">
<span className="dsh-wt_layoutName">{t('console.name')}</span>
</span>
+4 -1
View File
@@ -234,7 +234,10 @@ export const css = xtermCss + '\n' + [
'.dsh-wt_layout:hover{border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);background:var(--dsw-alias-fill-l1,rgba(255,255,255,.05))}',
'.dsh-wt_layout[data-on=true]{border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);background:var(--dsw-alias-fill-l1,rgba(255,255,255,.05))}',
'.dsh-wt_layout[data-on=true] .dsh-wt_layoutName{color:var(--dsw-alias-state-accent-primary,#4f8ef7)}',
'.dsh-wt_layoutIcon{flex:none;font-size:15px}',
'.dsh-wt_layoutIcon{flex:none;font-size:15px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px}',
// 内联 SVG 图标:跟随文字色,两平台渲染一致(emoji 依赖系统字体,形状/配色不统一)
'.dsh-wt_layoutSvg{width:15px;height:15px;display:block;flex:none;color:var(--dsw-alias-label-secondary,#9aa4b2)}',
'.dsh-wt_layout[data-on=true] .dsh-wt_layoutSvg{color:var(--dsw-alias-state-accent-primary,#4f8ef7)}',
'.dsh-wt_layoutText{flex:1;min-width:0;display:flex;flex-direction:column;gap:0}',
'.dsh-wt_layoutName{font-size:12px;font-weight:400;line-height:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
// 箭头与项目名同一行高 + 字面中心对齐;› 墨迹在字面框内偏下,整体上移 1px 使视觉居中