@takagaki/cortex-decisions-viewer 0.4.21 → 0.4.22

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/dist/build.js CHANGED
@@ -145,6 +145,10 @@ async function readFleetSources(repoRoot) {
145
145
  label: String(s.label ?? ""),
146
146
  url: s.url != null ? String(s.url) : undefined,
147
147
  lastSync: s.lastSync != null ? String(s.lastSync) : undefined,
148
+ matchKeys: Array.isArray(s.matchKeys)
149
+ ? s.matchKeys.map((k) => String(k)).filter(Boolean)
150
+ : undefined,
151
+ driveSync: typeof s.driveSync === "boolean" ? s.driveSync : undefined,
148
152
  }))
149
153
  : undefined;
150
154
  const pipelines = Array.isArray(obj.pipelines)
@@ -154,6 +158,8 @@ async function readFleetSources(repoRoot) {
154
158
  id: String(p.id ?? ""),
155
159
  label: String(p.label ?? ""),
156
160
  lastSuccess: p.lastSuccess != null ? String(p.lastSuccess) : undefined,
161
+ lastConclusion: p.lastConclusion != null ? String(p.lastConclusion) : undefined,
162
+ lastRun: p.lastRun != null ? String(p.lastRun) : undefined,
157
163
  }))
158
164
  : undefined;
159
165
  return { externalSources, internalSources, pipelines };
package/dist/render.js CHANGED
@@ -343,6 +343,23 @@ a.ds-name { color: var(--accent); }
343
343
  a.ds-name:hover { text-decoration: underline; }
344
344
  .ds-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 6px 0 0; }
345
345
  .ds-sync { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
346
+ .ds-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
347
+ .ds-keys { font-size: 12px; color: var(--muted); line-height: 1.6; }
348
+ .ds-drive-note { font-size: 12px; color: #6b7280; line-height: 1.6; }
349
+ .ds-group { border: none; margin: 0; }
350
+ .ds-group > summary {
351
+ display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; cursor: pointer;
352
+ background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
353
+ padding: 14px 16px; box-shadow: var(--shadow); font-size: 14.5px; font-weight: 600; color: var(--text);
354
+ list-style: none;
355
+ }
356
+ .ds-group > summary::-webkit-details-marker { display: none; }
357
+ .ds-group > summary::after { content: "▸"; margin-left: auto; color: var(--muted); font-size: 12px; }
358
+ .ds-group[open] > summary::after { content: "▾"; }
359
+ .ds-group[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
360
+ .ds-group > .ds-list { margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--border); }
361
+ .badge.ds-sum-ok { background: #e9f7ef; color: #1f7a45; }
362
+ .badge.ds-sum-warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
346
363
  .ds-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; }
347
364
  .badge.ds-gold { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
348
365
  .badge.ds-excluded { background: #eceef1; color: #6b7280; }
@@ -359,6 +376,7 @@ a.ds-name:hover { text-decoration: underline; }
359
376
  }
360
377
  .ds-pipe-label { font-size: 14px; font-weight: 600; color: var(--text); }
361
378
  .ds-pipe-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
379
+ .ds-pipe-status { font-size: 13px; line-height: 1; flex: 0 0 auto; }
362
380
  /* ---- 操作タブ ---- */
363
381
  .ops-intro { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 4px 0 8px; }
364
382
  .ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
@@ -728,11 +746,26 @@ const CLIENT_JS = `
728
746
  sec.appendChild(el("div", { class: "ds-sub", text: "リポジトリ内の情報源(自動同期)" }));
729
747
  var ilist = el("div", { class: "ds-list" });
730
748
  internals.forEach(function (s) {
749
+ // ラベルの下に補足行(会議の照合キー・Drive未設定の注記)を重ねられるよう縦組みにする
750
+ var col = el("div", { class: "ds-col" }, [ dsNameEl(s.label || "", s.url) ]);
751
+ var keys = s.matchKeys || [];
752
+ if (keys.length) {
753
+ var shown = keys.slice(0, 5).join(" / ");
754
+ if (keys.length > 5) shown += " 他" + (keys.length - 5) + "件";
755
+ col.appendChild(el("span", {
756
+ class: "ds-keys",
757
+ text: "取り込み対象の会議名: " + shown,
758
+ title: "会議名にこれらの語が含まれていると、自動でこのCortexに取り込まれます",
759
+ }));
760
+ }
761
+ if (s.driveSync === false) {
762
+ col.appendChild(el("span", { class: "ds-drive-note", text: "Drive自動同期は未設定(手動で置いたファイルの変換のみ)" }));
763
+ }
731
764
  var card = el("div", { class: "ds-card" }, [
732
765
  el("div", { class: "ds-card-main" }, [
733
766
  el("span", { class: "ds-icon", text: DS_KIND_ICON[s.kind] || "📁" }),
734
767
  el("span", { class: "ds-type", text: s.kind || "" }),
735
- dsNameEl(s.label || "", s.url),
768
+ col,
736
769
  ]),
737
770
  s.lastSync && dsFmtTime(s.lastSync)
738
771
  ? el("span", { class: "ds-sync", text: "最終同期: " + dsFmtTime(s.lastSync) })
@@ -746,27 +779,36 @@ const CLIENT_JS = `
746
779
 
747
780
  if (sources.length) {
748
781
  sec.appendChild(el("div", { class: "ds-sub", text: "外部ソース(ライブ参照)" }));
749
- var list = el("div", { class: "ds-list" });
782
+ // ツール(type)別にグループ化し、多いグループ(4件以上)は折りたたむ
783
+ var groups = [];
784
+ var byType = {};
750
785
  sources.forEach(function (s) {
751
- var meta = DS_TYPE[s.type] || { icon: "🔗", label: s.type || "その他" };
752
- var badges = el("div", { class: "ds-badges" });
753
- if (s.gold === true) badges.appendChild(el("span", { class: "badge ds-gold", text: "Gold昇格の読み取り対象" }));
754
- else if (s.gold === false) badges.appendChild(el("span", { class: "badge ds-excluded", text: "除外" }));
755
- if (s.notify === true) badges.appendChild(el("span", { class: "badge ds-notify", text: "通知先" }));
756
- var gate = DS_GATE[s.gate] || DS_GATE["unknown"];
757
- var gateEl = el("span", { class: "ds-gate " + gate.cls, text: gate.text });
758
- var card = el("div", { class: "ds-card" }, [
759
- el("div", { class: "ds-card-main" }, [
760
- el("span", { class: "ds-icon", text: meta.icon }),
761
- el("span", { class: "ds-type", text: meta.label }),
762
- dsNameEl(s.name || "", s.url),
763
- ]),
764
- badges,
765
- gateEl,
766
- ]);
767
- list.appendChild(card);
786
+ var g = byType[s.type];
787
+ if (!g) { g = { type: s.type, items: [] }; byType[s.type] = g; groups.push(g); }
788
+ g.items.push(s);
768
789
  });
769
- sec.appendChild(list);
790
+ var UNIT = { "slack": "チャンネル", "github-issues": "リポジトリ", "github-discussions": "リポジトリ" };
791
+ var wrap = el("div", { class: "ds-list" });
792
+ groups.forEach(function (g) {
793
+ var meta = DS_TYPE[g.type] || { icon: "🔗", label: g.type || "その他" };
794
+ var cards = el("div", { class: "ds-list" });
795
+ g.items.forEach(function (s) { cards.appendChild(extSourceCard(s, meta)); });
796
+ if (g.items.length >= 4) {
797
+ // 折りたたみ(既定は閉)。summaryに件数と状態の要約を出す
798
+ var bad = 0;
799
+ g.items.forEach(function (s) { if (s.gate !== "ok") bad++; });
800
+ var sum = el("summary", {}, [
801
+ el("span", { text: meta.icon + " " + meta.label + "(" + g.items.length + (UNIT[g.type] || "件") + ")" }),
802
+ bad === 0
803
+ ? el("span", { class: "badge ds-sum-ok", text: "接続OK" })
804
+ : el("span", { class: "badge ds-sum-warn", text: "⚠️ " + bad + "件に問題" }),
805
+ ]);
806
+ wrap.appendChild(el("details", { class: "ds-group" }, [sum, cards]));
807
+ } else {
808
+ while (cards.firstChild) wrap.appendChild(cards.firstChild);
809
+ }
810
+ });
811
+ sec.appendChild(wrap);
770
812
  }
771
813
 
772
814
  if (pipes.length) {
@@ -774,7 +816,13 @@ const CLIENT_JS = `
774
816
  var plist = el("div", { class: "ds-pipes" });
775
817
  pipes.forEach(function (p) {
776
818
  var t = p.lastSuccess ? dsFmtTime(p.lastSuccess) : "";
777
- var children = [ el("span", { class: "ds-pipe-label", text: p.label || p.id || "" }) ];
819
+ var children = [];
820
+ if (p.lastConclusion === "success") {
821
+ children.push(el("span", { class: "ds-pipe-status", text: "✅", title: "直近の実行は成功しています" }));
822
+ } else if (p.lastConclusion === "failure") {
823
+ children.push(el("span", { class: "ds-pipe-status", text: "❌", title: "直近の実行が失敗しています" }));
824
+ }
825
+ children.push(el("span", { class: "ds-pipe-label", text: p.label || p.id || "" }));
778
826
  if (t) children.push(el("span", { class: "ds-pipe-time", text: "最終成功: " + t }));
779
827
  plist.appendChild(el("div", { class: "ds-pipe" }, children));
780
828
  });
@@ -783,6 +831,23 @@ const CLIENT_JS = `
783
831
 
784
832
  app.appendChild(sec);
785
833
  }
834
+ // 外部ソース1件のカード(グループ化表示・展開表示の両方から使う)
835
+ function extSourceCard(s, meta) {
836
+ var badges = el("div", { class: "ds-badges" });
837
+ if (s.gold === true) badges.appendChild(el("span", { class: "badge ds-gold", text: "Gold昇格の読み取り対象" }));
838
+ else if (s.gold === false) badges.appendChild(el("span", { class: "badge ds-excluded", text: "除外" }));
839
+ if (s.notify === true) badges.appendChild(el("span", { class: "badge ds-notify", text: "通知先" }));
840
+ var gate = DS_GATE[s.gate] || DS_GATE["unknown"];
841
+ return el("div", { class: "ds-card" }, [
842
+ el("div", { class: "ds-card-main" }, [
843
+ el("span", { class: "ds-icon", text: meta.icon }),
844
+ el("span", { class: "ds-type", text: meta.label }),
845
+ dsNameEl(s.name || "", s.url),
846
+ ]),
847
+ badges,
848
+ el("span", { class: "ds-gate " + gate.cls, text: gate.text }),
849
+ ]);
850
+ }
786
851
 
787
852
  // ---------- 操作タブ(Cortex自体への操作。まずは取り込み。今後この受け皿に機能を足す) ----------
788
853
  function renderOps() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takagaki/cortex-decisions-viewer",
3
- "version": "0.4.21",
3
+ "version": "0.4.22",
4
4
  "description": "Cortexの意思決定記録(Decisions/*.md)を静的サイトにビルドして閲覧する。各レコードに「Edit on GitHub」リンクを付与する。",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,