@dungsil/dsh-plugin-ui-sidebar-inbox 0.2.0 → 0.2.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 CHANGED
@@ -4,9 +4,19 @@ DSH의 기존 사이드바 모양을 유지하면서, 프로젝트별 목록을
4
4
 
5
5
  기존 `@dungsil/dsh-plugin-sidebar-inbox`를 대체하는 패키지이며, 새 이름의 첫 버전은 `0.1.0`입니다. 기존 패키지의 모든 버전은 사용 중단(deprecated) 대상입니다. 기존 패키지를 비활성화하고 새 패키지를 설치·활성화합니다. 두 패키지를 동시에 활성화하지 마세요. 기존 정렬 선택과 이전 정렬 복원 설정은 유지됩니다.
6
6
 
7
- <img src="./assets/sidebar-preview.webp" alt="Sidebar Inbox 적용 예시: 상단의 고정·확인할 세션과 하단 Working 목록, 왼쪽은 Archived 접힘, 오른쪽은 펼침 상태" width="560" />
7
+ ### 미리보기
8
8
 
9
- DSH `0.2.2-alpha.2`의 영어 UI에서 예시 세션으로 촬영한 화면입니다. 왼쪽은 Archived가 접힌 기본 상태이고, 오른쪽은 펼친 상태입니다.
9
+ **라이트 · 영어** — 왼쪽은 Archived 접힘, 오른쪽은 펼침 상태입니다.
10
+
11
+ <img src="./assets/sidebar-preview.webp" alt="라이트 테마의 Sidebar Inbox: 상단의 고정·수신함 세션과 하단 Working 목록, 왼쪽 Archived 접힘과 오른쪽 펼침 비교" width="720" />
12
+
13
+ **다크 · 한국어** — 같은 예시 세션에서 보관됨의 접힘·펼침을 비교합니다.
14
+
15
+ <img src="./assets/sidebar-preview-dark.webp" alt="다크 테마의 한국어 Sidebar Inbox: 상단의 고정·수신함 세션과 하단 작업 중 목록, 왼쪽 보관됨 접힘과 오른쪽 펼침 비교" width="720" />
16
+
17
+ DSH `0.2.1-rc.5`의 별도 검증용 `web` 프로필에 최신 빌드한 플러그인을 활성화하고, 실제 DSH 웹 화면의 사이드바를 DPR 2로 캡처해 테마별로 나란히 배치했습니다. 한국어 화면에는 저장소의 `@dungsil/dsh-plugin-locale-ko`를 함께 활성화했습니다. 세션 제목은 두 언어 화면에서 동일한 영어 예시 데이터입니다.
18
+
19
+ 캡처 전용 서버 fixture로 예시 세션 7개를 생성했습니다. 고정 1개와 보관 2개는 DSH의 실제 고정·보관 API로 설정하고, Working 2개는 세션 목록의 실행 상태를 fixture로 제공했습니다. 실제 모델 작업을 실행한 기록은 아닙니다. 세션 필터는 `모든 대화 (보관된 세션 포함)`이며, 행·상태 아이콘·테마·접힘과 펼침은 실제 DSH 및 이 플러그인의 렌더링입니다. Pinned와 Inbox에는 별도 제목이 없는 원래 배치를 그대로 보여줍니다.
10
20
 
11
21
  ## 배치 규칙
12
22
 
@@ -21,7 +31,7 @@ DSH `0.2.2-alpha.2`의 영어 UI에서 예시 세션으로 촬영한 화면입
21
31
 
22
32
  목록 제목과 메뉴 항목은 DSH UI 언어를 따릅니다. 한국어 UI에서는 정렬 항목이 `에이전트 활동`, 영역 제목이 `작업 중`·`보관됨`으로 표시됩니다. 번역 사전은 이 플러그인이 직접 포함하므로 한국어 UI 언어 팩을 따로 설치하지 않아도 됩니다.
23
33
 
24
- Pinned와 Inbox는 별도 제목 없이 위쪽 목록에 표시합니다. Working과 Archived는 펼친 영역의 전체 높이가 사이드바 표시 영역에 들어갈 때 하단에 붙어 있습니다. 높이가 표시 영역을 넘으면 하단 고정을 해제하므로 제목과 모든 세션을 목록 스크롤로 확인할 수 있습니다. 영역을 접거나 사이드바 높이를 늘려 다시 들어가면 하단 고정이 복원됩니다. 기본값은 Working을 펼치고 Archived를 접은 상태입니다. 두 제목을 누르거나 키보드로 활성화하면 각 영역이 부드럽게 펼쳐지고 접힙니다. Archived는 세션 필터가 `모든 대화 (보관된 세션 포함)`일 때만 접을 수 있습니다. `보관된 세션만` 필터에서는 보관한 세션이 목록 전체이므로 접지 않고 그대로 표시합니다. 새로고침하면 기본값으로 돌아갑니다.
34
+ Pinned와 Inbox는 별도 제목 없이 위쪽 목록에 표시합니다. Working과 Archived는 하단의 스크롤 영역을 공유합니다. 두 영역의 제목과 세션을 합친 높이는 사이드바 목록 표시 영역의 50%를 넘지 않습니다. 내용이 많으면 하단 영역 안에서 스크롤하며, Pinned와 Inbox는 위쪽에서 따로 스크롤합니다. 기본값은 Working을 펼치고 Archived를 접은 상태입니다. 두 제목을 누르거나 키보드로 활성화하면 각 영역이 부드럽게 펼쳐지고 접힙니다. Archived는 세션 필터가 `모든 대화 (보관된 세션 포함)`일 때만 접을 수 있습니다. `보관된 세션만` 필터에서는 보관한 세션이 목록 전체이므로 접지 않고 그대로 표시합니다. 새로고침하면 기본값으로 돌아갑니다.
25
35
 
26
36
  이 배치와 제목은 `그룹 기준`이 `하나의 목록`일 때만 적용됩니다. `작업 공간`·`작업 공간 트리` 그룹에서는 DSH 기본 표시를 따르며, 정렬을 켠 채 그룹 기준을 바꾸면 자동으로 해제됩니다.
27
37
 
@@ -61,9 +71,10 @@ DSH의 플러그인 관리 화면에서 **Sidebar Inbox / 사이드바 수신함
61
71
  - 행을 드래그하면 DSH가 수동 정렬로 전환하므로 에이전트 활동이 자동으로 해제됩니다. DSH의 정렬 변경 규칙을 그대로 따르므로, 에이전트 활동을 켜기 전에 드래그해 둔 수동 배치는 복원되지 않습니다.
62
72
  - 보관 상태와 보관 필터는 DSH가 소유합니다. 이 플러그인은 브라우저 저장소에 상태를 남기지 않으며, 보관한 세션도 하단 영역에서 그대로 복원할 수 있습니다.
63
73
  - 기존 세션 행, 검색, 메뉴, 선택, 고정, 보관 필터를 재사용합니다. CSS로 순서만 바꾸지 않고 DSH의 목록 정렬을 갱신하므로 화면 순서와 DOM 순서가 일치합니다.
64
- - 영역을 접고 펼 때는 160~180ms 높이 전환으로 애니메이션합니다. 운영체제의 동작 줄이기(`prefers-reduced-motion`) 설정을 켜면 애니메이션 없이 즉시 바뀝니다.
74
+ - Working의 펼침은 320ms로 유지합니다. Archived는 세션 수와 관계없이 실제로 보이는 하단 영역을 480ms 동안 펼칩니다. 접힘은 260ms이며, 운영체제의 동작 줄이기(`prefers-reduced-motion`) 설정을 켜면 애니메이션 없이 즉시 바뀝니다.
75
+ - 위쪽 목록과 하단 영역은 DSH 기본 스크롤바의 두께·색상·호버 스타일을 사용합니다. Shadow DOM 안에서도 DSH의 스크롤바 테마 변수를 그대로 따릅니다.
65
76
  - 접힌 영역의 래퍼는 목록 행 간격을 남기지 않아, 보이는 내용이 짧아도 불필요한 세로 스크롤바가 생기지 않습니다.
66
- - DSH `0.2.x`의 보기 옵션 메뉴에는 플러그인 확장 슬롯이 없어서 정렬 항목을 메뉴 DOM에 직접 추가합니다. DSH가 이 메뉴 구조를 바꾸면 호환성 갱신이 필요합니다. 같은 이유로 공유 Workspace 보기 저장소와 `data-row-key`를 사용하며, 기본 행은 교체하거나 다른 DOM 부모로 옮기지 않고 영역 제목만 추가합니다.
77
+ - DSH `0.2.x`의 보기 옵션 메뉴에는 플러그인 확장 슬롯이 없어서 정렬 항목을 메뉴 DOM에 직접 추가합니다. DSH가 이 메뉴 구조를 바꾸면 호환성 갱신이 필요합니다. 같은 이유로 공유 Workspace 보기 저장소와 `data-row-key`를 사용합니다. 기본 행은 교체하거나 다른 DOM 부모로 옮기지 않습니다. Shadow DOM 슬롯으로 위쪽 목록과 하단 영역을 나누며, 비활성화하면 기본 슬롯으로 원래 목록 표시를 복원합니다.
67
78
  - 플러그인을 비활성화하면 이전에 쓰던 정렬 기준으로 돌아갑니다. 정렬 기준이 어긋나 보이면 보기 옵션에서 수동이나 최근 수정일을 한 번 선택하면 DSH 기본 동작으로 돌아갑니다.
68
79
 
69
80
  ## 검증
Binary file
Binary file
package/dist/client.js CHANGED
@@ -59,6 +59,9 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
59
59
  const icons = /* @__PURE__ */ new Map();
60
60
  const trees = /* @__PURE__ */ new Set();
61
61
  const wrappers = /* @__PURE__ */ new Set();
62
+ const originalSlots = /* @__PURE__ */ new Map();
63
+ const panes = /* @__PURE__ */ new Map();
64
+ const archiveAnimations = /* @__PURE__ */ new Map();
62
65
  /** Each footer opens independently; a reload resets to these defaults. */
63
66
  const open = {
64
67
  Working: true,
@@ -66,26 +69,26 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
66
69
  };
67
70
  const style = document.createElement("style");
68
71
  style.textContent = `
69
- [data-dsh-inbox-tree] { display: flex; flex-direction: column; padding-bottom: 0; interpolate-size: allow-keywords; }
72
+ [data-dsh-inbox-tree] {
73
+ display: flex; flex-direction: column; padding-bottom: 0;
74
+ overflow: hidden; scrollbar-gutter: auto; interpolate-size: allow-keywords;
75
+ }
70
76
  [data-dsh-inbox-tree] > * { flex: none; }
71
77
  [data-dsh-inbox-tree] ~ span { display: none; }
72
- [data-dsh-inbox-footer] {
73
- position: sticky; z-index: 1; background: var(--dsw-specific-sidebar-fill);
74
- bottom: var(--dsh-inbox-bottom, 0px);
75
- }
76
- /* A footer stack taller than the viewport overlaps its own heading and
77
- pins rows in place even while scrolling. Let the native list scroll it. */
78
- [data-dsh-inbox-overflow] > [data-dsh-inbox-footer] { position: static; }
79
- [data-dsh-inbox-first] { margin-top: auto !important; }
78
+ [data-dsh-inbox-footer] { background: var(--dsw-specific-sidebar-fill); }
79
+ [data-dsh-inbox-first] { margin-top: 0 !important; }
80
80
  /* Closed rows keep their box at zero height, so a heading press animates in
81
81
  both directions without moving or cloning React-owned rows. */
82
82
  [data-dsh-inbox-footer] > [data-row-key] {
83
83
  overflow: hidden;
84
- transition: height 180ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 140ms ease-out, visibility 0s;
84
+ transition: height 320ms cubic-bezier(0.2, 0, 0, 1), opacity 200ms ease-out, visibility 0s;
85
+ }
86
+ [data-dsh-inbox-footer="Archived"] > [data-row-key] {
87
+ transition: height 480ms cubic-bezier(0.4, 0, 0.2, 1), opacity 280ms ease-in-out, visibility 0s;
85
88
  }
86
89
  [data-dsh-inbox-closed] > [data-row-key] {
87
90
  height: 0; opacity: 0; visibility: hidden;
88
- transition: height 160ms cubic-bezier(0.4, 0, 1, 1), opacity 120ms ease-in, visibility 0s 160ms;
91
+ transition: height 260ms cubic-bezier(0.4, 0, 1, 1), opacity 180ms ease-in, visibility 0s 260ms;
89
92
  }
90
93
  @media (prefers-reduced-motion: reduce) {
91
94
  [data-dsh-inbox-footer] > [data-row-key],
@@ -100,7 +103,7 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
100
103
  }
101
104
  [data-dsh-inbox-heading] button {
102
105
  display: flex; align-items: center; width: 100%; padding: 0; border: 0; background: none;
103
- color: inherit; font: inherit; text-align: left; cursor: pointer;
106
+ color: inherit; font: inherit; text-align: start; cursor: pointer;
104
107
  }
105
108
  [data-dsh-inbox-heading] button > span:first-child { display: flex; flex: 0 0 16px; }
106
109
  `;
@@ -109,21 +112,123 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
109
112
  delete wrapper.dataset.dshInboxFooter;
110
113
  delete wrapper.dataset.dshInboxFirst;
111
114
  delete wrapper.dataset.dshInboxClosed;
112
- wrapper.style.removeProperty("--dsh-inbox-bottom");
115
+ if (originalSlots.has(wrapper)) {
116
+ const slot = originalSlots.get(wrapper);
117
+ if (slot === null) wrapper.removeAttribute("slot");
118
+ else wrapper.setAttribute("slot", slot);
119
+ originalSlots.delete(wrapper);
120
+ }
113
121
  };
114
- const positionFooters = () => {
115
- for (const tree of trees) {
116
- let bottom = 0;
117
- const footers = [...tree.querySelectorAll("[data-dsh-inbox-footer]")];
118
- for (const wrapper of footers.reverse()) {
119
- wrapper.style.setProperty("--dsh-inbox-bottom", `${bottom}px`);
120
- const height = wrapper.offsetHeight;
121
- if (height > 0) bottom += height + 2;
122
- }
123
- tree.toggleAttribute("data-dsh-inbox-overflow", Math.max(0, bottom - 2) > tree.clientHeight);
122
+ const releasePane = (tree) => {
123
+ archiveAnimations.get(tree)?.();
124
+ const pane = panes.get(tree);
125
+ if (!pane) return;
126
+ pane.stopScrolling();
127
+ const slot = document.createElement("slot");
128
+ slot.dataset.dshInboxNative = "";
129
+ pane.root.replaceChildren(slot);
130
+ panes.delete(tree);
131
+ };
132
+ const installPane = (tree) => {
133
+ if (panes.has(tree)) return;
134
+ const root = tree.shadowRoot ?? tree.attachShadow({ mode: "open" });
135
+ const sheet = document.createElement("style");
136
+ sheet.textContent = `
137
+ slot { display: contents; }
138
+ .pane {
139
+ box-sizing: border-box; min-inline-size: 0; min-block-size: 0;
140
+ overflow: auto; overscroll-behavior: contain;
141
+ scrollbar-gutter: stable;
142
+ }
143
+ @supports not selector(::-webkit-scrollbar) {
144
+ .pane { scrollbar-width: thin; scrollbar-color: var(--dsh-scrollbar-thumb) transparent; }
145
+ }
146
+ ::-webkit-scrollbar { width: var(--dsh-scrollbar-width); height: var(--dsh-scrollbar-width); }
147
+ ::-webkit-scrollbar-track { margin-block: var(--dsh-scrollbar-track-margin); background: transparent; }
148
+ ::-webkit-scrollbar-thumb {
149
+ border: var(--dsh-scrollbar-thumb-border) solid transparent; corner-shape: round;
150
+ background: var(--dsh-scrollbar-thumb); background-clip: content-box; border-radius: 999px;
151
+ }
152
+ ::-webkit-scrollbar-thumb:hover { background-color: var(--dsh-scrollbar-thumb-hover); }
153
+ ::-webkit-scrollbar-corner { background: transparent; }
154
+ .main { flex: 1; }
155
+ .footer {
156
+ flex: none; max-block-size: 50%;
157
+ --dsh-scrollbar-thumb: transparent; --dsh-scrollbar-thumb-hover: transparent;
158
+ }
159
+ .footer[data-scrolling] {
160
+ --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);
161
+ --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);
162
+ }
163
+ @media (prefers-reduced-motion: reduce) { .footer { transition: none !important; } }
164
+ ::slotted(*) { display: block; }
165
+ `;
166
+ const main = document.createElement("div");
167
+ main.className = "pane main";
168
+ main.append(document.createElement("slot"));
169
+ const footer = document.createElement("div");
170
+ footer.className = "pane footer";
171
+ footer.dataset.dshInboxPane = "";
172
+ const slot = document.createElement("slot");
173
+ slot.name = "dsh-inbox-footer";
174
+ footer.append(slot);
175
+ const notifyScroll = () => tree.dispatchEvent(new Event("scroll"));
176
+ let scrollTimeout;
177
+ const stopScrolling = () => {
178
+ clearTimeout(scrollTimeout);
179
+ delete footer.dataset.scrolling;
180
+ };
181
+ main.addEventListener("scroll", notifyScroll);
182
+ footer.addEventListener("scroll", () => {
183
+ clearTimeout(scrollTimeout);
184
+ footer.dataset.scrolling = "";
185
+ scrollTimeout = setTimeout(stopScrolling, 150);
186
+ notifyScroll();
187
+ });
188
+ root.replaceChildren(sheet, main, footer);
189
+ panes.set(tree, {
190
+ root,
191
+ footer,
192
+ stopScrolling
193
+ });
194
+ };
195
+ const sizeFooters = () => {
196
+ for (const [tree, { footer }] of panes) footer.style.maxBlockSize = `${tree.clientHeight / 2}px`;
197
+ };
198
+ const animateArchive = (tree, from) => {
199
+ archiveAnimations.get(tree)?.();
200
+ const footer = panes.get(tree)?.footer;
201
+ if (!footer || tree.clientHeight === 0 || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
202
+ let naturalHeight = 0;
203
+ for (const wrapper of wrappers) {
204
+ if (wrapper.parentElement !== tree) continue;
205
+ const row = wrapper.querySelector("[data-row-key]");
206
+ const margins = getComputedStyle(wrapper);
207
+ naturalHeight += (headings.get(wrapper)?.offsetHeight ?? 0) + (wrapper.hasAttribute("data-dsh-inbox-closed") ? 0 : row?.scrollHeight ?? 0) + (Number.parseFloat(margins.marginTop) || 0) + (Number.parseFloat(margins.marginBottom) || 0);
124
208
  }
209
+ const target = Math.min(naturalHeight, tree.clientHeight / 2);
210
+ if (Math.abs(target - from) < .5) return;
211
+ const duration = open.Archived ? 480 : 260;
212
+ footer.style.transition = "none";
213
+ footer.style.height = `${from}px`;
214
+ footer.getBoundingClientRect();
215
+ footer.style.transition = `height ${duration}ms cubic-bezier(0.4, 0, 0.2, 1)`;
216
+ footer.style.height = `${target}px`;
217
+ const finish = () => {
218
+ clearTimeout(timeout);
219
+ footer.removeEventListener("transitionend", onEnd);
220
+ footer.style.removeProperty("height");
221
+ footer.style.removeProperty("transition");
222
+ archiveAnimations.delete(tree);
223
+ };
224
+ const onEnd = (event) => {
225
+ if (event.target === footer && event.propertyName === "height") finish();
226
+ };
227
+ const timeout = setTimeout(finish, duration + 100);
228
+ footer.addEventListener("transitionend", onEnd);
229
+ archiveAnimations.set(tree, finish);
125
230
  };
126
- const resize = new ResizeObserver(positionFooters);
231
+ const resize = new ResizeObserver(sizeFooters);
127
232
  let scheduled = false;
128
233
  let disposed = false;
129
234
  const refresh = () => {
@@ -135,14 +240,12 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
135
240
  const wanted = /* @__PURE__ */ new Map();
136
241
  const foldable = archivedCollapsible();
137
242
  resize.disconnect();
138
- for (const tree of trees) {
139
- delete tree.dataset.dshInboxTree;
140
- delete tree.dataset.dshInboxOverflow;
141
- }
243
+ for (const tree of trees) delete tree.dataset.dshInboxTree;
142
244
  trees.clear();
143
245
  for (const wrapper of wrappers) clearWrapper(wrapper);
144
246
  wrappers.clear();
145
247
  if (!active()) {
248
+ for (const tree of panes.keys()) releasePane(tree);
146
249
  for (const [wrapper, heading] of headings) {
147
250
  icons.get(heading)?.unmount();
148
251
  icons.delete(heading);
@@ -153,6 +256,8 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
153
256
  }
154
257
  for (const tree of document.querySelectorAll("[role=\"tree\"]")) {
155
258
  if (tree.querySelector("[data-row-key^=\"workspace:\"]")) continue;
259
+ if (tree.shadowRoot && !panes.has(tree) && !tree.shadowRoot.querySelector("[data-dsh-inbox-native]")) continue;
260
+ if ([...tree.children].some((child) => child.getAttribute("slot"))) continue;
156
261
  let previous;
157
262
  let firstFooter = true;
158
263
  for (const row of tree.querySelectorAll("[data-row-key^=\"session:\"]")) {
@@ -165,16 +270,21 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
165
270
  trees.add(tree);
166
271
  tree.dataset.dshInboxTree = "";
167
272
  wrappers.add(wrapper);
168
- wrapper.dataset.dshInboxFooter = "";
273
+ originalSlots.set(wrapper, wrapper.getAttribute("slot"));
274
+ wrapper.slot = "dsh-inbox-footer";
275
+ wrapper.dataset.dshInboxFooter = section;
169
276
  if (firstFooter) wrapper.dataset.dshInboxFirst = "";
170
277
  firstFooter = false;
171
278
  if (section !== previous) wanted.set(wrapper, section);
172
279
  if (!open[section]) wrapper.dataset.dshInboxClosed = "";
173
280
  previous = section;
174
- resize.observe(wrapper);
175
281
  }
176
- if (trees.has(tree)) resize.observe(tree);
282
+ if (trees.has(tree)) {
283
+ installPane(tree);
284
+ resize.observe(tree);
285
+ }
177
286
  }
287
+ for (const tree of panes.keys()) if (!trees.has(tree)) releasePane(tree);
178
288
  for (const [wrapper, heading] of headings) if (!wanted.has(wrapper)) {
179
289
  icons.get(heading)?.unmount();
180
290
  icons.delete(heading);
@@ -208,8 +318,14 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
208
318
  event.stopPropagation();
209
319
  const current = heading.dataset.dshInboxSection;
210
320
  if (current !== "Working" && current !== "Archived") return;
321
+ const tree = wrapper.parentElement;
322
+ const from = (panes.get(tree)?.footer)?.getBoundingClientRect().height ?? 0;
323
+ const animate = current === "Archived" || archiveAnimations.has(tree);
211
324
  open[current] = !open[current];
212
325
  refresh();
326
+ if (animate) queueMicrotask(() => {
327
+ if (!disposed && panes.has(tree)) animateArchive(tree, from);
328
+ });
213
329
  };
214
330
  heading.append(button);
215
331
  }
@@ -224,7 +340,7 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
224
340
  }
225
341
  if (wrapper.firstChild !== heading) wrapper.prepend(heading);
226
342
  }
227
- positionFooters();
343
+ sizeFooters();
228
344
  });
229
345
  };
230
346
  const observer = new MutationObserver((records) => {
@@ -248,42 +364,40 @@ function installHeadings(placements, labels, archivedCollapsible, active = () =>
248
364
  icons.clear();
249
365
  for (const heading of headings.values()) heading.remove();
250
366
  headings.clear();
251
- for (const tree of trees) {
252
- delete tree.dataset.dshInboxTree;
253
- delete tree.dataset.dshInboxOverflow;
254
- }
367
+ for (const tree of trees) delete tree.dataset.dshInboxTree;
255
368
  for (const wrapper of wrappers) clearWrapper(wrapper);
369
+ for (const tree of panes.keys()) releasePane(tree);
256
370
  style.remove();
257
371
  }
258
372
  };
259
373
  }
374
+ // ../../tools/ui/src/icons/activity.svg
375
+ var activity_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M3 12h4l3-8 4 16 3-8h4\"/>\n</svg>\n";
376
+ // ../../tools/ui/src/icons/check.svg
377
+ var check_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"m4 13 5 5L20 6\"/>\n</svg>\n";
378
+ // ../../tools/ui/src/icons-dom.ts
379
+ /** Accepts only trusted SVG assets bundled at build time. */
380
+ function createIconGlyph(svg) {
381
+ const template = document.createElement("template");
382
+ template.innerHTML = svg;
383
+ return template.content.querySelector("svg");
384
+ }
260
385
  // src/menu.ts
386
+ /**
387
+ * Add one row to the native View Options menu without forking ui-workspace.
388
+ *
389
+ * DSH 0.2.x renders that menu from a hardcoded item list and exposes no slot,
390
+ * so the row is injected into the portaled menu DOM. The menu primitive walks
391
+ * `button[role="menuitem"]` nodes for its keyboard order, so an injected row
392
+ * joins the arrow/Tab walk for free; activation closes the menu through the
393
+ * same Escape path the primitive already handles, which also returns focus to
394
+ * the trigger. Only classes and spans are read from the native rows, so the
395
+ * injected row keeps the shipped styling without naming any hashed class.
396
+ */
261
397
  /** ui-workspace passes this CSS-module class to the View Options menu only. */
262
398
  const MENU_SELECTOR = "[role=\"menu\"][class*=\"viewOptionsMenu\"]";
263
399
  /** Marker on the injected wrapper so refreshes recognize their own node. */
264
400
  const ROW_ATTRIBUTE = "data-dsh-inbox-sort-item";
265
- const SVG_NS = "http://www.w3.org/2000/svg";
266
- /** Stroke glyph for "agent activity": a pulse line in the shipped icon grid. */
267
- const ACTIVITY_PATH = "M2.25 8.5h2.9l1.55-4.5 2.55 8 1.55-4.5h2.95";
268
- /** Fallback check glyph, used only when no selected native row exists to copy. */
269
- const CHECK_PATH = "M2.25 8.5L5.5 11.75C5.9 12.15 6.57 12.13 6.95 11.7L13.75 4";
270
- function createGlyph(path) {
271
- const svg = document.createElementNS(SVG_NS, "svg");
272
- svg.setAttribute("width", "16");
273
- svg.setAttribute("height", "16");
274
- svg.setAttribute("viewBox", "0 0 16 16");
275
- svg.setAttribute("fill", "none");
276
- svg.setAttribute("xmlns", SVG_NS);
277
- svg.setAttribute("aria-hidden", "true");
278
- const line = document.createElementNS(SVG_NS, "path");
279
- line.setAttribute("d", path);
280
- line.setAttribute("stroke", "currentColor");
281
- line.setAttribute("stroke-width", "1");
282
- line.setAttribute("stroke-linecap", "round");
283
- line.setAttribute("stroke-linejoin", "round");
284
- svg.append(line);
285
- return svg;
286
- }
287
401
  /** A native row wraps one `role="menuitem"` button, optionally after a group separator. */
288
402
  function isMenuRow(node) {
289
403
  return node.tagName === "DIV" && [...node.children].some((child) => child.tagName === "BUTTON" && child.getAttribute("role") === "menuitem");
@@ -328,7 +442,7 @@ function buildRow(anchor, options) {
328
442
  if (iconTemplate !== void 0) {
329
443
  const icon = document.createElement("span");
330
444
  icon.className = iconTemplate.className;
331
- icon.append(createGlyph(ACTIVITY_PATH));
445
+ icon.append(createIconGlyph(activity_default));
332
446
  button.append(icon);
333
447
  }
334
448
  const labelTemplate = [...template.children].find((child) => child.tagName === "SPAN" && child.querySelector("svg") === null && !child.hasAttribute("aria-hidden"));
@@ -361,7 +475,7 @@ function closeMenu() {
361
475
  }
362
476
  function syncCheck(button, active, check) {
363
477
  const existing = [...button.children].find((child) => child.tagName === "svg");
364
- if (active && existing === void 0) button.append(check === null ? createGlyph(CHECK_PATH) : check.cloneNode(true));
478
+ if (active && existing === void 0) button.append(check === null ? createIconGlyph(check_default) : check.cloneNode(true));
365
479
  else if (!active && existing !== void 0) existing.remove();
366
480
  if (active) button.setAttribute("aria-current", "true");
367
481
  else button.removeAttribute("aria-current");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dungsil/dsh-plugin-ui-sidebar-inbox",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "State-based Inbox, Working and Archived sidebar ordering for DeepSeek Harness, selected from a native Agent activity sort option.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "dist",
12
12
  "locale",
13
+ "assets",
13
14
  "cordis.patch.yml"
14
15
  ],
15
16
  "type": "module",
@@ -28,7 +29,6 @@
28
29
  "@deepseek-ai/dsh-api-workspace-controller": "0.2.1-rc.5",
29
30
  "@deepseek-ai/dsh-client-locale": "0.2.1-rc.5",
30
31
  "@deepseek-ai/dsh-client-store": "0.2.1-rc.5",
31
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
32
32
  "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.5",
33
33
  "@deepseek-ai/dsh-client-ui-session": "0.2.1-rc.5",
34
34
  "@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-rc.5",
@@ -36,9 +36,10 @@
36
36
  "@deepseek-ai/dsh-client-ui-workspace": "0.2.1-rc.5",
37
37
  "@deepseek-ai/dsh-session": "0.2.1-rc.5",
38
38
  "@dungsil/dsh-tsconfig": "0.0.0",
39
+ "@dungsil/dsh-tsdown": "0.0.0",
40
+ "@dungsil/dsh-ui": "0.0.0",
39
41
  "@types/react": "18.3.18",
40
42
  "@types/react-dom": "18.3.7",
41
- "happy-dom": "21.0.4",
42
43
  "react": "18.3.1",
43
44
  "react-dom": "18.3.1",
44
45
  "tsdown": "0.23.4"
@@ -84,7 +85,6 @@
84
85
  },
85
86
  "scripts": {
86
87
  "build": "tsdown",
87
- "typecheck": "tsc --noEmit",
88
- "test": "node --test test/*.test.mjs"
88
+ "typecheck": "tsc --noEmit"
89
89
  }
90
90
  }