dsh-workspace-status 0.3.3 → 0.3.5
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/CHANGELOG.md +30 -0
- package/client.js +367 -22
- package/locale/en.json +10 -1
- package/locale/zh.json +10 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,36 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.5] - 2026-12-05
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- A status bar under the Pinned header: one line summarising how many pinned
|
|
14
|
+
conversations are waiting for you, running, or parked for later.
|
|
15
|
+
- "Work on later": park a conversation from its row with an optional one-line
|
|
16
|
+
note, e.g. "waiting for reboot". Parked conversations leave their workspace
|
|
17
|
+
group, collect under a **Later** heading in queue order, show their note, and
|
|
18
|
+
can be unparked from that row.
|
|
19
|
+
- A parked conversation raises no in-app notice, chime or system banner while
|
|
20
|
+
it stays parked, and unparking cannot replay the events it muted: the diff
|
|
21
|
+
still advances while the row is quiet.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- The pinned group count referenced an invalid theme token
|
|
26
|
+
(`--dsws-alias-label-tertiary`) and inherited its colour instead of the
|
|
27
|
+
tertiary label colour.
|
|
28
|
+
|
|
29
|
+
## [0.3.4] - 2026-12-05
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- When the shell no longer exposes the sidebar region the pinned section is
|
|
34
|
+
portaled into, the section now renders inline in the sidebar footer and logs
|
|
35
|
+
one console warning naming the fallback. A future layout change therefore
|
|
36
|
+
looks wrong and stays reachable instead of looking like the feature was never
|
|
37
|
+
installed.
|
|
38
|
+
|
|
9
39
|
## [0.3.3] - 2026-12-05
|
|
10
40
|
|
|
11
41
|
### Fixed
|
package/client.js
CHANGED
|
@@ -75,6 +75,9 @@ window.__ModuleLoader__.load({
|
|
|
75
75
|
/** Browser-local preference store for pinned-conversation notifications. */
|
|
76
76
|
const NOTIFY_STORE_KEY = 'dsh-workspace-status/notifications/v1'
|
|
77
77
|
|
|
78
|
+
/** Browser-local "work on this later" marks, keyed by Session id. */
|
|
79
|
+
const LATER_STORE_KEY = 'dsh-workspace-status/later/v1'
|
|
80
|
+
|
|
78
81
|
/** The renderer's Notification constructor, when the platform has one. */
|
|
79
82
|
const NOTIFICATION_API = typeof Notification === 'undefined' ? undefined : Notification
|
|
80
83
|
|
|
@@ -103,6 +106,7 @@ window.__ModuleLoader__.load({
|
|
|
103
106
|
'activity.waiting': '{n} waiting for you',
|
|
104
107
|
'activity.running': '{n} running',
|
|
105
108
|
'activity.done': '{n} recently finished',
|
|
109
|
+
'activity.later': '{n} later',
|
|
106
110
|
'activity.unnamed': 'Ungrouped',
|
|
107
111
|
'activity.more': 'and {n} more',
|
|
108
112
|
'activity.listSeparator': ', ',
|
|
@@ -134,6 +138,14 @@ window.__ModuleLoader__.load({
|
|
|
134
138
|
'notify.finished.title': '{title} finished',
|
|
135
139
|
'notify.finished.body': 'Finished and not opened yet · {workspace}',
|
|
136
140
|
'notify.dismiss': 'Dismiss',
|
|
141
|
+
'later.title': 'Later',
|
|
142
|
+
'later.mark': 'Mark for later',
|
|
143
|
+
'later.markAria': 'Mark {title} for later',
|
|
144
|
+
'later.unmark': 'Stop deferring',
|
|
145
|
+
'later.unmarkAria': 'Stop deferring {title}',
|
|
146
|
+
'later.note': 'Why later? e.g. waiting for reboot',
|
|
147
|
+
'later.groupAria': 'Conversations parked for later',
|
|
148
|
+
'later.noteFallback': 'No note',
|
|
137
149
|
'star.suite': 'Star the suite',
|
|
138
150
|
},
|
|
139
151
|
zh: {
|
|
@@ -141,6 +153,7 @@ window.__ModuleLoader__.load({
|
|
|
141
153
|
'activity.waiting': '{n} 个等待你处理',
|
|
142
154
|
'activity.running': '{n} 个运行中',
|
|
143
155
|
'activity.done': '{n} 个刚刚完成',
|
|
156
|
+
'activity.later': '{n} 个稍后处理',
|
|
144
157
|
'activity.unnamed': '未分组',
|
|
145
158
|
'activity.more': '等 {n} 个',
|
|
146
159
|
'activity.listSeparator': '、',
|
|
@@ -172,6 +185,14 @@ window.__ModuleLoader__.load({
|
|
|
172
185
|
'notify.finished.title': '{title} 已完成',
|
|
173
186
|
'notify.finished.body': '已完成且尚未打开 · {workspace}',
|
|
174
187
|
'notify.dismiss': '关闭',
|
|
188
|
+
'later.title': '稍后处理',
|
|
189
|
+
'later.mark': '标记为稍后处理',
|
|
190
|
+
'later.markAria': '将 {title} 标记为稍后处理',
|
|
191
|
+
'later.unmark': '取消稍后处理',
|
|
192
|
+
'later.unmarkAria': '取消 {title} 的稍后处理',
|
|
193
|
+
'later.note': '为什么稍后?例如:等待重启',
|
|
194
|
+
'later.groupAria': '已推迟到稍后处理的会话',
|
|
195
|
+
'later.noteFallback': '无备注',
|
|
175
196
|
'star.suite': '为插件套件点星',
|
|
176
197
|
},
|
|
177
198
|
}
|
|
@@ -287,6 +308,19 @@ window.__ModuleLoader__.load({
|
|
|
287
308
|
}, h('path', { d: BELL_PATH, fill: 'currentColor' }))
|
|
288
309
|
}
|
|
289
310
|
|
|
311
|
+
/** Render the later bookmark; `filled` marks a parked Session. */
|
|
312
|
+
function bookmarkIcon(filled) {
|
|
313
|
+
return h('svg', {
|
|
314
|
+
width: 13, height: 13, viewBox: '0 0 24 24', 'aria-hidden': 'true', focusable: 'false',
|
|
315
|
+
}, h('path', {
|
|
316
|
+
d: 'M7 3.75h10a1.25 1.25 0 0 1 1.25 1.25v16.1a.4.4 0 0 1-.62.33L12 17.3l-5.63 4.13a.4.4 0 0 1-.62-.33V5A1.25 1.25 0 0 1 7 3.75Z',
|
|
317
|
+
fill: filled ? 'currentColor' : 'none',
|
|
318
|
+
stroke: 'currentColor',
|
|
319
|
+
'stroke-width': filled ? 0 : 1.6,
|
|
320
|
+
'stroke-linejoin': 'round',
|
|
321
|
+
}))
|
|
322
|
+
}
|
|
323
|
+
|
|
290
324
|
/** Render the sound toggle glyph. */
|
|
291
325
|
function volumeIcon() {
|
|
292
326
|
return h('svg', {
|
|
@@ -746,6 +780,8 @@ window.__ModuleLoader__.load({
|
|
|
746
780
|
'--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);',
|
|
747
781
|
'--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}',
|
|
748
782
|
'.dsws-pinned[data-rail="true"],.dsws-pinned:empty{display:none}',
|
|
783
|
+
'.dsws-pinned-fallback{max-height:min(30vh,220px);margin:0 0 4px;padding-top:4px;',
|
|
784
|
+
'border-top:0.5px solid var(--dsw-alias-border-l2)}',
|
|
749
785
|
'.dsws-pinned-headerrow{display:flex;align-items:center;gap:2px;margin:0;padding:0 2px 0 0}',
|
|
750
786
|
'.dsws-pinned-header{display:flex;align-items:center;gap:6px;box-sizing:border-box;flex:1;min-width:0;height:30px;',
|
|
751
787
|
'margin:0;padding:0 8px;border:0;border-radius:var(--dsw-radius-md);background:none;',
|
|
@@ -804,7 +840,7 @@ window.__ModuleLoader__.load({
|
|
|
804
840
|
'.dsws-pinned-group-head:hover .dsws-pinned-fileglyph,.dsws-pinned-group-head:focus-visible .dsws-pinned-fileglyph{display:none}',
|
|
805
841
|
'.dsws-pinned-group-head:hover .dsws-pinned-arrow,.dsws-pinned-group-head:focus-visible .dsws-pinned-arrow{display:inline-flex}',
|
|
806
842
|
'.dsws-pinned-group-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
807
|
-
'.dsws-pinned-group-count{flex:none;color:var(--
|
|
843
|
+
'.dsws-pinned-group-count{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px;',
|
|
808
844
|
'font-variant-numeric:tabular-nums}',
|
|
809
845
|
'.dsws-pinned-row{display:flex;align-items:center;box-sizing:border-box;width:100%;height:32px;',
|
|
810
846
|
'margin:0;padding:0 6px 0 28px;border:0;border-radius:var(--dsw-radius-md);background:none;',
|
|
@@ -829,6 +865,28 @@ window.__ModuleLoader__.load({
|
|
|
829
865
|
'background:none;color:var(--dsw-alias-label-tertiary);cursor:pointer}',
|
|
830
866
|
'.dsws-pinned-unpin:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
|
|
831
867
|
'.dsws-pinned-unpin:disabled{opacity:.45;cursor:default}',
|
|
868
|
+
'.dsws-pinned-statusbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px;',
|
|
869
|
+
'padding:0 8px 6px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}',
|
|
870
|
+
'.dsws-statusbar-seg{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}',
|
|
871
|
+
'.dsws-statusbar-dot{flex:none;width:6px;height:6px;border-radius:50%;',
|
|
872
|
+
'background:var(--dsw-alias-label-tertiary)}',
|
|
873
|
+
'.dsws-statusbar-dot[data-tone="wait"]{background:var(--dsw-alias-state-warn-primary)}',
|
|
874
|
+
'.dsws-statusbar-dot[data-tone="run"]{background:var(--dsw-static-deepseek-450)}',
|
|
875
|
+
'.dsws-statusbar-dot[data-tone="later"]{background:var(--dsw-alias-label-secondary)}',
|
|
876
|
+
'.dsws-pinned-latergroup{margin-top:2px}',
|
|
877
|
+
'.dsws-pinned-laterrow{align-items:flex-start;height:auto;min-height:32px;padding-top:3px;padding-bottom:3px}',
|
|
878
|
+
'.dsws-pinned-laterrow .dsws-pinned-dotslot{margin-top:2px}',
|
|
879
|
+
'.dsws-pinned-latertext{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}',
|
|
880
|
+
'.dsws-pinned-laternote{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px;',
|
|
881
|
+
'overflow:hidden;text-overflow:ellipsis;white-space:nowrap}',
|
|
882
|
+
'.dsws-pinned-bookmark{flex:none;width:22px;height:22px;margin-left:2px;display:inline-flex;',
|
|
883
|
+
'align-items:center;justify-content:center;padding:0;border:0;border-radius:var(--dsw-radius-sm);',
|
|
884
|
+
'background:none;color:var(--dsw-alias-label-tertiary);cursor:pointer}',
|
|
885
|
+
'.dsws-pinned-bookmark:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}',
|
|
886
|
+
'.dsws-pinned-bookmark[data-on="true"]{color:var(--dsw-alias-label-secondary)}',
|
|
887
|
+
'.dsws-pinned-note{flex:1;min-width:0;height:22px;box-sizing:border-box;padding:0 6px;',
|
|
888
|
+
'border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm);',
|
|
889
|
+
'background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px}',
|
|
832
890
|
'@media (prefers-reduced-motion:reduce){',
|
|
833
891
|
'.dsws-pinned-dot[data-state="ongoing"]{animation:none;opacity:.7}',
|
|
834
892
|
'.dsws-pinned-chevron,.dsws-pinned-arrow{transition:none}}',
|
|
@@ -845,9 +903,11 @@ window.__ModuleLoader__.load({
|
|
|
845
903
|
*
|
|
846
904
|
* @param previous - previous per-session status map.
|
|
847
905
|
* @param sessions - pinned sessions from the current model.
|
|
906
|
+
* @param muted - Sessions parked for later: their state still advances so
|
|
907
|
+
* unparking cannot replay history, but no event is emitted.
|
|
848
908
|
* @returns the events to deliver plus the map for the next render.
|
|
849
909
|
*/
|
|
850
|
-
function notificationEvents(previous, sessions) {
|
|
910
|
+
function notificationEvents(previous, sessions, muted) {
|
|
851
911
|
const next = new Map()
|
|
852
912
|
const events = []
|
|
853
913
|
for (const session of Array.isArray(sessions) ? sessions : []) {
|
|
@@ -860,10 +920,11 @@ window.__ModuleLoader__.load({
|
|
|
860
920
|
next.set(session.id, state)
|
|
861
921
|
continue
|
|
862
922
|
}
|
|
863
|
-
|
|
923
|
+
const parked = muted !== null && typeof muted?.has === 'function' && muted.has(session.id)
|
|
924
|
+
if (!parked && pendingKind !== null && pendingKind !== prior.pendingKind) {
|
|
864
925
|
events.push({ type: 'waiting', session })
|
|
865
926
|
}
|
|
866
|
-
if (completionUnread && !running && (prior.running === true || prior.completionUnread !== true)) {
|
|
927
|
+
if (!parked && completionUnread && !running && (prior.running === true || prior.completionUnread !== true)) {
|
|
867
928
|
events.push({ type: 'finished', session })
|
|
868
929
|
}
|
|
869
930
|
next.set(session.id, state)
|
|
@@ -928,6 +989,104 @@ window.__ModuleLoader__.load({
|
|
|
928
989
|
return prefs
|
|
929
990
|
}
|
|
930
991
|
|
|
992
|
+
/** Read the browser-local later marks without assuming storage access. */
|
|
993
|
+
function readLater() {
|
|
994
|
+
if (typeof localStorage === 'undefined') return {}
|
|
995
|
+
try {
|
|
996
|
+
const raw = localStorage.getItem(LATER_STORE_KEY)
|
|
997
|
+
if (typeof raw !== 'string' || raw === '') return {}
|
|
998
|
+
const parsed = JSON.parse(raw)
|
|
999
|
+
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) return {}
|
|
1000
|
+
const later = {}
|
|
1001
|
+
for (const [sessionId, value] of Object.entries(parsed)) {
|
|
1002
|
+
if (typeof sessionId !== 'string' || sessionId === '') continue
|
|
1003
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value)) continue
|
|
1004
|
+
later[sessionId] = {
|
|
1005
|
+
note: typeof value.note === 'string' ? value.note.slice(0, 160) : '',
|
|
1006
|
+
at: typeof value.at === 'number' && Number.isFinite(value.at) ? value.at : 0,
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
return later
|
|
1010
|
+
} catch {
|
|
1011
|
+
return {}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/** Persist the later marks and return the value for a state update. */
|
|
1016
|
+
function writeLater(later) {
|
|
1017
|
+
if (typeof localStorage !== 'undefined') {
|
|
1018
|
+
try {
|
|
1019
|
+
localStorage.setItem(LATER_STORE_KEY, JSON.stringify(later))
|
|
1020
|
+
} catch {
|
|
1021
|
+
// Storage may be unavailable; the in-memory marks still apply.
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
return later
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
/** Whether a Session is parked for later. */
|
|
1028
|
+
function hasLater(later, sessionId) {
|
|
1029
|
+
return later !== null && typeof later === 'object' && typeof sessionId === 'string'
|
|
1030
|
+
&& Object.prototype.hasOwnProperty.call(later, sessionId)
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** Park a Session with an optional note and return the next map. */
|
|
1034
|
+
function setLater(later, sessionId, note) {
|
|
1035
|
+
const next = { ...later }
|
|
1036
|
+
next[sessionId] = { note: String(note ?? '').slice(0, 160), at: Date.now() }
|
|
1037
|
+
return writeLater(next)
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
/** Clear one Session's later mark and return the next map. */
|
|
1041
|
+
function clearLater(later, sessionId) {
|
|
1042
|
+
const next = { ...later }
|
|
1043
|
+
delete next[sessionId]
|
|
1044
|
+
return writeLater(next)
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/**
|
|
1048
|
+
* Parked Sessions, oldest park first, with the same live facts the pinned
|
|
1049
|
+
* rows carry. Archived, blank and subagent rows have no ordinary row to
|
|
1050
|
+
* lift, so they are skipped exactly like the pinned view does.
|
|
1051
|
+
* @param later - browser-local marks keyed by Session id.
|
|
1052
|
+
* @param sessions - Session summaries keyed by id.
|
|
1053
|
+
* @param statuses - Session UI status map.
|
|
1054
|
+
* @param archivedSessionIds - registry archive set.
|
|
1055
|
+
* @param now - render clock for the relative label.
|
|
1056
|
+
* @returns the entries in queue order plus their count.
|
|
1057
|
+
*/
|
|
1058
|
+
function buildLaterView(later, sessions, statuses, archivedSessionIds, now) {
|
|
1059
|
+
const byId = sessions !== null && typeof sessions === 'object' ? sessions : {}
|
|
1060
|
+
const archived = new Set(Array.isArray(archivedSessionIds) ? archivedSessionIds : [])
|
|
1061
|
+
const statusMap = statuses !== null && typeof statuses?.get === 'function' ? statuses : undefined
|
|
1062
|
+
const children = childMap(byId)
|
|
1063
|
+
const entries = []
|
|
1064
|
+
for (const [sessionId, mark] of Object.entries(later ?? {})) {
|
|
1065
|
+
const row = byId[sessionId]
|
|
1066
|
+
if (row === null || row === undefined) continue
|
|
1067
|
+
if (archived.has(sessionId)) continue
|
|
1068
|
+
if (row.origin === 'subagent' || row.blank === true) continue
|
|
1069
|
+
const facts = sessionFacts(sessionId, row, statusMap, children, byId)
|
|
1070
|
+
entries.push({
|
|
1071
|
+
id: sessionId,
|
|
1072
|
+
title: typeof row.displayTitle === 'string' && row.displayTitle !== ''
|
|
1073
|
+
? row.displayTitle
|
|
1074
|
+
: typeof row.title === 'string' && row.title !== ''
|
|
1075
|
+
? row.title
|
|
1076
|
+
: message('pinned.untitled'),
|
|
1077
|
+
note: typeof mark?.note === 'string' ? mark.note : '',
|
|
1078
|
+
at: typeof mark?.at === 'number' ? mark.at : 0,
|
|
1079
|
+
time: relativeTime(row.updatedAt, now),
|
|
1080
|
+
mark: facts.mark,
|
|
1081
|
+
pendingKind: facts.pendingKind,
|
|
1082
|
+
running: facts.running,
|
|
1083
|
+
completionUnread: facts.completionUnread,
|
|
1084
|
+
})
|
|
1085
|
+
}
|
|
1086
|
+
entries.sort((left, right) => left.at - right.at)
|
|
1087
|
+
return { entries, count: entries.length }
|
|
1088
|
+
}
|
|
1089
|
+
|
|
931
1090
|
/** Lazily created audio context for the optional chime. */
|
|
932
1091
|
let audioContext
|
|
933
1092
|
|
|
@@ -1056,7 +1215,7 @@ window.__ModuleLoader__.load({
|
|
|
1056
1215
|
* the Workspace feed, groups it per Workspace, and unpins through the
|
|
1057
1216
|
* Workspace service so the official tree and this section update together.
|
|
1058
1217
|
*/
|
|
1059
|
-
function PinnedSection({ model, openSession, unpinSession }) {
|
|
1218
|
+
function PinnedSection({ model, sessions, statuses, archived, openSession, unpinSession }) {
|
|
1060
1219
|
const [view, setView] = React.useState(readViewState)
|
|
1061
1220
|
const [pending, setPending] = React.useState(() => ({}))
|
|
1062
1221
|
const [notifyPrefs, setNotifyPrefs] = React.useState(readNotificationPrefs)
|
|
@@ -1066,6 +1225,8 @@ window.__ModuleLoader__.load({
|
|
|
1066
1225
|
const notifyStateRef = React.useRef(new Map())
|
|
1067
1226
|
const [notices, setNotices] = React.useState([])
|
|
1068
1227
|
const noticeTimers = React.useRef(new Map())
|
|
1228
|
+
const [later, setLaterState] = React.useState(readLater)
|
|
1229
|
+
const [editingLater, setEditingLater] = React.useState(null)
|
|
1069
1230
|
|
|
1070
1231
|
const dismissNotice = (id) => {
|
|
1071
1232
|
const timer = noticeTimers.current.get(id)
|
|
@@ -1102,8 +1263,9 @@ window.__ModuleLoader__.load({
|
|
|
1102
1263
|
// advances even while notifications are off, so turning them on cannot
|
|
1103
1264
|
// replay history.
|
|
1104
1265
|
React.useEffect(() => {
|
|
1105
|
-
const
|
|
1106
|
-
const
|
|
1266
|
+
const pinnedSessions = model.groups.flatMap((group) => group.sessions)
|
|
1267
|
+
const muted = new Set(Object.keys(later))
|
|
1268
|
+
const { events, next } = notificationEvents(notifyStateRef.current, pinnedSessions, muted)
|
|
1107
1269
|
notifyStateRef.current = next
|
|
1108
1270
|
if (events.length === 0) return
|
|
1109
1271
|
if (!notifyPrefs.enabled) return
|
|
@@ -1142,7 +1304,7 @@ window.__ModuleLoader__.load({
|
|
|
1142
1304
|
}
|
|
1143
1305
|
}
|
|
1144
1306
|
if (delivered && notifyPrefs.sound) playChime()
|
|
1145
|
-
}, [model, notifyPrefs.enabled, notifyPrefs.sound, permission, openSession])
|
|
1307
|
+
}, [model, later, notifyPrefs.enabled, notifyPrefs.sound, permission, openSession])
|
|
1146
1308
|
|
|
1147
1309
|
const sendTestNotification = (osAllowed = permission === 'granted') => {
|
|
1148
1310
|
const title = message('notify.enabled.title')
|
|
@@ -1232,6 +1394,31 @@ window.__ModuleLoader__.load({
|
|
|
1232
1394
|
const sectionOpen = view.sectionCollapsed !== true
|
|
1233
1395
|
const rows = []
|
|
1234
1396
|
|
|
1397
|
+
const laterModel = React.useMemo(
|
|
1398
|
+
() => buildLaterView(later, sessions, statuses, archived, Date.now()),
|
|
1399
|
+
[later, sessions, statuses, archived],
|
|
1400
|
+
)
|
|
1401
|
+
// Parked conversations leave their workspace group: they are lifted into
|
|
1402
|
+
// the Later group, so one row never appears twice.
|
|
1403
|
+
const visibleGroups = React.useMemo(
|
|
1404
|
+
() => model.groups
|
|
1405
|
+
.map((group) => ({
|
|
1406
|
+
...group,
|
|
1407
|
+
sessions: group.sessions.filter((session) => !hasLater(later, session.id)),
|
|
1408
|
+
}))
|
|
1409
|
+
.map((group) => ({ ...group, count: group.sessions.length }))
|
|
1410
|
+
.filter((group) => group.count > 0),
|
|
1411
|
+
[model, later],
|
|
1412
|
+
)
|
|
1413
|
+
const waitingNow = visibleGroups.reduce(
|
|
1414
|
+
(total, group) => total + group.sessions.filter((session) => session.mark === 'warning').length,
|
|
1415
|
+
0,
|
|
1416
|
+
)
|
|
1417
|
+
const runningNow = visibleGroups.reduce(
|
|
1418
|
+
(total, group) => total + group.sessions.filter((session) => session.mark === 'ongoing').length,
|
|
1419
|
+
0,
|
|
1420
|
+
)
|
|
1421
|
+
|
|
1235
1422
|
rows.push(h(
|
|
1236
1423
|
'div',
|
|
1237
1424
|
{ key: 'header', className: 'dsws-pinned-headerrow' },
|
|
@@ -1335,8 +1522,102 @@ window.__ModuleLoader__.load({
|
|
|
1335
1522
|
))
|
|
1336
1523
|
}
|
|
1337
1524
|
|
|
1525
|
+
const statusSegments = []
|
|
1526
|
+
if (waitingNow > 0) statusSegments.push(['wait', message('activity.waiting', { n: waitingNow })])
|
|
1527
|
+
if (runningNow > 0) statusSegments.push(['run', message('activity.running', { n: runningNow })])
|
|
1528
|
+
if (laterModel.count > 0) statusSegments.push(['later', message('activity.later', { n: laterModel.count })])
|
|
1529
|
+
if (statusSegments.length > 0) {
|
|
1530
|
+
rows.push(h(
|
|
1531
|
+
'div',
|
|
1532
|
+
{ key: 'statusbar', className: 'dsws-pinned-statusbar', role: 'status', 'aria-live': 'polite' },
|
|
1533
|
+
statusSegments.map(([tone, label]) => h(
|
|
1534
|
+
'span',
|
|
1535
|
+
{ key: tone, className: 'dsws-statusbar-seg' },
|
|
1536
|
+
h('span', { className: 'dsws-statusbar-dot', 'data-tone': tone }),
|
|
1537
|
+
label,
|
|
1538
|
+
)),
|
|
1539
|
+
))
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
if (laterModel.count > 0) {
|
|
1543
|
+
const laterOpen = view.groups['__later'] !== true
|
|
1544
|
+
const laterRows = [h(
|
|
1545
|
+
'button',
|
|
1546
|
+
{
|
|
1547
|
+
key: 'later-head',
|
|
1548
|
+
type: 'button',
|
|
1549
|
+
className: 'dsws-pinned-group-head dsws-pinned-laterhead',
|
|
1550
|
+
'aria-expanded': String(laterOpen),
|
|
1551
|
+
'aria-label': message('later.groupAria'),
|
|
1552
|
+
onClick: () => toggleGroup('__later'),
|
|
1553
|
+
},
|
|
1554
|
+
h('span', { className: 'dsws-pinned-fileglyph' }, bookmarkIcon(false)),
|
|
1555
|
+
h('span', { className: 'dsws-pinned-arrow' }, chevronIcon()),
|
|
1556
|
+
h('span', { className: 'dsws-pinned-group-title' }, message('later.title')),
|
|
1557
|
+
h('span', { className: 'dsws-pinned-group-count' }, String(laterModel.count)),
|
|
1558
|
+
)]
|
|
1559
|
+
if (laterOpen) {
|
|
1560
|
+
for (const entry of laterModel.entries) {
|
|
1561
|
+
laterRows.push(h(
|
|
1562
|
+
'div',
|
|
1563
|
+
{
|
|
1564
|
+
key: entry.id,
|
|
1565
|
+
className: 'dsws-pinned-row dsws-pinned-laterrow',
|
|
1566
|
+
role: 'treeitem',
|
|
1567
|
+
tabIndex: 0,
|
|
1568
|
+
title: entry.title,
|
|
1569
|
+
onClick: () => open(entry.id),
|
|
1570
|
+
onKeyDown: (event) => {
|
|
1571
|
+
if (event.key !== 'Enter' && event.key !== ' ') return
|
|
1572
|
+
event.preventDefault()
|
|
1573
|
+
open(entry.id)
|
|
1574
|
+
},
|
|
1575
|
+
},
|
|
1576
|
+
h(
|
|
1577
|
+
'span',
|
|
1578
|
+
{ className: 'dsws-pinned-dotslot' },
|
|
1579
|
+
entry.mark === undefined
|
|
1580
|
+
? null
|
|
1581
|
+
: h('span', { className: 'dsws-pinned-dot', 'data-state': entry.mark }),
|
|
1582
|
+
),
|
|
1583
|
+
h(
|
|
1584
|
+
'span',
|
|
1585
|
+
{ className: 'dsws-pinned-latertext' },
|
|
1586
|
+
h('span', { className: 'dsws-pinned-row-title' }, entry.title),
|
|
1587
|
+
h(
|
|
1588
|
+
'span',
|
|
1589
|
+
{ className: 'dsws-pinned-laternote' },
|
|
1590
|
+
entry.note !== '' ? entry.note : message('later.noteFallback'),
|
|
1591
|
+
),
|
|
1592
|
+
),
|
|
1593
|
+
entry.time === '' ? null : h('span', { className: 'dsws-pinned-time' }, entry.time),
|
|
1594
|
+
h(
|
|
1595
|
+
'button',
|
|
1596
|
+
{
|
|
1597
|
+
type: 'button',
|
|
1598
|
+
className: 'dsws-pinned-bookmark',
|
|
1599
|
+
'data-on': 'true',
|
|
1600
|
+
title: message('later.unmark'),
|
|
1601
|
+
'aria-label': message('later.unmarkAria', { title: entry.title }),
|
|
1602
|
+
onClick: (event) => {
|
|
1603
|
+
event.stopPropagation()
|
|
1604
|
+
setLaterState(clearLater(later, entry.id))
|
|
1605
|
+
},
|
|
1606
|
+
},
|
|
1607
|
+
bookmarkIcon(true),
|
|
1608
|
+
),
|
|
1609
|
+
))
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
rows.push(h(
|
|
1613
|
+
'div',
|
|
1614
|
+
{ key: 'later-group', className: 'dsws-pinned-group dsws-pinned-latergroup', role: 'group' },
|
|
1615
|
+
laterRows,
|
|
1616
|
+
))
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1338
1619
|
if (sectionOpen) {
|
|
1339
|
-
for (const group of
|
|
1620
|
+
for (const group of visibleGroups) {
|
|
1340
1621
|
const expanded = view.groups[group.key] !== true
|
|
1341
1622
|
const title = group.title !== '' ? group.title : message('activity.unnamed')
|
|
1342
1623
|
const groupRows = []
|
|
@@ -1381,8 +1662,44 @@ window.__ModuleLoader__.load({
|
|
|
1381
1662
|
? null
|
|
1382
1663
|
: h('span', { className: 'dsws-pinned-dot', 'data-state': session.mark }),
|
|
1383
1664
|
),
|
|
1384
|
-
|
|
1665
|
+
editingLater === session.id
|
|
1666
|
+
? h('input', {
|
|
1667
|
+
className: 'dsws-pinned-note',
|
|
1668
|
+
defaultValue: later[session.id] === undefined ? '' : later[session.id].note,
|
|
1669
|
+
placeholder: message('later.note'),
|
|
1670
|
+
onClick: (event) => event.stopPropagation(),
|
|
1671
|
+
onKeyDown: (event) => {
|
|
1672
|
+
event.stopPropagation()
|
|
1673
|
+
if (event.key === 'Enter') {
|
|
1674
|
+
event.preventDefault()
|
|
1675
|
+
setLaterState(setLater(later, session.id, event.currentTarget.value))
|
|
1676
|
+
setEditingLater(null)
|
|
1677
|
+
} else if (event.key === 'Escape') {
|
|
1678
|
+
event.preventDefault()
|
|
1679
|
+
setEditingLater(null)
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1682
|
+
onBlur: (event) => {
|
|
1683
|
+
setLaterState(setLater(later, session.id, event.currentTarget.value))
|
|
1684
|
+
setEditingLater(null)
|
|
1685
|
+
},
|
|
1686
|
+
})
|
|
1687
|
+
: h('span', { className: 'dsws-pinned-row-title' }, session.title),
|
|
1385
1688
|
session.time === '' ? null : h('span', { className: 'dsws-pinned-time' }, session.time),
|
|
1689
|
+
h(
|
|
1690
|
+
'button',
|
|
1691
|
+
{
|
|
1692
|
+
type: 'button',
|
|
1693
|
+
className: 'dsws-pinned-bookmark',
|
|
1694
|
+
title: message('later.mark'),
|
|
1695
|
+
'aria-label': message('later.markAria', { title: session.title }),
|
|
1696
|
+
onClick: (event) => {
|
|
1697
|
+
event.stopPropagation()
|
|
1698
|
+
setEditingLater(session.id)
|
|
1699
|
+
},
|
|
1700
|
+
},
|
|
1701
|
+
bookmarkIcon(false),
|
|
1702
|
+
),
|
|
1386
1703
|
h(
|
|
1387
1704
|
'button',
|
|
1388
1705
|
{
|
|
@@ -1492,8 +1809,19 @@ window.__ModuleLoader__.load({
|
|
|
1492
1809
|
let raf = 0
|
|
1493
1810
|
const retry = () => {
|
|
1494
1811
|
attached = attachPinnedHost(markerRef.current)
|
|
1495
|
-
if (attached
|
|
1496
|
-
|
|
1812
|
+
if (attached !== null) {
|
|
1813
|
+
setPortalHost(attached.host)
|
|
1814
|
+
return
|
|
1815
|
+
}
|
|
1816
|
+
if (++frame < 120) {
|
|
1817
|
+
raf = window.requestAnimationFrame(retry)
|
|
1818
|
+
return
|
|
1819
|
+
}
|
|
1820
|
+
// Give the fallback a voice: without a host the section still renders
|
|
1821
|
+
// inline, and this line is what a bug report can be searched for.
|
|
1822
|
+
if (typeof console !== 'undefined' && typeof console.warn === 'function') {
|
|
1823
|
+
console.warn('dsh-workspace-status: sidebar region not found; the pinned section falls back to the footer slot')
|
|
1824
|
+
}
|
|
1497
1825
|
}
|
|
1498
1826
|
if (attached !== null) setPortalHost(attached.host)
|
|
1499
1827
|
else if (typeof window !== 'undefined' && typeof window.requestAnimationFrame === 'function') raf = window.requestAnimationFrame(retry)
|
|
@@ -1518,16 +1846,27 @@ window.__ModuleLoader__.load({
|
|
|
1518
1846
|
key: 'anchor', ref: markerRef, className: 'dsws-anchor', 'aria-hidden': 'true',
|
|
1519
1847
|
}))
|
|
1520
1848
|
|
|
1521
|
-
if (
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
)
|
|
1849
|
+
if (pinnedModel.total > 0) {
|
|
1850
|
+
const section = h(PinnedSection, {
|
|
1851
|
+
model: pinnedModel,
|
|
1852
|
+
sessions: byId,
|
|
1853
|
+
statuses,
|
|
1854
|
+
archived,
|
|
1855
|
+
openSession: typeof externalOpenSession === 'function' ? externalOpenSession : noop,
|
|
1856
|
+
unpinSession: typeof externalUnpinSession === 'function' ? externalUnpinSession : noopAsync,
|
|
1857
|
+
})
|
|
1858
|
+
if (portalHost !== undefined) {
|
|
1859
|
+
children.push(ReactDOM.createPortal(section, portalHost, ENTRY_ID))
|
|
1860
|
+
} else {
|
|
1861
|
+
// The sidebar region is absent or never appeared. Keep the section
|
|
1862
|
+
// reachable in the footer slot instead of dropping it silently: a
|
|
1863
|
+
// future shell layout change must look odd, not disappear.
|
|
1864
|
+
children.push(h('div', {
|
|
1865
|
+
key: 'pinned-fallback',
|
|
1866
|
+
className: 'dsws-pinned dsws-pinned-fallback',
|
|
1867
|
+
'data-fallback': 'true',
|
|
1868
|
+
}, section))
|
|
1869
|
+
}
|
|
1531
1870
|
}
|
|
1532
1871
|
|
|
1533
1872
|
return h(React.Fragment, null, children)
|
|
@@ -1606,7 +1945,13 @@ window.__ModuleLoader__.load({
|
|
|
1606
1945
|
sessionFacts,
|
|
1607
1946
|
notificationEvents,
|
|
1608
1947
|
notificationContent,
|
|
1948
|
+
buildLaterView,
|
|
1949
|
+
readLater,
|
|
1950
|
+
setLater,
|
|
1951
|
+
clearLater,
|
|
1952
|
+
hasLater,
|
|
1609
1953
|
WorkspaceStatus,
|
|
1954
|
+
PinnedSection,
|
|
1610
1955
|
FINISHED_WINDOW_MS,
|
|
1611
1956
|
},
|
|
1612
1957
|
}
|
package/locale/en.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"activity.waiting": "{n} waiting for you",
|
|
8
8
|
"activity.running": "{n} running",
|
|
9
9
|
"activity.done": "{n} recently finished",
|
|
10
|
+
"activity.later": "{n} later",
|
|
10
11
|
"activity.unnamed": "Ungrouped",
|
|
11
12
|
"activity.more": "and {n} more",
|
|
12
13
|
"activity.listSeparator": ", ",
|
|
@@ -36,5 +37,13 @@
|
|
|
36
37
|
"notify.waiting.title": "{title} needs you",
|
|
37
38
|
"notify.waiting.body": "{reason} · {workspace}",
|
|
38
39
|
"notify.finished.title": "{title} finished",
|
|
39
|
-
"notify.finished.body": "Finished and not opened yet · {workspace}"
|
|
40
|
+
"notify.finished.body": "Finished and not opened yet · {workspace}",
|
|
41
|
+
"later.title": "Later",
|
|
42
|
+
"later.mark": "Mark for later",
|
|
43
|
+
"later.markAria": "Mark {title} for later",
|
|
44
|
+
"later.unmark": "Stop deferring",
|
|
45
|
+
"later.unmarkAria": "Stop deferring {title}",
|
|
46
|
+
"later.note": "Why later? e.g. waiting for reboot",
|
|
47
|
+
"later.groupAria": "Conversations parked for later",
|
|
48
|
+
"later.noteFallback": "No note"
|
|
40
49
|
}
|
package/locale/zh.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"activity.waiting": "{n} 个等待你处理",
|
|
8
8
|
"activity.running": "{n} 个运行中",
|
|
9
9
|
"activity.done": "{n} 个刚刚完成",
|
|
10
|
+
"activity.later": "{n} 个稍后处理",
|
|
10
11
|
"activity.unnamed": "未分组",
|
|
11
12
|
"activity.more": "等 {n} 个",
|
|
12
13
|
"activity.listSeparator": "、",
|
|
@@ -36,5 +37,13 @@
|
|
|
36
37
|
"notify.waiting.title": "{title} 需要你",
|
|
37
38
|
"notify.waiting.body": "{reason} · {workspace}",
|
|
38
39
|
"notify.finished.title": "{title} 已完成",
|
|
39
|
-
"notify.finished.body": "已完成且尚未打开 · {workspace}"
|
|
40
|
+
"notify.finished.body": "已完成且尚未打开 · {workspace}",
|
|
41
|
+
"later.title": "稍后处理",
|
|
42
|
+
"later.mark": "标记为稍后处理",
|
|
43
|
+
"later.markAria": "将 {title} 标记为稍后处理",
|
|
44
|
+
"later.unmark": "取消稍后处理",
|
|
45
|
+
"later.unmarkAria": "取消 {title} 的稍后处理",
|
|
46
|
+
"later.note": "为什么稍后?例如:等待重启",
|
|
47
|
+
"later.groupAria": "已推迟到稍后处理的会话",
|
|
48
|
+
"later.noteFallback": "无备注"
|
|
40
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workspace-status",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Workspace status marks, a pinned-conversation section and pinned-only notifications for the DeepSeek Harness sidebar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"catalog": {
|
|
65
65
|
"summary": {
|
|
66
66
|
"en": "Workspace status marks, a pinned-conversation section above the sidebar list and pinned-only notifications: waiting for you, running, recently finished, grouped per workspace and persisted.",
|
|
67
|
-
"zh": "
|
|
67
|
+
"zh": "\u4fa7\u8fb9\u680f\u5de5\u4f5c\u533a\u72b6\u6001\u6807\u8bb0\u3001\u5217\u8868\u4e0a\u65b9\u7684\u5df2\u7f6e\u9876\u4f1a\u8bdd\u533a\uff0c\u4ee5\u53ca\u4ec5\u9488\u5bf9\u7f6e\u9876\u4f1a\u8bdd\u7684\u901a\u77e5\uff1a\u7b49\u5f85\u4f60\u5904\u7406\u3001\u8fd0\u884c\u4e2d\u3001\u521a\u521a\u5b8c\u6210\uff1b\u7f6e\u9876\u6309\u5de5\u4f5c\u533a\u5206\u7ec4\u5e76\u6301\u4e45\u4fdd\u5b58\u3002"
|
|
68
68
|
},
|
|
69
69
|
"category": "ui"
|
|
70
70
|
}
|