dsh-connect-workbuddy 5.18.3 → 5.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +188 -0
- package/README.en.md +12 -8
- package/README.md +16 -9
- package/lib/bin.js +1 -1
- package/lib/client.js +628 -221
- package/lib/{host-heartbeat-DEB3nt25.js → host-heartbeat-hEksLFOK.js} +1 -1
- package/lib/index.js +6 -6
- package/locale/en.json +1 -2
- package/locale/zh.json +1 -2
- package/package.json +2 -3
- package/docs/DETAIL.md +0 -1
- package/docs/DETAIL.zh.md +0 -1
package/lib/client.js
CHANGED
|
@@ -670,30 +670,35 @@ window.__ModuleLoader__.load({
|
|
|
670
670
|
WORKBUDDY_SETTINGS_NS
|
|
671
671
|
];
|
|
672
672
|
/**
|
|
673
|
-
* The
|
|
674
|
-
*
|
|
675
|
-
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
*
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
*
|
|
685
|
-
*
|
|
686
|
-
* `
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
694
|
-
*
|
|
695
|
-
|
|
696
|
-
|
|
673
|
+
* The `id` of this plugin's page in the Settings panel's left-hand navigation.
|
|
674
|
+
*
|
|
675
|
+
* ## Why the configuration moved here (5.19.0)
|
|
676
|
+
*
|
|
677
|
+
* It used to live ONLY in the Plugins page's `plugins.bundle.config` /
|
|
678
|
+
* `plugins.row.config` keyed slots, looked up by `<package name>`. That is a
|
|
679
|
+
* KEYED slot: the page renders it with `entryKey: pkg.name` and gates the whole
|
|
680
|
+
* section on `ledger.bundles.has(pkg.name)`, an EXACT string comparison against
|
|
681
|
+
* the plugin-manager inventory's package name while a deployment is free to
|
|
682
|
+
* mount the same code under a different Loader entry id. Two spellings had to
|
|
683
|
+
* be registered to cover it (issue #55), and a spelling nobody predicted
|
|
684
|
+
* rendered nothing at all — no section, no placeholder, no error.
|
|
685
|
+
*
|
|
686
|
+
* `settings.section` is a LIST slot keyed by an id **this plugin owns**. There
|
|
687
|
+
* is no inventory name to match, so the whole class of mismatch disappears,
|
|
688
|
+
* and the user finds the configuration where every other preference lives.
|
|
689
|
+
*
|
|
690
|
+
* ## The id is also the icon's address
|
|
691
|
+
*
|
|
692
|
+
* The shell renders `settings.section.icon` with `{ only: row.id }`, so the
|
|
693
|
+
* glyph must register under this same string. Both registrations come from one
|
|
694
|
+
* `inject` callback so the pairing is structural rather than a convention.
|
|
695
|
+
*
|
|
696
|
+
* Deliberately the bare, unnamespaced plugin name and NOT one of
|
|
697
|
+
* {@link WORKBUDDY_SETTINGS_NAMESPACE_CANDIDATES}: those are Loader entry ids
|
|
698
|
+
* the Host happens to serve, while this id is ours and must be stable across
|
|
699
|
+
* deployments.
|
|
700
|
+
*/
|
|
701
|
+
const WORKBUDDY_SETTINGS_SECTION_ID = "dsh-connect-workbuddy";
|
|
697
702
|
//#endregion
|
|
698
703
|
//#region src/client/account-selection.ts
|
|
699
704
|
/**
|
|
@@ -4001,7 +4006,7 @@ window.__ModuleLoader__.load({
|
|
|
4001
4006
|
changeDeviceMode(mode);
|
|
4002
4007
|
}
|
|
4003
4008
|
}, t(mode === "virtual" ? "row.deviceModeVirtual" : "row.deviceModeReal"));
|
|
4004
|
-
})), (0, react.createElement)("span", { className: "dsm-workbuddy-hint" }, modeHintBlocked ? t("row.deviceModeRealUnsupported") : deviceMode === "real" ? t("row.deviceModeHintReal") : t("row.deviceModeHintVirtual"))), (0, react.createElement)("div", { className: `dsm-workbuddy-pool-table${pool.checkinSupported ? " dsm-workbuddy-pool-table-checkin" : ""}` }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-row dsm-workbuddy-pool-row-head" }, (0, react.createElement)("span",
|
|
4009
|
+
})), (0, react.createElement)("span", { className: "dsm-workbuddy-hint" }, modeHintBlocked ? t("row.deviceModeRealUnsupported") : deviceMode === "real" ? t("row.deviceModeHintReal") : t("row.deviceModeHintVirtual"))), (0, react.createElement)("div", { className: `dsm-workbuddy-pool-table${pool.checkinSupported ? " dsm-workbuddy-pool-table-checkin" : ""}` }, (0, react.createElement)("div", { className: "dsm-workbuddy-pool-row dsm-workbuddy-pool-row-head" }, (0, react.createElement)("span", { className: "dsm-workbuddy-pool-col-account" }, t("row.poolColumnAccount")), (0, react.createElement)("span", null, t("row.poolColumnCredits")), (0, react.createElement)("span", null, t("row.poolColumnProbe")), pool.checkinSupported ? (0, react.createElement)("span", null, t("row.poolColumnCheckin")) : null, (0, react.createElement)("span", null)), ...(() => {
|
|
4005
4010
|
const ordered = sortAccountsByOrder(pool.accounts, orderIds);
|
|
4006
4011
|
let memberSeen = 0;
|
|
4007
4012
|
let memberTotal = 0;
|
|
@@ -6176,7 +6181,7 @@ window.__ModuleLoader__.load({
|
|
|
6176
6181
|
.dsm-btn-outline:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:rgba(255,255,255,.04)}
|
|
6177
6182
|
.dsm-btn-primary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}
|
|
6178
6183
|
.dsm-btn-primary:hover:not(:disabled){opacity:.9}
|
|
6179
|
-
.dsm-workbuddy-usage{display:flex;flex-direction:column;gap:16px;margin:0;padding:16px 0 4px}
|
|
6184
|
+
.dsm-workbuddy-usage{--dsm-workbuddy-surface:var(--dsw-alias-bg-layer-1,#17181b);display:flex;flex-direction:column;gap:16px;margin:0;padding:16px 0 4px;background:var(--dsw-alias-bg-layer-1,#17181b);border-radius:12px}
|
|
6180
6185
|
/* The provider bar: one CARD per region, side by side.
|
|
6181
6186
|
*
|
|
6182
6187
|
* COPIED FROM dsh-connect-trae, rule for rule, because an approximation of it
|
|
@@ -6243,12 +6248,47 @@ window.__ModuleLoader__.load({
|
|
|
6243
6248
|
* inactive panel out of the accessibility tree, which is exactly what
|
|
6244
6249
|
* role="tabpanel" wants — unlike display:none reached by a CSS class, it
|
|
6245
6250
|
* cannot be overridden by a later rule. */
|
|
6246
|
-
|
|
6251
|
+
/* No top margin: this row is a flex child of .dsm-workbuddy-usage, whose
|
|
6252
|
+
* column gap already separates it from the paragraph above. The margin stacked
|
|
6253
|
+
* ON TOP of that gap and doubled the distance (measured: 32px where the rhythm
|
|
6254
|
+
* is 16px).
|
|
6255
|
+
*
|
|
6256
|
+
* The bottom rule stays: it is the tabs' underline, not spacing.
|
|
6257
|
+
*
|
|
6258
|
+
* STICKY, so the strip cannot be scrolled away from the sections it switches
|
|
6259
|
+
* (learned from dsh-connect-trae 4.9.0, same migration). This is NOT a decision
|
|
6260
|
+
* to take over scrolling: the Settings panel's own .options column scrolls, and
|
|
6261
|
+
* the card must not add a second scroller inside it — so there is no height:100%
|
|
6262
|
+
* and no overflow here either. But "not scrolling" is not the same as "may
|
|
6263
|
+
* disappear": the pool sits below the fold, and by the time the reader scrolls
|
|
6264
|
+
* down to it the five tabs are off the top, so switching sections means
|
|
6265
|
+
* scrolling the whole page back up first.
|
|
6266
|
+
*
|
|
6267
|
+
* The background is not decoration: it is what stops the rows sliding under a
|
|
6268
|
+
* transparent strip and showing through the gaps between the labels — and under
|
|
6269
|
+
* a wallpaper (issue #209) a transparent one would be unreadable outright.
|
|
6270
|
+
*
|
|
6271
|
+
* It paints --dsm-workbuddy-surface, NOT a hard-coded layer. That variable is
|
|
6272
|
+
* declared beside the fill on every surface's own .dsm-workbuddy-usage rule
|
|
6273
|
+
* (card / page / settings), which is the element whose opaque area the strip sits
|
|
6274
|
+
* inside. The three do not agree — the page paints layer-3 while the other two
|
|
6275
|
+
* paint layer-1 — so a strip pinned to either constant becomes a visibly lighter
|
|
6276
|
+
* bar over the other. One variable, declared where the fill is declared, is what
|
|
6277
|
+
* keeps the two from drifting; a test requires every declarer to declare it.
|
|
6278
|
+
*
|
|
6279
|
+
* top:-1px rather than 0, because the strip's own border-bottom is drawn
|
|
6280
|
+
* OUTSIDE the box and 0 leaves a 1px slit for the scrolling rows to show
|
|
6281
|
+
* through. */
|
|
6282
|
+
.dsm-workbuddy-panels{position:sticky;top:-1px;z-index:2;display:flex;align-items:stretch;gap:2px;margin:0;border-bottom:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.24));background:var(--dsm-workbuddy-surface,var(--dsw-alias-bg-layer-1,#17181b))}
|
|
6247
6283
|
.dsm-workbuddy-panel-tab{appearance:none;font:inherit;cursor:pointer;border:0;background:transparent;padding:7px 11px;margin-bottom:-1px;border-bottom:2px solid transparent;color:var(--dsw-alias-label-tertiary,#999);font-size:13px;font-weight:600;line-height:20px;white-space:nowrap;transition:color .15s,border-color .15s}
|
|
6248
6284
|
.dsm-workbuddy-panel-tab:hover:not(.dsm-workbuddy-panel-tab-active){color:var(--dsw-alias-label-primary,#e6e6e6)}
|
|
6249
6285
|
.dsm-workbuddy-panel-tab:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:1px}
|
|
6250
6286
|
.dsm-workbuddy-panel-tab-active{color:var(--dsw-alias-label-primary,#e6e6e6);border-bottom-color:var(--dsw-alias-brand-primary,#5686fe)}
|
|
6251
|
-
|
|
6287
|
+
/* Same rule as the tab row above: the usage column's gap is the only spacing
|
|
6288
|
+
* between a tab row and the panel under it. This margin used to add 12px on top
|
|
6289
|
+
* of the 16px gap, and the panel's first block (the pool, with its own 16px top
|
|
6290
|
+
* padding) added a third layer. */
|
|
6291
|
+
.dsm-workbuddy-panel{margin:0}
|
|
6252
6292
|
/* DIAGNOSTICS: a two-column fact table rather than prose. Each row is one thing
|
|
6253
6293
|
* the card actually READ, so a bug report can quote a line instead of
|
|
6254
6294
|
* paraphrasing the UI. No control lives here on purpose — a diagnostics panel
|
|
@@ -6422,7 +6462,22 @@ window.__ModuleLoader__.load({
|
|
|
6422
6462
|
/* A plain header now: the section does not fold, so it is neither clickable nor
|
|
6423
6463
|
focusable, and the list-marker rules that hid the native <details> triangle are
|
|
6424
6464
|
gone with it. */
|
|
6425
|
-
.
|
|
6465
|
+
/* WRAPS, and the title column may shrink.
|
|
6466
|
+
*
|
|
6467
|
+
* In the Settings panel this header has ~538px for a title, a count line and
|
|
6468
|
+
* FOUR buttons (refresh + two availability sweeps + the speed sweep), whose
|
|
6469
|
+
* Chinese labels are long (一键测速启用模型). Without wrapping the flex line
|
|
6470
|
+
* never breaks, so the buttons keep their intrinsic width and the title column
|
|
6471
|
+
* is squeezed until 「已启用 3 个」 breaks mid-phrase — the header grows a second
|
|
6472
|
+
* line while the buttons stay put, which reads as a layout accident.
|
|
6473
|
+
*
|
|
6474
|
+
* row-gap is smaller than gap: a wrapped row is a continuation of the same
|
|
6475
|
+
* header, not a new section. */
|
|
6476
|
+
.dsm-workbuddy-models-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px 12px;flex-wrap:wrap}
|
|
6477
|
+
/* The title column must be allowed to shrink below its content (min-width:0),
|
|
6478
|
+
or wrapping does not help — a flex item defaults to min-width:auto and would
|
|
6479
|
+
still push the buttons onto their own line at full width. */
|
|
6480
|
+
.dsm-workbuddy-models-head>div:first-child{min-width:0}
|
|
6426
6481
|
.dsm-workbuddy-models-title-row{display:flex;align-items:center;gap:6px;min-width:0}
|
|
6427
6482
|
.dsm-workbuddy-models-title{margin:0;color:var(--dsw-alias-label-primary,#e6e6e6);font-size:14px;font-weight:600;line-height:20px}
|
|
6428
6483
|
/* Unsaved-changes marker. It sits in the HEADER rather than beside the save
|
|
@@ -6440,7 +6495,19 @@ window.__ModuleLoader__.load({
|
|
|
6440
6495
|
colour: it has to stand out from the three lines around it WITHOUT reading as
|
|
6441
6496
|
an error banner, because the fact it states is normal product behaviour
|
|
6442
6497
|
rather than a failure. Weight is the only signal it needs. */
|
|
6443
|
-
|
|
6498
|
+
/* 这两句现在连在一起读:先说这两个 tab 是什么,再说它们的免费额度有限。
|
|
6499
|
+
* 所以两行之间不要段落间距(上一条 .dsm-workbuddy-tab-hint 的下边距已经给
|
|
6500
|
+
* 足了),否则会读成两段互不相干的话。 */
|
|
6501
|
+
.dsm-workbuddy-free-quota-warn{font-weight:600;margin-top:-10px}
|
|
6502
|
+
/* The line that explains the REGION pair, directly under it.
|
|
6503
|
+
*
|
|
6504
|
+
* It used to be a .dsm-workbuddy-models-summary inside the accounts panel,
|
|
6505
|
+
* borrowing a class named for the model list. It describes the two provider
|
|
6506
|
+
* cells above it, so it gets its own name and its own margin: the summary's
|
|
6507
|
+
* margin:2px 0 0 was tuned to sit under a section heading, and here the line
|
|
6508
|
+
* follows a row of boxed cells and needs more air, plus it precedes the section
|
|
6509
|
+
* tabs whose own top margin would otherwise crowd it. */
|
|
6510
|
+
.dsm-workbuddy-tab-hint{margin:10px 0 0;color:var(--dsw-alias-label-tertiary,#999);font-size:12px;line-height:18px}
|
|
6444
6511
|
/* Every model is laid out in full — NO inner scroll box.
|
|
6445
6512
|
*
|
|
6446
6513
|
* The previous rule capped this at max-height 520px with overflow-y auto, so a
|
|
@@ -6483,7 +6550,23 @@ window.__ModuleLoader__.load({
|
|
|
6483
6550
|
.dsm-workbuddy-model-off input{margin:0;accent-color:var(--dsw-alias-brand-primary,#5686fe)}
|
|
6484
6551
|
.dsm-workbuddy-model-off-blocked{cursor:not-allowed;opacity:.75}
|
|
6485
6552
|
.dsm-workbuddy-model-off-flag{margin-left:2px;padding:0 4px;border-radius:4px;background:var(--dsw-alias-label-caution-background,#4a3a1f);color:var(--dsw-alias-label-caution,#e8b34b);font-size:10px;line-height:14px;white-space:nowrap}
|
|
6486
|
-
.
|
|
6553
|
+
/* The name and its chips share one line, and WHICH ONE gives way matters.
|
|
6554
|
+
*
|
|
6555
|
+
* The chips are flex:none (a half-drawn pill reads as a rendering bug), so the
|
|
6556
|
+
* only shrinkable item is the name — and it is also the one thing a reader
|
|
6557
|
+
* needs. Left alone, a long name plus two or three chips squeezes the name down
|
|
6558
|
+
* to a few characters: 「GLM-5.」 with nothing after it, which is exactly the
|
|
6559
|
+
* report this fixes.
|
|
6560
|
+
*
|
|
6561
|
+
* So the chips wrap among themselves when the line is tight, and the name gets a
|
|
6562
|
+
* floor. It may still ellipsize — a name longer than the whole row cannot fit —
|
|
6563
|
+
* but it never collapses to a stub while a badge sits whole beside it. */
|
|
6564
|
+
.dsm-workbuddy-model-copy{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px;min-width:0}
|
|
6565
|
+
.dsm-workbuddy-model-copy>.dsm-workbuddy-model-name{flex:1 1 auto;min-width:9em}
|
|
6566
|
+
/* Below the panel's own width the floor is too greedy: 9em plus two chips is
|
|
6567
|
+
wider than the line, and the NAME would force the wrap it is meant to avoid.
|
|
6568
|
+
Give it less and let the chips take the second line. */
|
|
6569
|
+
|
|
6487
6570
|
.dsm-workbuddy-model-name{display:inline-flex;align-items:baseline;gap:7px;color:var(--dsw-alias-label-primary,#e6e6e6);font-size:13px;font-weight:500;line-height:19px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
6488
6571
|
.dsm-workbuddy-model-name-rate{color:var(--dsw-alias-label-tertiary,#999);font-size:11px;font-weight:400;line-height:16px;flex:none}
|
|
6489
6572
|
/* The upstream's own promotion badge ("限时免费" / "Free now" / "Pro Only").
|
|
@@ -6562,7 +6645,11 @@ window.__ModuleLoader__.load({
|
|
|
6562
6645
|
.dsm-workbuddy-usage-cheer:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:2px}
|
|
6563
6646
|
|
|
6564
6647
|
/* ---- Account pool ---- */
|
|
6565
|
-
|
|
6648
|
+
/* No top rule any more. It separated the 「免费模型并非无限量」 warning from the
|
|
6649
|
+
* pool; that warning moved up beside the region hint it belongs with, so the
|
|
6650
|
+
* line now had nothing above it to separate and only added a seam between the
|
|
6651
|
+
* section tabs and the first thing they contain. */
|
|
6652
|
+
.dsm-workbuddy-pool{display:flex;flex-direction:column;gap:12px;margin:0;padding:0 0 4px}
|
|
6566
6653
|
/* The block's heading: title on the left, serving-account badge on the right.
|
|
6567
6654
|
*
|
|
6568
6655
|
* It used to hold a THIRD child — the credit-readout switch, slotted in between
|
|
@@ -6593,7 +6680,7 @@ window.__ModuleLoader__.load({
|
|
|
6593
6680
|
* a sentence: it is read as a shape first, a word second. The border keeps the
|
|
6594
6681
|
* pill from bleeding into the row tint if a theme remaps success to something
|
|
6595
6682
|
* dark. */
|
|
6596
|
-
.dsm-workbuddy-pool-current-badge{margin-left:auto;padding:2px 10px;border-radius:999px;background:var(--dsw-alias-state-success-primary,#22c55e);border:1px solid rgba(34,197,94,.55);color:#fff;font-size:12px;font-weight:600;line-height:18px;white-space:nowrap}
|
|
6683
|
+
.dsm-workbuddy-pool-current-badge{margin-left:auto;max-width:100%;overflow:hidden;text-overflow:ellipsis;padding:2px 10px;border-radius:999px;background:var(--dsw-alias-state-success-primary,#22c55e);border:1px solid rgba(34,197,94,.55);color:#fff;font-size:12px;font-weight:600;line-height:18px;white-space:nowrap}
|
|
6597
6684
|
/* Sits under the header block, before the batch buttons: account discovery is
|
|
6598
6685
|
the first step of using the pool, so it reads above the actions it enables. */
|
|
6599
6686
|
/* THE HEAD SLOT — one place that answers "who is serving?".
|
|
@@ -6628,12 +6715,43 @@ window.__ModuleLoader__.load({
|
|
|
6628
6715
|
.dsm-workbuddy-pool-ghost-remove:hover:not(:disabled){background:rgba(245,158,11,.2)}
|
|
6629
6716
|
.dsm-workbuddy-pool-ghost-remove:disabled{cursor:default;opacity:.5}
|
|
6630
6717
|
.dsm-workbuddy-pool-error{margin:0;font-size:12px;line-height:17px;color:var(--dsw-alias-state-error-primary,#ef4444);white-space:pre-line}
|
|
6631
|
-
|
|
6718
|
+
/* CONTAINMENT ROOT for the row breakpoints below.
|
|
6719
|
+
*
|
|
6720
|
+
* The card now renders in three places whose WIDTHS have nothing to do with the
|
|
6721
|
+
* window: the composer card, the full page (capped at 860px), and the Settings
|
|
6722
|
+
* panel's content column (~560px on a 1400px screen). Every @media breakpoint
|
|
6723
|
+
* in this file measures the VIEWPORT, so inside the Settings panel they never
|
|
6724
|
+
* fire — a 564px column got the five-column desktop table and each cell clipped.
|
|
6725
|
+
*
|
|
6726
|
+
* container-type: inline-size lets the breakpoints below measure the TABLE
|
|
6727
|
+
* instead, which is the width the rows actually have to fit into.
|
|
6728
|
+
*
|
|
6729
|
+
* Deliberately on the table and NOT on an ancestor: container-type makes the
|
|
6730
|
+
* element the containing block for position:fixed descendants, and the busy
|
|
6731
|
+
* veils and the device dialog are siblings of this table inside
|
|
6732
|
+
* .dsm-workbuddy-pool. Putting the containment here leaves them on the
|
|
6733
|
+
* viewport, which is where a full-screen overlay belongs. The table itself
|
|
6734
|
+
* contains only the header and member rows — no fixed-position descendants. */
|
|
6735
|
+
.dsm-workbuddy-pool-table{container-type:inline-size;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:12px;overflow:hidden;background:var(--dsw-alias-bg-layer-2,#24262c)}
|
|
6632
6736
|
.dsm-workbuddy-pool-row{display:grid;grid-template-columns:1.6fr 1fr 1.3fr .9fr .8fr;gap:10px;align-items:center;padding:10px 14px;border-top:1px solid var(--dsw-alias-border-l1,#2c2d31);font-size:13px;color:var(--dsw-alias-label-secondary,#c6c9d0)}
|
|
6633
6737
|
/* No check-in column (the international region): the freed track goes to the actions. */
|
|
6634
6738
|
.dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{grid-template-columns:1.6fr 1fr 1.3fr 1.7fr}
|
|
6635
6739
|
.dsm-workbuddy-pool-row:first-child{border-top:0}
|
|
6636
6740
|
.dsm-workbuddy-pool-row-head{padding:8px 14px;background:var(--dsw-alias-bg-layer-3,#2a2c33);color:var(--dsw-alias-label-tertiary,#999);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:uppercase}
|
|
6741
|
+
/* WHERE THE LABELED COLUMN ACTUALLY STARTS (learned from dsh-connect-trae, which
|
|
6742
|
+
carries the same rule for the same reason).
|
|
6743
|
+
*
|
|
6744
|
+
* The account cell's first element is the membership checkbox, so the account
|
|
6745
|
+
* NAME begins well inside the track. Measured at the plugin page's 1120px: the
|
|
6746
|
+
* header cell starts at x=65 and the name at x=103 — a 38px gap. Flush to the
|
|
6747
|
+
* cell edge, the word 「账号」 floated in the padding and pointed at nothing.
|
|
6748
|
+
*
|
|
6749
|
+
* 38px is the checkbox (13px) plus the cell's 8px gap plus the vertical
|
|
6750
|
+
* centring slack of an 18px glyph in a 20px label; rounded to the value that
|
|
6751
|
+
* measured flush rather than derived, because the two cells do not share a
|
|
6752
|
+
* box. The narrow form hides the whole header row, so this offset never has to
|
|
6753
|
+
* be re-tuned for the stacked layout. */
|
|
6754
|
+
.dsm-workbuddy-pool-col-account{padding-inline-start:38px}
|
|
6637
6755
|
.dsm-workbuddy-pool-row-current{background:rgba(86,134,254,.07)}
|
|
6638
6756
|
/* The serving row, made findable at a glance: a left accent bar plus the tint.
|
|
6639
6757
|
The bar is what distinguishes it in a long table, where a 7%-opacity wash
|
|
@@ -6835,7 +6953,12 @@ window.__ModuleLoader__.load({
|
|
|
6835
6953
|
heading floated under the table with nothing marking the change of subject. */
|
|
6836
6954
|
.dsm-workbuddy-pool-settings-wrap{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--dsw-alias-border-l2,#36373b);padding-top:14px}
|
|
6837
6955
|
.dsm-workbuddy-pool-dirty{font-size:12px;line-height:18px;font-weight:500;color:var(--dsw-alias-state-warn-primary,#f59e0b)}
|
|
6838
|
-
|
|
6956
|
+
/* Second containment root, for the settings rows. They are NOT inside
|
|
6957
|
+
* .dsm-workbuddy-pool-table (that is the member table only), so the table's
|
|
6958
|
+
* container query cannot reach them. This element holds just the stacked
|
|
6959
|
+
* setting rows — no position:fixed descendants, so containment here cannot move
|
|
6960
|
+
* an overlay's containing block. */
|
|
6961
|
+
.dsm-workbuddy-pool-settings{container-type:inline-size;display:flex;flex-direction:column;gap:1px;border:1px solid var(--dsw-alias-border-l2,#3a3d45);border-radius:12px;overflow:hidden;background:var(--dsw-alias-bg-layer-2,#24262c)}
|
|
6839
6962
|
/* THE MODE BAR — the page's master control, directly under the title.
|
|
6840
6963
|
*
|
|
6841
6964
|
* It reuses the .dsm-workbuddy-pool-settings class for the bordered, stacked
|
|
@@ -6951,9 +7074,92 @@ window.__ModuleLoader__.load({
|
|
|
6951
7074
|
.dsm-workbuddy-pool-row-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;flex:none}
|
|
6952
7075
|
.dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{white-space:nowrap}
|
|
6953
7076
|
.dsm-workbuddy-pool-row-actions .dsm-workbuddy-pool-small-btn{padding:2px 10px;font-size:12px}
|
|
6954
|
-
/*
|
|
6955
|
-
|
|
6956
|
-
|
|
7077
|
+
/* The picker's cap, narrowed on a phone. NOTE this @media measures the VIEWPORT,
|
|
7078
|
+
which is why it is the only rule left here that is allowed to: it exists for
|
|
7079
|
+
the Plugins page at phone width, where the viewport IS the constraint. The
|
|
7080
|
+
ROW's own narrow form is the @container block further down — a media query
|
|
7081
|
+
cannot express it, because inside the Settings panel the viewport is 1400px
|
|
7082
|
+
while the table gets 564px.
|
|
7083
|
+
*
|
|
7084
|
+
* The row's re-grid that used to live here was the source of that panel's
|
|
7085
|
+
* 2x2 defect: it fired at phone widths only, so the 564px column kept the
|
|
7086
|
+
* five-track desktop grid and clipped every cell. Removed rather than left
|
|
7087
|
+
* behind, because a second, half-correct narrow form is worse than none. */
|
|
7088
|
+
@media (max-width:760px){.dsm-workbuddy-pool-select{max-width:180px}}
|
|
7089
|
+
/* The settings rows (target model, probe size) are flex with a content column
|
|
7090
|
+
* that grows and a control that does not. In the Settings panel the control was
|
|
7091
|
+
* squeezed to a sliver: max-width:260px caps it but nothing gives it a floor,
|
|
7092
|
+
* and the copy beside it takes everything else. Stacking is the same move the
|
|
7093
|
+
* table makes at this width — one fact per line rather than two columns of
|
|
7094
|
+
* clipped text. */
|
|
7095
|
+
@container (max-width:620px){.dsm-workbuddy-pool-set{flex-direction:column;align-items:stretch;gap:8px}
|
|
7096
|
+
.dsm-workbuddy-pool-set-ctl{flex:1 1 auto;justify-content:flex-start}
|
|
7097
|
+
.dsm-workbuddy-pool-select{max-width:none;width:100%}}
|
|
7098
|
+
/* THE TABLE'S NARROW FORM, measured against the table rather than the window.
|
|
7099
|
+
*
|
|
7100
|
+
* Every breakpoint in this file up to here is a @media query, and those
|
|
7101
|
+
* measure the VIEWPORT. The same card now renders in the Settings panel's
|
|
7102
|
+
* content column (~564px on a 1400px screen), where a media query never fires:
|
|
7103
|
+
* a five-column table was laid into 564px and every cell clipped.
|
|
7104
|
+
*
|
|
7105
|
+
* ONE threshold, not two. An earlier revision had a 720px band that merely
|
|
7106
|
+
* dropped one track, on the theory that "slightly narrower" still wants a grid
|
|
7107
|
+
* — but the Settings column lands at ~564px, i.e. INSIDE that band, so the
|
|
7108
|
+
* reader got a 2x2 grid whose cells no longer lined up with their headers and
|
|
7109
|
+
* whose rows were twice as tall as the wide ones. A table has no "slightly
|
|
7110
|
+
* narrower" form worth having: either there is room for the columns or there
|
|
7111
|
+
* is not.
|
|
7112
|
+
*
|
|
7113
|
+
* Below the threshold each row becomes a STACKED CARD: the same five facts, in
|
|
7114
|
+
* the same order they read left to right when wide, now top to bottom. That is
|
|
7115
|
+
* what keeps a narrow row legible instead of merely fitting. */
|
|
7116
|
+
@container (max-width:700px){
|
|
7117
|
+
/* THREE LINES, not five. A plain flex-direction:column stacked every cell
|
|
7118
|
+
onto its own line, which doubled the row height and read as a form rather
|
|
7119
|
+
than an account. Wrapping is what keeps the row a CARD: the account and the
|
|
7120
|
+
actions own a full line each (they are the identify-it and act-on-it ends),
|
|
7121
|
+
while the three facts in between share the middle line and wrap among
|
|
7122
|
+
themselves only when they genuinely do not fit. */
|
|
7123
|
+
.dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:10px 12px}
|
|
7124
|
+
.dsm-workbuddy-pool-table:not(.dsm-workbuddy-pool-table-checkin) .dsm-workbuddy-pool-row{display:flex;flex-wrap:wrap;align-items:baseline}
|
|
7125
|
+
/* The column headers describe tracks that no longer exist. */
|
|
7126
|
+
.dsm-workbuddy-pool-row-head{display:none}
|
|
7127
|
+
.dsm-workbuddy-pool-account{flex:1 1 100%;align-items:center}
|
|
7128
|
+
/* THE ACCOUNT CELL'S OWN COLUMN, collapsed the same way — and this is the
|
|
7129
|
+
rule that actually decides the row height (learned from dsh-connect-trae
|
|
7130
|
+
4.9.0, which shipped the outer half of this fix and measured 138px rows).
|
|
7131
|
+
*
|
|
7132
|
+
* Collapsing only .dsm-workbuddy-pool-account above is NOT enough: that is
|
|
7133
|
+
* just a flex wrapper. The cells that stack are one level deeper, inside
|
|
7134
|
+
* .dsm-workbuddy-pool-account-name, which declares flex-direction:column so
|
|
7135
|
+
* that the name, the rank badge with its ↑/↓ arrows, the 「当前使用」 pill and
|
|
7136
|
+
* the 「测试于 …」 line read as a small card when the table is WIDE.
|
|
7137
|
+
*
|
|
7138
|
+
* In the Settings column they have no reason to keep one line each: measured
|
|
7139
|
+
* at 549px, that block was 81px of the row's 157px — five lines (name, rank +
|
|
7140
|
+
* arrows, current badge, tested-at), while the three facts beside it sat on
|
|
7141
|
+
* one 18px line. The row therefore read as "one tall account block and three
|
|
7142
|
+
* strays", and every extra row cost the reader two thirds of a screen.
|
|
7143
|
+
*
|
|
7144
|
+
* Read as a sentence it is one line — 「用户7520607992 · 第 1 位 ↑↓ · 当前使用 ·
|
|
7145
|
+
* 测试于 11/06, 03:57」 — so it wraps among itself instead of stacking. The
|
|
7146
|
+
* margins the wide form needs (2px above the badge, 2px above the current pill)
|
|
7147
|
+
* go away with the stacking: in a wrapped row they become uneven leading. */
|
|
7148
|
+
.dsm-workbuddy-pool-account-name{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7149
|
+
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-order{margin-top:0}
|
|
7150
|
+
.dsm-workbuddy-pool-account-name .dsm-workbuddy-pool-current-tag{align-self:center;margin-top:0}
|
|
7151
|
+
/* The name still has to be allowed to SHRINK. The <b> carries nowrap + ellipsis,
|
|
7152
|
+
whose whole point is that a long account name ends in "…" rather than
|
|
7153
|
+
pushing the line — but as a flex item it defaults to min-width:auto, i.e.
|
|
7154
|
+
its content width, and then the ellipsis can never engage. */
|
|
7155
|
+
.dsm-workbuddy-pool-account-name b{min-width:0;max-width:100%}
|
|
7156
|
+
/* The three middle facts, laid out as one line of the same sentence. */
|
|
7157
|
+
.dsm-workbuddy-pool-credits{flex:0 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7158
|
+
.dsm-workbuddy-pool-probe{flex:1 1 auto;flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 8px}
|
|
7159
|
+
.dsm-workbuddy-pool-checkin{flex:none}
|
|
7160
|
+
.dsm-workbuddy-pool-row-actions{flex:1 1 100%;justify-content:flex-start;padding-top:4px}
|
|
7161
|
+
}
|
|
7162
|
+
|
|
6957
7163
|
/* ISSUE #198, the same breakpoint the pool row already uses. On a phone the model
|
|
6958
7164
|
row's budget group takes the WHOLE line and left-aligns: right-justified, a
|
|
6959
7165
|
wrapped two-tier group reads as a stray fragment under the buttons, and the tier
|
|
@@ -7065,7 +7271,13 @@ window.__ModuleLoader__.load({
|
|
|
7065
7271
|
@keyframes dsm-workbuddy-veil-dash{0%{stroke-dasharray:12 150;stroke-dashoffset:0}50%{stroke-dasharray:24 150;stroke-dashoffset:-6}to{stroke-dasharray:12 150;stroke-dashoffset:0}}
|
|
7066
7272
|
@media (prefers-reduced-motion: reduce){.dsm-workbuddy-veil-spinner{animation:none}.dsm-workbuddy-veil-spinner-arc{animation:none;stroke-dasharray:18 150;stroke-dashoffset:-3}}
|
|
7067
7273
|
.dsm-workbuddy-page{box-sizing:border-box;height:100%;display:flex;flex-direction:column;align-items:center;gap:20px;padding:28px clamp(24px,4vw,48px) 48px;overflow:auto;color:var(--dsw-alias-label-primary,#e6e6e6)}
|
|
7068
|
-
|
|
7274
|
+
/* 1120px, not 860: the page is the WIDE layout — that is the whole reason the
|
|
7275
|
+
* sidebar row and the readout's button exist — so capping it at 860 left a third
|
|
7276
|
+
* of a 1440px window empty while the table inside still had five columns to
|
|
7277
|
+
* place. The cap still matters: past ~1120 a five-column row of short figures
|
|
7278
|
+
* starts to read as scattered, and a line of prose runs longer than the eye
|
|
7279
|
+
* likes to track. */
|
|
7280
|
+
.dsm-workbuddy-page>*{width:100%;max-width:1120px}
|
|
7069
7281
|
.dsm-workbuddy-page-head{display:flex;flex-direction:column;gap:6px}
|
|
7070
7282
|
.dsm-workbuddy-page-back{appearance:none;font:inherit;cursor:pointer;border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-1,#17181b);color:var(--dsw-alias-label-secondary,#c7c7c7);border-radius:8px;padding:5px 12px;display:inline-flex;align-items:center;gap:6px;align-self:flex-start;font-size:13px;line-height:20px}
|
|
7071
7283
|
.dsm-workbuddy-page-back:hover{color:var(--dsw-alias-label-primary,#e6e6e6);border-color:var(--dsw-alias-label-dimmed,#777)}
|
|
@@ -7073,8 +7285,39 @@ window.__ModuleLoader__.load({
|
|
|
7073
7285
|
.dsm-workbuddy-page-icon{width:40px;height:40px;border-radius:9px;align-self:flex-start;margin-top:14px}
|
|
7074
7286
|
.dsm-workbuddy-page-title{margin:0;font-size:20px;font-weight:600;line-height:1.4}
|
|
7075
7287
|
.dsm-workbuddy-page-desc{margin:0;font-size:13px;line-height:1.5;color:var(--dsw-alias-label-tertiary,#999)}
|
|
7076
|
-
.dsm-workbuddy-page-body .dsm-workbuddy-usage{padding:20px 20px 8px;border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px}
|
|
7077
|
-
.
|
|
7288
|
+
.dsm-workbuddy-page-body .dsm-workbuddy-usage{--dsm-workbuddy-surface:var(--dsw-alias-bg-layer-3,#202126);padding:20px 20px 8px;border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px}
|
|
7289
|
+
/* ---- 设置面板里的一节(settings.section,5.19.0)------------------------
|
|
7290
|
+
面板内容列本来就窄(800px 面板减 188px 导航),而且它自己滚动。所以这一页
|
|
7291
|
+
不去抢整页的高度与居中:height:100% 会在列里撑出第二根滚动条,860px 的
|
|
7292
|
+
居中上限又会让内容缩在左边。改成从上往下排、宽度交给列,只有内边距是本插件
|
|
7293
|
+
自己的;卡片边框也去掉——它现在是页面内容,不再是别人列表里的一行。 */
|
|
7294
|
+
.dsm-workbuddy-settings{height:auto;min-height:0;padding:0;gap:14px;overflow:visible}
|
|
7295
|
+
|
|
7296
|
+
.dsm-workbuddy-settings>*{max-width:none}
|
|
7297
|
+
/* 顶部那块自报家门:图标与标题同排,简介独占一行。面板已有一层标题栏,这里
|
|
7298
|
+
不再叠一个大标题,只把"这是什么"说清楚。 */
|
|
7299
|
+
.dsm-workbuddy-settings .dsm-workbuddy-settings-head{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;row-gap:2px;align-items:center}
|
|
7300
|
+
.dsm-workbuddy-settings .dsm-workbuddy-page-icon{width:28px;height:28px;border-radius:6px;margin-top:0;grid-row:1}
|
|
7301
|
+
.dsm-workbuddy-settings .dsm-workbuddy-page-title{font-size:15px;line-height:22px;grid-row:1;min-width:0}
|
|
7302
|
+
.dsm-workbuddy-settings .dsm-workbuddy-page-desc{grid-column:1/-1;font-size:12px;line-height:18px}
|
|
7303
|
+
/* 内容块不再是一张浮在页面上的卡:去掉边框与底色,内边距改成横向对齐列边。
|
|
7304
|
+
*
|
|
7305
|
+
* 但那是「外壳那一列是实底色」时的结论。issue #209:换上个性化壁纸后,外壳的列
|
|
7306
|
+
* 是半透明的,这一页自己又没有任何底色,于是壁纸整片透过内容区——标题、说明段落、
|
|
7307
|
+
* 标签栏、账号池 全部直接压在壁纸上。这台机器上其余内容块各自有实底
|
|
7308
|
+
* (表格、设置组),唯独它们之间的留白与正文没有,所以只有「什么都没有」的地方在
|
|
7309
|
+
* 透。修复是给内容区自己一层底,取外壳的 layer 色;实底主题上与原来看不出差别。 */
|
|
7310
|
+
/* 页头那两行(标题、一句简介)在内容区外面,壁纸下同样没有承托。
|
|
7311
|
+
*
|
|
7312
|
+
* 补一块底而不是把它并进内容区:面板自己已经有一层标题栏,页头与正文之间要
|
|
7313
|
+
* 留出间隔,两块底拼成一片会让页头看起来属于正文。取同一个 layer 色,实底主题
|
|
7314
|
+
* 上与原来看不出差别。
|
|
7315
|
+
*
|
|
7316
|
+
* 这一条同时作用于整页(侧边栏入口那个宽页面),它同样没有底色。 */
|
|
7317
|
+
.dsm-workbuddy-settings .dsm-workbuddy-settings-head,
|
|
7318
|
+
.dsm-workbuddy-page .dsm-workbuddy-page-head{background:var(--dsw-alias-bg-layer-1,#17181b);border-radius:12px;padding:10px 12px}
|
|
7319
|
+
/* 这一页的内容区不能有内边距,否则底色会缩进一截,与页头对不齐。 */
|
|
7320
|
+
.dsm-workbuddy-settings .dsm-workbuddy-page-body .dsm-workbuddy-usage{--dsm-workbuddy-surface:var(--dsw-alias-bg-layer-1,#17181b);padding:0;border:0;border-radius:0;background:var(--dsw-alias-bg-layer-1,#17181b)}.dsm-workbuddy-panel-icon{display:block;border-radius:4px;flex:none}
|
|
7078
7321
|
/* ---- 设备头档位与逐账号参数弹窗 ------------------------------------------
|
|
7079
7322
|
档位那一行贴着账号表:它同时决定"这台机器对外声称自己是谁"和"每行的齿轮能
|
|
7080
7323
|
不能用",埋进「更多设置」会让齿轮看起来时好时坏。
|
|
@@ -7327,6 +7570,15 @@ window.__ModuleLoader__.load({
|
|
|
7327
7570
|
.dsm-workbuddy-composer-panel-refresh-icon-spin{animation:none;opacity:.55}
|
|
7328
7571
|
}
|
|
7329
7572
|
|
|
7573
|
+
/* The header's right-hand control: the link to this plugin's settings.
|
|
7574
|
+
A wrapper rather than an auto margin on the button, because the button is NOT
|
|
7575
|
+
always rendered (a host with no route renders none) and a wrapper that is
|
|
7576
|
+
always present keeps the header layout identical either way. */
|
|
7577
|
+
.dsm-workbuddy-composer-panel-actions{flex:none;margin-left:auto;display:flex;align-items:center}
|
|
7578
|
+
/* The header holds ONE control (refresh) now that the settings page lives in
|
|
7579
|
+
the Settings panel: the gear pill that navigated to the Plugins page retired
|
|
7580
|
+
with the page it pointed at. margin-left:auto on the wrapper keeps the
|
|
7581
|
+
control pinned right regardless of how many buttons the actions row holds. */
|
|
7330
7582
|
/* The header's right-hand control: the link to this plugin's settings.
|
|
7331
7583
|
A wrapper rather than an auto margin on the button, because the button is NOT
|
|
7332
7584
|
always rendered (a host with no route renders none) and a wrapper that is
|
|
@@ -8104,8 +8356,9 @@ window.__ModuleLoader__.load({
|
|
|
8104
8356
|
function WorkBuddyCardBody({ t, settingsScope, view, surface, backToConversation }) {
|
|
8105
8357
|
if (t === void 0) throw new Error("WorkBuddy plugin card requires its translation function");
|
|
8106
8358
|
const pageSurface = surface === "page";
|
|
8359
|
+
const settingsSurface = surface === "settings";
|
|
8107
8360
|
const [cardOpen, setCardOpen] = (0, react.useState)(view === "page");
|
|
8108
|
-
const open = pageSurface || cardOpen;
|
|
8361
|
+
const open = pageSurface || settingsSurface || cardOpen;
|
|
8109
8362
|
/** The region whose tab is on screen; each tab is its own provider stack. */
|
|
8110
8363
|
const [activeRegion, setActiveRegion] = (0, react.useState)("cn");
|
|
8111
8364
|
/**
|
|
@@ -10201,10 +10454,19 @@ window.__ModuleLoader__.load({
|
|
|
10201
10454
|
})
|
|
10202
10455
|
]
|
|
10203
10456
|
});
|
|
10204
|
-
|
|
10205
|
-
|
|
10457
|
+
/**
|
|
10458
|
+
* The page header: the sidebar panel's own page, and the Settings section.
|
|
10459
|
+
*
|
|
10460
|
+
* Both are "a page about WorkBuddy" rather than a row in someone else's list,
|
|
10461
|
+
* so both say what this is in one line. They differ in exactly one control:
|
|
10462
|
+
* the sidebar page needs a way back to the conversation, while the Settings
|
|
10463
|
+
* section is inside a dialog the shell closes for you — a back arrow there
|
|
10464
|
+
* would point at a place the reader did not come from.
|
|
10465
|
+
*/
|
|
10466
|
+
const pageHead = pageSurface || settingsSurface ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10467
|
+
className: settingsSurface ? "dsm-workbuddy-page-head dsm-workbuddy-settings-head" : "dsm-workbuddy-page-head",
|
|
10206
10468
|
children: [
|
|
10207
|
-
backToConversation !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
10469
|
+
pageSurface && backToConversation !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
10208
10470
|
type: "button",
|
|
10209
10471
|
className: "dsm-workbuddy-page-back",
|
|
10210
10472
|
onClick: backToConversation,
|
|
@@ -10282,6 +10544,14 @@ window.__ModuleLoader__.load({
|
|
|
10282
10544
|
}, region);
|
|
10283
10545
|
})
|
|
10284
10546
|
}),
|
|
10547
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10548
|
+
className: "dsm-workbuddy-models-summary dsm-workbuddy-tab-hint",
|
|
10549
|
+
children: t("row.tabHint")
|
|
10550
|
+
}),
|
|
10551
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10552
|
+
className: "dsm-workbuddy-models-summary dsm-workbuddy-free-quota-warn",
|
|
10553
|
+
children: t("row.tabFreeQuotaWarn")
|
|
10554
|
+
}),
|
|
10285
10555
|
signedIn ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10286
10556
|
className: "dsm-workbuddy-panels",
|
|
10287
10557
|
role: "tablist",
|
|
@@ -10356,14 +10626,6 @@ window.__ModuleLoader__.load({
|
|
|
10356
10626
|
"aria-labelledby": "dsm-workbuddy-tab-accounts",
|
|
10357
10627
|
hidden: signedIn && panel !== "accounts",
|
|
10358
10628
|
children: [
|
|
10359
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10360
|
-
className: "dsm-workbuddy-models-summary",
|
|
10361
|
-
children: t("row.tabHint")
|
|
10362
|
-
}),
|
|
10363
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10364
|
-
className: "dsm-workbuddy-models-summary dsm-workbuddy-free-quota-warn",
|
|
10365
|
-
children: t("row.tabFreeQuotaWarn")
|
|
10366
|
-
}),
|
|
10367
10629
|
!activeRegionOn ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
10368
10630
|
className: "dsm-workbuddy-tab-off-notice",
|
|
10369
10631
|
children: t("row.tabOffNotice")
|
|
@@ -10949,8 +11211,8 @@ window.__ModuleLoader__.load({
|
|
|
10949
11211
|
]
|
|
10950
11212
|
})
|
|
10951
11213
|
});
|
|
10952
|
-
if (pageSurface) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10953
|
-
className: "dsm-workbuddy-page",
|
|
11214
|
+
if (pageSurface || settingsSurface) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
11215
|
+
className: settingsSurface ? "dsm-workbuddy-page dsm-workbuddy-settings" : "dsm-workbuddy-page",
|
|
10954
11216
|
children: [pageHead, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
10955
11217
|
className: "dsm-workbuddy-page-body",
|
|
10956
11218
|
children: cardBody
|
|
@@ -11377,12 +11639,11 @@ window.__ModuleLoader__.load({
|
|
|
11377
11639
|
const [testError, setTestError] = (0, react.useState)(void 0);
|
|
11378
11640
|
const [failed, setFailed] = (0, react.useState)(false);
|
|
11379
11641
|
/**
|
|
11380
|
-
* The
|
|
11642
|
+
* The full-page button could not reach the page on this host.
|
|
11381
11643
|
*
|
|
11382
11644
|
* Its own flag, not `failed`, because the two render DIFFERENT sentences: this
|
|
11383
|
-
* one says the host offers no route to the
|
|
11384
|
-
*
|
|
11385
|
-
* the other.
|
|
11645
|
+
* one says the host offers no route to the page, which is not the same claim as
|
|
11646
|
+
* "the credits read failed", and sharing a flag would print one over the other.
|
|
11386
11647
|
*/
|
|
11387
11648
|
const [settingsFailed, setSettingsFailed] = (0, react.useState)(false);
|
|
11388
11649
|
const [lastRefresh, setLastRefresh] = (0, react.useState)(void 0);
|
|
@@ -11682,7 +11943,7 @@ window.__ModuleLoader__.load({
|
|
|
11682
11943
|
t
|
|
11683
11944
|
]);
|
|
11684
11945
|
/**
|
|
11685
|
-
* The header's
|
|
11946
|
+
* The header's page control: open this plugin's full page, then close.
|
|
11686
11947
|
*
|
|
11687
11948
|
* CLOSING IS PART OF THE JOB. The panel is portaled to `document.body` and
|
|
11688
11949
|
* floats over the composer; navigating the centre column does not remove it, so
|
|
@@ -11870,6 +12131,16 @@ window.__ModuleLoader__.load({
|
|
|
11870
12131
|
})]
|
|
11871
12132
|
})]
|
|
11872
12133
|
}),
|
|
12134
|
+
settingsFailed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12135
|
+
className: "dsm-workbuddy-composer-panel-error",
|
|
12136
|
+
role: "status",
|
|
12137
|
+
children: t("composer.openSettingsFailed")
|
|
12138
|
+
}) : null,
|
|
12139
|
+
testError === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
12140
|
+
className: "dsm-workbuddy-composer-panel-error",
|
|
12141
|
+
role: "status",
|
|
12142
|
+
children: testError
|
|
12143
|
+
}),
|
|
11873
12144
|
signedOut ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11874
12145
|
className: "dsm-workbuddy-composer-panel-empty",
|
|
11875
12146
|
children: t("composer.signedOut")
|
|
@@ -11978,12 +12249,7 @@ window.__ModuleLoader__.load({
|
|
|
11978
12249
|
className: "dsm-workbuddy-composer-panel-error",
|
|
11979
12250
|
role: "status",
|
|
11980
12251
|
children: testError
|
|
11981
|
-
})
|
|
11982
|
-
settingsFailed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
11983
|
-
className: "dsm-workbuddy-composer-panel-error",
|
|
11984
|
-
role: "status",
|
|
11985
|
-
children: t("composer.openSettingsFailed")
|
|
11986
|
-
}) : null
|
|
12252
|
+
})
|
|
11987
12253
|
]
|
|
11988
12254
|
}), document.body)
|
|
11989
12255
|
]
|
|
@@ -13267,8 +13533,8 @@ window.__ModuleLoader__.load({
|
|
|
13267
13533
|
"composer.noAccounts": "No account in this region",
|
|
13268
13534
|
"composer.signedOut": "Not signed in",
|
|
13269
13535
|
"composer.openSettings": "Settings",
|
|
13270
|
-
"composer.openSettingsHint": "Open this plugin's
|
|
13271
|
-
"composer.openSettingsFailed": "This host offers no route to the plugin
|
|
13536
|
+
"composer.openSettingsHint": "Open this plugin's full page (accounts, models, switches)",
|
|
13537
|
+
"composer.openSettingsFailed": "This host offers no route to the plugin page",
|
|
13272
13538
|
"composer.refresh": "Refresh",
|
|
13273
13539
|
"composer.refreshing": "Refreshing…",
|
|
13274
13540
|
"composer.refreshHint": "Refresh every account status in this region — probes each account once, one at a time (spends a small amount of credits, takes up to a minute)",
|
|
@@ -13791,8 +14057,8 @@ window.__ModuleLoader__.load({
|
|
|
13791
14057
|
"composer.noAccounts": "该区域暂无账号",
|
|
13792
14058
|
"composer.signedOut": "未登录",
|
|
13793
14059
|
"composer.openSettings": "设置",
|
|
13794
|
-
"composer.openSettingsHint": "
|
|
13795
|
-
"composer.openSettingsFailed": "
|
|
14060
|
+
"composer.openSettingsHint": "打开本插件的完整页面(账号、模型、各项开关)",
|
|
14061
|
+
"composer.openSettingsFailed": "这台宿主没有通往插件页面的入口",
|
|
13796
14062
|
"composer.refresh": "刷新",
|
|
13797
14063
|
"composer.refreshing": "正在刷新…",
|
|
13798
14064
|
"composer.refreshHint": "刷新本区所有账号的状态——逐个探测每个账号(会消耗少量积分,最长约一分钟)",
|
|
@@ -13822,89 +14088,134 @@ window.__ModuleLoader__.load({
|
|
|
13822
14088
|
"cliLive.aria": "有一个 CodeBuddy 回合正在跑:{detail}"
|
|
13823
14089
|
};
|
|
13824
14090
|
//#endregion
|
|
13825
|
-
//#region src/client/settings-
|
|
13826
|
-
/**
|
|
13827
|
-
*
|
|
13828
|
-
*
|
|
13829
|
-
* ## Why this is a module and not three lines inside `apply`
|
|
13830
|
-
*
|
|
13831
|
-
* The entry (`src/client/index.tsx`) imports browser-only DSH packages that the
|
|
13832
|
-
* Node test environment cannot load, so anything worth asserting on has to live
|
|
13833
|
-
* outside it — the same seam `panel-switch.ts` provides for the opt-in switch and
|
|
13834
|
-
* `ComposerCreditsGate.tsx` provides for the readout's own visibility rule. This
|
|
13835
|
-
* module holds the whole decision, so the spec exercises the REAL chain instead
|
|
13836
|
-
* of a mirror of it.
|
|
13837
|
-
*
|
|
13838
|
-
* ## Why two routes
|
|
13839
|
-
*
|
|
13840
|
-
* On this host line a plugin's settings are not a "page in Settings" at all:
|
|
13841
|
-
* the Plugins page owns them, and each bundle's page (`plugins.bundle.config` /
|
|
13842
|
-
* `plugins.row.config`) IS the configuration surface — Settings keeps only the
|
|
13843
|
-
* read-only built-in inventory. So "open the plugin's settings" means "open the
|
|
13844
|
-
* Plugins page on this bundle", and the supported way to ask for that is the
|
|
13845
|
-
* `pluginNavigation` service the Plugins page provides:
|
|
13846
|
-
* `openBundle(packageName)` selects that page without changing the Session.
|
|
13847
|
-
*
|
|
13848
|
-
* `pluginNavigation` is provided by `@deepseek-ai/dsh-client-ui-plugin-manager`,
|
|
13849
|
-
* NOT by the shell. A profile can be composed without it, and plugin load order
|
|
13850
|
-
* is not something a contributor may assume — so the probe happens at CALL time
|
|
13851
|
-
* rather than at registration time. Probing once in `apply` would capture
|
|
13852
|
-
* `undefined` on a page whose Plugins bundle simply applied after ours, and the
|
|
13853
|
-
* button would be dead for the rest of the session with nothing to re-evaluate
|
|
13854
|
-
* it.
|
|
14091
|
+
//#region src/client/settings-jump.ts
|
|
14092
|
+
/**
|
|
14093
|
+
* Best-effort jump to this plugin's **Settings section** (设置 → WorkBuddy).
|
|
13855
14094
|
*
|
|
13856
|
-
*
|
|
13857
|
-
*
|
|
13858
|
-
*
|
|
13859
|
-
* `
|
|
13860
|
-
*
|
|
13861
|
-
*
|
|
13862
|
-
*
|
|
13863
|
-
*
|
|
13864
|
-
*
|
|
13865
|
-
*
|
|
13866
|
-
*
|
|
13867
|
-
*
|
|
13868
|
-
*
|
|
13869
|
-
*
|
|
13870
|
-
*
|
|
13871
|
-
*
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
*
|
|
13875
|
-
*
|
|
13876
|
-
*
|
|
13877
|
-
*
|
|
13878
|
-
*
|
|
13879
|
-
* the
|
|
13880
|
-
*
|
|
13881
|
-
*
|
|
13882
|
-
*
|
|
13883
|
-
|
|
13884
|
-
|
|
13885
|
-
|
|
13886
|
-
|
|
13887
|
-
|
|
13888
|
-
*
|
|
13889
|
-
*
|
|
13890
|
-
*
|
|
13891
|
-
*
|
|
13892
|
-
*
|
|
13893
|
-
*
|
|
13894
|
-
*
|
|
13895
|
-
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
|
|
14095
|
+
* ## Why a DOM walk rather than a service call
|
|
14096
|
+
*
|
|
14097
|
+
* The host gives a third-party plugin NO public way to open one of its
|
|
14098
|
+
* `settings.section`s. The shell keeps the selected section in its own store
|
|
14099
|
+
* (`ui-settings-general`'s `createSettingsShellStore().activeId`), and the only
|
|
14100
|
+
* `openSection(id)` it hands out goes to `settings.onboarding` registrants —
|
|
14101
|
+
* that is the first-run guidance seat, not a configuration entry. Nothing else
|
|
14102
|
+
* in `@deepseek-ai/dsh-client-ui-settings`' client contract exposes a
|
|
14103
|
+
* `openSection` / `selectedSection` service.
|
|
14104
|
+
*
|
|
14105
|
+
* This is not a WorkBuddy-specific finding: `dsh-connect-qoder`, `dsh-context`
|
|
14106
|
+
* and `dsh-better-sidebar` all document the same gap and all drive the real
|
|
14107
|
+
* chrome instead.
|
|
14108
|
+
*
|
|
14109
|
+
* ## What "driving the chrome" means here
|
|
14110
|
+
*
|
|
14111
|
+
* 1. click the shell's settings trigger (`aria-haspopup="dialog"` +
|
|
14112
|
+
* `aria-expanded`) — unless the panel is already open, in which case
|
|
14113
|
+
* clicking it would CLOSE it and the jump would turn into a disappearing
|
|
14114
|
+
* act;
|
|
14115
|
+
* 2. wait for the panel to mount (it renders on demand into `body`);
|
|
14116
|
+
* 3. find this plugin's nav row by its LABEL and click it.
|
|
14117
|
+
*
|
|
14118
|
+
* ## Why the label and not the id
|
|
14119
|
+
*
|
|
14120
|
+
* The shell renders each nav row's `row.label` — an already-localized string —
|
|
14121
|
+
* and writes no `data-section-id` or similar stable anchor; `aria-current` only
|
|
14122
|
+
* appears on the row that is already selected. The label comes from this
|
|
14123
|
+
* plugin's own `section.label` (`t('nav.panel')`), so both languages live in
|
|
14124
|
+
* this repository and "the one we found" cannot drift from "the one we
|
|
14125
|
+
* registered".
|
|
14126
|
+
*
|
|
14127
|
+
* ## Why it never throws
|
|
14128
|
+
*
|
|
14129
|
+
* Every step is called from a RENDER path (a click handler in the credits
|
|
14130
|
+
* popover). A throw here would take out the whole readout rather than one
|
|
14131
|
+
* button, so each stage swallows its own failure and the whole jump degrades to
|
|
14132
|
+
* a silent no-op when the shell has a different shape (an older host, a hidden
|
|
14133
|
+
* sidebar, a language we did not ship).
|
|
14134
|
+
*
|
|
14135
|
+
* @module dsh-connect-workbuddy/client/settings-jump
|
|
14136
|
+
*/
|
|
14137
|
+
/**
|
|
14138
|
+
* The settings panel container.
|
|
14139
|
+
*
|
|
14140
|
+
* `data-shortcut-modal="settings"` is the shell's OWN attribute — its shortcut
|
|
14141
|
+
* router keys off it to decide whether the open modal is the settings one — so
|
|
14142
|
+
* it is far more stable than any class name, which is a CSS-module hash.
|
|
14143
|
+
*/
|
|
14144
|
+
const SETTINGS_PANEL_SELECTOR = "[data-shortcut-modal=\"settings\"]";
|
|
14145
|
+
/** The sidebar's settings trigger: dialog semantics plus an expanded state. */
|
|
14146
|
+
const TRIGGER_SELECTOR = "button[aria-haspopup=\"dialog\"][aria-expanded]";
|
|
14147
|
+
/**
|
|
14148
|
+
* Budget for "panel mounted + nav row rendered".
|
|
14149
|
+
*
|
|
14150
|
+
* The panel mounts SYNCHRONOUSLY on the click, but the nav rows' labels wait for
|
|
14151
|
+
* a locale snapshot, so a same-frame query is often one tick too early. Five
|
|
14152
|
+
* attempts over ~300ms covers one layout pass while staying under the threshold
|
|
14153
|
+
* where a user starts to think the click did nothing.
|
|
14154
|
+
*/
|
|
14155
|
+
const RETRY_DELAYS_MS = [
|
|
14156
|
+
0,
|
|
14157
|
+
60,
|
|
14158
|
+
70,
|
|
14159
|
+
80,
|
|
14160
|
+
90
|
|
14161
|
+
];
|
|
14162
|
+
function defaultSchedule(run, ms) {
|
|
14163
|
+
try {
|
|
14164
|
+
window.setTimeout(run, ms);
|
|
14165
|
+
} catch {
|
|
14166
|
+
run();
|
|
14167
|
+
}
|
|
14168
|
+
}
|
|
14169
|
+
function buttonsIn(scope) {
|
|
14170
|
+
return Array.from(scope.querySelectorAll("button"));
|
|
14171
|
+
}
|
|
14172
|
+
/** Find the nav-row button whose label is this plugin's. */
|
|
14173
|
+
function findSectionRow(scope, label) {
|
|
14174
|
+
const want = label.trim();
|
|
14175
|
+
if (want === "") return void 0;
|
|
14176
|
+
return buttonsIn(scope).find((button) => (button.textContent ?? "").trim() === want);
|
|
14177
|
+
}
|
|
14178
|
+
/**
|
|
14179
|
+
* Open the settings panel and select this plugin's section.
|
|
14180
|
+
*
|
|
14181
|
+
* @returns whether the trigger was driven at all (`false` = the panel is not on
|
|
14182
|
+
* this host, so nothing was attempted and `onGiveUp` already ran).
|
|
14183
|
+
*/
|
|
14184
|
+
function openWorkBuddySettingsSection(options) {
|
|
14185
|
+
const { doc = document, label } = options;
|
|
14186
|
+
const schedule = options.schedule ?? defaultSchedule;
|
|
14187
|
+
try {
|
|
14188
|
+
if (doc.querySelector(SETTINGS_PANEL_SELECTOR) === null) {
|
|
14189
|
+
const collapsed = Array.from(doc.querySelectorAll(TRIGGER_SELECTOR)).find((button) => button.getAttribute("aria-expanded") !== "true");
|
|
14190
|
+
if (collapsed === void 0) {
|
|
14191
|
+
try {
|
|
14192
|
+
options.onGiveUp?.();
|
|
14193
|
+
} catch {}
|
|
14194
|
+
return false;
|
|
14195
|
+
}
|
|
14196
|
+
collapsed.click();
|
|
14197
|
+
}
|
|
14198
|
+
let clicked = false;
|
|
14199
|
+
let remaining = RETRY_DELAYS_MS.length;
|
|
14200
|
+
for (const delay of RETRY_DELAYS_MS) schedule(() => {
|
|
14201
|
+
if (clicked) return;
|
|
14202
|
+
remaining -= 1;
|
|
14203
|
+
try {
|
|
14204
|
+
const row = findSectionRow(doc.querySelector(SETTINGS_PANEL_SELECTOR) ?? doc, label());
|
|
14205
|
+
if (row !== void 0) {
|
|
14206
|
+
clicked = true;
|
|
14207
|
+
row.click();
|
|
14208
|
+
return;
|
|
14209
|
+
}
|
|
14210
|
+
} catch {}
|
|
14211
|
+
if (remaining === 0) try {
|
|
14212
|
+
options.onGiveUp?.();
|
|
14213
|
+
} catch {}
|
|
14214
|
+
}, delay);
|
|
13905
14215
|
return true;
|
|
13906
|
-
} catch {
|
|
13907
|
-
|
|
14216
|
+
} catch {
|
|
14217
|
+
return false;
|
|
14218
|
+
}
|
|
13908
14219
|
}
|
|
13909
14220
|
//#endregion
|
|
13910
14221
|
//#region src/client/index.tsx
|
|
@@ -13955,39 +14266,116 @@ window.__ModuleLoader__.load({
|
|
|
13955
14266
|
const t = ctx.locale.bind(namespace);
|
|
13956
14267
|
const softGet = (name) => ctx.get(name);
|
|
13957
14268
|
/**
|
|
13958
|
-
*
|
|
13959
|
-
*
|
|
14269
|
+
* The credits popover's header button: open 设置 → WorkBuddy.
|
|
14270
|
+
*
|
|
14271
|
+
* ALWAYS A FUNCTION, never `undefined`. It drives the shell's real chrome
|
|
14272
|
+
* (see `settings-jump.ts`) rather than asking a host service, so it has a
|
|
14273
|
+
* definite value from the moment `apply` runs. That matters because the
|
|
14274
|
+
* readout only renders the button when this is present, and the first
|
|
14275
|
+
* `registerAllSlots()` happens before most of `apply` has finished — a
|
|
14276
|
+
* route captured from `ctx.get('layout')` at that moment is `undefined` on
|
|
14277
|
+
* a host whose layout plugin applies later, and the renderer caches
|
|
14278
|
+
* `inject()` results by entry identity, so nothing would ever correct it.
|
|
13960
14279
|
*
|
|
13961
|
-
*
|
|
13962
|
-
*
|
|
13963
|
-
* its own test. The probe runs per press, which is why this is a function
|
|
13964
|
-
* and not a captured answer.
|
|
14280
|
+
* The `onGiveUp` fallback asks the plugin manager for this bundle's page,
|
|
14281
|
+
* so an unrecognisable shell still lands somewhere useful.
|
|
13965
14282
|
*/
|
|
13966
|
-
const
|
|
14283
|
+
const openSettingsSection = () => openWorkBuddySettingsSection({
|
|
14284
|
+
label: () => t("nav.panel"),
|
|
14285
|
+
onGiveUp: () => {
|
|
14286
|
+
const navigation = softGet("pluginNavigation");
|
|
14287
|
+
if (navigation !== void 0 && typeof navigation.openBundle === "function") try {
|
|
14288
|
+
navigation.openBundle("dsh-connect-workbuddy");
|
|
14289
|
+
} catch {}
|
|
14290
|
+
}
|
|
14291
|
+
});
|
|
13967
14292
|
let settingsScope;
|
|
13968
14293
|
const forms = softGet("configForms");
|
|
13969
14294
|
/**
|
|
13970
|
-
* Register
|
|
14295
|
+
* Register this plugin's page — and its nav glyph — in the Settings panel.
|
|
13971
14296
|
*
|
|
13972
|
-
*
|
|
13973
|
-
*
|
|
13974
|
-
* `
|
|
13975
|
-
*
|
|
13976
|
-
*
|
|
14297
|
+
* ## Why one callback rather than two
|
|
14298
|
+
*
|
|
14299
|
+
* `settings.section` drives the nav row; `settings.section.icon` is rendered
|
|
14300
|
+
* by the shell as `renderSlot('settings.section.icon', …, { only: row.id })`,
|
|
14301
|
+
* so the glyph's cell is only meaningful while the page's id exists.
|
|
14302
|
+
* Registering both from the same `inject` callback makes the pairing
|
|
14303
|
+
* structural: the page's declaration is what makes the glyph addressable at
|
|
14304
|
+
* all, and Cordis disposes both with this fiber.
|
|
14305
|
+
*
|
|
14306
|
+
* ## Why there is NO capability probe
|
|
14307
|
+
*
|
|
14308
|
+
* `ctx.slots.inject(name, …)` already IS the probe. It waits for the
|
|
14309
|
+
* declaration and runs its callback once the slot exists; on a host that
|
|
14310
|
+
* never declares `settings.section` it does nothing at all — no throw, no
|
|
14311
|
+
* queued-forever registration. A probe built on anything else (a version
|
|
14312
|
+
* string, an accessor the service may not expose) turns "not supported
|
|
14313
|
+
* here" into "never registers anywhere", which is how a page nobody can see
|
|
14314
|
+
* ships with no error at all. Let the host answer.
|
|
14315
|
+
*
|
|
14316
|
+
* `WorkBuddyCard` is registered with `surface: 'settings'`: the shell owns
|
|
14317
|
+
* the panel chrome (title, close), so the card drops its own collapse and
|
|
14318
|
+
* back affordances and keeps only its content.
|
|
13977
14319
|
*/
|
|
13978
|
-
const
|
|
14320
|
+
const registerSettingsSection = () => {
|
|
13979
14321
|
try {
|
|
13980
|
-
return ctx.slots.inject(
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
14322
|
+
return ctx.slots.inject("settings.section", () => {
|
|
14323
|
+
const disposers = [];
|
|
14324
|
+
const injected = () => settingsScope === void 0 ? {
|
|
14325
|
+
t,
|
|
14326
|
+
surface: "settings"
|
|
14327
|
+
} : {
|
|
13985
14328
|
t,
|
|
13986
|
-
settingsScope
|
|
14329
|
+
settingsScope,
|
|
14330
|
+
surface: "settings"
|
|
14331
|
+
};
|
|
14332
|
+
disposers.push(ctx.slots.register({
|
|
14333
|
+
name: "settings.section",
|
|
14334
|
+
id: WORKBUDDY_SETTINGS_SECTION_ID,
|
|
14335
|
+
order: 35,
|
|
14336
|
+
label: () => t("nav.panel"),
|
|
14337
|
+
locale: namespace,
|
|
14338
|
+
inject: injected
|
|
14339
|
+
}, WorkBuddyCard));
|
|
14340
|
+
try {
|
|
14341
|
+
const iconInject = ctx.slots.inject("settings.section.icon", () => {
|
|
14342
|
+
const iconDisposer = ctx.slots.register({
|
|
14343
|
+
name: "settings.section.icon",
|
|
14344
|
+
id: WORKBUDDY_SETTINGS_SECTION_ID,
|
|
14345
|
+
locale: namespace
|
|
14346
|
+
}, (iconProps) => {
|
|
14347
|
+
const edge = typeof iconProps?.size === "number" ? iconProps.size : 16;
|
|
14348
|
+
return (0, react.createElement)("img", {
|
|
14349
|
+
src: WORKBUDDY_PLUGIN_ICON,
|
|
14350
|
+
alt: "",
|
|
14351
|
+
width: edge,
|
|
14352
|
+
height: edge,
|
|
14353
|
+
className: "dsm-workbuddy-nav-icon",
|
|
14354
|
+
style: {
|
|
14355
|
+
width: `${edge}px`,
|
|
14356
|
+
height: `${edge}px`,
|
|
14357
|
+
borderRadius: "4px",
|
|
14358
|
+
display: "block",
|
|
14359
|
+
objectFit: "contain",
|
|
14360
|
+
opacity: iconProps?.active === false ? .75 : 1
|
|
14361
|
+
}
|
|
14362
|
+
});
|
|
14363
|
+
});
|
|
14364
|
+
disposers.push(iconDisposer);
|
|
14365
|
+
return iconDisposer;
|
|
14366
|
+
});
|
|
14367
|
+
if (typeof iconInject === "function") disposers.push(iconInject);
|
|
14368
|
+
} catch (error) {
|
|
14369
|
+
console.error("[dsh-connect-workbuddy] settings nav icon failed to register (page unaffected):", error);
|
|
13987
14370
|
}
|
|
13988
|
-
|
|
14371
|
+
return () => {
|
|
14372
|
+
for (const dispose of disposers) try {
|
|
14373
|
+
dispose();
|
|
14374
|
+
} catch {}
|
|
14375
|
+
};
|
|
14376
|
+
});
|
|
13989
14377
|
} catch (error) {
|
|
13990
|
-
console.error(
|
|
14378
|
+
console.error("[dsh-connect-workbuddy] settings section failed to register (host provider unaffected):", error);
|
|
13991
14379
|
return;
|
|
13992
14380
|
}
|
|
13993
14381
|
};
|
|
@@ -14027,16 +14415,12 @@ window.__ModuleLoader__.load({
|
|
|
14027
14415
|
id: "dsh-connect-workbuddy-composer-credits",
|
|
14028
14416
|
order: 4,
|
|
14029
14417
|
locale: namespace,
|
|
14030
|
-
inject: () =>
|
|
14418
|
+
inject: () => ({
|
|
14031
14419
|
t,
|
|
14032
14420
|
position: "composer",
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
position: "composer",
|
|
14037
|
-
settingsScope,
|
|
14038
|
-
onOpenSettings
|
|
14039
|
-
}
|
|
14421
|
+
...settingsScope === void 0 ? {} : { settingsScope },
|
|
14422
|
+
onOpenSettings: openSettingsSection
|
|
14423
|
+
})
|
|
14040
14424
|
}, ComposerCreditsGate));
|
|
14041
14425
|
} catch (error) {
|
|
14042
14426
|
console.error("[dsh-connect-workbuddy] composer credits slot failed to register (host provider unaffected):", error);
|
|
@@ -14132,26 +14516,31 @@ window.__ModuleLoader__.load({
|
|
|
14132
14516
|
* affordance instead of blocking the whole plugin (the same degradation the
|
|
14133
14517
|
* card already promises for a missing settings form).
|
|
14134
14518
|
*/
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14519
|
+
/**
|
|
14520
|
+
* The `main` key this plugin's full page is registered under.
|
|
14521
|
+
*
|
|
14522
|
+
* Also the id the composer readout asks `layout.selectPanel` for, so the two
|
|
14523
|
+
* cannot drift: a rename here that missed `openFullPage` below would leave a
|
|
14524
|
+
* button that throws "main panel is not registered".
|
|
14525
|
+
*/
|
|
14526
|
+
const PANEL_ID = "dsh-connect-workbuddy";
|
|
14527
|
+
/** Hand the centre column back to the conversation. */
|
|
14528
|
+
const backToConversation = () => {
|
|
14529
|
+
const layout = softGet("layout");
|
|
14530
|
+
if (layout !== void 0 && typeof layout.selectPanel === "function") layout.selectPanel(null);
|
|
14531
|
+
};
|
|
14532
|
+
/**
|
|
14533
|
+
* The full page: a `main` panel keyed by {@link PANEL_ID}.
|
|
14534
|
+
*
|
|
14535
|
+
* Registered ALWAYS, independently of the sidebar row. They used to share one
|
|
14536
|
+
* lifetime, which made the page reachable only while the optional nav row was
|
|
14537
|
+
* switched on — and the nav row is a global seat, off by default, that most
|
|
14538
|
+
* users never turn on. The page is what the composer readout's button opens,
|
|
14539
|
+
* so tying the two together meant that button could not exist.
|
|
14540
|
+
*/
|
|
14541
|
+
const registerMainPage = () => {
|
|
14153
14542
|
try {
|
|
14154
|
-
|
|
14543
|
+
return ctx.slots.inject("main", () => ctx.slots.register({
|
|
14155
14544
|
name: "main",
|
|
14156
14545
|
key: PANEL_ID,
|
|
14157
14546
|
locale: namespace,
|
|
@@ -14165,9 +14554,32 @@ window.__ModuleLoader__.load({
|
|
|
14165
14554
|
surface: "page",
|
|
14166
14555
|
backToConversation
|
|
14167
14556
|
}
|
|
14168
|
-
}, WorkBuddyCard))
|
|
14557
|
+
}, WorkBuddyCard));
|
|
14558
|
+
} catch (error) {
|
|
14559
|
+
console.error("[dsh-connect-workbuddy] full page failed to register (host provider unaffected):", error);
|
|
14560
|
+
return;
|
|
14561
|
+
}
|
|
14562
|
+
};
|
|
14563
|
+
/**
|
|
14564
|
+
* The OPTIONAL sidebar nav row that points at {@link registerMainPage}'s page.
|
|
14565
|
+
*
|
|
14566
|
+
* Separate from the page for the reason above: `sidebar.panellist` builds its
|
|
14567
|
+
* rows from ENTRY METADATA (`usePanels`), so this is the only half that has to
|
|
14568
|
+
* come and go with the switch. Registering the row is what makes the page
|
|
14569
|
+
* reachable from the sidebar; the page itself exists either way.
|
|
14570
|
+
*/
|
|
14571
|
+
const registerPanelRow = () => {
|
|
14572
|
+
const disposers = [];
|
|
14573
|
+
try {
|
|
14574
|
+
disposers.push(ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
|
|
14575
|
+
name: "sidebar.panellist",
|
|
14576
|
+
id: PANEL_ID,
|
|
14577
|
+
order: 2,
|
|
14578
|
+
label: () => t("nav.panel"),
|
|
14579
|
+
locale: namespace
|
|
14580
|
+
}, WorkBuddyPanelIcon)));
|
|
14169
14581
|
} catch (error) {
|
|
14170
|
-
console.error("[dsh-connect-workbuddy] sidebar panel
|
|
14582
|
+
console.error("[dsh-connect-workbuddy] sidebar panel row failed to register (host provider unaffected):", error);
|
|
14171
14583
|
}
|
|
14172
14584
|
return disposers;
|
|
14173
14585
|
};
|
|
@@ -14199,7 +14611,7 @@ window.__ModuleLoader__.load({
|
|
|
14199
14611
|
} catch {}
|
|
14200
14612
|
panelDisposers = [];
|
|
14201
14613
|
if (!sidebarPanelWanted()) return;
|
|
14202
|
-
panelDisposers =
|
|
14614
|
+
panelDisposers = registerPanelRow();
|
|
14203
14615
|
};
|
|
14204
14616
|
/**
|
|
14205
14617
|
* The SAME readout in the ambient dock below the composer card (issue #62).
|
|
@@ -14227,16 +14639,12 @@ window.__ModuleLoader__.load({
|
|
|
14227
14639
|
id: "dsh-connect-workbuddy-stats-credits",
|
|
14228
14640
|
order: 10,
|
|
14229
14641
|
locale: namespace,
|
|
14230
|
-
inject: () =>
|
|
14642
|
+
inject: () => ({
|
|
14231
14643
|
t,
|
|
14232
14644
|
position: "stats",
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
position: "stats",
|
|
14237
|
-
settingsScope,
|
|
14238
|
-
onOpenSettings
|
|
14239
|
-
}
|
|
14645
|
+
...settingsScope === void 0 ? {} : { settingsScope },
|
|
14646
|
+
onOpenSettings: openSettingsSection
|
|
14647
|
+
})
|
|
14240
14648
|
}, ComposerCreditsGate));
|
|
14241
14649
|
} catch (error) {
|
|
14242
14650
|
console.error("[dsh-connect-workbuddy] stats credits slot failed to register (host provider unaffected):", error);
|
|
@@ -14331,21 +14739,20 @@ window.__ModuleLoader__.load({
|
|
|
14331
14739
|
* late-arriving namespace has to produce fresh registrations rather than a
|
|
14332
14740
|
* mutated closure.
|
|
14333
14741
|
*
|
|
14334
|
-
* The
|
|
14335
|
-
*
|
|
14336
|
-
*
|
|
14337
|
-
*
|
|
14338
|
-
*
|
|
14339
|
-
* reports nothing at all.
|
|
14742
|
+
* The configuration page is `settings.section` — ONE registration under an
|
|
14743
|
+
* id this plugin owns, so there is no inventory name to match and no
|
|
14744
|
+
* spelling to get wrong (see {@link WORKBUDDY_SETTINGS_SECTION_ID}). The
|
|
14745
|
+
* former `plugins.bundle.config` / `plugins.row.config` pair is GONE with
|
|
14746
|
+
* 5.19.0: the same configuration must not have two editing entries.
|
|
14340
14747
|
*/
|
|
14341
14748
|
const registerAllSlots = () => [
|
|
14342
|
-
|
|
14343
|
-
...WORKBUDDY_CARD_KEYS.map((key) => registerCard("plugins.row.config", `${key}#${key}`)),
|
|
14749
|
+
registerSettingsSection(),
|
|
14344
14750
|
registerComposerCredits(),
|
|
14345
14751
|
registerStatsCredits(),
|
|
14346
14752
|
registerCliLive(),
|
|
14347
14753
|
registerQuotaNotice(),
|
|
14348
|
-
registerModelLabel()
|
|
14754
|
+
registerModelLabel(),
|
|
14755
|
+
registerMainPage()
|
|
14349
14756
|
].filter((disposer) => disposer !== void 0);
|
|
14350
14757
|
/**
|
|
14351
14758
|
* Disposers of the slots registered for the CURRENT binding.
|
|
@@ -14377,7 +14784,7 @@ window.__ModuleLoader__.load({
|
|
|
14377
14784
|
liveDisposers = [];
|
|
14378
14785
|
liveDisposers = registerAllSlots();
|
|
14379
14786
|
try {
|
|
14380
|
-
console.info(`[dsh-connect-workbuddy] registered ${String(liveDisposers.length)} slots (settings form: ${settingsScope === void 0 ? "none —
|
|
14787
|
+
console.info(`[dsh-connect-workbuddy] registered ${String(liveDisposers.length)} slots (settings form: ${settingsScope === void 0 ? "none — page is read-only" : "bound"}, sidebar panel: ${sidebarPanelWanted() ? "on" : "off"})`);
|
|
14381
14788
|
} catch {}
|
|
14382
14789
|
syncPanelRegistration();
|
|
14383
14790
|
};
|