dsh-sidebar-shelves 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/client.js +42 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Two-line session cards for the [DeepSeek Harness](https://github.com/deepseek-ai
|
|
|
8
8
|
- **Pinning** — pinned sessions lead the list; pinning applies to active sessions, and archiving clears the pin.
|
|
9
9
|
- **Context menu** — right-click a card to pin, rename, fork, copy the Session ID, archive it, or remove its project; Shift+F10 opens the same menu from the keyboard.
|
|
10
10
|
- **Project menu** — right-click a card's project tile or name to change its icon or remove the project; removal only unregisters the workspace and keeps its folder and sessions.
|
|
11
|
-
- **Archiving** — archive a session by hand, or let cards archive themselves after 3, 7, 14, or 30 days. Archived sessions drop to the Archived shelf at the bottom; expanding it scrolls within a capped area.
|
|
11
|
+
- **Archiving** — archive a session by hand, or let cards archive themselves after 3, 7, 14, or 30 days. Archiving the session on screen opens the next card below (the one above when it was last) instead of the New Session page. Archived sessions drop to the Archived shelf at the bottom; expanding it scrolls within a capped area, and a click anywhere outside it folds it back.
|
|
12
12
|
- **Status markers** — running and waiting markers; a running session's time takes the brand accent, and a terminal marker flags sessions that own one.
|
|
13
13
|
- **Activity counts** — running background jobs and subagents per session, folded on the Host from the Session's own job records.
|
|
14
14
|
- **Recency sorting** — newest input first, and the composer's Workspace menu reuses the same tiles and the same order.
|
|
@@ -58,7 +58,7 @@ DeepSeek Harness 侧边栏的会话卡片:每个会话是一张两行卡片。
|
|
|
58
58
|
- **置顶** — 置顶会话排在最前,仅适用于活跃会话;归档时会自动取消置顶。
|
|
59
59
|
- **右键菜单** — 在会话卡片上右键可置顶、重命名、分叉、复制会话 ID、归档或移除所属项目;键盘上 Shift+F10 打开同一菜单。
|
|
60
60
|
- **项目菜单** — 在卡片的项目图标或项目名上右键,可更改项目图标或移除项目;移除只取消工作区注册,文件夹和会话都会保留。
|
|
61
|
-
- **归档** — 手动归档,或按 3、7、14、30
|
|
61
|
+
- **归档** — 手动归档,或按 3、7、14、30 天自动归档;归档当前会话后自动打开列表中的下一张卡片(它是最后一张时打开上一张),不再停在新建会话页。归档的会话收进底部的「已归档」,展开后在限定高度内滚动,点击该区域以外的任何地方自动收起。
|
|
62
62
|
- **状态标记** — 运行中、等待中标记;运行中会话的时间改用品牌色高亮,带终端会话另显示终端标记。
|
|
63
63
|
- **活动计数** — 每个会话运行中的后台任务与子代理数量,由 Host 端从会话自身的任务记录折叠得出。
|
|
64
64
|
- **按最近输入排序** — 输入框的工作区菜单复用同一套图标和同一套顺序。
|
package/client.js
CHANGED
|
@@ -245,7 +245,7 @@ window.__ModuleLoader__.load({
|
|
|
245
245
|
'.dsh-shelves-row{position:relative;display:flex;box-sizing:border-box;flex-direction:column;justify-content:center;width:100%;min-height:56px;padding:5px 10px;border-radius:8px;color:var(--dsw-alias-label-primary);font-size:14px;text-align:left;cursor:pointer;user-select:none}',
|
|
246
246
|
'.dsh-shelves-row:hover{background:var(--dsw-alias-interactive-bg-hover,var(--dsw-alias-bg-layer-2))}',
|
|
247
247
|
'.dsh-shelves-row:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}',
|
|
248
|
-
'.dsh-shelves-row-selected{background:var(--dsw-alias-bg-layer-2)}',
|
|
248
|
+
'.dsh-shelves-row-selected{background:var(--dsw-specific-sidebar-nav-item-active,var(--dsw-alias-bg-layer-2))}',
|
|
249
249
|
'.dsh-shelves-titleline{display:flex;align-items:center;gap:6px;min-width:0;min-height:22px}',
|
|
250
250
|
'.dsh-shelves-title{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}',
|
|
251
251
|
'.dsh-shelves-title-done{font-weight:700}',
|
|
@@ -705,9 +705,11 @@ window.__ModuleLoader__.load({
|
|
|
705
705
|
context.fillRect(0, 0, ICON_CANVAS, ICON_CANVAS);
|
|
706
706
|
}
|
|
707
707
|
const ratio = ICON_CANVAS / 1024;
|
|
708
|
-
|
|
708
|
+
// icon.json lists groups and their layers front to back, so the back-most
|
|
709
|
+
// paint first; walking them in file order would bury the art under its fill.
|
|
710
|
+
for (const group of [...spec.groups].reverse()) {
|
|
709
711
|
if (group === null || typeof group !== 'object' || group.hidden === true) continue;
|
|
710
|
-
for (const layer of group.layers ?? []) {
|
|
712
|
+
for (const layer of [...(group.layers ?? [])].reverse()) {
|
|
711
713
|
if (layerHidden(layer, appearance)) continue;
|
|
712
714
|
const assetName = layer?.['image-name'];
|
|
713
715
|
if (typeof assetName !== 'string' || assetName === '') continue;
|
|
@@ -1601,6 +1603,21 @@ window.__ModuleLoader__.load({
|
|
|
1601
1603
|
'.dsh-shelves-settings, .dsh-shelves-gear',
|
|
1602
1604
|
settingsGearRef,
|
|
1603
1605
|
);
|
|
1606
|
+
// The expanded Archived shelf folds back on a click anywhere outside it, so
|
|
1607
|
+
// browsing the column never leaves it open. Its own header row and list keep
|
|
1608
|
+
// it open, and the header button still toggles it.
|
|
1609
|
+
React.useEffect(() => {
|
|
1610
|
+
if (!archivedOpen) return undefined;
|
|
1611
|
+
const onPointerDown = (event) => {
|
|
1612
|
+
const target = event.target;
|
|
1613
|
+
if (target instanceof Element && target.closest('.dsh-shelves-headrow, .dsh-shelves-archived-list') !== null) {
|
|
1614
|
+
return;
|
|
1615
|
+
}
|
|
1616
|
+
setArchivedOpen(false);
|
|
1617
|
+
};
|
|
1618
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
1619
|
+
return () => document.removeEventListener('pointerdown', onPointerDown, true);
|
|
1620
|
+
}, [archivedOpen]);
|
|
1604
1621
|
|
|
1605
1622
|
const currentId = React.useMemo(() => {
|
|
1606
1623
|
const byId = list.byId ?? {};
|
|
@@ -1768,9 +1785,29 @@ window.__ModuleLoader__.load({
|
|
|
1768
1785
|
// Archive is the Host's own durable state, so it survives reloads and reaches
|
|
1769
1786
|
// every client. A Session with running work refuses the plain archive; the
|
|
1770
1787
|
// refusal is left as-is instead of driving a stop-and-archive flow.
|
|
1788
|
+
//
|
|
1789
|
+
// Archiving the card on screen clears the main view and shows the New
|
|
1790
|
+
// Session page, so that one opens the card below instead — or the one
|
|
1791
|
+
// above when it was last — once the archive is durable. A failure keeps
|
|
1792
|
+
// the current card, so a refused archive never moves the user.
|
|
1793
|
+
const nextAfterArchive = (row) => {
|
|
1794
|
+
if (row.id !== currentId) return undefined;
|
|
1795
|
+
const index = active.findIndex((candidate) => candidate.id === row.id);
|
|
1796
|
+
if (index === -1) return undefined;
|
|
1797
|
+
return active[index + 1] ?? active[index - 1];
|
|
1798
|
+
};
|
|
1799
|
+
|
|
1771
1800
|
const toggleArchive = (row) => {
|
|
1772
|
-
|
|
1773
|
-
|
|
1801
|
+
if (row.archived) {
|
|
1802
|
+
Promise.resolve(unarchiveSession(row.id)).catch(() => {});
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
const next = nextAfterArchive(row);
|
|
1806
|
+
Promise.resolve(archiveSession(row.id))
|
|
1807
|
+
.then(() => {
|
|
1808
|
+
if (next !== undefined) open(next);
|
|
1809
|
+
})
|
|
1810
|
+
.catch(() => {});
|
|
1774
1811
|
};
|
|
1775
1812
|
|
|
1776
1813
|
const togglePin = (row) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-sidebar-shelves",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Two-line session cards for the DSH sidebar: per-workspace project icons, pinning, archiving, project removal, status markers, job counts, and recency sorting",
|
|
6
6
|
"license": "MIT",
|