dsh-task-cat 1.0.7 → 1.0.8
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 +1 -1
- package/client.js +32 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Harness 的桌面外壳并没有向插件开放窗口 API(preload 只暴露文
|
|
|
58
58
|
|
|
59
59
|
## 侧栏工作区标记
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
工作区折叠后,标题右侧会出现一个蓝色胶囊(与宠物进行中计数同色,`#4c90f2`)显示该工作区里**正在进行中**的会话数。展开时标记消失(此时每个会话行自己带状态点);数量归零也会消失。
|
|
62
62
|
|
|
63
63
|
实现上它是只读标注:侧栏工作区行由应用自己渲染、没有暴露插槽,所以插件读 `useSessions` / `useWorkspaces` 算出每个工作区的进行中数量,再往对应行(`data-row-key="workspace:<id>"`、`aria-expanded="false"`)里插入一个徽章,并用 MutationObserver 在重渲染后补回。插件不改写、不替换行内任何应用内容。
|
|
64
64
|
|
package/client.js
CHANGED
|
@@ -22,6 +22,28 @@ window.__ModuleLoader__.load({
|
|
|
22
22
|
const React = require('react');
|
|
23
23
|
const h = React.createElement;
|
|
24
24
|
|
|
25
|
+
/** Stylesheet for the workspace marker, independent of any React render. */
|
|
26
|
+
const MARKER_CSS = `
|
|
27
|
+
.dsh-task-cat-wsmark {
|
|
28
|
+
flex: none;
|
|
29
|
+
margin-left: 6px;
|
|
30
|
+
min-width: 17px;
|
|
31
|
+
height: 17px;
|
|
32
|
+
padding: 0 5px;
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
border-radius: 9px;
|
|
35
|
+
background: #4c90f2;
|
|
36
|
+
color: #fff;
|
|
37
|
+
font-size: 10.5px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
line-height: 17px;
|
|
40
|
+
text-align: center;
|
|
41
|
+
font-variant-numeric: tabular-nums;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
user-select: none;
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
25
47
|
/** Locale namespace, also used for slot ids and CSS prefixes. */
|
|
26
48
|
const NS = 'dsh-task-cat';
|
|
27
49
|
|
|
@@ -863,22 +885,6 @@ window.__ModuleLoader__.load({
|
|
|
863
885
|
}
|
|
864
886
|
.dsh-task-pet-fab:hover { color: var(--dsw-alias-label-primary); }
|
|
865
887
|
.dsh-task-pet-fab:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
|
|
866
|
-
/* Marker on a collapsed workspace row with running Sessions. */
|
|
867
|
-
.dsh-task-cat-wsmark {
|
|
868
|
-
flex: none;
|
|
869
|
-
margin-left: 6px;
|
|
870
|
-
min-width: 16px;
|
|
871
|
-
height: 16px;
|
|
872
|
-
padding: 0 4px;
|
|
873
|
-
border-radius: 8px;
|
|
874
|
-
background: #4c90f2;
|
|
875
|
-
color: #fff;
|
|
876
|
-
font-size: 10px;
|
|
877
|
-
font-weight: 600;
|
|
878
|
-
line-height: 16px;
|
|
879
|
-
text-align: center;
|
|
880
|
-
font-variant-numeric: tabular-nums;
|
|
881
|
-
}
|
|
882
888
|
@keyframes dsh-task-pet-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
|
|
883
889
|
/* The cat keeps moving between state changes: a tail on its own tempo, a slow
|
|
884
890
|
breath, and the occasional blink, all slower than the bob so they never sync. */
|
|
@@ -1680,6 +1686,16 @@ window.__ModuleLoader__.load({
|
|
|
1680
1686
|
}
|
|
1681
1687
|
};
|
|
1682
1688
|
ctx.effect(() => ctx.locale.register(NS, DICT), 'dsh-task-pet: dictionaries');
|
|
1689
|
+
// Workspace markers are drawn outside the pet's React tree, so their CSS
|
|
1690
|
+
// cannot ride on that component: it returns null whenever the desktop pet
|
|
1691
|
+
// is showing, which left the badge as a bare digit.
|
|
1692
|
+
ctx.effect(() => {
|
|
1693
|
+
const style = document.createElement('style');
|
|
1694
|
+
style.setAttribute('data-dsh-task-cat', 'markers');
|
|
1695
|
+
style.textContent = MARKER_CSS;
|
|
1696
|
+
document.head.appendChild(style);
|
|
1697
|
+
return () => { style.remove(); };
|
|
1698
|
+
}, 'dsh-task-pet: workspace marker styles');
|
|
1683
1699
|
ctx.slots.inject('shell.overlay', () => ctx.slots.register({
|
|
1684
1700
|
name: 'shell.overlay',
|
|
1685
1701
|
id: NS,
|
package/package.json
CHANGED