@lmzhen/dsh-evolution-skill-health 0.33.0 → 0.35.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 (2) hide show
  1. package/lib/client.js +27 -13
  2. package/package.json +6 -6
package/lib/client.js CHANGED
@@ -112,6 +112,9 @@ window.__ModuleLoader__.load({
112
112
  reason: "transport"
113
113
  });
114
114
  //#endregion
115
+ //#region ../evolution-client-kit/src/notice.ts
116
+ /** One inline state notice: semantic tone plus text, no surface-specific styling. */
117
+ //#endregion
115
118
  //#region ../evolution-client-kit/src/action.ts
116
119
  /**
117
120
  * Command-only actions. Approval decisions are a separate host API and must never
@@ -499,7 +502,8 @@ window.__ModuleLoader__.load({
499
502
  ":where(.dsh-evolution-skill-health) { display: flex; flex-direction: column; gap: var(--evo-space-12); padding: var(--evo-space-16); color: var(--dsw-alias-label-primary); font-size: var(--evo-type-sm); line-height: var(--evo-leading-base); }",
500
503
  ":where(.dsh-evolution-skill-health [data-role=\"hint\"]) { margin: 0; color: var(--dsw-alias-label-secondary); }",
501
504
  ":where(.dsh-evolution-skill-health [data-role=\"stats\"]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: var(--evo-space-8); }",
502
- ":where(.dsh-evolution-skill-health [data-role=\"stat\"]) { display: flex; flex-direction: column; gap: var(--evo-space-2); padding: var(--evo-space-8) var(--evo-space-10); border: var(--evo-hairline-width) solid var(--dsw-alias-border-l1); border-radius: var(--evo-radius-control); }",
505
+ ":where(.dsh-evolution-skill-health [data-role=\"stat\"]) { display: flex; flex-direction: column; gap: var(--evo-space-2); padding: var(--evo-space-8) var(--evo-space-10); border: var(--evo-hairline-width) solid var(--dsw-alias-border-l1); border-radius: var(--evo-radius-control); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }",
506
+ ":where(.dsh-evolution-skill-health [data-role=\"stat\"][aria-pressed=\"true\"]) { border-color: var(--dsw-alias-brand-primary); background: var(--dsw-alias-interactive-bg-hover); }",
503
507
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"ok\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-success-primary); }",
504
508
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"warn\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-warn-primary); }",
505
509
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"error\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-error-primary); }",
@@ -731,15 +735,17 @@ window.__ModuleLoader__.load({
731
735
  const [lastReadAt, setLastReadAt] = (0, react.useState)(face.readAt);
732
736
  const [scan, setScan] = (0, react.useState)(face.scan);
733
737
  const [viewMode, setViewMode] = (0, react.useState)("skills");
738
+ const [verdictFilter, setVerdictFilter] = (0, react.useState)(void 0);
734
739
  const firstLoad = (0, react.useRef)(false);
740
+ const readTicket = (0, react.useRef)(0);
735
741
  /** One read trigger for first paint and the refresh button; the latest answer wins. */
736
742
  const load = () => {
737
743
  const read = face.loadRows;
738
744
  if (read === void 0) return () => {};
739
- let live = true;
745
+ const ticket = ++readTicket.current;
740
746
  setLoading(true);
741
747
  read().then((outcome) => {
742
- if (!live) return;
748
+ if (ticket !== readTicket.current) return;
743
749
  if (outcome.ok) {
744
750
  const payload = outcome.payload;
745
751
  setView({
@@ -755,16 +761,14 @@ window.__ModuleLoader__.load({
755
761
  setFailed(void 0);
756
762
  } else setFailed(outcome.failure);
757
763
  }).catch(() => {
758
- if (live) setFailed({
764
+ if (ticket === readTicket.current) setFailed({
759
765
  kind: "server",
760
766
  status: 0
761
767
  });
762
768
  }).finally(() => {
763
- if (live) setLoading(false);
769
+ if (ticket === readTicket.current) setLoading(false);
764
770
  });
765
- return () => {
766
- live = false;
767
- };
771
+ return () => {};
768
772
  };
769
773
  (0, react.useEffect)(() => {
770
774
  if (firstLoad.current || face.loadRows === void 0) return;
@@ -772,11 +776,21 @@ window.__ModuleLoader__.load({
772
776
  load();
773
777
  }, [face]);
774
778
  const counts = new Map(KINDS.map((kind) => [kind, view.rows.filter((row) => row.verdict === kind).length]));
775
- const stats = (0, react.createElement)("div", { "data-role": "stats" }, KINDS.map((kind) => (0, react.createElement)("div", {
779
+ const shown = verdictFilter === void 0 ? view : {
780
+ ...view,
781
+ rows: view.rows.filter((row) => row.verdict === verdictFilter)
782
+ };
783
+ const stats = (0, react.createElement)("div", { "data-role": "stats" }, KINDS.map((kind) => (0, react.createElement)("button", {
776
784
  key: kind,
785
+ type: "button",
777
786
  "data-role": "stat",
778
- "data-tone": TONE[kind]
779
- }, (0, react.createElement)("div", { "data-role": "stat-value" }, String(counts.get(kind) ?? 0)), (0, react.createElement)("div", { "data-role": "stat-label" }, t("verdict." + kind)))));
787
+ "data-tone": TONE[kind],
788
+ "aria-pressed": verdictFilter === kind ? "true" : "false",
789
+ "aria-label": t("verdict." + kind),
790
+ onClick: () => {
791
+ setVerdictFilter((previous) => previous === kind ? void 0 : kind);
792
+ }
793
+ }, (0, react.createElement)("span", { "data-role": "stat-value" }, String(counts.get(kind) ?? 0)), (0, react.createElement)("span", { "data-role": "stat-label" }, t("verdict." + kind)))));
780
794
  return (0, react.createElement)("section", { className: CSS_TAG_ID }, (0, react.createElement)("div", { "data-role": "header" }, (0, react.createElement)("span", { "data-role": "read-at" }, lastReadAt === void 0 ? t("readAt.unknown") : new Date(lastReadAt).toLocaleString()), (0, react.createElement)("span", { "data-role": "scan-status" }, t("scan." + (scan?.status ?? "unavailable"))), (0, react.createElement)("button", {
781
795
  type: "button",
782
796
  "data-role": "refresh",
@@ -835,10 +849,10 @@ window.__ModuleLoader__.load({
835
849
  })(), viewMode === "skills" ? (0, react.createElement)("div", {
836
850
  id: "evo-health-skills",
837
851
  role: "tabpanel"
838
- }, skillQueue(view, t)) : (0, react.createElement)("div", {
852
+ }, skillQueue(shown, t)) : (0, react.createElement)("div", {
839
853
  id: "evo-health-rules",
840
854
  role: "tabpanel"
841
- }, (0, react.createElement)("h3", { "data-role": "group-title" }, t("group.byRule")), ruleTable(view, t)));
855
+ }, (0, react.createElement)("h3", { "data-role": "group-title" }, t("group.byRule")), ruleTable(shown, t)));
842
856
  }
843
857
  //#endregion
844
858
  //#region src/client/seats.ts
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  }
13
13
  },
14
- "version": "0.33.0",
14
+ "version": "0.35.0",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -42,18 +42,18 @@
42
42
  "peerDependencies": {
43
43
  "@deepseek-ai/cordis": "^4.0.5",
44
44
  "react": "^18.2.0",
45
- "@lmzhen/dsh-evolution-core": "^0.33.0",
46
- "@lmzhen/dsh-evolution-curator": "^0.33.0"
45
+ "@lmzhen/dsh-evolution-core": "^0.35.0",
46
+ "@lmzhen/dsh-evolution-curator": "^0.35.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/cordis": "^4.0.5",
50
50
  "@types/react": "~18.3.1",
51
51
  "react": "^18.2.0",
52
- "@lmzhen/dsh-evolution-core": "^0.33.0",
53
- "@lmzhen/dsh-evolution-curator": "^0.33.0"
52
+ "@lmzhen/dsh-evolution-core": "^0.35.0",
53
+ "@lmzhen/dsh-evolution-curator": "^0.35.0"
54
54
  },
55
55
  "dependencies": {
56
- "@lmzhen/dsh-evolution-client-kit": "^0.33.0"
56
+ "@lmzhen/dsh-evolution-client-kit": "^0.35.0"
57
57
  },
58
58
  "engines": {
59
59
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"