feat(ui): 收起态 rail 限制图标数量,其余进「⋯」菜单 (REQ-20261117-0013)
收起态 rail 原先把控制室、所有项目、所有快捷方式、所有布局四类全平铺, 且 railBox 是 flex-wrap 无上限、无滚动 —— 项目一多就把侧栏堆成一长列图标。 - railItems 只平铺前 RAIL_MAX(8) 个,其余进「⋯」溢出菜单 - 溢出菜单贴右侧浮层,可滚动(max-height 60vh/420px),点条目后自动收起 - 控制室始终在第一位(唯一固定入口),被挤出者按原顺序进菜单 - .dsh-wt_rail 补 position:relative 作为浮层定位基准 - locales 新增 rail.more(zh/en) - 版本 0.5.3-local.1 -> 0.5.3-local.2 验证:build 通过;client-factory-gate 10/10;7 个兼容回归 105/105; release-prep 全过(含真实 Chromium split margin 5 场景、sidebar popup、 split anchor dom 14 场景、独立安装 import 断言)
This commit is contained in:
@@ -7761,11 +7761,20 @@ var css = xterm_default + "\n" + [
|
||||
// 区块整体
|
||||
".dsh-wt_section{box-sizing:border-box;display:flex;flex-direction:column;gap:6px;width:100%;padding:0}",
|
||||
".dsh-wt_float{min-width:176px;max-width:264px;background:var(--dsw-alias-bg-base,#0b0e14);border:1px solid var(--dsw-alias-border-l2,#3a4150);border-radius:10px;padding:8px;box-shadow:var(--dsw-shadow-lv2,0 8px 24px rgba(0,0,0,.4))}",
|
||||
".dsh-wt_rail{pointer-events:none}",
|
||||
".dsh-wt_rail{pointer-events:none;position:relative}",
|
||||
".dsh-wt_railBox{display:flex;flex-wrap:wrap;gap:5px;justify-content:center;padding:5px 3px;border:1px solid var(--dsw-alias-border-l2,#3a4150);border-radius:8px;background:var(--dsw-alias-bg-base,#0b0e14)}",
|
||||
".dsh-wt_railBtn{flex:none;width:22px;height:22px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid var(--dsw-alias-border-l1,#262b36);border-radius:7px;background:var(--dsw-alias-fill-l1,rgba(255,255,255,.03));color:var(--dsw-alias-label-secondary,#9aa4b2);font:inherit;font-size:13px;line-height:1;cursor:pointer;pointer-events:auto}",
|
||||
".dsh-wt_railBtn:hover{background:var(--dsw-alias-fill-l1,rgba(255,255,255,.08));border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);color:var(--dsw-alias-label-primary,#e6e8eb)}",
|
||||
".dsh-wt_railIcon{font-size:17px;line-height:22px}",
|
||||
// REQ-20261117-0013:rail 溢出菜单。「⋯」按钮与普通 rail 按钮同尺寸,
|
||||
// 展开后是一个贴右侧的浮层列表(项目多时不再把 rail 堆成一长列)。
|
||||
".dsh-wt_railMore{font-size:15px;letter-spacing:1px;color:var(--dsw-alias-label-tertiary,#6e7683)}",
|
||||
".dsh-wt_railMoreOn{background:var(--dsw-alias-fill-l2,rgba(255,255,255,.09));border-color:var(--dsw-alias-state-accent-primary,#4f8ef7);color:var(--dsw-alias-label-primary,#e6e8eb)}",
|
||||
".dsh-wt_railMenu{position:absolute;top:100%;left:calc(100% + 6px);z-index:30;display:flex;flex-direction:column;gap:1px;min-width:168px;max-width:260px;max-height:min(60vh,420px);overflow-y:auto;padding:5px;border:1px solid var(--dsw-alias-border-l2,#3a4150);border-radius:8px;background:var(--dsw-alias-bg-base,#0b0e14);box-shadow:var(--dsw-shadow-lv2,0 8px 24px rgba(0,0,0,.4))}",
|
||||
".dsh-wt_railMenuItem{display:flex;align-items:center;gap:7px;padding:5px 8px;border:none;border-radius:5px;background:transparent;color:var(--dsw-alias-label-primary,#e6e8eb);font:inherit;font-size:12px;line-height:16px;cursor:pointer;text-align:left;pointer-events:auto}",
|
||||
".dsh-wt_railMenuItem:hover{background:var(--dsw-alias-fill-l1,rgba(255,255,255,.06))}",
|
||||
".dsh-wt_railMenuIcon{flex:none;width:18px;text-align:center;font-size:13px}",
|
||||
".dsh-wt_railMenuName{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
||||
// 分隔线
|
||||
".dsh-wt_divider{flex:none;height:1px;background:var(--dsw-alias-border-l1,#262b36);margin:2px 0}",
|
||||
// 头部
|
||||
@@ -8410,6 +8419,7 @@ var css = xterm_default + "\n" + [
|
||||
var zh = {
|
||||
"title": "\u5DE5\u4F5C\u53F0",
|
||||
"rail.title": "\u5DE5\u4F5C\u53F0\uFF08\u5C55\u5F00\u4FA7\u8FB9\u680F\u67E5\u770B\uFF09",
|
||||
"rail.more": "\u66F4\u591A",
|
||||
"handle.title": "\u6309\u4F4F\u62D6\u52A8\u4F4D\u7F6E \xB7 \u53CC\u51FB\u590D\u4F4D",
|
||||
"handle.aria": "\u62D6\u52A8\u5DE5\u4F5C\u53F0\u4F4D\u7F6E",
|
||||
"menu.search": "\u641C\u7D22\u9879\u76EE",
|
||||
@@ -8643,6 +8653,7 @@ var zh = {
|
||||
var en = {
|
||||
"title": "Worktable",
|
||||
"rail.title": "Worktable (expand sidebar to view)",
|
||||
"rail.more": "More",
|
||||
"handle.title": "Drag to move \xB7 double-click to reset",
|
||||
"handle.aria": "Drag worktable position",
|
||||
"menu.search": "Search projects",
|
||||
@@ -9164,7 +9175,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.1";
|
||||
var LOCAL_VERSION = false ? "dev" : "0.5.3-local.2";
|
||||
var UPDATE_REPO = "Aisland-SJL/dsh-worktable";
|
||||
var K_UPDATE_CHECK = "dsh.worktable.updateCheck.v1";
|
||||
var K_LAST_CHECK = "dsh.worktable.lastUpdateCheck.v1";
|
||||
@@ -21728,6 +21739,7 @@ function WorktableSection(props) {
|
||||
const [registeredIds, setRegisteredIds] = (0, import_react3.useState)(() => [...registryStore.ids]);
|
||||
const [addOpen, setAddOpen] = (0, import_react3.useState)(false);
|
||||
const [viewOptionsOpen, setViewOptionsOpen] = (0, import_react3.useState)(false);
|
||||
const [railMoreOpen, setRailMoreOpen] = (0, import_react3.useState)(false);
|
||||
const [rawUpdateInfo, setUpdateInfo] = (0, import_react3.useState)(null);
|
||||
const updateInfo = newerUpdateInfo(rawUpdateInfo);
|
||||
const [updateCheckOn, setUpdateCheckOn] = (0, import_react3.useState)(() => localStorage.getItem("dsh.worktable.updateCheck.v1") !== "0");
|
||||
@@ -23784,11 +23796,46 @@ function WorktableSection(props) {
|
||||
onClick: () => openSplit(l)
|
||||
}))
|
||||
];
|
||||
const RAIL_MAX = 8;
|
||||
const railShown = railItems.slice(0, RAIL_MAX);
|
||||
const railOverflow = railItems.slice(RAIL_MAX);
|
||||
const railStyle = isFloat && railRect ? { position: "fixed", top: float.top, left: railRect.left, width: railRect.width, zIndex: 70 } : bottomInset > 0 ? { marginBottom: bottomInset } : void 0;
|
||||
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { ref: rootRef, className: "dsh-wt_section dsh-wt_rail", style: railStyle, children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-wt_divider" }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-wt_railBox", children: railItems.length > 0 ? railItems.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: "dsh-wt_railBtn", title: it.name, "aria-label": it.name, onClick: it.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": true, children: it.icon }) }, i)) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_railIcon", children: "\u2261" }) })
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsh-wt_railBox", children: [
|
||||
railItems.length > 0 ? railShown.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("button", { type: "button", className: "dsh-wt_railBtn", title: it.name, "aria-label": it.name, onClick: it.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": true, children: it.icon }) }, i)) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_railIcon", children: "\u2261" }),
|
||||
railOverflow.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
||||
"button",
|
||||
{
|
||||
type: "button",
|
||||
className: "dsh-wt_railBtn dsh-wt_railMore" + (railMoreOpen ? " dsh-wt_railMoreOn" : ""),
|
||||
title: t("rail.more") + "\uFF08" + railOverflow.length + "\uFF09",
|
||||
"aria-label": t("rail.more"),
|
||||
"aria-expanded": railMoreOpen,
|
||||
onClick: () => setRailMoreOpen((v) => !v),
|
||||
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { "aria-hidden": true, children: "\u22EF" })
|
||||
}
|
||||
)
|
||||
] }),
|
||||
railMoreOpen && railOverflow.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsh-wt_railMenu", role: "menu", children: railOverflow.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
||||
"button",
|
||||
{
|
||||
type: "button",
|
||||
role: "menuitem",
|
||||
className: "dsh-wt_railMenuItem",
|
||||
title: it.name,
|
||||
onClick: (e) => {
|
||||
setRailMoreOpen(false);
|
||||
it.onClick(e);
|
||||
},
|
||||
children: [
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_railMenuIcon", "aria-hidden": true, children: it.icon }),
|
||||
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "dsh-wt_railMenuName", children: it.name })
|
||||
]
|
||||
},
|
||||
i
|
||||
)) })
|
||||
] }),
|
||||
popupLayer
|
||||
] });
|
||||
|
||||
@@ -225,7 +225,7 @@ function resolveDshHomeSafe() {
|
||||
cachedDshHome = baseDshHome();
|
||||
return cachedDshHome;
|
||||
}
|
||||
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.1";
|
||||
var PLUGIN_VERSION = false ? "dev" : "0.5.3-local.2";
|
||||
var name = "dsh-worktable";
|
||||
var inject = ["webServer", "sessions"];
|
||||
var HEALTH_PATH = "/api/worktable/health";
|
||||
|
||||
Reference in New Issue
Block a user