@skillre/dsh-plugin-work-dashboard 0.6.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.en.md +12 -6
  2. package/README.md +32 -8
  3. package/compatibility.json +44 -4
  4. package/docs/DESIGN-1.0-/344/274/230/345/214/226/346/226/271/346/241/210.md +212 -0
  5. package/docs/DESIGN-/344/274/232/350/257/235/344/272/214-SuperAgent/344/270/216/344/273/223/345/272/223/346/224/271/351/200/240.md +275 -0
  6. package/docs/LEDGER-REQUIREMENTS-v3.1.md +367 -0
  7. package/docs/PLAN-0.7-0.9.md +230 -0
  8. package/docs/PLAN-v3.1-adaptation.md +237 -0
  9. package/docs/TARGET-/345/217/260/350/264/246/344/273/223/345/272/223v3.1.md +500 -0
  10. package/docs//350/200/201Mac-SuperAgent/346/224/271/351/200/240/350/256/260/345/275/225-/347/254/254/344/272/214/346/255/245.md +233 -0
  11. package/lib/blockers.d.ts +45 -0
  12. package/lib/blockers.js +160 -0
  13. package/lib/client/api.d.ts +8 -1
  14. package/lib/client/api.js +1 -0
  15. package/lib/client/css/base.d.ts +1 -1
  16. package/lib/client/css/base.js +39 -0
  17. package/lib/client/css/blockers.d.ts +18 -0
  18. package/lib/client/css/blockers.js +196 -0
  19. package/lib/client/css/detail.d.ts +1 -1
  20. package/lib/client/css/detail.js +107 -4
  21. package/lib/client/css/overview.d.ts +5 -4
  22. package/lib/client/css/overview.js +23 -34
  23. package/lib/client/css/summary.d.ts +13 -0
  24. package/lib/client/css/summary.js +187 -0
  25. package/lib/client/format.d.ts +57 -0
  26. package/lib/client/format.js +96 -0
  27. package/lib/client/styles.js +3 -1
  28. package/lib/client/text.js +284 -44
  29. package/lib/client/view-contract.d.ts +9 -1
  30. package/lib/client.js +4836 -968
  31. package/lib/form.d.ts +278 -0
  32. package/lib/form.js +1153 -0
  33. package/lib/gap.d.ts +26 -8
  34. package/lib/gap.js +88 -17
  35. package/lib/index.js +29 -0
  36. package/lib/repo.d.ts +60 -0
  37. package/lib/repo.js +99 -0
  38. package/lib/rules.d.ts +105 -0
  39. package/lib/rules.js +227 -0
  40. package/lib/signals.d.ts +126 -0
  41. package/lib/signals.js +238 -0
  42. package/lib/store.d.ts +16 -1
  43. package/lib/store.js +92 -11
  44. package/lib/transport.d.ts +7 -1
  45. package/lib/transport.js +10 -0
  46. package/lib/types.d.ts +218 -15
  47. package/lib/types.js +21 -0
  48. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Overview styles: the portfolio band, the three project readings, the pending rail.
2
+ * Overview styles: the portfolio band and the three project readings.
3
3
  *
4
4
  * Three decisions drive this sheet:
5
5
  *
@@ -16,8 +16,9 @@
16
16
  * already doing hover duty.
17
17
  *
18
18
  * Class prefixes owned here: `.pf-` (band), `.pcard-`, `.pboard-`, `.ptable-`,
19
- * `.pending-`, plus the shared `.panel` / `.workspace-grid` / `.project-row`
20
- * atoms this surface defines because nothing else uses them.
19
+ * plus the shared `.panel` / `.workspace-grid` / `.project-row` atoms this
20
+ * surface defines because nothing else uses them. The blocker rail that used to
21
+ * live here moved to `css/blockers.ts` when it grew its own source filters.
21
22
  */
22
23
  export const OVERVIEW_CSS = `
23
24
  /* ---------- layout ---------- */
@@ -44,6 +45,13 @@ export const OVERVIEW_CSS = `
44
45
  }
45
46
  .wd-shell .panel-body { padding: 0; }
46
47
  .wd-shell .panel-body.padded { padding: 13px 18px; }
48
+ /* A one-line caption between the panel header and its body: used by the blocker
49
+ panel to state "12 of 30 projects blocked" before the list itself. */
50
+ .wd-shell .panel-note {
51
+ padding: 8px 18px 0;
52
+ font-size: 11px; line-height: 16px;
53
+ color: var(--dsw-alias-label-tertiary);
54
+ }
47
55
 
48
56
  /* ---------- portfolio band ---------- */
49
57
  .wd-shell .pf-band {
@@ -113,6 +121,18 @@ export const OVERVIEW_CSS = `
113
121
  }
114
122
  .wd-shell .pf-note[data-tone="amber"] { color: var(--wd-amber); }
115
123
 
124
+ /* A secondary figure nested inside a band block: same box, quieter rules, so it
125
+ reads as a detail of the chart above it rather than a seventh figure. */
126
+ .wd-shell .pf-subfigure {
127
+ margin-top: 9px; padding-top: 9px;
128
+ border-top: 1px dashed var(--wd-hairline);
129
+ display: flex; flex-direction: column; gap: 6px;
130
+ }
131
+ .wd-shell .pf-subfigure-label {
132
+ font-size: 10px; line-height: 14px; letter-spacing: .05em;
133
+ text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;
134
+ }
135
+
116
136
  /* ---------- project cards ---------- */
117
137
  .wd-shell .pcard-grid {
118
138
  display: grid;
@@ -301,37 +321,6 @@ export const OVERVIEW_CSS = `
301
321
  .wd-shell .row-actions { display: flex; gap: 5px; justify-content: flex-end; }
302
322
  .wd-shell .gap-copy { font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
303
323
 
304
- /* ---------- pending rail ---------- */
305
- .wd-shell .pending { display: flex; flex-direction: column; }
306
- .wd-shell .pending-group { border-bottom: 1px solid var(--wd-hairline); }
307
- .wd-shell .pending-group:last-child { border-bottom: 0; }
308
- .wd-shell .pending-group[data-level="high"] { border-left: 3px solid var(--wd-red); }
309
- .wd-shell .pending-group[data-level="medium"] { border-left: 3px solid var(--wd-amber); }
310
- .wd-shell .pending-group-head {
311
- display: flex; align-items: baseline; gap: 6px;
312
- padding: 9px 13px 5px; flex-wrap: wrap;
313
- }
314
- .wd-shell .pending-rule-no {
315
- flex: none; padding: 0 5px; border-radius: 4px;
316
- font-size: 9.5px; line-height: 15px; font-weight: 650;
317
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
318
- background: var(--wd-slate-soft); color: var(--dsw-alias-label-secondary);
319
- }
320
- .wd-shell .pending-group[data-level="high"] .pending-rule-no { background: var(--wd-red-soft); color: var(--wd-red); }
321
- .wd-shell .pending-group[data-level="medium"] .pending-rule-no { background: var(--wd-amber-soft); color: var(--wd-amber); }
322
- .wd-shell .pending-rule-title { flex: 1 1 auto; min-width: 0; font-size: 11.5px; line-height: 16px; font-weight: 600; overflow-wrap: anywhere; }
323
- .wd-shell .pending-rule-count { flex: none; font-size: 9.5px; color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums; }
324
- .wd-shell .pending-group-body { padding: 0 13px 10px; display: flex; flex-direction: column; gap: 6px; }
325
- .wd-shell .pending-gap { display: flex; flex-direction: column; gap: 2px; }
326
- .wd-shell .pending-gap-copy { font-size: 10.5px; line-height: 15px; color: var(--dsw-alias-label-secondary); overflow-wrap: anywhere; }
327
- .wd-shell .pending-gap-project { display: flex; }
328
- .wd-shell .pending-link {
329
- padding: 0; border: 0; background: transparent; cursor: pointer;
330
- font: inherit; font-size: 10px; color: var(--wd-primary); text-align: left;
331
- }
332
- .wd-shell .pending-link:hover { text-decoration: underline; }
333
- .wd-shell .pending-more { font-size: 9.5px; line-height: 14px; color: var(--dsw-alias-label-tertiary); font-style: italic; }
334
-
335
324
  @media (prefers-reduced-motion: reduce) {
336
325
  .wd-shell .pcard, .wd-shell .pboard-card, .wd-shell .project-row { transition: none; }
337
326
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * KPI strip, budget panel and in-stage progress styles.
3
+ *
4
+ * Three figures with one shared constraint: they are all READ-FIRST surfaces, so
5
+ * they use numbers at display size (17–22px) and labels at 10.5–11.5px. The
6
+ * earlier surfaces rendered every number at 10px, which made a portfolio of
7
+ * thirty projects read like a log file.
8
+ *
9
+ * Colour vocabulary is the same everywhere: green = justified/approved, amber =
10
+ * waiting, red = a gap that costs money, blue = neutral information. Nothing
11
+ * here introduces a fifth judgement colour.
12
+ */
13
+ export declare const SUMMARY_CSS = "\n/* ---------- KPI strip ---------- */\n.wd-shell .kpi-strip {\n border: 1px solid var(--wd-hairline); border-radius: 12px;\n background: var(--wd-surface); box-shadow: var(--wd-shadow-1);\n margin-bottom: 16px; overflow: hidden;\n}\n.wd-shell .kpi-cells {\n display: grid;\n grid-template-columns: repeat(5, minmax(0, 1fr));\n}\n@media (max-width: 1180px) { .wd-shell .kpi-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); } }\n@media (max-width: 720px) { .wd-shell .kpi-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n\n.wd-shell .kpi-cell {\n display: flex; flex-direction: column; gap: 2px;\n padding: 12px 16px;\n border-right: 1px solid var(--wd-hairline);\n min-width: 0;\n}\n.wd-shell .kpi-cell:last-child { border-right: 0; }\n/* A hairline above the value carries the tone, so the number itself stays the\n same ink on every cell: five differently-coloured numbers would read as five\n different kinds of number. */\n.wd-shell .kpi-label {\n font-size: 10.5px; line-height: 15px; letter-spacing: .05em;\n text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n}\n.wd-shell .kpi-value {\n font-size: 21px; line-height: 28px; font-weight: 650;\n color: var(--wd-text); font-variant-numeric: tabular-nums;\n letter-spacing: -.01em;\n}\n.wd-shell .kpi-cell[data-tone=\"red\"] .kpi-value { color: var(--wd-red); }\n.wd-shell .kpi-cell[data-tone=\"green\"] .kpi-value { color: var(--wd-green); }\n.wd-shell .kpi-cell[data-tone=\"amber\"] .kpi-value { color: var(--wd-amber); }\n.wd-shell .kpi-note {\n font-size: 10.5px; line-height: 15px;\n color: var(--dsw-alias-label-tertiary);\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n}\n\n.wd-shell .kpi-stages {\n display: flex; align-items: center; gap: 10px;\n padding: 9px 16px;\n border-top: 1px solid var(--wd-hairline);\n background: var(--wd-inset);\n flex-wrap: wrap;\n}\n.wd-shell .kpi-stages-label {\n flex: none; font-size: 10.5px; line-height: 15px; letter-spacing: .05em;\n text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;\n}\n.wd-shell .kpi-stage-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }\n.wd-shell .kpi-stage-chip {\n display: inline-flex; align-items: center; gap: 5px;\n height: 24px; padding: 0 9px;\n border: 1px solid var(--wd-hairline); border-radius: 20px;\n background: var(--wd-surface); color: var(--dsw-alias-label-secondary);\n font-size: 11px; line-height: 16px; cursor: pointer; white-space: nowrap;\n transition: background .12s ease, border-color .12s ease, color .12s ease;\n}\n.wd-shell .kpi-stage-chip:hover:not([disabled]) { background: var(--wd-canvas); color: var(--wd-text); }\n.wd-shell .kpi-stage-chip[data-active=\"true\"] {\n background: var(--wd-primary-soft); border-color: var(--wd-primary);\n color: var(--wd-primary); font-weight: 600;\n}\n/* A zero bucket stays visible but muted: its existence is information (\"nothing\n reached G3\"), and hiding it would make the funnel look shorter than it is. */\n.wd-shell .kpi-stage-chip[data-zero=\"true\"] { opacity: .5; }\n.wd-shell .kpi-stage-count {\n font-size: 10.5px; font-variant-numeric: tabular-nums;\n color: var(--dsw-alias-label-tertiary); font-weight: 500;\n}\n.wd-shell .kpi-stage-chip[data-active=\"true\"] .kpi-stage-count { color: var(--wd-primary); }\n.wd-shell .kpi-stages-summary {\n margin-left: auto; font-size: 10.5px; line-height: 15px;\n color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n}\n@media (max-width: 900px) { .wd-shell .kpi-stages-summary { display: none; } }\n\n/* ---------- budget panel ---------- */\n.wd-shell .budget-panel {\n border: 1px solid var(--wd-hairline); border-radius: 12px;\n background: var(--wd-surface); box-shadow: var(--wd-shadow-1);\n padding: 13px 16px 14px;\n display: flex; flex-direction: column; gap: 11px;\n}\n.wd-shell .budget-head { display: flex; align-items: baseline; gap: 9px; }\n.wd-shell .budget-title { margin: 0; font-size: 13.5px; line-height: 20px; font-weight: 650; }\n.wd-shell .budget-note { margin-left: auto; font-size: 10.5px; color: var(--dsw-alias-label-tertiary); }\n.wd-shell .budget-total { display: flex; align-items: baseline; gap: 8px; }\n.wd-shell .budget-total-label {\n font-size: 10.5px; line-height: 15px; letter-spacing: .05em;\n text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;\n}\n.wd-shell .budget-total-value {\n font-size: 22px; line-height: 30px; font-weight: 650; color: var(--wd-text);\n font-variant-numeric: tabular-nums; letter-spacing: -.01em;\n}\n.wd-shell .budget-total-unit { margin-left: 4px; font-size: 11px; font-weight: 500; color: var(--dsw-alias-label-tertiary); }\n.wd-shell .budget-bar {\n display: flex; height: 8px; border-radius: 5px; overflow: hidden;\n background: var(--wd-inset); border: 1px solid var(--wd-hairline);\n}\n.wd-shell .budget-bar-segment { height: 100%; }\n.wd-shell .budget-bar-segment[data-tone=\"green\"] { background: var(--wd-green); }\n.wd-shell .budget-bar-segment[data-tone=\"amber\"] { background: var(--wd-amber); }\n.wd-shell .budget-rows { margin: 0; display: flex; flex-direction: column; gap: 5px; }\n.wd-shell .budget-row { display: flex; align-items: baseline; gap: 8px; }\n.wd-shell .budget-row-label {\n flex: none; width: 82px; font-size: 11.5px; line-height: 17px; font-weight: 600;\n color: var(--dsw-alias-label-secondary);\n}\n.wd-shell .budget-row[data-tone=\"green\"] .budget-row-label { color: var(--wd-green); }\n.wd-shell .budget-row[data-tone=\"amber\"] .budget-row-label { color: var(--wd-amber); }\n.wd-shell .budget-row[data-tone=\"red\"] .budget-row-label { color: var(--wd-red); }\n.wd-shell .budget-row-value {\n margin: 0; font-size: 11.5px; line-height: 17px;\n color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums;\n}\n.wd-shell .budget-warning {\n margin: 0; padding: 7px 10px;\n border-radius: 8px; background: var(--wd-red-soft); color: var(--wd-red);\n font-size: 11.5px; line-height: 17px;\n}\n.wd-shell .budget-empty {\n margin: 0; padding: 16px 4px; text-align: center;\n font-size: 12px; color: var(--dsw-alias-label-tertiary);\n}\n.wd-shell .budget-orgs { display: flex; flex-direction: column; gap: 5px; }\n.wd-shell .budget-orgs-label {\n font-size: 10.5px; line-height: 15px; letter-spacing: .05em;\n text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;\n}\n.wd-shell .budget-org-row {\n display: grid; grid-template-columns: minmax(0, 1fr) 74px 34px;\n align-items: center; gap: 8px;\n}\n.wd-shell .budget-org-name {\n font-size: 11.5px; line-height: 17px; color: var(--wd-text);\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n}\n.wd-shell .budget-org-system { margin-left: 5px; font-size: 10px; color: var(--dsw-alias-label-tertiary); }\n.wd-shell .budget-org-value {\n font-size: 10.5px; line-height: 15px; text-align: right;\n color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;\n}\n.wd-shell .budget-concentration {\n margin: 0; font-size: 10.5px; line-height: 15px;\n color: var(--dsw-alias-label-tertiary);\n}\n\n/* ---------- in-stage progress ---------- */\n.wd-shell .stage-progress { display: flex; flex-direction: column; gap: 4px; }\n.wd-shell .stage-progress-row {\n display: grid; grid-template-columns: 68px minmax(0, 1fr) 82px;\n align-items: center; gap: 8px;\n}\n.wd-shell .stage-progress-label {\n font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-secondary);\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n}\n.wd-shell .stage-progress-value {\n font-size: 10.5px; line-height: 15px; text-align: right;\n color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;\n}\n.wd-shell .stage-progress-empty {\n grid-column: 2 / -1; font-size: 10.5px; line-height: 15px;\n color: var(--dsw-alias-label-tertiary);\n}\n.wd-shell .stage-progress-row[data-empty=\"true\"] { opacity: .7; }\n";
@@ -0,0 +1,187 @@
1
+ /**
2
+ * KPI strip, budget panel and in-stage progress styles.
3
+ *
4
+ * Three figures with one shared constraint: they are all READ-FIRST surfaces, so
5
+ * they use numbers at display size (17–22px) and labels at 10.5–11.5px. The
6
+ * earlier surfaces rendered every number at 10px, which made a portfolio of
7
+ * thirty projects read like a log file.
8
+ *
9
+ * Colour vocabulary is the same everywhere: green = justified/approved, amber =
10
+ * waiting, red = a gap that costs money, blue = neutral information. Nothing
11
+ * here introduces a fifth judgement colour.
12
+ */
13
+ export const SUMMARY_CSS = `
14
+ /* ---------- KPI strip ---------- */
15
+ .wd-shell .kpi-strip {
16
+ border: 1px solid var(--wd-hairline); border-radius: 12px;
17
+ background: var(--wd-surface); box-shadow: var(--wd-shadow-1);
18
+ margin-bottom: 16px; overflow: hidden;
19
+ }
20
+ .wd-shell .kpi-cells {
21
+ display: grid;
22
+ grid-template-columns: repeat(5, minmax(0, 1fr));
23
+ }
24
+ @media (max-width: 1180px) { .wd-shell .kpi-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
25
+ @media (max-width: 720px) { .wd-shell .kpi-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
26
+
27
+ .wd-shell .kpi-cell {
28
+ display: flex; flex-direction: column; gap: 2px;
29
+ padding: 12px 16px;
30
+ border-right: 1px solid var(--wd-hairline);
31
+ min-width: 0;
32
+ }
33
+ .wd-shell .kpi-cell:last-child { border-right: 0; }
34
+ /* A hairline above the value carries the tone, so the number itself stays the
35
+ same ink on every cell: five differently-coloured numbers would read as five
36
+ different kinds of number. */
37
+ .wd-shell .kpi-label {
38
+ font-size: 10.5px; line-height: 15px; letter-spacing: .05em;
39
+ text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;
40
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
41
+ }
42
+ .wd-shell .kpi-value {
43
+ font-size: 21px; line-height: 28px; font-weight: 650;
44
+ color: var(--wd-text); font-variant-numeric: tabular-nums;
45
+ letter-spacing: -.01em;
46
+ }
47
+ .wd-shell .kpi-cell[data-tone="red"] .kpi-value { color: var(--wd-red); }
48
+ .wd-shell .kpi-cell[data-tone="green"] .kpi-value { color: var(--wd-green); }
49
+ .wd-shell .kpi-cell[data-tone="amber"] .kpi-value { color: var(--wd-amber); }
50
+ .wd-shell .kpi-note {
51
+ font-size: 10.5px; line-height: 15px;
52
+ color: var(--dsw-alias-label-tertiary);
53
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
54
+ }
55
+
56
+ .wd-shell .kpi-stages {
57
+ display: flex; align-items: center; gap: 10px;
58
+ padding: 9px 16px;
59
+ border-top: 1px solid var(--wd-hairline);
60
+ background: var(--wd-inset);
61
+ flex-wrap: wrap;
62
+ }
63
+ .wd-shell .kpi-stages-label {
64
+ flex: none; font-size: 10.5px; line-height: 15px; letter-spacing: .05em;
65
+ text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;
66
+ }
67
+ .wd-shell .kpi-stage-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
68
+ .wd-shell .kpi-stage-chip {
69
+ display: inline-flex; align-items: center; gap: 5px;
70
+ height: 24px; padding: 0 9px;
71
+ border: 1px solid var(--wd-hairline); border-radius: 20px;
72
+ background: var(--wd-surface); color: var(--dsw-alias-label-secondary);
73
+ font-size: 11px; line-height: 16px; cursor: pointer; white-space: nowrap;
74
+ transition: background .12s ease, border-color .12s ease, color .12s ease;
75
+ }
76
+ .wd-shell .kpi-stage-chip:hover:not([disabled]) { background: var(--wd-canvas); color: var(--wd-text); }
77
+ .wd-shell .kpi-stage-chip[data-active="true"] {
78
+ background: var(--wd-primary-soft); border-color: var(--wd-primary);
79
+ color: var(--wd-primary); font-weight: 600;
80
+ }
81
+ /* A zero bucket stays visible but muted: its existence is information ("nothing
82
+ reached G3"), and hiding it would make the funnel look shorter than it is. */
83
+ .wd-shell .kpi-stage-chip[data-zero="true"] { opacity: .5; }
84
+ .wd-shell .kpi-stage-count {
85
+ font-size: 10.5px; font-variant-numeric: tabular-nums;
86
+ color: var(--dsw-alias-label-tertiary); font-weight: 500;
87
+ }
88
+ .wd-shell .kpi-stage-chip[data-active="true"] .kpi-stage-count { color: var(--wd-primary); }
89
+ .wd-shell .kpi-stages-summary {
90
+ margin-left: auto; font-size: 10.5px; line-height: 15px;
91
+ color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;
92
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
93
+ }
94
+ @media (max-width: 900px) { .wd-shell .kpi-stages-summary { display: none; } }
95
+
96
+ /* ---------- budget panel ---------- */
97
+ .wd-shell .budget-panel {
98
+ border: 1px solid var(--wd-hairline); border-radius: 12px;
99
+ background: var(--wd-surface); box-shadow: var(--wd-shadow-1);
100
+ padding: 13px 16px 14px;
101
+ display: flex; flex-direction: column; gap: 11px;
102
+ }
103
+ .wd-shell .budget-head { display: flex; align-items: baseline; gap: 9px; }
104
+ .wd-shell .budget-title { margin: 0; font-size: 13.5px; line-height: 20px; font-weight: 650; }
105
+ .wd-shell .budget-note { margin-left: auto; font-size: 10.5px; color: var(--dsw-alias-label-tertiary); }
106
+ .wd-shell .budget-total { display: flex; align-items: baseline; gap: 8px; }
107
+ .wd-shell .budget-total-label {
108
+ font-size: 10.5px; line-height: 15px; letter-spacing: .05em;
109
+ text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;
110
+ }
111
+ .wd-shell .budget-total-value {
112
+ font-size: 22px; line-height: 30px; font-weight: 650; color: var(--wd-text);
113
+ font-variant-numeric: tabular-nums; letter-spacing: -.01em;
114
+ }
115
+ .wd-shell .budget-total-unit { margin-left: 4px; font-size: 11px; font-weight: 500; color: var(--dsw-alias-label-tertiary); }
116
+ .wd-shell .budget-bar {
117
+ display: flex; height: 8px; border-radius: 5px; overflow: hidden;
118
+ background: var(--wd-inset); border: 1px solid var(--wd-hairline);
119
+ }
120
+ .wd-shell .budget-bar-segment { height: 100%; }
121
+ .wd-shell .budget-bar-segment[data-tone="green"] { background: var(--wd-green); }
122
+ .wd-shell .budget-bar-segment[data-tone="amber"] { background: var(--wd-amber); }
123
+ .wd-shell .budget-rows { margin: 0; display: flex; flex-direction: column; gap: 5px; }
124
+ .wd-shell .budget-row { display: flex; align-items: baseline; gap: 8px; }
125
+ .wd-shell .budget-row-label {
126
+ flex: none; width: 82px; font-size: 11.5px; line-height: 17px; font-weight: 600;
127
+ color: var(--dsw-alias-label-secondary);
128
+ }
129
+ .wd-shell .budget-row[data-tone="green"] .budget-row-label { color: var(--wd-green); }
130
+ .wd-shell .budget-row[data-tone="amber"] .budget-row-label { color: var(--wd-amber); }
131
+ .wd-shell .budget-row[data-tone="red"] .budget-row-label { color: var(--wd-red); }
132
+ .wd-shell .budget-row-value {
133
+ margin: 0; font-size: 11.5px; line-height: 17px;
134
+ color: var(--dsw-alias-label-secondary); font-variant-numeric: tabular-nums;
135
+ }
136
+ .wd-shell .budget-warning {
137
+ margin: 0; padding: 7px 10px;
138
+ border-radius: 8px; background: var(--wd-red-soft); color: var(--wd-red);
139
+ font-size: 11.5px; line-height: 17px;
140
+ }
141
+ .wd-shell .budget-empty {
142
+ margin: 0; padding: 16px 4px; text-align: center;
143
+ font-size: 12px; color: var(--dsw-alias-label-tertiary);
144
+ }
145
+ .wd-shell .budget-orgs { display: flex; flex-direction: column; gap: 5px; }
146
+ .wd-shell .budget-orgs-label {
147
+ font-size: 10.5px; line-height: 15px; letter-spacing: .05em;
148
+ text-transform: uppercase; color: var(--dsw-alias-label-tertiary); font-weight: 600;
149
+ }
150
+ .wd-shell .budget-org-row {
151
+ display: grid; grid-template-columns: minmax(0, 1fr) 74px 34px;
152
+ align-items: center; gap: 8px;
153
+ }
154
+ .wd-shell .budget-org-name {
155
+ font-size: 11.5px; line-height: 17px; color: var(--wd-text);
156
+ overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
157
+ }
158
+ .wd-shell .budget-org-system { margin-left: 5px; font-size: 10px; color: var(--dsw-alias-label-tertiary); }
159
+ .wd-shell .budget-org-value {
160
+ font-size: 10.5px; line-height: 15px; text-align: right;
161
+ color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;
162
+ }
163
+ .wd-shell .budget-concentration {
164
+ margin: 0; font-size: 10.5px; line-height: 15px;
165
+ color: var(--dsw-alias-label-tertiary);
166
+ }
167
+
168
+ /* ---------- in-stage progress ---------- */
169
+ .wd-shell .stage-progress { display: flex; flex-direction: column; gap: 4px; }
170
+ .wd-shell .stage-progress-row {
171
+ display: grid; grid-template-columns: 68px minmax(0, 1fr) 82px;
172
+ align-items: center; gap: 8px;
173
+ }
174
+ .wd-shell .stage-progress-label {
175
+ font-size: 11px; line-height: 16px; color: var(--dsw-alias-label-secondary);
176
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
177
+ }
178
+ .wd-shell .stage-progress-value {
179
+ font-size: 10.5px; line-height: 15px; text-align: right;
180
+ color: var(--dsw-alias-label-tertiary); font-variant-numeric: tabular-nums;
181
+ }
182
+ .wd-shell .stage-progress-empty {
183
+ grid-column: 2 / -1; font-size: 10.5px; line-height: 15px;
184
+ color: var(--dsw-alias-label-tertiary);
185
+ }
186
+ .wd-shell .stage-progress-row[data-empty="true"] { opacity: .7; }
187
+ `;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Shared display formatters.
3
+ *
4
+ * `formatWan` and `formatDate` had three copies each (overview, detail,
5
+ * insights), and `stageLabel` had two. Identical copies are not a style problem:
6
+ * three `formatDate` bodies meant three places to fix a timezone bug, and they
7
+ * had already drifted — the insights copy accepted `''` where the detail copy
8
+ * accepted `null`. One module, one behaviour.
9
+ *
10
+ * Everything here is pure and locale-explicit: the caller passes the active
11
+ * locale, so the result never depends on ambient state (and a replay or a test
12
+ * renders the same string as the live page).
13
+ */
14
+ import type { Translate } from './text.js';
15
+ /**
16
+ * Format a 万元 figure with thousands separators.
17
+ *
18
+ * Rounds to one decimal: the ledger stores whole 万元, so a decimal only ever
19
+ * appears from an average, and two decimals would imply a precision the data
20
+ * does not have.
21
+ */
22
+ export declare function formatWan(value: number): string;
23
+ /**
24
+ * Format a ledger date for the active locale.
25
+ *
26
+ * The ledger stores calendar dates, not instants, so a bare `new Date('2026-11-01')`
27
+ * parses as UTC midnight and prints the previous day west of Greenwich. The
28
+ * string is therefore read as local midnight. Anything that is not a calendar
29
+ * date is returned verbatim: showing the raw value is honest, and inventing a
30
+ * parse would hide a hand-edited typo.
31
+ *
32
+ * @param value the raw field, `null`, or `''`
33
+ * @param locale the active locale id
34
+ * @param fallback what to return for an absent value; defaults to `''`
35
+ */
36
+ export declare function formatDate(value: string | null, locale: string, fallback?: string): string;
37
+ /** Format an ISO instant (not a calendar date) as `HH:MM` for the status bar. */
38
+ export declare function clockOf(value: string | null, locale: string): string;
39
+ /**
40
+ * The dictionary label for a raw stage bucket key.
41
+ *
42
+ * Accepts the two sentinels `closed` / `unknown` alongside the five gate ids,
43
+ * because every stage-shaped surface (funnel, board column, filter chip) has to
44
+ * render all seven. An unrecognized value falls through unchanged rather than
45
+ * disappearing.
46
+ */
47
+ export declare function stageLabel(t: Translate, key: string): string;
48
+ /**
49
+ * A stage bucket key for one project: `closed` wins over the normalized stage.
50
+ *
51
+ * Kept here rather than inline so the funnel, the board and the blocker list
52
+ * bucket a project identically.
53
+ */
54
+ export declare function stageBucketKey(project: {
55
+ closed: boolean;
56
+ stage: string | null;
57
+ }): string;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Shared display formatters.
3
+ *
4
+ * `formatWan` and `formatDate` had three copies each (overview, detail,
5
+ * insights), and `stageLabel` had two. Identical copies are not a style problem:
6
+ * three `formatDate` bodies meant three places to fix a timezone bug, and they
7
+ * had already drifted — the insights copy accepted `''` where the detail copy
8
+ * accepted `null`. One module, one behaviour.
9
+ *
10
+ * Everything here is pure and locale-explicit: the caller passes the active
11
+ * locale, so the result never depends on ambient state (and a replay or a test
12
+ * renders the same string as the live page).
13
+ */
14
+ import { STAGES } from '../types.js';
15
+ /**
16
+ * Format a 万元 figure with thousands separators.
17
+ *
18
+ * Rounds to one decimal: the ledger stores whole 万元, so a decimal only ever
19
+ * appears from an average, and two decimals would imply a precision the data
20
+ * does not have.
21
+ */
22
+ export function formatWan(value) {
23
+ const rounded = Math.round(value * 10) / 10;
24
+ return rounded.toLocaleString('zh-CN', { maximumFractionDigits: 1 });
25
+ }
26
+ /** `true` when the value is a calendar date (`YYYY-MM-DD`), not an instant. */
27
+ function isCalendarDate(value) {
28
+ return /^\d{4}-\d{2}-\d{2}$/.test(value);
29
+ }
30
+ /**
31
+ * Format a ledger date for the active locale.
32
+ *
33
+ * The ledger stores calendar dates, not instants, so a bare `new Date('2026-11-01')`
34
+ * parses as UTC midnight and prints the previous day west of Greenwich. The
35
+ * string is therefore read as local midnight. Anything that is not a calendar
36
+ * date is returned verbatim: showing the raw value is honest, and inventing a
37
+ * parse would hide a hand-edited typo.
38
+ *
39
+ * @param value the raw field, `null`, or `''`
40
+ * @param locale the active locale id
41
+ * @param fallback what to return for an absent value; defaults to `''`
42
+ */
43
+ export function formatDate(value, locale, fallback = '') {
44
+ if (value === null || value === '')
45
+ return fallback;
46
+ if (!isCalendarDate(value))
47
+ return value;
48
+ const stamp = new Date(`${value}T00:00:00`);
49
+ if (Number.isNaN(stamp.getTime()))
50
+ return value;
51
+ return stamp.toLocaleDateString(locale.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en-US', {
52
+ year: 'numeric',
53
+ month: '2-digit',
54
+ day: '2-digit',
55
+ });
56
+ }
57
+ /** Format an ISO instant (not a calendar date) as `HH:MM` for the status bar. */
58
+ export function clockOf(value, locale) {
59
+ if (value === null)
60
+ return '';
61
+ const stamp = new Date(value);
62
+ if (Number.isNaN(stamp.getTime()))
63
+ return '';
64
+ return stamp.toLocaleTimeString(locale.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en-US', {
65
+ hour: '2-digit',
66
+ minute: '2-digit',
67
+ });
68
+ }
69
+ /**
70
+ * The dictionary label for a raw stage bucket key.
71
+ *
72
+ * Accepts the two sentinels `closed` / `unknown` alongside the five gate ids,
73
+ * because every stage-shaped surface (funnel, board column, filter chip) has to
74
+ * render all seven. An unrecognized value falls through unchanged rather than
75
+ * disappearing.
76
+ */
77
+ export function stageLabel(t, key) {
78
+ if (key === 'closed')
79
+ return t('stageClosed');
80
+ if (key === 'unknown')
81
+ return t('stageUnknown');
82
+ if (STAGES.includes(key))
83
+ return t(`stage${key}`);
84
+ return key;
85
+ }
86
+ /**
87
+ * A stage bucket key for one project: `closed` wins over the normalized stage.
88
+ *
89
+ * Kept here rather than inline so the funnel, the board and the blocker list
90
+ * bucket a project identically.
91
+ */
92
+ export function stageBucketKey(project) {
93
+ if (project.closed)
94
+ return 'closed';
95
+ return project.stage ?? 'unknown';
96
+ }
@@ -13,10 +13,12 @@
13
13
  * another surface's rules.
14
14
  */
15
15
  import { BASE_CSS } from './css/base.js';
16
+ import { BLOCKERS_CSS } from './css/blockers.js';
16
17
  import { CHARTS_CSS } from './css/charts.js';
17
18
  import { DETAIL_CSS } from './css/detail.js';
18
19
  import { INSIGHTS_CSS } from './css/insights.js';
19
20
  import { OVERVIEW_CSS } from './css/overview.js';
20
- export const CONSOLE_CSS = [BASE_CSS, CHARTS_CSS, OVERVIEW_CSS, DETAIL_CSS, INSIGHTS_CSS].join('\n');
21
+ import { SUMMARY_CSS } from './css/summary.js';
22
+ export const CONSOLE_CSS = [BASE_CSS, CHARTS_CSS, OVERVIEW_CSS, SUMMARY_CSS, DETAIL_CSS, INSIGHTS_CSS, BLOCKERS_CSS].join('\n');
21
23
  /** The scoped root class, re-exported for tests that assert the scope. */
22
24
  export const ROOT_CLASS = 'wd-shell';