@skillre/dsh-plugin-work-dashboard 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/DESIGN-/345/257/274/345/207/272/350/241/250/345/215/225/351/207/215/350/256/276/350/256/241.md +330 -0
- package/docs/DESIGN-/346/217/220/351/206/222/344/270/216Gate/350/257/204/345/256/241.md +518 -0
- package/docs/DESIGN-/350/241/250/345/215/225/345/210/206/351/230/266/346/256/265.md +420 -0
- package/lib/client/api.d.ts +1 -1
- package/lib/client/api.js +3 -1
- package/lib/client/css/base.d.ts +1 -1
- package/lib/client/css/base.js +30 -0
- package/lib/client/text.js +28 -4
- package/lib/client.js +165 -24
- package/lib/form.d.ts +189 -9
- package/lib/form.js +1038 -188
- package/lib/index.js +5 -3
- package/lib/transport.d.ts +5 -2
- package/lib/transport.js +4 -1
- package/lib/types.d.ts +16 -2
- package/package.json +1 -1
- package/skills/poc-export/SKILL.md +18 -5
- package/skills/poc-submit/SKILL.md +62 -13
package/lib/client.js
CHANGED
|
@@ -99,7 +99,10 @@ window.__ModuleLoader__.load({
|
|
|
99
99
|
detail: (pocId, signal) => call({ action: "detail", pocId }, signal),
|
|
100
100
|
risks: (signal) => call({ action: "risks" }, signal),
|
|
101
101
|
timeline: (signal) => call({ action: "timeline" }, signal),
|
|
102
|
-
exportForm: (mode, pocIds, signal) => call(
|
|
102
|
+
exportForm: (mode, pocIds, intent, signal) => call(
|
|
103
|
+
intent === void 0 ? { action: "export-form", mode, pocIds: [...pocIds] } : { action: "export-form", mode, pocIds: [...pocIds], intent },
|
|
104
|
+
signal
|
|
105
|
+
)
|
|
103
106
|
};
|
|
104
107
|
}
|
|
105
108
|
|
|
@@ -252,12 +255,25 @@ window.__ModuleLoader__.load({
|
|
|
252
255
|
exportSelectNone: "\u6E05\u7A7A",
|
|
253
256
|
exportSelected: "\u5DF2\u9009 {count} \u4E2A\u9879\u76EE",
|
|
254
257
|
exportBlank: "\u53EA\u5BFC\u51FA\u7A7A\u767D\u8868\u5355\uFF08\u65B0\u5EFA\u9879\u76EE\u7528\uFF09",
|
|
255
|
-
exportBlankHint: "\
|
|
258
|
+
exportBlankHint: "\u8FD8\u6CA1\u52FE\u9009\u9879\u76EE\u3002\u81F3\u5C11\u9009\u4E00\u4E2A\uFF0C\u5426\u5219\u8868\u5355\u91CC\u6CA1\u6709\u53EF\u8865\u5145\u7684\u5BF9\u8C61\u3002",
|
|
259
|
+
// The three intents. They differ in WHAT the form asks, not just how much it
|
|
260
|
+
// shows, so each carries a one-line explanation rather than a bare label.
|
|
261
|
+
exportIntentLabel: "\u8FD9\u6B21\u8981\u505A\u4EC0\u4E48",
|
|
262
|
+
exportIntentNew: "\u65B0\u5EFA\u9879\u76EE",
|
|
263
|
+
exportIntentNewHint: "\u7ACB\u9879\u767B\u8BB0\uFF1A\u8EAB\u4EFD + G0 \u4E94\u5FC5\u586B",
|
|
264
|
+
exportIntentSupplement: "\u8865\u5145\u4FE1\u606F",
|
|
265
|
+
exportIntentSupplementHint: "\u53EA\u586B\u5F53\u524D\u9636\u6BB5\u8BE5\u586B\u7684\uFF0C\u5176\u4F59\u53EA\u8BFB",
|
|
266
|
+
exportIntentProgress: "\u8BB0\u5F55\u8FDB\u5C55",
|
|
267
|
+
exportIntentProgressHint: "\u53EA\u586B\u8FD9\u4E00\u8F6E\uFF0C\u4E00\u5C4F\u5B8C\u6210",
|
|
268
|
+
exportNewHint: "\u65B0\u5EFA\u9879\u76EE\u8868\u5355\u53EA\u95EE\u4E24\u4EF6\u4E8B\uFF1A\u9879\u76EE\u8EAB\u4EFD\uFF0C\u548C G0 \u7684\u4E94\u4E2A\u5FC5\u586B\u9879\u3002\u8BA1\u5212\uFF08\u6307\u6807\u3001\u573A\u666F\uFF09\u7559\u5230 G1 \u518D\u586B\u2014\u2014\u53F0\u8D26\u4E5F\u662F G0 \u901A\u8FC7\u4E4B\u540E\u624D\u8981\u6C42\u8BA1\u5212\u3002",
|
|
269
|
+
exportStageFilterLabel: "\u6309\u9636\u6BB5\u7B5B\u9009",
|
|
270
|
+
exportStageAll: "\u5168\u90E8\u9636\u6BB5",
|
|
271
|
+
exportStageEmpty: "\u8FD9\u4E2A\u9636\u6BB5\u4E0B\u6CA1\u6709\u9879\u76EE\u3002",
|
|
272
|
+
exportHint: "\u8868\u5355\u5B8C\u5168\u79BB\u7EBF\u53EF\u7528\uFF1A\u6CA1\u6709 CDN\u3001\u6CA1\u6709\u5916\u90E8\u5B57\u4F53\u3001\u6CA1\u6709\u670D\u52A1\u5668\u3002\u586B\u5B8C\u4E0B\u8F7D\u7684\u53D8\u66F4\u96C6\uFF08.json\uFF09\u53D1\u7ED9\u9879\u76EE\u8D1F\u8D23\u4EBA\uFF0C\u7531\u4ED6\u5408\u5E76\u8FDB\u53F0\u8D26\u3002",
|
|
256
273
|
exportGenerate: "\u751F\u6210\u5E76\u4E0B\u8F7D",
|
|
257
274
|
exportGenerating: "\u6B63\u5728\u751F\u6210\u2026",
|
|
258
275
|
exportDone: "\u5DF2\u4E0B\u8F7D {name}",
|
|
259
276
|
exportSize: "{kb} KB",
|
|
260
|
-
exportHint: "\u8868\u5355\u5B8C\u5168\u79BB\u7EBF\u53EF\u7528\uFF1A\u6CA1\u6709 CDN\u3001\u6CA1\u6709\u5916\u90E8\u5B57\u4F53\u3001\u6CA1\u6709\u670D\u52A1\u5668\u3002\u586B\u5B8C\u5BFC\u51FA\u7684 .yaml \u53EF\u4EE5\u76F4\u63A5\u62D6\u8FDB\u672C\u63D2\u4EF6\u7684\u5BFC\u5165\u9875\u3002",
|
|
261
277
|
exportNoProjects: "\u5148\u70B9\u3010\u5237\u65B0\u3011\u62C9\u5230\u6570\u636E\uFF0C\u624D\u80FD\u5BFC\u51FA\u5DF2\u6709\u9879\u76EE\u7684\u8868\u5355\u3002",
|
|
262
278
|
exportFailed: "\u751F\u6210\u8868\u5355\u5931\u8D25",
|
|
263
279
|
// Milestone 3: risk board
|
|
@@ -826,12 +842,23 @@ window.__ModuleLoader__.load({
|
|
|
826
842
|
exportSelectNone: "Clear",
|
|
827
843
|
exportSelected: "{count} project(s) selected",
|
|
828
844
|
exportBlank: "Export a blank form only (for a new project)",
|
|
829
|
-
exportBlankHint:
|
|
845
|
+
exportBlankHint: "Nothing selected yet. Pick at least one project, or there is nothing to fill in.",
|
|
846
|
+
exportIntentLabel: "What is this for",
|
|
847
|
+
exportIntentNew: "New project",
|
|
848
|
+
exportIntentNewHint: "Registration: identity + the five G0 requirements",
|
|
849
|
+
exportIntentSupplement: "Fill in a stage",
|
|
850
|
+
exportIntentSupplementHint: "Only the current stage is editable",
|
|
851
|
+
exportIntentProgress: "Record progress",
|
|
852
|
+
exportIntentProgressHint: "One round, one screen",
|
|
853
|
+
exportNewHint: "A new-project form asks only two things: the project identity, and the five Gate 0 requirements. The plan (criteria, scenarios) waits for G1 \u2014 the ledger only demands a plan after G0 passes.",
|
|
854
|
+
exportStageFilterLabel: "Filter by stage",
|
|
855
|
+
exportStageAll: "All stages",
|
|
856
|
+
exportStageEmpty: "No projects at this stage.",
|
|
857
|
+
exportHint: "The form works fully offline: no CDN, no external fonts, no server. The change set (.json) it produces goes to the project owner, who merges it into the ledger.",
|
|
830
858
|
exportGenerate: "Generate and download",
|
|
831
859
|
exportGenerating: "Generating\u2026",
|
|
832
860
|
exportDone: "Downloaded {name}",
|
|
833
861
|
exportSize: "{kb} KB",
|
|
834
|
-
exportHint: "The form works fully offline: no CDN, no external fonts, no server. The .yaml it produces can be dropped straight into this plugin's import page.",
|
|
835
862
|
exportNoProjects: "Refresh first to pull the ledger before exporting an existing project.",
|
|
836
863
|
exportFailed: "Could not generate the form",
|
|
837
864
|
// Milestone 3: risk board
|
|
@@ -4579,11 +4606,31 @@ window.__ModuleLoader__.load({
|
|
|
4579
4606
|
// src/client/export-form.tsx
|
|
4580
4607
|
var import_react3 = require("react");
|
|
4581
4608
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4609
|
+
var STAGE_FILTERS = [
|
|
4610
|
+
{ key: "G0", label: "G0" },
|
|
4611
|
+
{ key: "G1", label: "G1" },
|
|
4612
|
+
{ key: "G2", label: "G2" },
|
|
4613
|
+
{ key: "G3", label: "G3" },
|
|
4614
|
+
{ key: "G4", label: "G4" },
|
|
4615
|
+
{ key: "closed", label: "\u5DF2\u7ED3\u675F" }
|
|
4616
|
+
];
|
|
4582
4617
|
function ExportFormDialog({ api, projects, t, onClose, onError }) {
|
|
4583
4618
|
const rows = (0, import_react3.useMemo)(
|
|
4584
|
-
() => projects.map((project) => ({
|
|
4619
|
+
() => projects.map((project) => ({
|
|
4620
|
+
pocId: project.pocId,
|
|
4621
|
+
name: project.name,
|
|
4622
|
+
company: project.company,
|
|
4623
|
+
stage: project.stageLabel,
|
|
4624
|
+
stageKey: project.closed ? "closed" : project.stage ?? "unknown"
|
|
4625
|
+
})),
|
|
4585
4626
|
[projects]
|
|
4586
4627
|
);
|
|
4628
|
+
const [intent, setIntent] = (0, import_react3.useState)("supplement");
|
|
4629
|
+
const [stageFilter, setStageFilter] = (0, import_react3.useState)(null);
|
|
4630
|
+
const visibleRows = (0, import_react3.useMemo)(
|
|
4631
|
+
() => stageFilter === null ? rows : rows.filter((row) => row.stageKey === stageFilter),
|
|
4632
|
+
[rows, stageFilter]
|
|
4633
|
+
);
|
|
4587
4634
|
const [selected, setSelected] = (0, import_react3.useState)(() => new Set(rows.map((row) => row.pocId)));
|
|
4588
4635
|
const [busy, setBusy] = (0, import_react3.useState)(false);
|
|
4589
4636
|
const toggle = (pocId) => {
|
|
@@ -4594,13 +4641,13 @@ window.__ModuleLoader__.load({
|
|
|
4594
4641
|
return next;
|
|
4595
4642
|
});
|
|
4596
4643
|
};
|
|
4597
|
-
const selectAll = () => setSelected(new Set(
|
|
4644
|
+
const selectAll = () => setSelected(new Set(visibleRows.map((row) => row.pocId)));
|
|
4598
4645
|
const selectNone = () => setSelected(/* @__PURE__ */ new Set());
|
|
4599
4646
|
const generate = async () => {
|
|
4600
4647
|
setBusy(true);
|
|
4601
4648
|
try {
|
|
4602
|
-
const mode =
|
|
4603
|
-
const result = await api.exportForm(mode, mode === "blank" ? [] : [...selected]);
|
|
4649
|
+
const mode = intent === "new" ? "blank" : "fill";
|
|
4650
|
+
const result = await api.exportForm(mode, mode === "blank" ? [] : [...selected], intent);
|
|
4604
4651
|
const blob = new Blob([result.html], { type: "text/html;charset=utf-8" });
|
|
4605
4652
|
const url = URL.createObjectURL(blob);
|
|
4606
4653
|
const anchor = document.createElement("a");
|
|
@@ -4639,12 +4686,66 @@ window.__ModuleLoader__.load({
|
|
|
4639
4686
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "modal-header", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "modal-title", children: t("exportTitle") }) }),
|
|
4640
4687
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "modal-content", children: [
|
|
4641
4688
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportSubtitle") }),
|
|
4642
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "export-intent", role: "group", "aria-label": t("exportIntentLabel"), children: [
|
|
4690
|
+
{ key: "new", label: t("exportIntentNew"), hint: t("exportIntentNewHint") },
|
|
4691
|
+
{ key: "supplement", label: t("exportIntentSupplement"), hint: t("exportIntentSupplementHint") },
|
|
4692
|
+
{ key: "progress", label: t("exportIntentProgress"), hint: t("exportIntentProgressHint") }
|
|
4693
|
+
].map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4694
|
+
"button",
|
|
4695
|
+
{
|
|
4696
|
+
type: "button",
|
|
4697
|
+
className: "export-intent-btn",
|
|
4698
|
+
"data-active": intent === option.key,
|
|
4699
|
+
title: option.hint,
|
|
4700
|
+
disabled: busy,
|
|
4701
|
+
onClick: () => setIntent(option.key),
|
|
4702
|
+
children: [
|
|
4703
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-intent-label", children: option.label }),
|
|
4704
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-intent-hint", children: option.hint })
|
|
4705
|
+
]
|
|
4706
|
+
},
|
|
4707
|
+
option.key
|
|
4708
|
+
)) }),
|
|
4709
|
+
intent === "new" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "helper-box", children: t("exportNewHint") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
4710
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "export-stage-filter", role: "group", "aria-label": t("exportStageFilterLabel"), children: [
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4712
|
+
"button",
|
|
4713
|
+
{
|
|
4714
|
+
type: "button",
|
|
4715
|
+
className: "btn btn-small",
|
|
4716
|
+
"data-active": stageFilter === null,
|
|
4717
|
+
onClick: () => setStageFilter(null),
|
|
4718
|
+
disabled: busy,
|
|
4719
|
+
children: t("exportStageAll")
|
|
4720
|
+
}
|
|
4721
|
+
),
|
|
4722
|
+
STAGE_FILTERS.map((bucket) => {
|
|
4723
|
+
const count = rows.filter((row) => row.stageKey === bucket.key).length;
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
4725
|
+
"button",
|
|
4726
|
+
{
|
|
4727
|
+
type: "button",
|
|
4728
|
+
className: "btn btn-small",
|
|
4729
|
+
"data-active": stageFilter === bucket.key,
|
|
4730
|
+
"data-zero": count === 0,
|
|
4731
|
+
disabled: busy || count === 0 && stageFilter !== bucket.key,
|
|
4732
|
+
onClick: () => setStageFilter(stageFilter === bucket.key ? null : bucket.key),
|
|
4733
|
+
children: [
|
|
4734
|
+
bucket.label,
|
|
4735
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-stage-count", children: count })
|
|
4736
|
+
]
|
|
4737
|
+
},
|
|
4738
|
+
bucket.key
|
|
4739
|
+
);
|
|
4740
|
+
})
|
|
4741
|
+
] }),
|
|
4742
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "export-toolbar", children: [
|
|
4743
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "btn btn-small", onClick: selectAll, disabled: busy, children: t("exportSelectAll") }),
|
|
4744
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "btn btn-small", onClick: selectNone, disabled: busy, children: t("exportSelectNone") }),
|
|
4745
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-count", children: format(t("exportSelected"), { count: selected.size }) })
|
|
4746
|
+
] })
|
|
4646
4747
|
] }),
|
|
4647
|
-
rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportNoProjects") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "export-list", children:
|
|
4748
|
+
intent !== "new" && (rows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportNoProjects") }) : visibleRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "modal-lead", children: t("exportStageEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "export-list", children: visibleRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "export-row", "data-selected": selected.has(row.pocId), children: [
|
|
4648
4749
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4649
4750
|
"input",
|
|
4650
4751
|
{
|
|
@@ -4658,22 +4759,32 @@ window.__ModuleLoader__.load({
|
|
|
4658
4759
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "export-row-name", children: row.name === "" ? row.pocId : row.name }),
|
|
4659
4760
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "export-row-meta", children: [
|
|
4660
4761
|
row.pocId,
|
|
4661
|
-
row.company === "" ? "" : ` \xB7 ${row.company}
|
|
4762
|
+
row.company === "" ? "" : ` \xB7 ${row.company}`,
|
|
4763
|
+
row.stage === "" ? "" : ` \xB7 ${row.stage}`
|
|
4662
4764
|
] })
|
|
4663
4765
|
] })
|
|
4664
|
-
] }) }, row.pocId)) }),
|
|
4665
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "helper-box", children: selected.size === 0 ? t("exportBlankHint") : t("exportHint") })
|
|
4766
|
+
] }) }, row.pocId)) })),
|
|
4767
|
+
intent === "new" ? null : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "helper-box", children: selected.size === 0 ? t("exportBlankHint") : t("exportHint") })
|
|
4666
4768
|
] }),
|
|
4667
4769
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "modal-footer", children: [
|
|
4668
4770
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "spacer" }),
|
|
4669
4771
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("button", { type: "button", className: "btn", onClick: onClose, disabled: busy, children: t("cancel") }),
|
|
4670
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4773
|
+
"button",
|
|
4774
|
+
{
|
|
4775
|
+
type: "button",
|
|
4776
|
+
className: "btn btn-primary",
|
|
4777
|
+
onClick: () => {
|
|
4778
|
+
void generate();
|
|
4779
|
+
},
|
|
4780
|
+
disabled: busy || intent !== "new" && selected.size === 0,
|
|
4781
|
+
children: busy ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "spinner" }),
|
|
4783
|
+
" ",
|
|
4784
|
+
t("exportGenerating")
|
|
4785
|
+
] }) : t("exportGenerate")
|
|
4786
|
+
}
|
|
4787
|
+
)
|
|
4677
4788
|
] })
|
|
4678
4789
|
]
|
|
4679
4790
|
}
|
|
@@ -6081,6 +6192,36 @@ window.__ModuleLoader__.load({
|
|
|
6081
6192
|
margin: 0 0 4px; font-size: 12px; line-height: 18px;
|
|
6082
6193
|
color: var(--dsw-alias-label-secondary);
|
|
6083
6194
|
}
|
|
6195
|
+
/* ---------- export intents: the choice that decides what the form asks ---- */
|
|
6196
|
+
.wd-shell .export-intent {
|
|
6197
|
+
display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
6198
|
+
gap: 8px; margin: 10px 0 4px;
|
|
6199
|
+
}
|
|
6200
|
+
.wd-shell .export-intent-btn {
|
|
6201
|
+
display: flex; flex-direction: column; gap: 2px; text-align: left;
|
|
6202
|
+
padding: 9px 11px; border-radius: 8px; cursor: pointer;
|
|
6203
|
+
background: var(--wd-surface); border: 1px solid var(--wd-hairline);
|
|
6204
|
+
font-family: inherit; transition: border-color .11s ease, background .11s ease;
|
|
6205
|
+
}
|
|
6206
|
+
.wd-shell .export-intent-btn:hover { border-color: var(--wd-primary); }
|
|
6207
|
+
.wd-shell .export-intent-btn[data-active="true"] {
|
|
6208
|
+
background: var(--wd-primary-soft); border-color: var(--wd-primary);
|
|
6209
|
+
}
|
|
6210
|
+
.wd-shell .export-intent-label { font-size: 12px; line-height: 17px; font-weight: 650; color: var(--wd-text); }
|
|
6211
|
+
.wd-shell .export-intent-hint { font-size: 10px; line-height: 14px; color: var(--dsw-alias-label-tertiary); }
|
|
6212
|
+
.wd-shell .export-stage-filter {
|
|
6213
|
+
display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
|
|
6214
|
+
padding: 6px 0 2px;
|
|
6215
|
+
}
|
|
6216
|
+
.wd-shell .export-stage-filter .btn[data-active="true"] {
|
|
6217
|
+
background: var(--wd-primary-soft); border-color: var(--wd-primary); color: var(--wd-primary);
|
|
6218
|
+
}
|
|
6219
|
+
.wd-shell .export-stage-filter .btn[data-zero="true"] { opacity: .45; }
|
|
6220
|
+
.wd-shell .export-stage-count {
|
|
6221
|
+
margin-left: 5px; font-size: 9.5px; font-variant-numeric: tabular-nums;
|
|
6222
|
+
color: var(--dsw-alias-label-tertiary);
|
|
6223
|
+
}
|
|
6224
|
+
|
|
6084
6225
|
.wd-shell .export-toolbar {
|
|
6085
6226
|
display: flex; align-items: center; gap: 7px;
|
|
6086
6227
|
padding: 8px 0 6px;
|
package/lib/form.d.ts
CHANGED
|
@@ -146,11 +146,67 @@ export interface FormProject {
|
|
|
146
146
|
progress: FormProgress;
|
|
147
147
|
/** How many entries the project already has (so `seq` can continue). */
|
|
148
148
|
existingProgressCount: number;
|
|
149
|
+
/**
|
|
150
|
+
* The G4 conclusion block.
|
|
151
|
+
*
|
|
152
|
+
* It was missing entirely: the form could collect a progress round but not the
|
|
153
|
+
* one thing a G4 project exists to state — what was proved, what the customer
|
|
154
|
+
* accepted, and what business step follows. Every field is optional because
|
|
155
|
+
* only a G4 form shows them.
|
|
156
|
+
*/
|
|
157
|
+
outcome: {
|
|
158
|
+
achievement: string;
|
|
159
|
+
customer_recognition: string;
|
|
160
|
+
our_proof: string;
|
|
161
|
+
proved: string;
|
|
162
|
+
recognized: string;
|
|
163
|
+
next_business: string;
|
|
164
|
+
milestone: string;
|
|
165
|
+
businessOwner: string;
|
|
166
|
+
businessDeadline: string;
|
|
167
|
+
businessStatus: string;
|
|
168
|
+
overall: string;
|
|
169
|
+
};
|
|
149
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* What the colleague is here to do.
|
|
173
|
+
*
|
|
174
|
+
* Two orthogonal questions decide what the form asks, and conflating them is
|
|
175
|
+
* what made the old form a 20-field wall:
|
|
176
|
+
*
|
|
177
|
+
* - the **stage** says which fields are the subject (a G1 project is about the
|
|
178
|
+
* plan, a G3 project is about the proof);
|
|
179
|
+
* - the **intent** says how deep to go (registering a new project, filling in
|
|
180
|
+
* the current stage, or appending one round of progress).
|
|
181
|
+
*
|
|
182
|
+
* The same G2 project needs completely different forms for "first test" and
|
|
183
|
+
* "weekly sync", so a stage-only split would still force a colleague to scroll
|
|
184
|
+
* past everything they are not editing.
|
|
185
|
+
*/
|
|
186
|
+
export type FormIntent = 'new' | 'supplement' | 'progress';
|
|
187
|
+
/** The section groups a form can show. Order is reading order. */
|
|
188
|
+
export type FormSection = 'identity' | 'gate0' | 'plan' | 'gate12' | 'progress' | 'outcome';
|
|
189
|
+
/**
|
|
190
|
+
* Resolve what a form should ask, given the intent and the project's stage.
|
|
191
|
+
*
|
|
192
|
+
* Returns the editable sections (the subject) and the context sections (shown
|
|
193
|
+
* read-only so the colleague knows what they are adding to). An unknown stage
|
|
194
|
+
* falls back to G0's set: a project whose stage is unrecognised is, for form
|
|
195
|
+
* purposes, still being set up.
|
|
196
|
+
*/
|
|
197
|
+
export declare function resolveSections(intent: FormIntent, stage: string): {
|
|
198
|
+
editable: FormSection[];
|
|
199
|
+
context: FormSection[];
|
|
200
|
+
};
|
|
150
201
|
/** Options for one generation run. */
|
|
151
202
|
export interface FormOptions {
|
|
152
203
|
/** `fill` pre-fills from the ledger; `blank` is an empty new-project form. */
|
|
153
204
|
mode: 'fill' | 'blank';
|
|
205
|
+
/**
|
|
206
|
+
* What the colleague is doing. Defaults from `mode`: `blank` → `new`,
|
|
207
|
+
* `fill` → `supplement`. `progress` is the one-screen append form.
|
|
208
|
+
*/
|
|
209
|
+
intent?: FormIntent;
|
|
154
210
|
/** Projects to include; one blank project for `blank` mode. */
|
|
155
211
|
projects: FormProject[];
|
|
156
212
|
/** Clock injection so the generated header and default dates are testable. */
|
|
@@ -185,8 +241,107 @@ export declare function draftKeyFor(mode: 'fill' | 'blank', pocIds: readonly str
|
|
|
185
241
|
* Empty plan/progress blocks are emitted as empty collections, not omitted: the
|
|
186
242
|
* ledger's parser tolerates absence, but a colleague reopening the file should
|
|
187
243
|
* see the shape they are expected to fill.
|
|
244
|
+
*
|
|
245
|
+
* **This is not the download format.** The form ships a change set (see
|
|
246
|
+
* {@link projectToChangeSet}); a complete file would have to carry the ledger's
|
|
247
|
+
* derived fields (`gate0.missing`, `priority`, scenario status), and those are
|
|
248
|
+
* owned by `tools/derive.mjs` — writing them here would either be wrong or be
|
|
249
|
+
* overwritten by CI. `projectToYaml` remains for tests and for a full-file
|
|
250
|
+
* preview.
|
|
188
251
|
*/
|
|
189
252
|
export declare function projectToYaml(project: FormProject): string;
|
|
253
|
+
/**
|
|
254
|
+
* One project's change set: what the colleague touched, and nothing else.
|
|
255
|
+
*
|
|
256
|
+
* ## Why a change set rather than a file
|
|
257
|
+
*
|
|
258
|
+
* A `projects/*.yaml` file carries three kinds of value: what a human wrote, what
|
|
259
|
+
* the ledger derives (`gate0.missing`, `gate0.complete`, `priority`, per-scenario
|
|
260
|
+
* status), and what the clock implies. Only the first belongs to a form. The
|
|
261
|
+
* derived ones are computed by `tools/derive.mjs` and asserted by CI, so a form
|
|
262
|
+
* that wrote them would either be wrong or be overwritten — and a form that
|
|
263
|
+
* omitted them would produce a file CI rejects.
|
|
264
|
+
*
|
|
265
|
+
* So the form ships only the human half, `poc-submit` merges it into the existing
|
|
266
|
+
* file (preserving everything it did not touch), and CI recomputes the rest.
|
|
267
|
+
*
|
|
268
|
+
* `schema_version` IS included even though it is a constant: the ledger refuses a
|
|
269
|
+
* file without it (`E-VERSION`), and a brand-new project has no existing file to
|
|
270
|
+
* inherit the stamp from.
|
|
271
|
+
*/
|
|
272
|
+
export interface FormChangeSet {
|
|
273
|
+
schema_version: string;
|
|
274
|
+
poc_id: string;
|
|
275
|
+
name: string;
|
|
276
|
+
org: {
|
|
277
|
+
system: string | null;
|
|
278
|
+
company: string | null;
|
|
279
|
+
department: string | null;
|
|
280
|
+
};
|
|
281
|
+
amount_wan: number | null;
|
|
282
|
+
poc_type: string | null;
|
|
283
|
+
owner: string | null;
|
|
284
|
+
sales: string | null;
|
|
285
|
+
tech_owner: string | null;
|
|
286
|
+
exec_sponsor: string | null;
|
|
287
|
+
stage: string;
|
|
288
|
+
status: string;
|
|
289
|
+
stage_since: string | null;
|
|
290
|
+
gate0: {
|
|
291
|
+
why_customer: string | null;
|
|
292
|
+
why_us: string | null;
|
|
293
|
+
decision_chain: string | null;
|
|
294
|
+
post_poc_decision: string | null;
|
|
295
|
+
competitor: string | null;
|
|
296
|
+
review: {
|
|
297
|
+
conclusion: string | null;
|
|
298
|
+
reviewer: string | null;
|
|
299
|
+
reviewed_at: string | null;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
plan: {
|
|
303
|
+
customer_pain: string | null;
|
|
304
|
+
expected_recognition: string | null;
|
|
305
|
+
our_edge: string | null;
|
|
306
|
+
criteria: Array<Record<string, unknown>>;
|
|
307
|
+
scenarios: Array<Record<string, unknown>>;
|
|
308
|
+
risks: Array<Record<string, unknown>>;
|
|
309
|
+
timeline: {
|
|
310
|
+
start: string | null;
|
|
311
|
+
end: string | null;
|
|
312
|
+
};
|
|
313
|
+
gate1: {
|
|
314
|
+
conclusion: string | null;
|
|
315
|
+
};
|
|
316
|
+
gate2: {
|
|
317
|
+
ready: string | null;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
/** The rounds this form ADDS; empty when the colleague recorded none. */
|
|
321
|
+
progress: Array<Record<string, unknown>>;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Build one project's change set from the form state.
|
|
325
|
+
*
|
|
326
|
+
* Every field the form can edit appears, so `poc-submit` can apply the whole
|
|
327
|
+
* object with `setIfPresent` semantics: a blank field means "I did not change
|
|
328
|
+
* this", which the merge step must not read as "delete it".
|
|
329
|
+
*/
|
|
330
|
+
export declare function projectToChangeSet(project: FormProject): FormChangeSet;
|
|
331
|
+
/** The whole download: one change set per project, plus provenance. */
|
|
332
|
+
export interface FormChangeDocument {
|
|
333
|
+
schemaVersion: string;
|
|
334
|
+
generatedAt: string;
|
|
335
|
+
generatedBy: string;
|
|
336
|
+
intent: FormIntent;
|
|
337
|
+
changes: FormChangeSet[];
|
|
338
|
+
}
|
|
339
|
+
/** Build the document a colleague sends back. */
|
|
340
|
+
export declare function buildChangeDocument(options: {
|
|
341
|
+
projects: readonly FormProject[];
|
|
342
|
+
intent: FormIntent;
|
|
343
|
+
now?: Date;
|
|
344
|
+
}): FormChangeDocument;
|
|
190
345
|
/** The enums, mirrored from `schemas/enums.yaml`. */
|
|
191
346
|
declare const ENUMS: {
|
|
192
347
|
pocType: string[];
|
|
@@ -204,26 +359,50 @@ declare const ENUMS: {
|
|
|
204
359
|
gate3_2: string[];
|
|
205
360
|
evidenceType: string[];
|
|
206
361
|
system: string[];
|
|
362
|
+
achievement: string[];
|
|
363
|
+
businessStatus: string[];
|
|
207
364
|
};
|
|
208
365
|
/**
|
|
209
366
|
* The schema generation this form emits.
|
|
210
367
|
*
|
|
211
368
|
* Stamped into every generated page so a returned form can be checked against
|
|
212
|
-
* the schema that will read it.
|
|
213
|
-
*
|
|
214
|
-
*
|
|
369
|
+
* the schema that will read it. There is deliberately **no older-shape
|
|
370
|
+
* fallback**: the ledger declares one shape version and its validator rejects
|
|
371
|
+
* anything else outright (`E-VERSION`). A tolerant reader here would only move
|
|
372
|
+
* that failure later — to a point where the colleague already believes their
|
|
373
|
+
* work was recorded.
|
|
215
374
|
*/
|
|
216
375
|
export declare const FORM_SCHEMA_VERSION = "3.1";
|
|
217
|
-
/**
|
|
376
|
+
/**
|
|
377
|
+
* The stamp a pre-v3.1 form carries.
|
|
378
|
+
*
|
|
379
|
+
* A named constant only so the refusal message can name it. This is not a
|
|
380
|
+
* supported shape: nothing parses it, nothing converts it, and importing one is
|
|
381
|
+
* refused rather than half-applied.
|
|
382
|
+
*/
|
|
218
383
|
export declare const LEGACY_FORM_SCHEMA_VERSION = "3.0";
|
|
219
384
|
/** The state the generated page boots from. */
|
|
220
385
|
export interface FormPayload {
|
|
221
386
|
mode: 'fill' | 'blank';
|
|
387
|
+
/** What the colleague is doing; decides how much of the page is editable. */
|
|
388
|
+
intent: FormIntent;
|
|
222
389
|
/** The schema this page writes. Absent means a pre-v3.1 form. */
|
|
223
390
|
schemaVersion: string;
|
|
224
391
|
generatedAt: string;
|
|
225
392
|
today: string;
|
|
226
393
|
projects: FormProject[];
|
|
394
|
+
/**
|
|
395
|
+
* Per-project section resolution, index-aligned with `projects`.
|
|
396
|
+
*
|
|
397
|
+
* Resolved on the Host rather than in the page because the mapping is a
|
|
398
|
+
* statement about the ledger's own structure, and the browser has no way to
|
|
399
|
+
* check it. Sending it also keeps the payload inspectable: reading the JSON
|
|
400
|
+
* tells you exactly what the page will let you edit.
|
|
401
|
+
*/
|
|
402
|
+
sections: Array<{
|
|
403
|
+
editable: FormSection[];
|
|
404
|
+
context: FormSection[];
|
|
405
|
+
}>;
|
|
227
406
|
draftKey: string;
|
|
228
407
|
enums: typeof ENUMS;
|
|
229
408
|
/** The G0 fields, in schema order, with their prompt text. */
|
|
@@ -254,13 +433,14 @@ export { YAML };
|
|
|
254
433
|
* Whether a returned form was generated by this schema generation.
|
|
255
434
|
*
|
|
256
435
|
* `poc-export` produces a standalone HTML file that colleagues fill in offline,
|
|
257
|
-
* so **old copies keep circulating** long after the schema moves.
|
|
258
|
-
* carries `progress[].items` and a string array of scenarios; reading it as
|
|
259
|
-
* would drop every scenario and criterion reference without an error, and
|
|
260
|
-
* ledger's whole proof chain hangs off those ids.
|
|
436
|
+
* so **old copies keep circulating** long after the schema moves. A pre-v3.1
|
|
437
|
+
* form carries `progress[].items` and a string array of scenarios; reading it as
|
|
438
|
+
* v3.1 would drop every scenario and criterion reference without an error, and
|
|
439
|
+
* the ledger's whole proof chain hangs off those ids.
|
|
261
440
|
*
|
|
262
441
|
* So this is a hard gate rather than a tolerant reader: a stale form is refused
|
|
263
|
-
* with an explanation, not silently half-imported.
|
|
442
|
+
* with an explanation, not silently half-imported. There is no conversion path
|
|
443
|
+
* and none is planned — the ledger itself rejects any other shape version.
|
|
264
444
|
*/
|
|
265
445
|
export interface FormCompatibility {
|
|
266
446
|
compatible: boolean;
|