@linxin666/dsh-client-ui-task-board 0.4.13 → 0.4.15
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.i18n.yaml +2 -2
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/client.js +244 -264
- package/lib/client.js.map +1 -1
- package/lib/index.js +36 -11
- package/lib/types/client/board/source-group.d.ts +27 -0
- package/lib/types/client/locales.d.ts +1 -0
- package/lib/types/client/pending-verify.d.ts +47 -0
- package/lib/types/client/plugin-card-seat.d.ts +1 -1
- package/lib/types/client/service.d.ts +4 -1
- package/lib/types/core/controller.d.ts +7 -1
- package/lib/types/core/extension.d.ts +14 -0
- package/lib/types/host-routes.d.ts +6 -0
- package/lib/types/index.d.ts +1 -1
- package/package.json +28 -28
- package/src/client/board/TaskBoard.tsx +47 -10
- package/src/client/board/source-group.ts +94 -0
- package/src/client/board.module.css +17 -0
- package/src/client/host-api.ts +7 -0
- package/src/client/index.ts +11 -10
- package/src/client/locales.ts +2 -0
- package/src/client/pending-verify.ts +90 -0
- package/src/client/plugin-card-seat.ts +2 -2
- package/src/client/service.ts +24 -0
- package/src/core/controller.ts +18 -0
- package/src/core/extension.ts +16 -0
- package/src/host-routes.ts +46 -11
- package/src/index.ts +1 -1
- package/lib/types/client/suppress-schedule-row.d.ts +0 -86
- package/src/client/suppress-schedule-row.ts +0 -198
package/lib/index.js
CHANGED
|
@@ -10541,6 +10541,11 @@ function isForwardedLoopbackRequest(request) {
|
|
|
10541
10541
|
//#region src/host-routes.ts
|
|
10542
10542
|
const ACTION_LIMIT = 64 * 1024;
|
|
10543
10543
|
const IMPORT_LIMIT = 2 * 1024 * 1024;
|
|
10544
|
+
/**
|
|
10545
|
+
* Comment-frame cadence on the event stream. It keeps the connection alive
|
|
10546
|
+
* through intermediaries that would close an idle one; it is not a frame the
|
|
10547
|
+
* browser reports to the panel (an SSE comment is invisible to EventSource).
|
|
10548
|
+
*/
|
|
10544
10549
|
const HEARTBEAT_MS = 15e3;
|
|
10545
10550
|
/** Header replaced by an authenticated same-host reverse proxy. */
|
|
10546
10551
|
const TASK_BOARD_PROXY_TOKEN_HEADER = "x-dsh-task-board-proxy-token";
|
|
@@ -10780,20 +10785,40 @@ function makeTaskBoardRoutes(service, access = {}, options = {}) {
|
|
|
10780
10785
|
"cache-control": "no-cache",
|
|
10781
10786
|
connection: "keep-alive"
|
|
10782
10787
|
});
|
|
10788
|
+
let heartbeat;
|
|
10789
|
+
let release;
|
|
10790
|
+
const stop = () => {
|
|
10791
|
+
if (heartbeat !== void 0) {
|
|
10792
|
+
clearInterval(heartbeat);
|
|
10793
|
+
heartbeat = void 0;
|
|
10794
|
+
}
|
|
10795
|
+
const unsubscribe = release;
|
|
10796
|
+
release = void 0;
|
|
10797
|
+
unsubscribe?.();
|
|
10798
|
+
};
|
|
10799
|
+
const drop = () => {
|
|
10800
|
+
if (release === void 0) return;
|
|
10801
|
+
stop();
|
|
10802
|
+
res.destroy();
|
|
10803
|
+
};
|
|
10804
|
+
const write = (chunk) => {
|
|
10805
|
+
if (release === void 0 || res.writableEnded || res.destroyed) return;
|
|
10806
|
+
res.write(chunk, (error) => {
|
|
10807
|
+
if (error !== null && error !== void 0) drop();
|
|
10808
|
+
});
|
|
10809
|
+
};
|
|
10783
10810
|
const push = () => {
|
|
10784
|
-
|
|
10785
|
-
res.write(`data: ${JSON.stringify(payload)}\n\n`);
|
|
10811
|
+
write(`data: ${JSON.stringify(service.eventPayload())}\n\n`);
|
|
10786
10812
|
};
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10813
|
+
release = service.subscribe(push);
|
|
10814
|
+
heartbeat = setInterval(() => {
|
|
10815
|
+
write(": ping\n\n");
|
|
10790
10816
|
}, HEARTBEAT_MS);
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
res.once("close", close);
|
|
10817
|
+
req.once("close", stop);
|
|
10818
|
+
res.once("close", stop);
|
|
10819
|
+
res.on("error", () => {
|
|
10820
|
+
drop();
|
|
10821
|
+
});
|
|
10797
10822
|
push();
|
|
10798
10823
|
}
|
|
10799
10824
|
},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source grouping and fold preferences for the board view. Providers contribute
|
|
3
|
+
* opaque groups through the client contract; this module owns only ordering,
|
|
4
|
+
* local fallback, and browser persistence, never provider metadata semantics.
|
|
5
|
+
*/
|
|
6
|
+
import type { TaskBoardGroupingSelector, TaskBoardSourceGroup } from '../../core/extension.ts';
|
|
7
|
+
import type { TaskRecord, TaskStatus } from '../../core/tasks.ts';
|
|
8
|
+
/** Reserved group for cards no provider claimed. */
|
|
9
|
+
export declare const LOCAL_SOURCE_GROUP_ID = "local";
|
|
10
|
+
/** Browser storage key for explicit source-fold overrides. */
|
|
11
|
+
export declare const SOURCE_GROUP_FOLDS_KEY = "dsh.taskBoard.sourceGroupFolds.v1";
|
|
12
|
+
export type SourceGroupView = TaskStatus | 'archived';
|
|
13
|
+
export type SourceGroupFolds = Readonly<Record<string, boolean>>;
|
|
14
|
+
export interface SourceGroupBucket extends TaskBoardSourceGroup {
|
|
15
|
+
items: TaskRecord[];
|
|
16
|
+
local: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Group cards in their incoming order, then sort provider groups by full label. */
|
|
19
|
+
export declare function groupTasksBySource(tasks: readonly TaskRecord[], selectors: readonly TaskBoardGroupingSelector[]): SourceGroupBucket[];
|
|
20
|
+
/** Compound key keeps a fold choice scoped to one column/view and one source. */
|
|
21
|
+
export declare function sourceGroupFoldKey(view: SourceGroupView, sourceId: string): string;
|
|
22
|
+
/** Read explicit overrides; malformed or unavailable storage falls back to defaults. */
|
|
23
|
+
export declare function readSourceGroupFolds(storage: Pick<Storage, 'getItem'> | undefined): SourceGroupFolds;
|
|
24
|
+
/** Persist overrides; a storage failure only loses the preference. */
|
|
25
|
+
export declare function writeSourceGroupFolds(storage: Pick<Storage, 'setItem'> | undefined, folds: SourceGroupFolds): void;
|
|
26
|
+
/** Search always reveals matches; otherwise an override beats the column default. */
|
|
27
|
+
export declare function isSourceGroupFolded(folds: SourceGroupFolds, view: SourceGroupView, sourceId: string, searchActive: boolean): boolean;
|
|
@@ -494,6 +494,7 @@ export declare const zh: {
|
|
|
494
494
|
'card.time.updated': string;
|
|
495
495
|
'board.density.compact': string;
|
|
496
496
|
'board.density.comfortable': string;
|
|
497
|
+
'board.source.local': string;
|
|
497
498
|
'board.group.today': string;
|
|
498
499
|
'board.group.week': string;
|
|
499
500
|
'board.group.earlier': string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded verification of the one board state the mirror knows is transient.
|
|
3
|
+
*
|
|
4
|
+
* A pushed frame is how the panel normally learns that the Host moved, and the
|
|
5
|
+
* browser cannot verify that frames still arrive: an SSE connection that stops
|
|
6
|
+
* delivering without closing leaves `EventSource` open and silent, so no error
|
|
7
|
+
* fires and no frame comes. While the mirror still shows an execution the Host
|
|
8
|
+
* has not settled, that silence looks exactly like a run still in progress —
|
|
9
|
+
* the row a reader is looking at keeps saying "running" long after the Host
|
|
10
|
+
* wrote the session id and settled it.
|
|
11
|
+
*
|
|
12
|
+
* So the mirror verifies exactly that state and nothing else: one state read per
|
|
13
|
+
* {@link PENDING_VERIFICATION_MS} while at least one execution is still open,
|
|
14
|
+
* disarmed by the snapshot itself as soon as the last one settles. A board with
|
|
15
|
+
* nothing in flight reads nothing (the package rule: an idle board does not
|
|
16
|
+
* poll), and a hidden page defers its reads until it is looked at again.
|
|
17
|
+
*
|
|
18
|
+
* @module dsh-task-board/client/pending-verify
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Verification cadence while an execution is open. It matches the interval the
|
|
22
|
+
* transport already uses to recover from a stream error, so a missed frame and
|
|
23
|
+
* a broken stream converge within the same bound.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PENDING_VERIFICATION_MS = 15000;
|
|
26
|
+
/** What the loop needs from the mirror and from the Host transport. */
|
|
27
|
+
export interface PendingVerificationFace {
|
|
28
|
+
/** Whether the mirror still shows an execution the Host has not settled. */
|
|
29
|
+
pending(): boolean;
|
|
30
|
+
/** Re-read the authoritative Host snapshot. */
|
|
31
|
+
refresh(): void;
|
|
32
|
+
/** Follow mirror changes; the loop is armed and disarmed by them. */
|
|
33
|
+
subscribe(listener: () => void): () => void;
|
|
34
|
+
/** Whether a read is useful right now; defaults to the page being visible. */
|
|
35
|
+
visible?(): boolean;
|
|
36
|
+
/** Timer arming; defaults to the page's own interval. */
|
|
37
|
+
schedule?(run: () => void): unknown;
|
|
38
|
+
/** Timer release, paired with {@link PendingVerificationFace.schedule}. */
|
|
39
|
+
cancel?(handle: unknown): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Watch the mirror and re-read the Host snapshot while it shows work in flight.
|
|
43
|
+
* @param face - the mirror, the read, and the seams the loop runs on.
|
|
44
|
+
* @param intervalMs - verification cadence in milliseconds.
|
|
45
|
+
* @returns the disposer that releases the timer and the subscription.
|
|
46
|
+
*/
|
|
47
|
+
export declare function startPendingVerification(face: PendingVerificationFace, intervalMs?: number): () => void;
|
|
@@ -56,7 +56,7 @@ export interface PluginCardContext {
|
|
|
56
56
|
/** Service lookup; absent on a context double that only models the slots. */
|
|
57
57
|
get?(name: string): unknown;
|
|
58
58
|
/** Event subscription seat; absent on an event-less test double. */
|
|
59
|
-
on?(event:
|
|
59
|
+
on?(event: never, listener: never): unknown;
|
|
60
60
|
}
|
|
61
61
|
/** Owner share of a family list-seat card (that seat supplies nothing). */
|
|
62
62
|
export interface SettingsPluginItemOwnerProps {
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
* @module dsh-task-board/client/service
|
|
11
11
|
*/
|
|
12
12
|
import type { BoardController } from '../core/controller.ts';
|
|
13
|
-
import type { TaskBoardClientFace, TaskBoardClientMirror, TaskBoardExtensionActionRequest, TaskBoardVisibilityPredicate } from '../core/extension.ts';
|
|
13
|
+
import type { TaskBoardClientFace, TaskBoardClientMirror, TaskBoardExtensionActionRequest, TaskBoardGroupingSelector, TaskBoardVisibilityPredicate } from '../core/extension.ts';
|
|
14
14
|
export declare class TaskBoardClientService implements TaskBoardClientFace {
|
|
15
15
|
private controller;
|
|
16
16
|
private enabled;
|
|
17
17
|
private unsubscribeController;
|
|
18
18
|
/** Predicates registered before the controller exists, replayed on attach. */
|
|
19
19
|
private readonly pendingVisibility;
|
|
20
|
+
/** Source selectors registered before the controller exists, replayed on attach. */
|
|
21
|
+
private readonly pendingGrouping;
|
|
20
22
|
private readonly listeners;
|
|
21
23
|
/** Bind the live board controller (called when the UI mounts). */
|
|
22
24
|
attach(controller: BoardController): void;
|
|
@@ -26,6 +28,7 @@ export declare class TaskBoardClientService implements TaskBoardClientFace {
|
|
|
26
28
|
setEnabled(enabled: boolean): void;
|
|
27
29
|
dispatch(request: TaskBoardExtensionActionRequest): Promise<boolean>;
|
|
28
30
|
registerVisibility(predicate: TaskBoardVisibilityPredicate): () => void;
|
|
31
|
+
registerGrouping(selector: TaskBoardGroupingSelector): () => void;
|
|
29
32
|
subscribe(callback: (mirror: TaskBoardClientMirror) => void): () => void;
|
|
30
33
|
snapshot(): TaskBoardClientMirror;
|
|
31
34
|
private notify;
|
|
@@ -17,7 +17,7 @@ import type { TaskAttachment, TaskAttachmentKind } from './attachment.ts';
|
|
|
17
17
|
import { type SetSchedulePatch } from './use-cases/task-schedule.ts';
|
|
18
18
|
import { type TaskUpdatePatch } from './use-cases/task-update.ts';
|
|
19
19
|
import type { TaskBoardAction, TaskBoardEventPayload, TaskBoardParseDraft, TaskBoardParseRequest, TaskBoardSnapshot } from '../protocol.ts';
|
|
20
|
-
import type { TaskBoardExtensionActionRequest, TaskBoardVisibilityPredicate } from './extension.ts';
|
|
20
|
+
import type { TaskBoardExtensionActionRequest, TaskBoardGroupingSelector, TaskBoardVisibilityPredicate } from './extension.ts';
|
|
21
21
|
export interface TaskBoardTransport {
|
|
22
22
|
bootstrap(legacy: readonly TaskRecord[]): Promise<TaskBoardSnapshot>;
|
|
23
23
|
state(): Promise<TaskBoardSnapshot>;
|
|
@@ -154,6 +154,8 @@ export interface ControllerSnapshot {
|
|
|
154
154
|
* hand-built snapshot (tests, a shell-less composition) defaults to visible.
|
|
155
155
|
*/
|
|
156
156
|
visibility?: readonly TaskBoardVisibilityPredicate[];
|
|
157
|
+
/** Provider source-group selectors, in registration order; browser-only functions. */
|
|
158
|
+
grouping?: readonly TaskBoardGroupingSelector[];
|
|
157
159
|
/** Read-only summaries published by running extensions, keyed by extension id. */
|
|
158
160
|
extensions?: Readonly<Record<string, unknown>>;
|
|
159
161
|
}
|
|
@@ -181,6 +183,8 @@ export declare class BoardController {
|
|
|
181
183
|
private hostState;
|
|
182
184
|
/** Provider visibility predicates (immutable array; replaced on change). */
|
|
183
185
|
private visibility;
|
|
186
|
+
/** Provider source-group selectors (immutable array; replaced on change). */
|
|
187
|
+
private grouping;
|
|
184
188
|
private remoteSubscribed;
|
|
185
189
|
private remoteInitialization;
|
|
186
190
|
/** @param deps - store and the sessions navigation face. */
|
|
@@ -195,6 +199,8 @@ export declare class BoardController {
|
|
|
195
199
|
* both changes notify subscribers so the board re-renders.
|
|
196
200
|
*/
|
|
197
201
|
registerVisibility(predicate: TaskBoardVisibilityPredicate): () => void;
|
|
202
|
+
/** Register one source-group selector; registration order breaks ownership ties. */
|
|
203
|
+
registerGrouping(selector: TaskBoardGroupingSelector): () => void;
|
|
198
204
|
/**
|
|
199
205
|
* Deliver one provider action through the board's same-origin channel. A
|
|
200
206
|
* board without a Host transport (the legacy in-memory path) refuses it.
|
|
@@ -283,6 +283,15 @@ export interface TaskBoardClientMirror {
|
|
|
283
283
|
}
|
|
284
284
|
/** Whether a task should be shown on the board; false hides it. */
|
|
285
285
|
export type TaskBoardVisibilityPredicate = (task: TaskRecord) => boolean;
|
|
286
|
+
/** Generic source bucket a provider assigns to one card. */
|
|
287
|
+
export interface TaskBoardSourceGroup {
|
|
288
|
+
/** Stable, provider-namespaced identity used for ordering and fold persistence. */
|
|
289
|
+
id: string;
|
|
290
|
+
/** Full human-readable source label, such as an owner/repository pair. */
|
|
291
|
+
label: string;
|
|
292
|
+
}
|
|
293
|
+
/** Return a card's source group, or undefined when this provider does not own it. */
|
|
294
|
+
export type TaskBoardGroupingSelector = (task: TaskRecord) => TaskBoardSourceGroup | undefined;
|
|
286
295
|
/**
|
|
287
296
|
* Client capability face the board's browser half provides. A provider's
|
|
288
297
|
* browser half resolves it from the shared cordis service name; it never
|
|
@@ -293,6 +302,11 @@ export interface TaskBoardClientFace {
|
|
|
293
302
|
dispatch(request: TaskBoardExtensionActionRequest): Promise<boolean>;
|
|
294
303
|
/** Register one card visibility predicate; the returned disposer removes it. */
|
|
295
304
|
registerVisibility(predicate: TaskBoardVisibilityPredicate): () => void;
|
|
305
|
+
/**
|
|
306
|
+
* Register one source-group selector; the first selector returning a group
|
|
307
|
+
* wins. Optional so an older board can serve the same API version.
|
|
308
|
+
*/
|
|
309
|
+
registerGrouping?(selector: TaskBoardGroupingSelector): () => void;
|
|
296
310
|
/** Subscribe to the board mirror. */
|
|
297
311
|
subscribe(callback: (mirror: TaskBoardClientMirror) => void): () => void;
|
|
298
312
|
/** Read the current board mirror. */
|
|
@@ -3,6 +3,12 @@ import type { WebRoute } from '@deepseek-ai/dsh-host-webserver';
|
|
|
3
3
|
import type { TaskBoardHostService } from './host-service.ts';
|
|
4
4
|
import { type TaskBoardParseDraft, type TaskBoardParseRequest } from './protocol.ts';
|
|
5
5
|
import { type TaskBoardAttachmentStore } from './host/attachments.ts';
|
|
6
|
+
/**
|
|
7
|
+
* Comment-frame cadence on the event stream. It keeps the connection alive
|
|
8
|
+
* through intermediaries that would close an idle one; it is not a frame the
|
|
9
|
+
* browser reports to the panel (an SSE comment is invisible to EventSource).
|
|
10
|
+
*/
|
|
11
|
+
export declare const HEARTBEAT_MS = 15000;
|
|
6
12
|
/** Header replaced by an authenticated same-host reverse proxy. */
|
|
7
13
|
export declare const TASK_BOARD_PROXY_TOKEN_HEADER = "x-dsh-task-board-proxy-token";
|
|
8
14
|
/**
|
package/lib/types/index.d.ts
CHANGED
|
@@ -195,7 +195,7 @@ export interface Config {
|
|
|
195
195
|
* config against, before the schema turns volatile fields into live references
|
|
196
196
|
* and applies defaults. Declared separately because the two sides no longer
|
|
197
197
|
* share one shape, so the schema is annotated `z<ConfigInput, Config>` — the
|
|
198
|
-
* same split
|
|
198
|
+
* same split the git-family packages use. The annotation is also what keeps the
|
|
199
199
|
* emitted declaration portable: an unannotated schema holding a nested object
|
|
200
200
|
* array infers a type that cannot be named without reaching into a transitive
|
|
201
201
|
* dependency's own types.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linxin666/dsh-client-ui-task-board",
|
|
3
3
|
"description": "Host-authoritative task board for the DSH Web GUI with real session execution, Host cron scheduling, and optional cross-platform idle-sleep protection; mounted without DSH source changes.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.15",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dsh": {
|
|
24
24
|
"engines": {
|
|
25
|
-
"dsh": ">=0.2.
|
|
25
|
+
"dsh": ">=0.2.2-rc.1"
|
|
26
26
|
},
|
|
27
27
|
"bundle": {
|
|
28
28
|
"patch": "./cordis.patch.yml"
|
|
@@ -42,38 +42,38 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/dsh": ">=0.2.
|
|
45
|
+
"@deepseek-ai/dsh": ">=0.2.2-rc.1",
|
|
46
46
|
"react": "^18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@deepseek-ai/schemastery": "^3.
|
|
49
|
+
"@deepseek-ai/schemastery": "^3.19.0",
|
|
50
50
|
"marked": "^18.0.14"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@deepseek-ai/cordis": "^4.0
|
|
54
|
-
"@deepseek-ai/dsh-agent": "^0.2.
|
|
55
|
-
"@deepseek-ai/dsh-agent-preset-registry": "^0.2.
|
|
56
|
-
"@deepseek-ai/dsh-attachment": "^0.2.
|
|
57
|
-
"@deepseek-ai/dsh-api-gateway": "^0.2.
|
|
58
|
-
"@deepseek-ai/dsh-api-remotes": "^0.2.
|
|
59
|
-
"@deepseek-ai/dsh-api-session-controller": "^0.2.
|
|
60
|
-
"@deepseek-ai/dsh-api-workspace-controller": "^0.2.
|
|
61
|
-
"@deepseek-ai/dsh-client-connection": "^0.2.
|
|
62
|
-
"@deepseek-ai/dsh-client-locale": "^0.2.
|
|
63
|
-
"@deepseek-ai/dsh-client-store": "^0.2.
|
|
64
|
-
"@deepseek-ai/dsh-client-ui-layout": "^0.2.
|
|
65
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.
|
|
66
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.2.
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "^0.2.
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.2.
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-workspace": "^0.2.
|
|
70
|
-
"@deepseek-ai/dsh-commands": "^0.2.
|
|
71
|
-
"@deepseek-ai/dsh-host-webserver": "^0.2.
|
|
72
|
-
"@deepseek-ai/dsh-llm": "^0.2.
|
|
73
|
-
"@deepseek-ai/dsh-settings": "^0.2.
|
|
74
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.
|
|
75
|
-
"@deepseek-ai/dsh-tools": "^0.2.
|
|
76
|
-
"@deepseek-ai/dsh-workspace": "^0.2.
|
|
53
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
54
|
+
"@deepseek-ai/dsh-agent": "^0.2.2-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-agent-preset-registry": "^0.2.2-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-attachment": "^0.2.2-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-api-gateway": "^0.2.2-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-api-remotes": "^0.2.2-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.2.2-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.2.2-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-connection": "^0.2.2-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-locale": "^0.2.2-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-client-store": "^0.2.2-rc.1",
|
|
64
|
+
"@deepseek-ai/dsh-client-ui-layout": "^0.2.2-rc.1",
|
|
65
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.1",
|
|
66
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.1",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "^0.2.2-rc.1",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.1",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-workspace": "^0.2.2-rc.1",
|
|
70
|
+
"@deepseek-ai/dsh-commands": "^0.2.2-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-host-webserver": "^0.2.2-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-llm": "^0.2.2-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-settings": "^0.2.2-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-tools": "^0.2.2-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-workspace": "^0.2.2-rc.1",
|
|
77
77
|
"@types/node": "^22.20.0",
|
|
78
78
|
"@types/react": "~18.3.1",
|
|
79
79
|
"@types/react-dom": "^18.3.5",
|
|
@@ -16,6 +16,7 @@ import { TagManagerModal } from './TagManagerModal.tsx'
|
|
|
16
16
|
import { cardTimeline, groupByRecency, readCompactColumns, RECENCY_KEY, writeCompactColumns, type RecencyGroup } from './card-view.ts'
|
|
17
17
|
import { TaskCard } from './TaskCard.tsx'
|
|
18
18
|
import { TaskDetail } from './TaskDetail.tsx'
|
|
19
|
+
import { groupTasksBySource, isSourceGroupFolded, readSourceGroupFolds, sourceGroupFoldKey, writeSourceGroupFolds, type SourceGroupView } from './source-group.ts'
|
|
19
20
|
|
|
20
21
|
/** Sentinel option value of the project row's "register a new project" entry. */
|
|
21
22
|
export const NEW_PROJECT_VALUE = '__dsh_new_project__'
|
|
@@ -140,6 +141,8 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
140
141
|
// Density is a per-column browser preference: the long settled column starts
|
|
141
142
|
// compact, and each column header toggles its own density.
|
|
142
143
|
const [compactColumns, setCompactColumns] = useState<TaskStatus[]>(() => readCompactColumns(globalThis.localStorage))
|
|
144
|
+
// Source-group fold overrides persist per browser; done starts folded.
|
|
145
|
+
const [sourceFolds, setSourceFolds] = useState(() => readSourceGroupFolds(globalThis.localStorage))
|
|
143
146
|
// Grouped columns whose folded "earlier" group the user expanded this visit.
|
|
144
147
|
const [unfolded, setUnfolded] = useState<string[]>([])
|
|
145
148
|
const [showNew, setShowNew] = useState(false)
|
|
@@ -250,15 +253,13 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
250
253
|
/>
|
|
251
254
|
)
|
|
252
255
|
/**
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* a hundred finished issues opens on what happened lately; a text or label
|
|
256
|
-
* search never folds, because a match hidden behind a fold reads as no match.
|
|
256
|
+
* Recency groups nested inside one source group. The fold key includes the
|
|
257
|
+
* source, so expanding one repository's earlier cards opens no other group's.
|
|
257
258
|
*/
|
|
258
|
-
const
|
|
259
|
+
const renderRecencyGroups = (foldScope: string, tasks: TaskRecord[], compact: boolean, archived: boolean) => {
|
|
259
260
|
const buckets = groupByRecency(tasks, task => cardTimeline(task, archived).at, now, timeZone)
|
|
260
261
|
const foldable = !searchActive && tasks.length > COLUMN_FOLD_THRESHOLD && buckets.length > 1
|
|
261
|
-
const open = unfolded.includes(
|
|
262
|
+
const open = unfolded.includes(foldScope)
|
|
262
263
|
return buckets.map(bucket => {
|
|
263
264
|
const folded = foldable && bucket.group === buckets[buckets.length - 1]!.group && !open
|
|
264
265
|
return (
|
|
@@ -273,7 +274,7 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
273
274
|
data-dsh-part="card-group-toggle"
|
|
274
275
|
aria-expanded={!folded}
|
|
275
276
|
onClick={() => {
|
|
276
|
-
setUnfolded(current => current.includes(
|
|
277
|
+
setUnfolded(current => current.includes(foldScope) ? current.filter(entry => entry !== foldScope) : [...current, foldScope])
|
|
277
278
|
}}
|
|
278
279
|
>
|
|
279
280
|
{folded ? t('board.group.expand', { count: String(bucket.items.length) }) : t('board.group.collapse')}
|
|
@@ -286,6 +287,43 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
286
287
|
})
|
|
287
288
|
}
|
|
288
289
|
|
|
290
|
+
/** Every column and the archive first split by provider-owned source. */
|
|
291
|
+
const renderSourceGroups = (view: SourceGroupView, tasks: TaskRecord[], compact: boolean, archived: boolean) => {
|
|
292
|
+
const recency = archived || GROUPED_COLUMNS.includes(view as TaskStatus)
|
|
293
|
+
return groupTasksBySource(tasks, snapshot.grouping ?? []).map(bucket => {
|
|
294
|
+
const foldKey = sourceGroupFoldKey(view, bucket.id)
|
|
295
|
+
const folded = isSourceGroupFolded(sourceFolds, view, bucket.id, searchActive)
|
|
296
|
+
const label = bucket.local ? t('board.source.local') : bucket.label
|
|
297
|
+
return (
|
|
298
|
+
<div key={bucket.id} className={`${css.cardGroup} ${css.sourceGroup}`} data-dsh-part="card-group">
|
|
299
|
+
<div className={`${css.cardGroupHeader} ${css.sourceGroupHeader}`}>
|
|
300
|
+
<span className={css.sourceGroupLabel}>{label}</span>
|
|
301
|
+
<span className={css.cardGroupCount}>{bucket.items.length}</span>
|
|
302
|
+
<button
|
|
303
|
+
type="button"
|
|
304
|
+
className={css.linkButton}
|
|
305
|
+
data-dsh-part="card-group-toggle"
|
|
306
|
+
aria-expanded={!folded}
|
|
307
|
+
disabled={searchActive}
|
|
308
|
+
onClick={() => {
|
|
309
|
+
setSourceFolds(current => {
|
|
310
|
+
const next = { ...current, [foldKey]: !isSourceGroupFolded(current, view, bucket.id, false) }
|
|
311
|
+
writeSourceGroupFolds(globalThis.localStorage, next)
|
|
312
|
+
return next
|
|
313
|
+
})
|
|
314
|
+
}}
|
|
315
|
+
>
|
|
316
|
+
{folded ? t('board.group.expand', { count: String(bucket.items.length) }) : t('board.group.collapse')}
|
|
317
|
+
</button>
|
|
318
|
+
</div>
|
|
319
|
+
{!folded && (recency
|
|
320
|
+
? renderRecencyGroups(foldKey, bucket.items, compact, archived)
|
|
321
|
+
: bucket.items.map(task => renderCard(task, compact)))}
|
|
322
|
+
</div>
|
|
323
|
+
)
|
|
324
|
+
})
|
|
325
|
+
}
|
|
326
|
+
|
|
289
327
|
return (
|
|
290
328
|
<div className={css.board} data-dsh-taskboard-board="" data-dsh-plugin="task-board">
|
|
291
329
|
<header className={css.boardHeader}>
|
|
@@ -472,7 +510,7 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
472
510
|
<span className={css.columnCount}>{visible.length}</span>
|
|
473
511
|
</header>
|
|
474
512
|
<div className={css.cards}>
|
|
475
|
-
{
|
|
513
|
+
{renderSourceGroups(ARCHIVE_COLUMN, visible, false, true)}
|
|
476
514
|
{visible.length === 0 && (
|
|
477
515
|
<div className={css.columnEmpty}>{tagFilter.length > 0 ? t('board.tagEmpty') : t('archive.empty')}</div>
|
|
478
516
|
)}
|
|
@@ -485,7 +523,6 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
485
523
|
// never does, because only the runner opens an execution.
|
|
486
524
|
const isManualDropTarget = MANUAL_STATUSES.includes(column.status)
|
|
487
525
|
const compact = compactColumns.includes(column.status)
|
|
488
|
-
const grouped = GROUPED_COLUMNS.includes(column.status)
|
|
489
526
|
return (
|
|
490
527
|
<section
|
|
491
528
|
key={column.status}
|
|
@@ -524,7 +561,7 @@ export function TaskBoard({ controller }: { controller: BoardController }) {
|
|
|
524
561
|
</button>
|
|
525
562
|
</header>
|
|
526
563
|
<div className={css.cards}>
|
|
527
|
-
{
|
|
564
|
+
{renderSourceGroups(column.status, tasks, compact, false)}
|
|
528
565
|
{tasks.length === 0 && (
|
|
529
566
|
<div className={css.columnEmpty}>{tagFilter.length > 0 ? t('board.tagEmpty') : t('board.empty')}</div>
|
|
530
567
|
)}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source grouping and fold preferences for the board view. Providers contribute
|
|
3
|
+
* opaque groups through the client contract; this module owns only ordering,
|
|
4
|
+
* local fallback, and browser persistence, never provider metadata semantics.
|
|
5
|
+
*/
|
|
6
|
+
import type { TaskBoardGroupingSelector, TaskBoardSourceGroup } from '../../core/extension.ts'
|
|
7
|
+
import type { TaskRecord, TaskStatus } from '../../core/tasks.ts'
|
|
8
|
+
|
|
9
|
+
/** Reserved group for cards no provider claimed. */
|
|
10
|
+
export const LOCAL_SOURCE_GROUP_ID = 'local'
|
|
11
|
+
/** Browser storage key for explicit source-fold overrides. */
|
|
12
|
+
export const SOURCE_GROUP_FOLDS_KEY = 'dsh.taskBoard.sourceGroupFolds.v1'
|
|
13
|
+
|
|
14
|
+
export type SourceGroupView = TaskStatus | 'archived'
|
|
15
|
+
export type SourceGroupFolds = Readonly<Record<string, boolean>>
|
|
16
|
+
|
|
17
|
+
export interface SourceGroupBucket extends TaskBoardSourceGroup {
|
|
18
|
+
items: TaskRecord[]
|
|
19
|
+
local: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function compareText(left: string, right: string): number {
|
|
23
|
+
const a = left.toLowerCase()
|
|
24
|
+
const b = right.toLowerCase()
|
|
25
|
+
if (a < b) return -1
|
|
26
|
+
if (a > b) return 1
|
|
27
|
+
return left < right ? -1 : left > right ? 1 : 0
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Group cards in their incoming order, then sort provider groups by full label. */
|
|
31
|
+
export function groupTasksBySource(tasks: readonly TaskRecord[], selectors: readonly TaskBoardGroupingSelector[]): SourceGroupBucket[] {
|
|
32
|
+
const groups = new Map<string, SourceGroupBucket>()
|
|
33
|
+
for (const task of tasks) {
|
|
34
|
+
let source: TaskBoardSourceGroup | undefined
|
|
35
|
+
for (const selector of selectors) {
|
|
36
|
+
try {
|
|
37
|
+
const candidate = selector(task)
|
|
38
|
+
if (candidate === undefined) continue
|
|
39
|
+
const id = candidate.id.trim()
|
|
40
|
+
const label = candidate.label.trim()
|
|
41
|
+
if (id === '' || label === '') continue
|
|
42
|
+
source = { id, label }
|
|
43
|
+
break
|
|
44
|
+
} catch {
|
|
45
|
+
// A faulty provider loses its grouping contribution, not the board.
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const group = source ?? { id: LOCAL_SOURCE_GROUP_ID, label: '' }
|
|
49
|
+
const bucket = groups.get(group.id) ?? { ...group, items: [], local: source === undefined }
|
|
50
|
+
bucket.items.push(task)
|
|
51
|
+
groups.set(group.id, bucket)
|
|
52
|
+
}
|
|
53
|
+
return [...groups.values()].sort((left, right) => {
|
|
54
|
+
if (left.local !== right.local) return left.local ? 1 : -1
|
|
55
|
+
return compareText(left.label, right.label) || compareText(left.id, right.id)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Compound key keeps a fold choice scoped to one column/view and one source. */
|
|
60
|
+
export function sourceGroupFoldKey(view: SourceGroupView, sourceId: string): string {
|
|
61
|
+
return `${view}:${sourceId}`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Read explicit overrides; malformed or unavailable storage falls back to defaults. */
|
|
65
|
+
export function readSourceGroupFolds(storage: Pick<Storage, 'getItem'> | undefined): SourceGroupFolds {
|
|
66
|
+
try {
|
|
67
|
+
const raw = storage?.getItem(SOURCE_GROUP_FOLDS_KEY)
|
|
68
|
+
if (raw === null || raw === undefined) return {}
|
|
69
|
+
const parsed: unknown = JSON.parse(raw)
|
|
70
|
+
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) return {}
|
|
71
|
+
const result: Record<string, boolean> = Object.create(null) as Record<string, boolean>
|
|
72
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
73
|
+
if (key !== '' && typeof value === 'boolean') result[key] = value
|
|
74
|
+
}
|
|
75
|
+
return result
|
|
76
|
+
} catch {
|
|
77
|
+
return {}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Persist overrides; a storage failure only loses the preference. */
|
|
82
|
+
export function writeSourceGroupFolds(storage: Pick<Storage, 'setItem'> | undefined, folds: SourceGroupFolds): void {
|
|
83
|
+
try {
|
|
84
|
+
storage?.setItem(SOURCE_GROUP_FOLDS_KEY, JSON.stringify(folds))
|
|
85
|
+
} catch {
|
|
86
|
+
// Preference only: the in-memory choice still works.
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Search always reveals matches; otherwise an override beats the column default. */
|
|
91
|
+
export function isSourceGroupFolded(folds: SourceGroupFolds, view: SourceGroupView, sourceId: string, searchActive: boolean): boolean {
|
|
92
|
+
if (searchActive) return false
|
|
93
|
+
return folds[sourceGroupFoldKey(view, sourceId)] ?? view === 'done'
|
|
94
|
+
}
|
|
@@ -564,6 +564,23 @@
|
|
|
564
564
|
font-size: 12px;
|
|
565
565
|
}
|
|
566
566
|
|
|
567
|
+
/* Provider-owned source groups wrap recency groups without adding a new
|
|
568
|
+
semantic part. Long owner/repository labels wrap instead of pushing the
|
|
569
|
+
count and disclosure beyond a narrow column. */
|
|
570
|
+
.sourceGroup {
|
|
571
|
+
gap: 8px;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
.sourceGroupHeader {
|
|
575
|
+
color: var(--dsw-alias-label-secondary);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.sourceGroupLabel {
|
|
579
|
+
flex: 1 1 auto;
|
|
580
|
+
min-width: 0;
|
|
581
|
+
overflow-wrap: anywhere;
|
|
582
|
+
}
|
|
583
|
+
|
|
567
584
|
/* Per-column density switch in the column header: one row slot, 44px pointer
|
|
568
585
|
target from the same expansion the card's quick action uses. */
|
|
569
586
|
.densityToggle {
|
package/src/client/host-api.ts
CHANGED
|
@@ -380,6 +380,13 @@ export class HttpTaskBoardHostTransport implements TaskBoardHostTransport {
|
|
|
380
380
|
listener()
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
+
// Every connect and every reconnect is a resynchronization point: the route
|
|
384
|
+
// pushes one frame when it accepts a stream, but a frame whose revision
|
|
385
|
+
// already matches the mirrored one is what the panel applies without a
|
|
386
|
+
// read, so the connection itself asks for the snapshot. Without this, a
|
|
387
|
+
// stream that came back after an outage would only catch up if some later
|
|
388
|
+
// Host write happened to move the revision past the mirror.
|
|
389
|
+
events.onopen = (): void => { listener() }
|
|
383
390
|
// A stream that cannot connect at all (unmounted route, refused socket) is
|
|
384
391
|
// how a Host half that never mounted looks from the browser; nudge the
|
|
385
392
|
// panel into one state read so the failure becomes visible (#1528).
|