dsh-input-traffic 0.2.2 → 0.2.4
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/lib/client.js +303 -53
- package/lib/client.js.map +1 -1
- package/lib/types/client/freeze-button.d.ts +1 -1
- package/lib/types/client/freeze-button.d.ts.map +1 -1
- package/lib/types/client/freeze-button.js +11 -6
- package/lib/types/client/freeze-button.js.map +1 -1
- package/lib/types/client/freeze-store.d.ts +24 -7
- package/lib/types/client/freeze-store.d.ts.map +1 -1
- package/lib/types/client/freeze-store.js +62 -0
- package/lib/types/client/freeze-store.js.map +1 -1
- package/lib/types/client/steer-queue-dock.d.ts.map +1 -1
- package/lib/types/client/steer-queue-dock.js +32 -3
- package/lib/types/client/steer-queue-dock.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -136,6 +136,63 @@ window.__ModuleLoader__.load({
|
|
|
136
136
|
for (const listener of listeners) listener();
|
|
137
137
|
}
|
|
138
138
|
};
|
|
139
|
+
/** Edit one detached queued message's text in place. */
|
|
140
|
+
function updatePendingAt(index, text) {
|
|
141
|
+
const pending = [...state.pending];
|
|
142
|
+
if (index < 0 || index >= pending.length) return;
|
|
143
|
+
const entry = pending[index];
|
|
144
|
+
if (entry === void 0) return;
|
|
145
|
+
pending[index] = {
|
|
146
|
+
...entry,
|
|
147
|
+
text
|
|
148
|
+
};
|
|
149
|
+
state = {
|
|
150
|
+
...state,
|
|
151
|
+
pending
|
|
152
|
+
};
|
|
153
|
+
emit();
|
|
154
|
+
}
|
|
155
|
+
/** Change one detached queued message's planned insertion tier. */
|
|
156
|
+
function setTierAt(index, tier) {
|
|
157
|
+
const pending = [...state.pending];
|
|
158
|
+
if (index < 0 || index >= pending.length) return;
|
|
159
|
+
const entry = pending[index];
|
|
160
|
+
if (entry === void 0) return;
|
|
161
|
+
pending[index] = {
|
|
162
|
+
...entry,
|
|
163
|
+
tier
|
|
164
|
+
};
|
|
165
|
+
state = {
|
|
166
|
+
...state,
|
|
167
|
+
pending
|
|
168
|
+
};
|
|
169
|
+
emit();
|
|
170
|
+
}
|
|
171
|
+
/** Remove one detached queued message. */
|
|
172
|
+
function removePendingAt(index) {
|
|
173
|
+
if (index < 0 || index >= state.pending.length) return;
|
|
174
|
+
state = {
|
|
175
|
+
...state,
|
|
176
|
+
pending: state.pending.filter((_, i) => i !== index)
|
|
177
|
+
};
|
|
178
|
+
emit();
|
|
179
|
+
}
|
|
180
|
+
/** Move one detached queued message to a new position (reorder while frozen). */
|
|
181
|
+
function movePending(from, to) {
|
|
182
|
+
if (from === to) return;
|
|
183
|
+
const pending = [...state.pending];
|
|
184
|
+
const [moved] = pending.splice(from, 1);
|
|
185
|
+
if (moved === void 0) return;
|
|
186
|
+
pending.splice(to, 0, moved);
|
|
187
|
+
state = {
|
|
188
|
+
...state,
|
|
189
|
+
pending
|
|
190
|
+
};
|
|
191
|
+
emit();
|
|
192
|
+
}
|
|
193
|
+
function emit() {
|
|
194
|
+
for (const listener of listeners) listener();
|
|
195
|
+
}
|
|
139
196
|
//#endregion
|
|
140
197
|
//#region \0dsh-css:E:\test\rewrite-agently\dsh-input-traffic\src\client\steer-queue-dock.module.css.mjs
|
|
141
198
|
const css$1 = ".cev0eq_dock{width:100%}.cev0eq_panel{background:var(--ds-color-surface,#fffc);border:1px solid var(--ds-color-border,#00000014);border-radius:10px;overflow:hidden}.cev0eq_toolbar{border-bottom:1px solid var(--ds-color-border,#0000000f);align-items:center;gap:8px;padding:4px 8px;display:flex}.cev0eq_header{color:var(--ds-color-text-secondary,#6b7280);cursor:pointer;background:0 0;border:0;align-items:center;gap:6px;padding:2px 6px;font-size:12px;display:inline-flex}.cev0eq_header:disabled{cursor:default}.cev0eq_lead{color:var(--ds-color-text-tertiary,#9ca3af);display:inline-flex}.cev0eq_count{font-weight:600}.cev0eq_chevron{color:var(--ds-color-text-tertiary,#9ca3af);display:inline-flex}.cev0eq_toolbarActions{margin-left:auto}.cev0eq_clear{color:var(--ds-color-text-secondary,#6b7280);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;align-items:center;gap:4px;padding:3px 8px;font-size:12px;display:inline-flex}.cev0eq_freeze{border:1px solid var(--ds-color-border,#0000001f);color:var(--ds-color-text-secondary,#6b7280);cursor:pointer;background:0 0;border-radius:6px;align-items:center;gap:4px;padding:3px 8px;font-size:12px;display:inline-flex}.cev0eq_freeze[aria-pressed=true]{border-color:var(--ds-steer-green,#30a46c);color:var(--ds-steer-green,#30a46c)}.cev0eq_freeze:hover:not(:disabled){background:var(--ds-color-surface-hover,#0000000a)}.cev0eq_freeze:disabled{opacity:.5;cursor:default}.cev0eq_frozenBanner{border-bottom:1px solid var(--ds-color-border,#0000000f);background:color-mix(in srgb, var(--ds-steer-green,#30a46c) 8%, transparent);color:var(--ds-steer-green,#30a46c);padding:4px 10px;font-size:12px}.cev0eq_frozenList{margin:0;padding:4px;list-style:none}.cev0eq_frozenRow{border-radius:6px;align-items:center;gap:8px;padding:4px 6px;display:flex}.cev0eq_frozenMark{color:var(--ds-color-text-tertiary,#9ca3af);flex:none;margin-left:auto;font-size:11px}.cev0eq_clear:hover:not(:disabled){border-color:var(--ds-color-border,#0000001f);background:var(--ds-color-surface-hover,#0000000a)}.cev0eq_clear:disabled{opacity:.5;cursor:default}.cev0eq_clearConfirm{border-color:var(--ds-steer-red,#e5484d);color:var(--ds-steer-red,#e5484d)}.cev0eq_clearConfirm:hover:not(:disabled){border-color:var(--ds-steer-red,#e5484d);background:color-mix(in srgb, var(--ds-steer-red,#e5484d) 8%, transparent)}.cev0eq_clearCancel{color:var(--ds-color-text-secondary,#6b7280);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;align-items:center;gap:4px;padding:3px 8px;font-size:12px;display:inline-flex}.cev0eq_clearCancel:hover:not(:disabled){background:var(--ds-color-surface-hover,#0000000a)}.cev0eq_clearLabel{font-size:12px}.cev0eq_list{margin:0;padding:4px;list-style:none}.cev0eq_row{border-radius:6px;align-items:center;gap:8px;padding:4px 6px;display:flex}.cev0eq_row[draggable=true]{cursor:grab}.cev0eq_row[draggable=true]:active{cursor:grabbing}.cev0eq_rowDragOver{outline:2px dashed var(--ds-color-border-strong,#00000040);outline-offset:-2px;background:var(--ds-color-surface-hover,#0000000d)}.cev0eq_row:hover{background:var(--ds-color-surface-hover,#00000008)}.cev0eq_row[data-editing]{align-items:flex-start}.cev0eq_preview{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--ds-color-text,#1f2937);flex:1;font-size:13px;overflow:hidden}.cev0eq_badge{white-space:nowrap;border-radius:999px;flex:none;align-items:center;gap:4px;padding:1px 6px;font-size:11px;line-height:16px;display:inline-flex}.cev0eq_badgeLabel{color:inherit}.cev0eq_badgeNow{color:var(--ds-steer-red,#e5484d);background:color-mix(in srgb, var(--ds-steer-red,#e5484d) 10%, transparent)}.cev0eq_badgeNext{color:var(--ds-steer-yellow,#e8a33d);background:color-mix(in srgb, var(--ds-steer-yellow,#e8a33d) 12%, transparent)}.cev0eq_badgeLater{color:var(--ds-steer-green,#30a46c);background:color-mix(in srgb, var(--ds-steer-green,#30a46c) 12%, transparent)}.cev0eq_badgeNow .cev0eq_dot{background:var(--ds-steer-red,#e5484d)}.cev0eq_badgeNext .cev0eq_dot{background:var(--ds-steer-yellow,#e8a33d)}.cev0eq_badgeLater .cev0eq_dot{background:var(--ds-steer-green,#30a46c)}.cev0eq_steeringList{margin:0;padding:0 4px 4px;list-style:none}.cev0eq_steeringList .cev0eq_row{opacity:.85}.cev0eq_editor{border:1px solid var(--ds-color-border,#00000026);background:var(--ds-color-surface,#fff);resize:none;border-radius:6px;flex:1;min-width:0;max-height:160px;padding:4px 6px;font-size:13px;line-height:20px;overflow-y:auto}.cev0eq_actions{align-items:center;gap:2px;display:inline-flex}.cev0eq_action{width:24px;height:24px;color:var(--ds-color-text-tertiary,#9ca3af);cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;display:inline-flex}.cev0eq_action:hover:not(:disabled){background:var(--ds-color-surface-hover,#0000000d);color:var(--ds-color-text,#1f2937)}.cev0eq_action:disabled{opacity:.4;cursor:default}.cev0eq_plan{border-left:1px solid var(--ds-color-border,#00000014);align-items:center;gap:2px;margin-left:4px;padding-left:6px;display:inline-flex}.cev0eq_tier{cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;justify-content:center;align-items:center;width:20px;height:20px;padding:0;display:inline-flex}.cev0eq_tier:hover:not(:disabled){border-color:var(--ds-color-border,#0003)}.cev0eq_tier:disabled{cursor:default}.cev0eq_tierLater{border-color:var(--ds-steer-green,#30a46c);background:color-mix(in srgb, var(--ds-steer-green,#30a46c) 12%, transparent)}.cev0eq_dot{border-radius:50%;width:10px;height:10px}.cev0eq_tierNow .cev0eq_dot{background:var(--ds-steer-red,#e5484d)}.cev0eq_tierNext .cev0eq_dot{background:var(--ds-steer-yellow,#e8a33d)}.cev0eq_tierLater .cev0eq_dot{background:var(--ds-steer-green,#30a46c)}";
|
|
@@ -148,42 +205,42 @@ window.__ModuleLoader__.load({
|
|
|
148
205
|
document.head.appendChild(tag);
|
|
149
206
|
}
|
|
150
207
|
var steer_queue_dock_module_css_default = {
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
208
|
+
"rowDragOver": "cev0eq_rowDragOver",
|
|
209
|
+
"steeringList": "cev0eq_steeringList",
|
|
210
|
+
"action": "cev0eq_action",
|
|
211
|
+
"clearCancel": "cev0eq_clearCancel",
|
|
212
|
+
"preview": "cev0eq_preview",
|
|
213
|
+
"badgeLabel": "cev0eq_badgeLabel",
|
|
214
|
+
"toolbarActions": "cev0eq_toolbarActions",
|
|
215
|
+
"freeze": "cev0eq_freeze",
|
|
156
216
|
"chevron": "cev0eq_chevron",
|
|
217
|
+
"dock": "cev0eq_dock",
|
|
157
218
|
"tier": "cev0eq_tier",
|
|
219
|
+
"badge": "cev0eq_badge",
|
|
220
|
+
"list": "cev0eq_list",
|
|
221
|
+
"frozenList": "cev0eq_frozenList",
|
|
222
|
+
"clearConfirm": "cev0eq_clearConfirm",
|
|
223
|
+
"badgeNext": "cev0eq_badgeNext",
|
|
224
|
+
"frozenBanner": "cev0eq_frozenBanner",
|
|
158
225
|
"toolbar": "cev0eq_toolbar",
|
|
226
|
+
"tierNext": "cev0eq_tierNext",
|
|
159
227
|
"tierNow": "cev0eq_tierNow",
|
|
160
|
-
"
|
|
161
|
-
"action": "cev0eq_action",
|
|
162
|
-
"panel": "cev0eq_panel",
|
|
228
|
+
"clearLabel": "cev0eq_clearLabel",
|
|
163
229
|
"clear": "cev0eq_clear",
|
|
164
|
-
"tierNext": "cev0eq_tierNext",
|
|
165
|
-
"lead": "cev0eq_lead",
|
|
166
|
-
"tierLater": "cev0eq_tierLater",
|
|
167
|
-
"freeze": "cev0eq_freeze",
|
|
168
|
-
"frozenList": "cev0eq_frozenList",
|
|
169
|
-
"badgeLabel": "cev0eq_badgeLabel",
|
|
170
|
-
"plan": "cev0eq_plan",
|
|
171
230
|
"row": "cev0eq_row",
|
|
231
|
+
"badgeNow": "cev0eq_badgeNow",
|
|
172
232
|
"header": "cev0eq_header",
|
|
173
|
-
"
|
|
174
|
-
"rowDragOver": "cev0eq_rowDragOver",
|
|
175
|
-
"toolbarActions": "cev0eq_toolbarActions",
|
|
176
|
-
"frozenBanner": "cev0eq_frozenBanner",
|
|
233
|
+
"frozenMark": "cev0eq_frozenMark",
|
|
177
234
|
"badgeLater": "cev0eq_badgeLater",
|
|
178
|
-
"steeringList": "cev0eq_steeringList",
|
|
179
|
-
"badge": "cev0eq_badge",
|
|
180
|
-
"frozenRow": "cev0eq_frozenRow",
|
|
181
|
-
"list": "cev0eq_list",
|
|
182
|
-
"badgeNow": "cev0eq_badgeNow",
|
|
183
|
-
"preview": "cev0eq_preview",
|
|
184
235
|
"dot": "cev0eq_dot",
|
|
185
|
-
"
|
|
186
|
-
"
|
|
236
|
+
"actions": "cev0eq_actions",
|
|
237
|
+
"panel": "cev0eq_panel",
|
|
238
|
+
"editor": "cev0eq_editor",
|
|
239
|
+
"lead": "cev0eq_lead",
|
|
240
|
+
"tierLater": "cev0eq_tierLater",
|
|
241
|
+
"plan": "cev0eq_plan",
|
|
242
|
+
"frozenRow": "cev0eq_frozenRow",
|
|
243
|
+
"count": "cev0eq_count"
|
|
187
244
|
};
|
|
188
245
|
//#endregion
|
|
189
246
|
//#region src/client/steer-queue-dock.tsx
|
|
@@ -267,7 +324,7 @@ window.__ModuleLoader__.load({
|
|
|
267
324
|
const editorRef = (0, react.useRef)(null);
|
|
268
325
|
(0, react.useEffect)(() => {
|
|
269
326
|
if (queue.length === 0 && !collapsed) setCollapsed(true);
|
|
270
|
-
if (editing !== null && (!queueMutable || !queue.some((row) => row.id === editing.id))) setEditing(null);
|
|
327
|
+
if (editing !== null && !editing.id.startsWith("frozen:") && (!queueMutable || !queue.some((row) => row.id === editing.id))) setEditing(null);
|
|
271
328
|
}, [
|
|
272
329
|
collapsed,
|
|
273
330
|
editing,
|
|
@@ -442,6 +499,17 @@ window.__ModuleLoader__.load({
|
|
|
442
499
|
if (confirmTimer.current !== null) clearTimeout(confirmTimer.current);
|
|
443
500
|
setConfirmClear(false);
|
|
444
501
|
};
|
|
502
|
+
/** Save an in-place edit of one detached (frozen) queued message. */
|
|
503
|
+
const saveFrozenEdit = async (index) => {
|
|
504
|
+
if (editing === null) return;
|
|
505
|
+
const text = editing.text.trim();
|
|
506
|
+
if (text === "") {
|
|
507
|
+
setEditing(null);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
updatePendingAt(index, text);
|
|
511
|
+
setEditing(null);
|
|
512
|
+
};
|
|
445
513
|
/**
|
|
446
514
|
* Pull one queued row back into the composer draft for editing: the text
|
|
447
515
|
* back-fills the input box and the row leaves the queue; the user edits and
|
|
@@ -542,28 +610,204 @@ window.__ModuleLoader__.load({
|
|
|
542
610
|
frozen && frozenPending.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
543
611
|
className: steer_queue_dock_module_css_default.frozenList,
|
|
544
612
|
"data-testid": "frozen-list",
|
|
545
|
-
children: frozenPending.map((
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
613
|
+
children: frozenPending.map((entry, i) => {
|
|
614
|
+
const editingFrozen = editing?.id === `frozen:${i}`;
|
|
615
|
+
const text = entry.text;
|
|
616
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
617
|
+
className: steer_queue_dock_module_css_default.frozenRow,
|
|
618
|
+
"data-tier": entry.tier === "force" ? "now" : entry.tier === "safe_point" ? "next" : "later",
|
|
619
|
+
"data-editing": editingFrozen ? "" : void 0,
|
|
620
|
+
children: [
|
|
621
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
622
|
+
className: steer_queue_dock_module_css_default.lead,
|
|
623
|
+
"aria-hidden": true,
|
|
624
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconQueueOutline14, {})
|
|
625
|
+
}),
|
|
626
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SteerBadge, {
|
|
627
|
+
tier: entry.tier === "force" ? "now" : entry.tier === "safe_point" ? "next" : "later",
|
|
628
|
+
t
|
|
629
|
+
}),
|
|
630
|
+
editingFrozen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
631
|
+
ref: editorRef,
|
|
632
|
+
autoFocus: true,
|
|
633
|
+
className: steer_queue_dock_module_css_default.editor,
|
|
634
|
+
"aria-label": t("queue.edit"),
|
|
635
|
+
rows: 1,
|
|
636
|
+
value: editing?.text ?? text,
|
|
637
|
+
onChange: (event) => {
|
|
638
|
+
setEditing({
|
|
639
|
+
id: `frozen:${i}`,
|
|
640
|
+
text: event.currentTarget.value
|
|
641
|
+
});
|
|
642
|
+
},
|
|
643
|
+
onInput: (event) => {
|
|
644
|
+
resizeEditor(event.currentTarget);
|
|
645
|
+
},
|
|
646
|
+
onKeyDown: (event) => {
|
|
647
|
+
if (event.key === "Escape") {
|
|
648
|
+
setEditing(null);
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
|
|
652
|
+
event.preventDefault();
|
|
653
|
+
saveFrozenEdit(i);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
657
|
+
className: steer_queue_dock_module_css_default.preview,
|
|
658
|
+
children: text
|
|
659
|
+
}),
|
|
660
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
661
|
+
className: steer_queue_dock_module_css_default.actions,
|
|
662
|
+
children: editingFrozen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
663
|
+
label: t("queue.save"),
|
|
664
|
+
side: "bottom",
|
|
665
|
+
delayMs: 500,
|
|
666
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
667
|
+
type: "button",
|
|
668
|
+
className: steer_queue_dock_module_css_default.action,
|
|
669
|
+
"aria-label": t("queue.save"),
|
|
670
|
+
disabled: editing === null || editing.text.trim() === "",
|
|
671
|
+
onClick: () => {
|
|
672
|
+
saveFrozenEdit(i);
|
|
673
|
+
},
|
|
674
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 14 })
|
|
675
|
+
})
|
|
676
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
677
|
+
label: t("queue.cancelEdit"),
|
|
678
|
+
side: "bottom",
|
|
679
|
+
delayMs: 500,
|
|
680
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
681
|
+
type: "button",
|
|
682
|
+
className: steer_queue_dock_module_css_default.action,
|
|
683
|
+
"aria-label": t("queue.cancelEdit"),
|
|
684
|
+
onClick: () => {
|
|
685
|
+
setEditing(null);
|
|
686
|
+
},
|
|
687
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 14 })
|
|
688
|
+
})
|
|
689
|
+
})] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
690
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
691
|
+
label: t("steer.moveUp"),
|
|
692
|
+
side: "bottom",
|
|
693
|
+
delayMs: 500,
|
|
694
|
+
disabled: i === 0,
|
|
695
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
696
|
+
type: "button",
|
|
697
|
+
className: steer_queue_dock_module_css_default.action,
|
|
698
|
+
"aria-label": t("steer.moveUp"),
|
|
699
|
+
disabled: i === 0,
|
|
700
|
+
onClick: () => movePending(i, i - 1),
|
|
701
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronUpOutline14, {})
|
|
702
|
+
})
|
|
703
|
+
}),
|
|
704
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
705
|
+
label: t("steer.moveDown"),
|
|
706
|
+
side: "bottom",
|
|
707
|
+
delayMs: 500,
|
|
708
|
+
disabled: i === frozenPending.length - 1,
|
|
709
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
710
|
+
type: "button",
|
|
711
|
+
className: steer_queue_dock_module_css_default.action,
|
|
712
|
+
"aria-label": t("steer.moveDown"),
|
|
713
|
+
disabled: i === frozenPending.length - 1,
|
|
714
|
+
onClick: () => movePending(i, i + 1),
|
|
715
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {})
|
|
716
|
+
})
|
|
717
|
+
}),
|
|
718
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
719
|
+
label: t("queue.edit"),
|
|
720
|
+
side: "bottom",
|
|
721
|
+
delayMs: 500,
|
|
722
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
723
|
+
type: "button",
|
|
724
|
+
className: steer_queue_dock_module_css_default.action,
|
|
725
|
+
"aria-label": t("queue.edit"),
|
|
726
|
+
onClick: () => {
|
|
727
|
+
setEditing({
|
|
728
|
+
id: `frozen:${i}`,
|
|
729
|
+
text
|
|
730
|
+
});
|
|
731
|
+
},
|
|
732
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 })
|
|
733
|
+
})
|
|
734
|
+
}),
|
|
735
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
736
|
+
label: t("queue.remove"),
|
|
737
|
+
side: "bottom",
|
|
738
|
+
delayMs: 500,
|
|
739
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
740
|
+
type: "button",
|
|
741
|
+
className: steer_queue_dock_module_css_default.action,
|
|
742
|
+
"aria-label": t("queue.remove"),
|
|
743
|
+
onClick: () => removePendingAt(i),
|
|
744
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 })
|
|
745
|
+
})
|
|
746
|
+
}),
|
|
747
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
748
|
+
className: steer_queue_dock_module_css_default.plan,
|
|
749
|
+
role: "group",
|
|
750
|
+
"aria-label": t("steer.later.aria"),
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
753
|
+
label: t("steer.now"),
|
|
754
|
+
side: "bottom",
|
|
755
|
+
delayMs: 500,
|
|
756
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
757
|
+
type: "button",
|
|
758
|
+
className: `${steer_queue_dock_module_css_default.tier} ${steer_queue_dock_module_css_default.tierNow}`,
|
|
759
|
+
"aria-label": t("steer.now"),
|
|
760
|
+
"aria-pressed": entry.tier === "force" || void 0,
|
|
761
|
+
onClick: () => setTierAt(i, "force"),
|
|
762
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
763
|
+
className: steer_queue_dock_module_css_default.dot,
|
|
764
|
+
"aria-hidden": true
|
|
765
|
+
})
|
|
766
|
+
})
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
769
|
+
label: t("steer.next"),
|
|
770
|
+
side: "bottom",
|
|
771
|
+
delayMs: 500,
|
|
772
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
773
|
+
type: "button",
|
|
774
|
+
className: `${steer_queue_dock_module_css_default.tier} ${steer_queue_dock_module_css_default.tierNext}`,
|
|
775
|
+
"aria-label": t("steer.next"),
|
|
776
|
+
"aria-pressed": entry.tier === "safe_point" || void 0,
|
|
777
|
+
onClick: () => setTierAt(i, "safe_point"),
|
|
778
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
779
|
+
className: steer_queue_dock_module_css_default.dot,
|
|
780
|
+
"aria-hidden": true
|
|
781
|
+
})
|
|
782
|
+
})
|
|
783
|
+
}),
|
|
784
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
785
|
+
label: t("steer.later"),
|
|
786
|
+
side: "bottom",
|
|
787
|
+
delayMs: 500,
|
|
788
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
789
|
+
type: "button",
|
|
790
|
+
className: `${steer_queue_dock_module_css_default.tier} ${steer_queue_dock_module_css_default.tierLater}`,
|
|
791
|
+
"aria-label": t("steer.later"),
|
|
792
|
+
"aria-pressed": entry.tier === "queue" || void 0,
|
|
793
|
+
onClick: () => setTierAt(i, "queue"),
|
|
794
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
795
|
+
className: steer_queue_dock_module_css_default.dot,
|
|
796
|
+
"aria-hidden": true
|
|
797
|
+
})
|
|
798
|
+
})
|
|
799
|
+
})
|
|
800
|
+
]
|
|
801
|
+
})
|
|
802
|
+
] })
|
|
803
|
+
}),
|
|
804
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
805
|
+
className: steer_queue_dock_module_css_default.frozenMark,
|
|
806
|
+
children: t("steer.frozenBadge")
|
|
807
|
+
})
|
|
808
|
+
]
|
|
809
|
+
}, i);
|
|
810
|
+
})
|
|
567
811
|
}),
|
|
568
812
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
569
813
|
id: listId,
|
|
@@ -929,11 +1173,14 @@ window.__ModuleLoader__.load({
|
|
|
929
1173
|
* Freeze/resume toggle for the peak-hour scenario.
|
|
930
1174
|
* @param props - slot props; the session snapshot drives the detach list.
|
|
931
1175
|
*/
|
|
932
|
-
function FreezeButton({ session, updateQueue, send, notify, t }) {
|
|
1176
|
+
function FreezeButton({ session, updateQueue, cancel, send, notify, t }) {
|
|
933
1177
|
const { frozen } = (0, react.useSyncExternalStore)(freezeStore.subscribe, freezeStore.getSnapshot);
|
|
934
1178
|
const freeze = async () => {
|
|
935
1179
|
const queued = session.queue.filter((row) => row.placement === "queued");
|
|
936
|
-
const pending = queued.flatMap((row) => row.text === null ? [] : [
|
|
1180
|
+
const pending = queued.flatMap((row) => row.text === null ? [] : [{
|
|
1181
|
+
text: row.text,
|
|
1182
|
+
tier: "queue"
|
|
1183
|
+
}]);
|
|
937
1184
|
await Promise.all(queued.map((row) => updateQueue(row.id, { kind: "remove" }).catch(() => void 0)));
|
|
938
1185
|
freezeStore.set({
|
|
939
1186
|
frozen: true,
|
|
@@ -947,7 +1194,10 @@ window.__ModuleLoader__.load({
|
|
|
947
1194
|
pending: []
|
|
948
1195
|
});
|
|
949
1196
|
try {
|
|
950
|
-
for (const
|
|
1197
|
+
for (const entry of pending) {
|
|
1198
|
+
if (entry.tier === "force") await cancel();
|
|
1199
|
+
await send(entry.text);
|
|
1200
|
+
}
|
|
951
1201
|
} catch {
|
|
952
1202
|
notify("error", t("steer.resumeFailed"));
|
|
953
1203
|
}
|