@fish-under-sea/dsh-client-ui-task-board-fish 0.0.0-stage → 0.5.0
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/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +202 -2
- package/README.zh.md +203 -0
- package/cordis.patch.yml +12 -0
- package/icon.svg +3 -0
- package/lib/client.js +12941 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +10471 -0
- package/lib/types/client/PluginSettingsCard.d.ts +144 -0
- package/lib/types/client/TaskBoardSettingsCard.d.ts +92 -0
- package/lib/types/client/apply-guard.d.ts +25 -0
- package/lib/types/client/board/ClampedMarkdown.d.ts +3 -0
- package/lib/types/client/board/ConfirmDialog.d.ts +15 -0
- package/lib/types/client/board/EditTaskModal.d.ts +17 -0
- package/lib/types/client/board/LinkSubtaskModal.d.ts +14 -0
- package/lib/types/client/board/NewTaskModal.d.ts +26 -0
- package/lib/types/client/board/TagManagerModal.d.ts +26 -0
- package/lib/types/client/board/TaskBoard.d.ts +26 -0
- package/lib/types/client/board/TaskCard.d.ts +36 -0
- package/lib/types/client/board/TaskDetail.d.ts +9 -0
- package/lib/types/client/board/TaskForm.d.ts +72 -0
- package/lib/types/client/board/VerificationReport.d.ts +23 -0
- package/lib/types/client/board/card-view.d.ts +113 -0
- package/lib/types/client/board/icons.d.ts +32 -0
- package/lib/types/client/board/overlay.d.ts +69 -0
- package/lib/types/client/board/parse-model-pref.d.ts +4 -0
- package/lib/types/client/board/preset-label.d.ts +22 -0
- package/lib/types/client/board/status-key.d.ts +19 -0
- package/lib/types/client/board/task-markdown.d.ts +19 -0
- package/lib/types/client/host-api.d.ts +63 -0
- package/lib/types/client/index.d.ts +128 -0
- package/lib/types/client/locales.d.ts +443 -0
- package/lib/types/client/main-session.d.ts +32 -0
- package/lib/types/client/native-panel.d.ts +48 -0
- package/lib/types/client/plugin-card-seat.d.ts +108 -0
- package/lib/types/client/schedule-presets.d.ts +10 -0
- package/lib/types/client/schedule-zone.d.ts +97 -0
- package/lib/types/client/seats.d.ts +18 -0
- package/lib/types/client/service.d.ts +32 -0
- package/lib/types/client/settings-entry-form.d.ts +49 -0
- package/lib/types/client/settings-form.d.ts +213 -0
- package/lib/types/core/controller.d.ts +373 -0
- package/lib/types/core/degraded-reason.d.ts +46 -0
- package/lib/types/core/extension.d.ts +283 -0
- package/lib/types/core/freeze-snapshot.d.ts +71 -0
- package/lib/types/core/handover.d.ts +70 -0
- package/lib/types/core/issue-form.d.ts +16 -0
- package/lib/types/core/package-name.d.ts +9 -0
- package/lib/types/core/poll-cadence.d.ts +31 -0
- package/lib/types/core/schedule.d.ts +124 -0
- package/lib/types/core/session-reuse.d.ts +24 -0
- package/lib/types/core/store.d.ts +64 -0
- package/lib/types/core/subtask.d.ts +141 -0
- package/lib/types/core/tasks.d.ts +601 -0
- package/lib/types/core/use-cases/task-archive.d.ts +20 -0
- package/lib/types/core/use-cases/task-create.d.ts +27 -0
- package/lib/types/core/use-cases/task-delete.d.ts +27 -0
- package/lib/types/core/use-cases/task-parent.d.ts +21 -0
- package/lib/types/core/use-cases/task-schedule.d.ts +96 -0
- package/lib/types/core/use-cases/task-tag.d.ts +48 -0
- package/lib/types/core/use-cases/task-update.d.ts +56 -0
- package/lib/types/core/verification-budget.d.ts +52 -0
- package/lib/types/core/verification.d.ts +753 -0
- package/lib/types/core/workspace-target.d.ts +41 -0
- package/lib/types/dsh-home.d.ts +16 -0
- package/lib/types/host/agent-tools.d.ts +27 -0
- package/lib/types/host/extension-registry.d.ts +111 -0
- package/lib/types/host/llm-dispatch.d.ts +63 -0
- package/lib/types/host/verification-gate.d.ts +95 -0
- package/lib/types/host/verification-runner.d.ts +139 -0
- package/lib/types/host/workspace-evidence.d.ts +53 -0
- package/lib/types/host-ai.d.ts +51 -0
- package/lib/types/host-ledger.d.ts +385 -0
- package/lib/types/host-routes.d.ts +36 -0
- package/lib/types/host-runner.d.ts +252 -0
- package/lib/types/host-service.d.ts +379 -0
- package/lib/types/http.d.ts +59 -0
- package/lib/types/index.d.ts +322 -0
- package/lib/types/loopback.d.ts +24 -0
- package/lib/types/mount-once.d.ts +55 -0
- package/lib/types/power-inhibitor.d.ts +73 -0
- package/lib/types/protocol.d.ts +212 -0
- package/lib/types/tool-surface.d.ts +71 -0
- package/package.json +107 -4
- package/src/client/PluginSettingsCard.tsx +564 -0
- package/src/client/TaskBoardSettingsCard.tsx +539 -0
- package/src/client/apply-guard.ts +35 -0
- package/src/client/board/ClampedMarkdown.tsx +69 -0
- package/src/client/board/ConfirmDialog.tsx +44 -0
- package/src/client/board/EditTaskModal.tsx +110 -0
- package/src/client/board/LinkSubtaskModal.tsx +97 -0
- package/src/client/board/NewTaskModal.tsx +718 -0
- package/src/client/board/TagManagerModal.tsx +235 -0
- package/src/client/board/TaskBoard.tsx +558 -0
- package/src/client/board/TaskCard.tsx +315 -0
- package/src/client/board/TaskDetail.tsx +985 -0
- package/src/client/board/TaskForm.tsx +264 -0
- package/src/client/board/VerificationReport.tsx +322 -0
- package/src/client/board/card-view.ts +220 -0
- package/src/client/board/icons.tsx +89 -0
- package/src/client/board/overlay.tsx +189 -0
- package/src/client/board/parse-model-pref.ts +35 -0
- package/src/client/board/preset-label.ts +44 -0
- package/src/client/board/status-key.ts +41 -0
- package/src/client/board/task-markdown.module.css +137 -0
- package/src/client/board/task-markdown.tsx +106 -0
- package/src/client/board-settings.module.css +66 -0
- package/src/client/board.module.css +1837 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/host-api.ts +336 -0
- package/src/client/index.ts +501 -0
- package/src/client/locales.ts +905 -0
- package/src/client/main-session.ts +43 -0
- package/src/client/native-panel.tsx +140 -0
- package/src/client/plugin-card-seat.ts +199 -0
- package/src/client/schedule-presets.ts +13 -0
- package/src/client/schedule-zone.ts +233 -0
- package/src/client/seats.tsx +58 -0
- package/src/client/service.ts +94 -0
- package/src/client/settings-card.module.css +444 -0
- package/src/client/settings-entry-form.ts +142 -0
- package/src/client/settings-form.ts +468 -0
- package/src/core/controller.ts +871 -0
- package/src/core/degraded-reason.ts +81 -0
- package/src/core/extension.ts +376 -0
- package/src/core/freeze-snapshot.ts +213 -0
- package/src/core/handover.ts +132 -0
- package/src/core/issue-form.ts +19 -0
- package/src/core/package-name.ts +9 -0
- package/src/core/poll-cadence.ts +41 -0
- package/src/core/schedule.ts +363 -0
- package/src/core/session-reuse.ts +40 -0
- package/src/core/store.ts +371 -0
- package/src/core/subtask.ts +341 -0
- package/src/core/tasks.ts +843 -0
- package/src/core/use-cases/task-archive.ts +91 -0
- package/src/core/use-cases/task-create.ts +110 -0
- package/src/core/use-cases/task-delete.ts +43 -0
- package/src/core/use-cases/task-parent.ts +65 -0
- package/src/core/use-cases/task-schedule.ts +251 -0
- package/src/core/use-cases/task-tag.ts +110 -0
- package/src/core/use-cases/task-update.ts +126 -0
- package/src/core/verification-budget.ts +115 -0
- package/src/core/verification.ts +1594 -0
- package/src/core/workspace-target.ts +59 -0
- package/src/dsh-home.ts +42 -0
- package/src/host/agent-tools.ts +762 -0
- package/src/host/extension-registry.ts +509 -0
- package/src/host/llm-dispatch.ts +87 -0
- package/src/host/verification-gate.ts +487 -0
- package/src/host/verification-runner.ts +702 -0
- package/src/host/workspace-evidence.ts +176 -0
- package/src/host-ai.ts +158 -0
- package/src/host-ledger.ts +1826 -0
- package/src/host-routes.ts +306 -0
- package/src/host-runner.ts +755 -0
- package/src/host-service.ts +1112 -0
- package/src/http.ts +127 -0
- package/src/index.ts +722 -0
- package/src/loopback.ts +63 -0
- package/src/mount-once.ts +142 -0
- package/src/power-inhibitor.ts +321 -0
- package/src/protocol.ts +591 -0
- package/src/tool-surface.ts +95 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Family-shared chrome for plugin settings cards: a disclosure header naming
|
|
3
|
+
* the plugin and what its settings govern, the controls inside, and the save
|
|
4
|
+
* that writes them. Renders nothing while the namespace is unavailable — a
|
|
5
|
+
* deployment that does not compose the owning plugin should show no trace of
|
|
6
|
+
* it. Inlined into each consumer's client bundle; mirrors the official
|
|
7
|
+
* ui-plugin-config PluginCard in a self-contained slice.
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import type { CardShell } from './settings-form.ts';
|
|
11
|
+
/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */
|
|
12
|
+
export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.unsaved", "settings.readOnly", "settings.saveFailed", "settings.discard", "settings.save", "settings.saving"];
|
|
13
|
+
/** Copy key the card chrome itself reads. */
|
|
14
|
+
export type CardCopyKey = (typeof CARD_COPY_KEYS)[number];
|
|
15
|
+
/** Key domain for the plugin's own copy (inferred per consumer). */
|
|
16
|
+
export type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey;
|
|
17
|
+
/** Card chrome shared by every plugin settings card. */
|
|
18
|
+
export interface PluginSettingsCardProps<TKey extends string = string> {
|
|
19
|
+
/** Locale reader for this card's copy. */
|
|
20
|
+
t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string;
|
|
21
|
+
/** Locale key of the plugin's name. */
|
|
22
|
+
titleKey: TKey;
|
|
23
|
+
/** Locale key of the line describing what this plugin's settings govern. */
|
|
24
|
+
descriptionKey: TKey;
|
|
25
|
+
/** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */
|
|
26
|
+
descriptionNode?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Optional leading mark identifying the plugin. A card without one keeps the
|
|
29
|
+
* plain official header shape, so the chrome stays a readable sibling of the
|
|
30
|
+
* built-in PluginCard wherever a family plugin lands in the official bundle
|
|
31
|
+
* seat.
|
|
32
|
+
*/
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
/** The card's form state: availability, writability, and what a save would do. */
|
|
35
|
+
state: CardShell;
|
|
36
|
+
/** Write every staged edit. */
|
|
37
|
+
onSave: () => void;
|
|
38
|
+
/** Drop every staged edit. */
|
|
39
|
+
onDiscard: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Render the controls expanded on arrival (still collapsible). Defaults to
|
|
42
|
+
* true: promoted first-level sections show their settings immediately.
|
|
43
|
+
*/
|
|
44
|
+
defaultOpen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Render without the collapse affordance: a static header and an always
|
|
47
|
+
* visible body. Used by first-level settings sections whose nav entry
|
|
48
|
+
* already provides the selection.
|
|
49
|
+
*/
|
|
50
|
+
alwaysOpen?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Hide the save/discard footer: cards whose body applies its own changes
|
|
53
|
+
* immediately (an embedded external settings section) have no staged
|
|
54
|
+
* edits, so the footer would sit there permanently disabled.
|
|
55
|
+
*/
|
|
56
|
+
hideFooter?: boolean;
|
|
57
|
+
/** Render children even when the settings namespace is not exposed by the host. */
|
|
58
|
+
renderChildrenWhenNotExposed?: boolean;
|
|
59
|
+
/** Hide the 'not exposed' warning banner when the settings namespace is not exposed. */
|
|
60
|
+
hideNotExposedNotice?: boolean;
|
|
61
|
+
/** The plugin's controls. */
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Render one plugin settings card.
|
|
66
|
+
* @param props - the plugin's copy keys, its form state, and its controls.
|
|
67
|
+
* @returns the card, or nothing while the namespace is still loading.
|
|
68
|
+
*/
|
|
69
|
+
export declare function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>): import("react").JSX.Element | null;
|
|
70
|
+
/** Props every field control needs regardless of its value type. */
|
|
71
|
+
export interface FieldProps {
|
|
72
|
+
/** Stable id associating the label with its control. */
|
|
73
|
+
id: string;
|
|
74
|
+
/** Visible label. */
|
|
75
|
+
label: string;
|
|
76
|
+
/** One-line explanation rendered under the control. */
|
|
77
|
+
hint: string;
|
|
78
|
+
/** Draft text this control renders. */
|
|
79
|
+
text: string;
|
|
80
|
+
/** True when saving would leave a user-layer entry for this field. */
|
|
81
|
+
overridden: boolean;
|
|
82
|
+
/** True when the draft is not a value this field accepts. */
|
|
83
|
+
invalid: boolean;
|
|
84
|
+
/** Copy for the overridden badge. */
|
|
85
|
+
overriddenLabel: string;
|
|
86
|
+
/** Copy for the reset control. */
|
|
87
|
+
resetLabel: string;
|
|
88
|
+
/** Copy shown in place of the hint while the draft is invalid. */
|
|
89
|
+
invalidLabel: string;
|
|
90
|
+
/** Disables every control (read-only document, or an unavailable namespace). */
|
|
91
|
+
disabled: boolean;
|
|
92
|
+
/** Stage draft text. */
|
|
93
|
+
onEdit: (text: string) => void;
|
|
94
|
+
/** Stage a clear so the field re-inherits the composition layer. */
|
|
95
|
+
onReset: () => void;
|
|
96
|
+
}
|
|
97
|
+
/** A staged value field. `numeric` only hints the keypad: which drafts a field accepts is decided by its spec. */
|
|
98
|
+
export declare function ValueField(props: FieldProps & {
|
|
99
|
+
/** Hints a numeric keypad without narrowing what the control accepts. */
|
|
100
|
+
numeric?: boolean;
|
|
101
|
+
/** Placeholder shown while the draft is empty. */
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
}): import("react").JSX.Element;
|
|
104
|
+
interface SelectOption {
|
|
105
|
+
value: string;
|
|
106
|
+
label: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The shared dual-mode select control. While an appearance skin is active it
|
|
110
|
+
* renders the legacy native `<select>` untouched, so element-level skin
|
|
111
|
+
* selectors keep working; under the default appearance it renders a
|
|
112
|
+
* self-drawn `role="listbox"` popup whose open/close is transition-animated.
|
|
113
|
+
* Staged cards reach it through BooleanField/ChoiceField; immediate-apply
|
|
114
|
+
* editors (the side-card prefs) bind it directly through onEdit.
|
|
115
|
+
* 双模式下拉框:皮肤激活时用原生 select,默认外观用自绘动画弹层。
|
|
116
|
+
*/
|
|
117
|
+
export declare function SelectField(props: {
|
|
118
|
+
id: string;
|
|
119
|
+
options: ReadonlyArray<SelectOption>;
|
|
120
|
+
value: string;
|
|
121
|
+
disabled: boolean;
|
|
122
|
+
invalid: boolean;
|
|
123
|
+
onEdit: (text: string) => void;
|
|
124
|
+
}): import("react").JSX.Element;
|
|
125
|
+
/** A staged boolean field: 继承 / 开 / 关. */
|
|
126
|
+
export declare function BooleanField(props: FieldProps & {
|
|
127
|
+
/** Copy for the inherit option. */
|
|
128
|
+
inheritLabel: string;
|
|
129
|
+
/** Copy for the on option. */
|
|
130
|
+
onLabel: string;
|
|
131
|
+
/** Copy for the off option. */
|
|
132
|
+
offLabel: string;
|
|
133
|
+
}): import("react").JSX.Element;
|
|
134
|
+
/** A staged enumerated field rendered as a select. */
|
|
135
|
+
export declare function ChoiceField(props: FieldProps & {
|
|
136
|
+
/** Copy for the inherit option (draft text is the empty string). */
|
|
137
|
+
inheritLabel: string;
|
|
138
|
+
/** Choices rendered in order; `value` is the draft/stored text. */
|
|
139
|
+
choices: ReadonlyArray<{
|
|
140
|
+
value: string;
|
|
141
|
+
label: string;
|
|
142
|
+
}>;
|
|
143
|
+
}): import("react").JSX.Element;
|
|
144
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-board settings for availability, agent announcement, and optional Host
|
|
3
|
+
* idle-sleep protection. Registers into the `web-ui.plugin.item` child slot
|
|
4
|
+
* the Web UI plugin group renders, bound to the `task-board` namespace.
|
|
5
|
+
*/
|
|
6
|
+
import type { InjectFace, PropsLocale, PropsRenderSlots, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
7
|
+
import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
8
|
+
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
9
|
+
import type { TaskBoardExtensionDispatch } from '../core/extension.ts';
|
|
10
|
+
import { type CardActions, type CardShell, type FieldState as CardFieldState } from './settings-form.ts';
|
|
11
|
+
/** The task-board fields this card edits (the namespace's full schema). */
|
|
12
|
+
export interface TaskBoardSettings {
|
|
13
|
+
/** Master switch for the plugin. */
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
/** Whether the board announces itself in every agent's system prompt. */
|
|
16
|
+
announceToAgent?: boolean;
|
|
17
|
+
/** Prevent host idle sleep while sessions run or schedules are armed. */
|
|
18
|
+
preventIdleSleep?: boolean;
|
|
19
|
+
/** Subtask depth limit (1..3); 1 means a single level of subtasks. */
|
|
20
|
+
maxSubtaskDepth?: number;
|
|
21
|
+
/** Roster-poll cadence in seconds while the board has work to reconcile. */
|
|
22
|
+
sessionPollSeconds?: number;
|
|
23
|
+
/**
|
|
24
|
+
* GLOBAL native /goal switch (default off): the master control over whether
|
|
25
|
+
* this board starts a run with dsh's built-in /goal at all. Frozen per
|
|
26
|
+
* execution.
|
|
27
|
+
*/
|
|
28
|
+
goalRunEnabled?: boolean;
|
|
29
|
+
/** Goal acceptance for this board's executions (default on). */
|
|
30
|
+
goalVerification?: boolean;
|
|
31
|
+
/** Judge model route for goal acceptance; blank inherits the host default. */
|
|
32
|
+
goalVerificationModel?: string;
|
|
33
|
+
/** Judge reasoning effort; blank inherits the host default level. */
|
|
34
|
+
goalVerificationReasoningEffort?: string;
|
|
35
|
+
}
|
|
36
|
+
/** What the task-board card renders. */
|
|
37
|
+
export interface TaskBoardSettingsCardState extends CardShell {
|
|
38
|
+
/** Master switch. */
|
|
39
|
+
enabled: CardFieldState;
|
|
40
|
+
/** System-prompt announcement flag. */
|
|
41
|
+
announceToAgent: CardFieldState;
|
|
42
|
+
/** Idle-system-sleep protection flag. */
|
|
43
|
+
preventIdleSleep: CardFieldState;
|
|
44
|
+
/** Subtask depth limit field. */
|
|
45
|
+
maxSubtaskDepth: CardFieldState;
|
|
46
|
+
/** Roster-poll cadence field. */
|
|
47
|
+
sessionPollSeconds: CardFieldState;
|
|
48
|
+
/** GLOBAL native /goal switch. */
|
|
49
|
+
goalRunEnabled: CardFieldState;
|
|
50
|
+
/** Goal-acceptance switch. */
|
|
51
|
+
goalVerification: CardFieldState;
|
|
52
|
+
/** Judge model route field. */
|
|
53
|
+
goalVerificationModel: CardFieldState;
|
|
54
|
+
/** Judge reasoning-effort field. */
|
|
55
|
+
goalVerificationReasoningEffort: CardFieldState;
|
|
56
|
+
}
|
|
57
|
+
/** The registration-side face the card's slot entry injects. */
|
|
58
|
+
export interface TaskBoardSettingsCardFace extends CardActions {
|
|
59
|
+
hooks: {
|
|
60
|
+
/** Card snapshot bound by the renderer as useTaskBoardSettingsCard. */
|
|
61
|
+
taskBoardSettingsCard: SnapshotStore<TaskBoardSettingsCardState>;
|
|
62
|
+
};
|
|
63
|
+
/** Deliver one provider action over the board's same-origin channel. */
|
|
64
|
+
dispatch: TaskBoardExtensionDispatch;
|
|
65
|
+
}
|
|
66
|
+
/** Bridges the `task-board` settings form onto the card's staged form. */
|
|
67
|
+
export declare class TaskBoardSettingsCardController {
|
|
68
|
+
private readonly dispatch;
|
|
69
|
+
private readonly form;
|
|
70
|
+
private readonly store;
|
|
71
|
+
/** @param scope - the bound configuration form for the `task-board` namespace. */
|
|
72
|
+
constructor(scope: ConfigForm<TaskBoardSettings>, dispatch: TaskBoardExtensionDispatch);
|
|
73
|
+
private projection;
|
|
74
|
+
/**
|
|
75
|
+
* Build the face the card's slot registration injects.
|
|
76
|
+
* @returns the card's snapshot and its form actions.
|
|
77
|
+
*/
|
|
78
|
+
inject(): TaskBoardSettingsCardFace;
|
|
79
|
+
/**
|
|
80
|
+
* Release the card's form subscription and bound stores; the slot
|
|
81
|
+
* disposer calls this on teardown.
|
|
82
|
+
*/
|
|
83
|
+
dispose(): void;
|
|
84
|
+
}
|
|
85
|
+
/** Props the renderer binds for the task-board card. */
|
|
86
|
+
export type TaskBoardSettingsCardProps = PropsRuntime<'web-ui.plugin.item'> & PropsLocale<'task-board'> & InjectFace<TaskBoardSettingsCardFace> & PropsRenderSlots<'task-board.settings.section'>;
|
|
87
|
+
/**
|
|
88
|
+
* Render the task-board card.
|
|
89
|
+
* @param props - locale copy, the card snapshot, and its form actions.
|
|
90
|
+
* @returns the card.
|
|
91
|
+
*/
|
|
92
|
+
export declare function TaskBoardSettingsCard(props: TaskBoardSettingsCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-module-instance apply guard for the task-board client bundle.
|
|
3
|
+
*
|
|
4
|
+
* The client factory can run more than once in a single page lifetime (for
|
|
5
|
+
* example when a stale bundle is mixed with a rebuilt one while `dsh web` is
|
|
6
|
+
* restarted). Without a guard, every factory run mounts its own sidebar entry
|
|
7
|
+
* and board view, so the shell ends up showing two "task board" rows.
|
|
8
|
+
*
|
|
9
|
+
* The flag lives on globalThis so separate module instances (independent
|
|
10
|
+
* factory runs) still share one guard. First claim wins; later claims become
|
|
11
|
+
* no-ops until the claim is released (fiber unload / hot-reload) or the page
|
|
12
|
+
* reloads.
|
|
13
|
+
*/
|
|
14
|
+
declare global {
|
|
15
|
+
var __dshTaskboardApplied: boolean | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Claims the plugin apply slot. Returns true when this call won the slot. */
|
|
18
|
+
export declare function claimTaskboardApply(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Releases the claim. Called from the client fiber cleanup so that a
|
|
21
|
+
* hot-reloaded bundle (the loader unloads the old plugin fiber and invokes
|
|
22
|
+
* the rebuilt one in the same page) can claim again instead of being
|
|
23
|
+
* silently dropped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function releaseTaskboardApply(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type OverlayPhase } from './overlay.tsx';
|
|
2
|
+
/** Confirm overlay props. */
|
|
3
|
+
export interface ConfirmDialogProps {
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
confirmLabel: string;
|
|
7
|
+
/** Render the confirm button in the danger style. */
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
/** Which leg of the enter/exit motion pair the surface is on. */
|
|
10
|
+
phase?: OverlayPhase;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
}
|
|
14
|
+
/** Small confirm overlay. */
|
|
15
|
+
export declare function ConfirmDialog({ title, message, confirmLabel, danger, phase, onCancel, onConfirm }: ConfirmDialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
import type { OverlayPhase } from './overlay.tsx';
|
|
4
|
+
/** Edit-task form overlay. */
|
|
5
|
+
export declare function EditTaskModal({ controller, task, onClose, phase }: {
|
|
6
|
+
controller: BoardController;
|
|
7
|
+
task: TaskRecord;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
phase?: OverlayPhase;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/** Edit-tags modal: edit labels only, shown for tasks after first execution. */
|
|
12
|
+
export declare function EditTagsModal({ controller, task, onClose, phase }: {
|
|
13
|
+
controller: BoardController;
|
|
14
|
+
task: TaskRecord;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
phase?: OverlayPhase;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
import { type OverlayPhase } from './overlay.tsx';
|
|
4
|
+
/** Link-subtask overlay props. */
|
|
5
|
+
export interface LinkSubtaskModalProps {
|
|
6
|
+
controller: BoardController;
|
|
7
|
+
/** The task the picked card becomes a subtask of. */
|
|
8
|
+
parent: TaskRecord;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Which leg of the enter/exit motion pair the surface is on. */
|
|
11
|
+
phase?: OverlayPhase;
|
|
12
|
+
}
|
|
13
|
+
/** Link-subtask overlay. */
|
|
14
|
+
export declare function LinkSubtaskModal({ controller, parent, onClose, phase }: LinkSubtaskModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
import type { OverlayPhase } from './overlay.tsx';
|
|
4
|
+
export interface NewTaskModalProps {
|
|
5
|
+
controller: BoardController;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** Optional task template to clone/duplicate from. */
|
|
8
|
+
initialTask?: TaskRecord;
|
|
9
|
+
/**
|
|
10
|
+
* Workspace the board's project filter has selected (#1536): a task created
|
|
11
|
+
* while a project is open belongs to that project unless the user changes it.
|
|
12
|
+
*/
|
|
13
|
+
defaultWorkspaceId?: string;
|
|
14
|
+
/** Optional callback after successful duplication (e.g. to archive source). */
|
|
15
|
+
onDuplicateSuccess?: (sourceTaskId: string) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Task the new card becomes a subtask of ("add subtask" from its detail
|
|
18
|
+
* view). The execution targets start from the parent's and the create action
|
|
19
|
+
* carries the parent link; unset targets inherit again at run time.
|
|
20
|
+
*/
|
|
21
|
+
parentTask?: TaskRecord;
|
|
22
|
+
/** Which leg of the enter/exit motion pair the surface is on. */
|
|
23
|
+
phase?: OverlayPhase;
|
|
24
|
+
}
|
|
25
|
+
/** New-task form overlay. */
|
|
26
|
+
export declare function NewTaskModal({ controller, onClose, initialTask, defaultWorkspaceId, onDuplicateSuccess, parentTask, phase }: NewTaskModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
import { type OverlayPhase } from './overlay.tsx';
|
|
4
|
+
/** One label as the manager lists it: its definition plus how many tasks carry it. */
|
|
5
|
+
export interface TagUsage {
|
|
6
|
+
name: string;
|
|
7
|
+
promptPrefix?: string;
|
|
8
|
+
/** Tasks carrying the label right now. */
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Labels in use, in board order (first occurrence wins, exactly like the
|
|
13
|
+
* filter row), each with its usage count.
|
|
14
|
+
* @param tasks - the whole ledger (board and archive).
|
|
15
|
+
* @returns one row per label.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tagUsage(tasks: readonly TaskRecord[]): TagUsage[];
|
|
18
|
+
/** Label-manager overlay props. */
|
|
19
|
+
export interface TagManagerModalProps {
|
|
20
|
+
controller: BoardController;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
/** Which leg of the enter/exit motion pair the surface is on. */
|
|
23
|
+
phase?: OverlayPhase;
|
|
24
|
+
}
|
|
25
|
+
/** Label-manager overlay. */
|
|
26
|
+
export declare function TagManagerModal({ controller, onClose, phase }: TagManagerModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
/** Sentinel option value of the project row's "register a new project" entry. */
|
|
4
|
+
export declare const NEW_PROJECT_VALUE = "__dsh_new_project__";
|
|
5
|
+
/**
|
|
6
|
+
* Case-insensitive title/description/tag/freeze-snapshot/provider-payload match.
|
|
7
|
+
*
|
|
8
|
+
* A leading `#` is dropped from the needle. Providers render their own
|
|
9
|
+
* identifiers with that prefix (`#1758`) and the board attaches no meaning to
|
|
10
|
+
* it: stripping it keeps the identifier searchable exactly as it is written on
|
|
11
|
+
* screen, without the board learning any provider's vocabulary.
|
|
12
|
+
*/
|
|
13
|
+
export declare function matchesFilter(task: TaskRecord, filter: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether a task carries every selected label (issue #1521). Multi-select is
|
|
16
|
+
* conjunctive: adding a label narrows the board instead of widening it, which
|
|
17
|
+
* is the only reading that keeps "工作" selected from dragging unrelated cards
|
|
18
|
+
* back in when a second label is added.
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchesTagFilter(task: TaskRecord, selected: readonly string[]): boolean;
|
|
21
|
+
/** Cards a grouped column renders before the oldest group folds. */
|
|
22
|
+
export declare const COLUMN_FOLD_THRESHOLD = 30;
|
|
23
|
+
/** Board component; subscribes to the controller snapshot. */
|
|
24
|
+
export declare function TaskBoard({ controller }: {
|
|
25
|
+
controller: BoardController;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TaskRecord } from '../../core/tasks.ts';
|
|
2
|
+
/** Compact relative/absolute time label. */
|
|
3
|
+
export declare function formatHostTimestamp(ms: number, timeZone?: string): string;
|
|
4
|
+
export declare function formatTime(ms: number, timeZone?: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Card time label: relative within a day, otherwise the calendar date read in
|
|
7
|
+
* the Host time zone (the same zone the tooltip and the detail view use), so a
|
|
8
|
+
* card never shows a browser-local date beside a Host-zone tooltip.
|
|
9
|
+
* @param ms - the instant.
|
|
10
|
+
* @param timeZone - Host IANA zone; absent uses the browser zone.
|
|
11
|
+
* @param now - the current instant.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatCardTime(ms: number, timeZone?: string, now?: number): string;
|
|
14
|
+
declare function TaskCardInner({ task, pending, timeZone, onClick, onOpenSession, compact, subtaskCount, isSubtask, subtasksDone, subtasksRunning, subtasksFailed, }: {
|
|
15
|
+
task: TaskRecord;
|
|
16
|
+
pending: boolean;
|
|
17
|
+
timeZone?: string;
|
|
18
|
+
onClick: () => void;
|
|
19
|
+
/** Open an execution session; absent renders the session mark inert. */
|
|
20
|
+
onOpenSession?: (sessionId: string) => void;
|
|
21
|
+
/** Single-line density used by long settled columns. */
|
|
22
|
+
compact?: boolean;
|
|
23
|
+
/** Direct subtasks of this card, shown as a badge (0 hides it). */
|
|
24
|
+
subtaskCount?: number;
|
|
25
|
+
/** Whether this card is itself a subtask. */
|
|
26
|
+
isSubtask?: boolean;
|
|
27
|
+
/** Direct subtasks already settled as done, for the roll-up badge. */
|
|
28
|
+
subtasksDone?: number;
|
|
29
|
+
/** Direct subtasks currently running, for the roll-up badge. */
|
|
30
|
+
subtasksRunning?: number;
|
|
31
|
+
/** Direct subtasks that failed, for the roll-up badge. */
|
|
32
|
+
subtasksFailed?: number;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
/** Memoized card: re-renders only when the card's own task record changes. */
|
|
35
|
+
export declare const TaskCard: import("react").MemoExoticComponent<typeof TaskCardInner>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BoardController } from '../../core/controller.ts';
|
|
2
|
+
import { type TaskRecord } from '../../core/tasks.ts';
|
|
3
|
+
import { type OverlayPhase } from './overlay.tsx';
|
|
4
|
+
/** Task detail overlay. */
|
|
5
|
+
export declare function TaskDetail({ controller, task, phase }: {
|
|
6
|
+
controller: BoardController;
|
|
7
|
+
task: TaskRecord;
|
|
8
|
+
phase?: OverlayPhase;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared task-modal pieces: the overlay shell (backdrop, form, title, error,
|
|
3
|
+
* footer) and the title/description/prompt field trio used by both the
|
|
4
|
+
* NewTaskModal and the EditTaskModal. State stays in the owning modal; these
|
|
5
|
+
* are controlled components.
|
|
6
|
+
*/
|
|
7
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
import { type TaskTag } from '../../core/tasks.ts';
|
|
9
|
+
import { type OverlayPhase } from './overlay.tsx';
|
|
10
|
+
/** Modal overlay: closes on backdrop press, submits through the form. */
|
|
11
|
+
export declare function ModalShell({ ariaLabel, title, error, pending, submitLabel, onSubmit, onClose, secondaryAction, phase, children, }: {
|
|
12
|
+
ariaLabel: string;
|
|
13
|
+
title: string;
|
|
14
|
+
error: string | undefined;
|
|
15
|
+
pending: boolean;
|
|
16
|
+
submitLabel: string;
|
|
17
|
+
onSubmit: () => void;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
/** Optional second action beside the primary submit (e.g. create and run). */
|
|
20
|
+
secondaryAction?: {
|
|
21
|
+
label: string;
|
|
22
|
+
onSubmit: () => void;
|
|
23
|
+
};
|
|
24
|
+
/** Which leg of the enter/exit motion pair the surface is on. */
|
|
25
|
+
phase?: OverlayPhase;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* One collapsible region of a task form (create/edit dialog UX): the form
|
|
30
|
+
* groups its configuration into a few regions instead of stacking every field
|
|
31
|
+
* in one long column, so a normal-sized dialog needs no scrollbar. A collapsed
|
|
32
|
+
* region keeps a one-line summary of the values it holds, so nothing is hidden
|
|
33
|
+
* without a trace; a region holding a blocking error is forced open by its
|
|
34
|
+
* owner (forceOpen) rather than reporting the error out of sight.
|
|
35
|
+
*/
|
|
36
|
+
export declare function CollapsibleSection({ title, summary, defaultOpen, forceOpen, children, }: {
|
|
37
|
+
title: string;
|
|
38
|
+
/** One-line value preview rendered only while the region is collapsed. */
|
|
39
|
+
summary?: string | undefined;
|
|
40
|
+
/** Whether the region starts expanded (the owner's default layout). */
|
|
41
|
+
defaultOpen?: boolean;
|
|
42
|
+
/** Open regardless of the stored state: an error inside must stay visible. */
|
|
43
|
+
forceOpen?: boolean;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
/** Title + description + prompt fields shared by the new and edit task forms. */
|
|
47
|
+
export declare function TaskContentFields({ title, description, prompt, onTitleChange, onDescriptionChange, onPromptChange, }: {
|
|
48
|
+
title: string;
|
|
49
|
+
description: string;
|
|
50
|
+
prompt: string;
|
|
51
|
+
/** Receives the new title; the owner also clears its error state. */
|
|
52
|
+
onTitleChange: (value: string) => void;
|
|
53
|
+
onDescriptionChange: (value: string) => void;
|
|
54
|
+
onPromptChange: (value: string) => void;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* Task labels (issue #1521): one row per label holding the badge name and an
|
|
58
|
+
* optional execution hint. The name inputs offer the labels already used on the
|
|
59
|
+
* board through a datalist, and picking one adopts its hint when the row has
|
|
60
|
+
* none — so a business line is defined once and reused by every later task.
|
|
61
|
+
*/
|
|
62
|
+
export declare function TaskTagFields({ tags, knownTags, onChange, }: {
|
|
63
|
+
tags: TaskTag[];
|
|
64
|
+
/** Labels already carried elsewhere on the board. */
|
|
65
|
+
knownTags: TaskTag[];
|
|
66
|
+
onChange: (tags: TaskTag[]) => void;
|
|
67
|
+
}): import("react").JSX.Element;
|
|
68
|
+
/**
|
|
69
|
+
* Clean a tag list via normalizeTags: trim, drop blanks and duplicates, cap
|
|
70
|
+
* lengths and count, so the wire always carries a valid tag list.
|
|
71
|
+
*/
|
|
72
|
+
export declare function cleanTags(tags: readonly TaskTag[]): TaskTag[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One execution's goal-acceptance report.
|
|
3
|
+
*
|
|
4
|
+
* Rendered inside the execution-history row, so a rerun or a scheduled run
|
|
5
|
+
* keeps its OWN report and a later cycle never overwrites an earlier verdict.
|
|
6
|
+
* It shows what the board decided and the evidence it decided on: the verdict,
|
|
7
|
+
* the judge route and reasoning level, the acceptance count, the total and
|
|
8
|
+
* per-criterion scores against their threshold, the findings the judge located,
|
|
9
|
+
* the evidence scope with its truncation, and the token usage.
|
|
10
|
+
*
|
|
11
|
+
* Deliberately adds no new `data-dsh-part` value: the part enum is owned by the
|
|
12
|
+
* cross-repository semantic-attribute contract, and this report reuses the
|
|
13
|
+
* execution row's existing markup instead of extending that enum.
|
|
14
|
+
*/
|
|
15
|
+
import { type ExecutionVerification } from '../../core/verification.ts';
|
|
16
|
+
/**
|
|
17
|
+
* Render one execution's acceptance report.
|
|
18
|
+
* @param props - the execution's persisted acceptance block.
|
|
19
|
+
* @returns the report, or nothing when acceptance never applied.
|
|
20
|
+
*/
|
|
21
|
+
export declare function VerificationReport({ verification }: {
|
|
22
|
+
verification: ExecutionVerification;
|
|
23
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card view model: the pure derivations a task card renders from its record.
|
|
3
|
+
*
|
|
4
|
+
* Everything here is a function of the task record (plus the clock and the
|
|
5
|
+
* Host time zone for the recency groups), so the card stays a thin renderer and
|
|
6
|
+
* every rule is unit-testable without mounting React. Nothing here writes the
|
|
7
|
+
* record: the type prefix, the tone and the time label are presentation only.
|
|
8
|
+
*
|
|
9
|
+
* @module @fish-under-sea/dsh-client-ui-task-board-fish/client/board/card-view
|
|
10
|
+
*/
|
|
11
|
+
import { type ExecutionOutcome, type ExecutionRecord, type TaskRecord, type TaskStatus } from '../../core/tasks.ts';
|
|
12
|
+
import type { TaskBoardKey } from '../locales.ts';
|
|
13
|
+
/** A title split into its bracketed type prefix and the remaining text. */
|
|
14
|
+
export interface TitleParts {
|
|
15
|
+
/** Bracketed type prefix such as `Bug` from `[Bug]: ...`; absent when none. */
|
|
16
|
+
kind?: string;
|
|
17
|
+
/** Title text without the prefix (the whole title when there is no prefix). */
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Split an issue-form style type prefix off a title. The prefix becomes a
|
|
22
|
+
* badge, so the clamped title lines carry the text the reader scans for. A
|
|
23
|
+
* title that is only a prefix keeps its full text.
|
|
24
|
+
* @param summary - the plain-text title.
|
|
25
|
+
* @returns the prefix (when present) and the remaining title text.
|
|
26
|
+
*/
|
|
27
|
+
export declare function splitTitleKind(summary: string): TitleParts;
|
|
28
|
+
/** Stripe tone of a card: the state of its latest execution. */
|
|
29
|
+
export type CardTone = 'running' | ExecutionOutcome;
|
|
30
|
+
/** What the card reports about its latest execution. */
|
|
31
|
+
export interface CardOutcome {
|
|
32
|
+
/** Stripe tone; absent on an archived card or a card that never ran. */
|
|
33
|
+
tone?: CardTone;
|
|
34
|
+
/** The latest execution record, when the card ran at least once. */
|
|
35
|
+
latest?: ExecutionRecord;
|
|
36
|
+
/**
|
|
37
|
+
* The column disagrees with the latest settled run: a card in Done whose last
|
|
38
|
+
* run did not succeed, or a card in Failed whose last run succeeded. The
|
|
39
|
+
* column was then set by hand or by a provider (a closed issue), and the
|
|
40
|
+
* card says so instead of letting a red run count read as a contradiction.
|
|
41
|
+
*/
|
|
42
|
+
declared: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Derive the card's execution outcome.
|
|
46
|
+
* @param task - the task record.
|
|
47
|
+
* @param archived - whether the card renders in the archive view.
|
|
48
|
+
*/
|
|
49
|
+
export declare function cardOutcome(task: TaskRecord, archived: boolean): CardOutcome;
|
|
50
|
+
/** Locale key of the latest settled result shown before the run count. */
|
|
51
|
+
export declare const RESULT_KEY: Record<ExecutionOutcome, TaskBoardKey>;
|
|
52
|
+
/** The one time a card shows, and what that time means. */
|
|
53
|
+
export interface CardTimeline {
|
|
54
|
+
/** Locale key with a `{time}` placeholder. */
|
|
55
|
+
key: TaskBoardKey;
|
|
56
|
+
/** The instant (ms epoch). */
|
|
57
|
+
at: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Pick the time that tells cards in the same column apart. `updatedAt` moves
|
|
61
|
+
* on every provider sync, so a column of synced cards would all read
|
|
62
|
+
* "updated 4m"; each column instead shows the instant its cards differ by:
|
|
63
|
+
* planning columns the creation time, an executing card its start, settled
|
|
64
|
+
* columns the latest run's settlement, the archive the archive time.
|
|
65
|
+
* @param task - the task record.
|
|
66
|
+
* @param archived - whether the card renders in the archive view.
|
|
67
|
+
*/
|
|
68
|
+
export declare function cardTimeline(task: TaskRecord, archived: boolean): CardTimeline;
|
|
69
|
+
/** Recency bucket of a settled card. */
|
|
70
|
+
export type RecencyGroup = 'today' | 'week' | 'earlier';
|
|
71
|
+
/** Group order, newest first. */
|
|
72
|
+
export declare const RECENCY_GROUPS: readonly RecencyGroup[];
|
|
73
|
+
/** Locale key of each recency group header. */
|
|
74
|
+
export declare const RECENCY_KEY: Record<RecencyGroup, TaskBoardKey>;
|
|
75
|
+
/**
|
|
76
|
+
* Bucket an instant: the same Host calendar day as now, the last seven days, or
|
|
77
|
+
* earlier.
|
|
78
|
+
* @param at - the instant to bucket.
|
|
79
|
+
* @param now - the current instant.
|
|
80
|
+
* @param timeZone - Host IANA zone the calendar day is read in.
|
|
81
|
+
*/
|
|
82
|
+
export declare function recencyGroup(at: number, now: number, timeZone?: string): RecencyGroup;
|
|
83
|
+
/** One recency group and its items, newest first. */
|
|
84
|
+
export interface RecencyBucket<T> {
|
|
85
|
+
group: RecencyGroup;
|
|
86
|
+
items: T[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sort items newest first and split them into recency groups; empty groups are
|
|
90
|
+
* omitted.
|
|
91
|
+
* @param items - the items to group.
|
|
92
|
+
* @param at - the instant each item is ordered and bucketed by.
|
|
93
|
+
* @param now - the current instant.
|
|
94
|
+
* @param timeZone - Host IANA zone.
|
|
95
|
+
*/
|
|
96
|
+
export declare function groupByRecency<T>(items: readonly T[], at: (item: T) => number, now: number, timeZone?: string): RecencyBucket<T>[];
|
|
97
|
+
/** Columns that render compact by default: the long settled column. */
|
|
98
|
+
export declare const DEFAULT_COMPACT_COLUMNS: readonly TaskStatus[];
|
|
99
|
+
/** Browser storage key of the per-column density choice. */
|
|
100
|
+
export declare const COMPACT_COLUMNS_KEY = "dsh.taskBoard.compactColumns.v1";
|
|
101
|
+
/**
|
|
102
|
+
* Read the columns the user set to compact. A missing, unreadable or malformed
|
|
103
|
+
* value falls back to the default rather than failing the board.
|
|
104
|
+
* @param storage - browser storage (absent outside a browser).
|
|
105
|
+
*/
|
|
106
|
+
export declare function readCompactColumns(storage: Pick<Storage, 'getItem'> | undefined): TaskStatus[];
|
|
107
|
+
/**
|
|
108
|
+
* Persist the compact columns; a storage failure (quota, privacy mode) only
|
|
109
|
+
* loses the preference.
|
|
110
|
+
* @param storage - browser storage (absent outside a browser).
|
|
111
|
+
* @param columns - the compact columns.
|
|
112
|
+
*/
|
|
113
|
+
export declare function writeCompactColumns(storage: Pick<Storage, 'setItem'> | undefined, columns: readonly TaskStatus[]): void;
|