@principal-ade/code-quality-panels 0.1.16 → 0.1.19

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 (60) hide show
  1. package/dist/panels.bundle.js +1014 -10
  2. package/dist/panels.bundle.js.map +1 -1
  3. package/dist/src/components/LensDataDebugPanel.d.ts +93 -0
  4. package/dist/src/components/LensDataDebugPanel.d.ts.map +1 -0
  5. package/dist/src/components/LensDataDebugPanel.stories.d.ts +31 -0
  6. package/dist/src/components/LensDataDebugPanel.stories.d.ts.map +1 -0
  7. package/dist/src/components/QualityEmptyState.d.ts.map +1 -0
  8. package/dist/src/components/QualityHexagon.d.ts.map +1 -0
  9. package/dist/src/components/QualityHexagon.stories.d.ts.map +1 -0
  10. package/dist/src/components/QualityMetricsList.d.ts +21 -0
  11. package/dist/src/components/QualityMetricsList.d.ts.map +1 -0
  12. package/dist/src/components/QualityMetricsList.stories.d.ts +33 -0
  13. package/dist/src/components/QualityMetricsList.stories.d.ts.map +1 -0
  14. package/dist/src/components/RepositoryQualityGrid.d.ts.map +1 -0
  15. package/dist/src/components/RepositoryQualityGrid.stories.d.ts.map +1 -0
  16. package/dist/{components → src/components}/index.d.ts +2 -0
  17. package/dist/src/components/index.d.ts.map +1 -0
  18. package/dist/{index.d.ts → src/index.d.ts} +3 -0
  19. package/dist/src/index.d.ts.map +1 -0
  20. package/dist/src/lib/utils.d.ts.map +1 -0
  21. package/dist/src/mocks/panelContext.d.ts.map +1 -0
  22. package/dist/src/panels/LensDataDebugPanel.d.ts +13 -0
  23. package/dist/src/panels/LensDataDebugPanel.d.ts.map +1 -0
  24. package/dist/src/panels/LensDataDebugPanel.stories.d.ts +46 -0
  25. package/dist/src/panels/LensDataDebugPanel.stories.d.ts.map +1 -0
  26. package/dist/src/panels/QualityHexagonPanel.d.ts.map +1 -0
  27. package/dist/src/panels/QualityHexagonPanel.stories.d.ts.map +1 -0
  28. package/dist/src/panels/RepositoryQualityGridPanel.d.ts.map +1 -0
  29. package/dist/src/panels/RepositoryQualityGridPanel.stories.d.ts.map +1 -0
  30. package/dist/src/tools/index.d.ts.map +1 -0
  31. package/dist/src/types/index.d.ts.map +1 -0
  32. package/package.json +4 -4
  33. package/dist/components/QualityEmptyState.d.ts.map +0 -1
  34. package/dist/components/QualityHexagon.d.ts.map +0 -1
  35. package/dist/components/QualityHexagon.stories.d.ts.map +0 -1
  36. package/dist/components/RepositoryQualityGrid.d.ts.map +0 -1
  37. package/dist/components/RepositoryQualityGrid.stories.d.ts.map +0 -1
  38. package/dist/components/index.d.ts.map +0 -1
  39. package/dist/index.d.ts.map +0 -1
  40. package/dist/lib/utils.d.ts.map +0 -1
  41. package/dist/mocks/panelContext.d.ts.map +0 -1
  42. package/dist/panels/QualityHexagonPanel.d.ts.map +0 -1
  43. package/dist/panels/QualityHexagonPanel.stories.d.ts.map +0 -1
  44. package/dist/panels/RepositoryQualityGridPanel.d.ts.map +0 -1
  45. package/dist/panels/RepositoryQualityGridPanel.stories.d.ts.map +0 -1
  46. package/dist/tools/index.d.ts.map +0 -1
  47. package/dist/types/index.d.ts.map +0 -1
  48. /package/dist/{components → src/components}/QualityEmptyState.d.ts +0 -0
  49. /package/dist/{components → src/components}/QualityHexagon.d.ts +0 -0
  50. /package/dist/{components → src/components}/QualityHexagon.stories.d.ts +0 -0
  51. /package/dist/{components → src/components}/RepositoryQualityGrid.d.ts +0 -0
  52. /package/dist/{components → src/components}/RepositoryQualityGrid.stories.d.ts +0 -0
  53. /package/dist/{lib → src/lib}/utils.d.ts +0 -0
  54. /package/dist/{mocks → src/mocks}/panelContext.d.ts +0 -0
  55. /package/dist/{panels → src/panels}/QualityHexagonPanel.d.ts +0 -0
  56. /package/dist/{panels → src/panels}/QualityHexagonPanel.stories.d.ts +0 -0
  57. /package/dist/{panels → src/panels}/RepositoryQualityGridPanel.d.ts +0 -0
  58. /package/dist/{panels → src/panels}/RepositoryQualityGridPanel.stories.d.ts +0 -0
  59. /package/dist/{tools → src/tools}/index.d.ts +0 -0
  60. /package/dist/{types → src/types}/index.d.ts +0 -0
@@ -106,7 +106,7 @@ const createLucideIcon = (iconName, iconNode) => {
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
108
  */
109
- const __iconNode$d = [
109
+ const __iconNode$e = [
110
110
  ["path", { d: "M12 7v14", key: "1akyts" }],
111
111
  [
112
112
  "path",
@@ -116,14 +116,14 @@ const __iconNode$d = [
116
116
  }
117
117
  ]
118
118
  ];
119
- const BookOpen = createLucideIcon("book-open", __iconNode$d);
119
+ const BookOpen = createLucideIcon("book-open", __iconNode$e);
120
120
  /**
121
121
  * @license lucide-react v0.552.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
125
  */
126
- const __iconNode$c = [
126
+ const __iconNode$d = [
127
127
  [
128
128
  "path",
129
129
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -136,7 +136,27 @@ const __iconNode$c = [
136
136
  }
137
137
  ]
138
138
  ];
139
- const Braces = createLucideIcon("braces", __iconNode$c);
139
+ const Braces = createLucideIcon("braces", __iconNode$d);
140
+ /**
141
+ * @license lucide-react v0.552.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */
146
+ const __iconNode$c = [
147
+ ["path", { d: "M12 20v-9", key: "1qisl0" }],
148
+ ["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", key: "uouzyp" }],
149
+ ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
150
+ ["path", { d: "M21 21a4 4 0 0 0-3.81-4", key: "1b0z45" }],
151
+ ["path", { d: "M21 5a4 4 0 0 1-3.55 3.97", key: "5cxbf6" }],
152
+ ["path", { d: "M22 13h-4", key: "1jl80f" }],
153
+ ["path", { d: "M3 21a4 4 0 0 1 3.81-4", key: "1fjd4g" }],
154
+ ["path", { d: "M3 5a4 4 0 0 0 3.55 3.97", key: "1d7oge" }],
155
+ ["path", { d: "M6 13H2", key: "82j7cp" }],
156
+ ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
157
+ ["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13", key: "1vgav8" }]
158
+ ];
159
+ const Bug = createLucideIcon("bug", __iconNode$c);
140
160
  /**
141
161
  * @license lucide-react v0.552.0 - ISC
142
162
  *
@@ -369,7 +389,7 @@ function getThemeColors(theme) {
369
389
  }
370
390
  };
371
391
  }
372
- function getValueColor$1(value, key) {
392
+ function getValueColor$2(value, key) {
373
393
  const effectiveValue = key === "deadCode" ? 100 - value : value;
374
394
  if (effectiveValue >= 80) return "#2E7D32";
375
395
  if (effectiveValue >= 60) return "#E6A700";
@@ -750,7 +770,7 @@ function QualityHexagonDetailed({
750
770
  /* @__PURE__ */ jsxs("span", { style: {
751
771
  fontSize: 14,
752
772
  fontWeight: 500,
753
- color: getValueColor$1(value, key)
773
+ color: getValueColor$2(value, key)
754
774
  }, children: [
755
775
  value,
756
776
  "%"
@@ -949,7 +969,7 @@ function QualityHexagonExpandable({
949
969
  /* @__PURE__ */ jsxs("span", { style: {
950
970
  fontSize: 14,
951
971
  fontWeight: 500,
952
- color: getValueColor$1(value, key)
972
+ color: getValueColor$2(value, key)
953
973
  }, children: [
954
974
  value,
955
975
  "%"
@@ -1682,7 +1702,7 @@ function formatLabel(item, showRepositoryName, isSameAsRepo) {
1682
1702
  }
1683
1703
  return `${item.repositoryName} / ${item.packageName}`;
1684
1704
  }
1685
- function getValueColor(value, key) {
1705
+ function getValueColor$1(value, key) {
1686
1706
  const effectiveValue = key === "deadCode" ? 100 - value : value;
1687
1707
  if (effectiveValue >= 80) return "#2E7D32";
1688
1708
  if (effectiveValue >= 60) return "#E6A700";
@@ -1715,7 +1735,7 @@ function RepositoryQualityGridItem({
1715
1735
  return {
1716
1736
  label: option.label,
1717
1737
  value,
1718
- valueColor: getValueColor(value, selectedMetric)
1738
+ valueColor: getValueColor$1(value, selectedMetric)
1719
1739
  };
1720
1740
  }
1721
1741
  }
@@ -1723,7 +1743,7 @@ function RepositoryQualityGridItem({
1723
1743
  return {
1724
1744
  label: hoveredVertex.label,
1725
1745
  value: hoveredVertex.value,
1726
- valueColor: getValueColor(hoveredVertex.value, hoveredVertex.key)
1746
+ valueColor: getValueColor$1(hoveredVertex.value, hoveredVertex.key)
1727
1747
  };
1728
1748
  }
1729
1749
  return null;
@@ -2165,6 +2185,960 @@ const RepositoryQualityGridPanelContent = ({
2165
2185
  );
2166
2186
  };
2167
2187
  const RepositoryQualityGridPanel = RepositoryQualityGridPanelContent;
2188
+ function groupResultsByPackage(results) {
2189
+ var _a;
2190
+ const map = /* @__PURE__ */ new Map();
2191
+ for (const result of results) {
2192
+ const key = ((_a = result.package) == null ? void 0 : _a.name) ?? "unknown";
2193
+ const existing = map.get(key) || [];
2194
+ existing.push(result);
2195
+ map.set(key, existing);
2196
+ }
2197
+ return map;
2198
+ }
2199
+ function getFilesWithIssues(issues) {
2200
+ const fileMap = /* @__PURE__ */ new Map();
2201
+ for (const issue of issues) {
2202
+ if (!issue.file) continue;
2203
+ const existing = fileMap.get(issue.file) || [];
2204
+ existing.push(issue);
2205
+ fileMap.set(issue.file, existing);
2206
+ }
2207
+ return fileMap;
2208
+ }
2209
+ function getSeverityColor(severity) {
2210
+ switch (severity) {
2211
+ case "error":
2212
+ return "#ef4444";
2213
+ case "warning":
2214
+ return "#f59e0b";
2215
+ case "info":
2216
+ return "#3b82f6";
2217
+ case "hint":
2218
+ return "#6b7280";
2219
+ default:
2220
+ return "#6b7280";
2221
+ }
2222
+ }
2223
+ function getSeverityBg(severity) {
2224
+ switch (severity) {
2225
+ case "error":
2226
+ return "rgba(239, 68, 68, 0.1)";
2227
+ case "warning":
2228
+ return "rgba(245, 158, 11, 0.1)";
2229
+ case "info":
2230
+ return "rgba(59, 130, 246, 0.1)";
2231
+ case "hint":
2232
+ return "rgba(107, 114, 128, 0.1)";
2233
+ default:
2234
+ return "rgba(107, 114, 128, 0.1)";
2235
+ }
2236
+ }
2237
+ function getPackageSummary(results) {
2238
+ var _a, _b, _c, _d, _e;
2239
+ let totalErrors = 0;
2240
+ let totalWarnings = 0;
2241
+ let passCount = 0;
2242
+ let failCount = 0;
2243
+ for (const result of results) {
2244
+ totalErrors += ((_b = (_a = result.metrics) == null ? void 0 : _a.issuesBySeverity) == null ? void 0 : _b.error) ?? 0;
2245
+ totalWarnings += ((_d = (_c = result.metrics) == null ? void 0 : _c.issuesBySeverity) == null ? void 0 : _d.warning) ?? 0;
2246
+ if ((_e = result.execution) == null ? void 0 : _e.success) {
2247
+ passCount++;
2248
+ } else {
2249
+ failCount++;
2250
+ }
2251
+ }
2252
+ return { totalErrors, totalWarnings, passCount, failCount, lensCount: results.length };
2253
+ }
2254
+ function LensDataDebugPanel$1({
2255
+ data,
2256
+ theme,
2257
+ className,
2258
+ selectedPackage: initialSelectedPackage,
2259
+ onFileClick,
2260
+ onPackageSelect
2261
+ }) {
2262
+ const packageGroups = React2.useMemo(() => groupResultsByPackage((data == null ? void 0 : data.results) ?? []), [data == null ? void 0 : data.results]);
2263
+ const packageNames = React2.useMemo(() => Array.from(packageGroups.keys()), [packageGroups]);
2264
+ const [selectedPackage, setSelectedPackage] = React2.useState(
2265
+ initialSelectedPackage || (packageNames.length === 1 ? packageNames[0] : null)
2266
+ );
2267
+ const [expandedLens, setExpandedLens] = React2.useState(null);
2268
+ const [expandedFiles, setExpandedFiles] = React2.useState(/* @__PURE__ */ new Set());
2269
+ const handlePackageSelect = (pkg) => {
2270
+ setSelectedPackage(pkg);
2271
+ setExpandedLens(null);
2272
+ setExpandedFiles(/* @__PURE__ */ new Set());
2273
+ onPackageSelect == null ? void 0 : onPackageSelect(pkg);
2274
+ };
2275
+ const toggleLens = (lensId) => {
2276
+ setExpandedLens(expandedLens === lensId ? null : lensId);
2277
+ setExpandedFiles(/* @__PURE__ */ new Set());
2278
+ };
2279
+ const toggleFile = (file) => {
2280
+ const newSet = new Set(expandedFiles);
2281
+ if (newSet.has(file)) {
2282
+ newSet.delete(file);
2283
+ } else {
2284
+ newSet.add(file);
2285
+ }
2286
+ setExpandedFiles(newSet);
2287
+ };
2288
+ const selectedResults = selectedPackage ? packageGroups.get(selectedPackage) || [] : [];
2289
+ return /* @__PURE__ */ jsxs(
2290
+ "div",
2291
+ {
2292
+ className: cn(className),
2293
+ style: {
2294
+ display: "flex",
2295
+ flexDirection: "column",
2296
+ gap: 8,
2297
+ padding: 16,
2298
+ backgroundColor: theme.colors.background,
2299
+ fontFamily: "monospace",
2300
+ fontSize: 13
2301
+ },
2302
+ children: [
2303
+ packageNames.length > 1 && /* @__PURE__ */ jsx("div", { style: {
2304
+ display: "flex",
2305
+ flexWrap: "wrap",
2306
+ gap: 8,
2307
+ marginBottom: 8
2308
+ }, children: packageNames.map((pkg) => {
2309
+ const summary = getPackageSummary(packageGroups.get(pkg) || []);
2310
+ const isSelected = selectedPackage === pkg;
2311
+ return /* @__PURE__ */ jsxs(
2312
+ "button",
2313
+ {
2314
+ onClick: () => handlePackageSelect(pkg),
2315
+ style: {
2316
+ display: "flex",
2317
+ alignItems: "center",
2318
+ gap: 8,
2319
+ padding: "8px 12px",
2320
+ borderRadius: 6,
2321
+ border: `1px solid ${isSelected ? theme.colors.primary : theme.colors.border}`,
2322
+ backgroundColor: isSelected ? theme.colors.surface : "transparent",
2323
+ color: theme.colors.text,
2324
+ cursor: "pointer",
2325
+ transition: "all 0.15s ease"
2326
+ },
2327
+ children: [
2328
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 500 }, children: pkg }),
2329
+ /* @__PURE__ */ jsxs("span", { style: {
2330
+ fontSize: 11,
2331
+ padding: "2px 6px",
2332
+ borderRadius: 4,
2333
+ backgroundColor: summary.totalErrors > 0 ? getSeverityBg("error") : summary.totalWarnings > 0 ? getSeverityBg("warning") : "rgba(34, 197, 94, 0.1)",
2334
+ color: summary.totalErrors > 0 ? getSeverityColor("error") : summary.totalWarnings > 0 ? getSeverityColor("warning") : "#22c55e"
2335
+ }, children: [
2336
+ summary.passCount,
2337
+ "/",
2338
+ summary.lensCount,
2339
+ " pass"
2340
+ ] })
2341
+ ]
2342
+ },
2343
+ pkg
2344
+ );
2345
+ }) }),
2346
+ packageNames.length === 1 && /* @__PURE__ */ jsxs("div", { style: {
2347
+ display: "flex",
2348
+ alignItems: "center",
2349
+ gap: 12,
2350
+ padding: "8px 12px",
2351
+ backgroundColor: theme.colors.surface,
2352
+ borderRadius: 6,
2353
+ marginBottom: 8
2354
+ }, children: [
2355
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 600, color: theme.colors.text }, children: packageNames[0] }),
2356
+ (() => {
2357
+ const summary = getPackageSummary(selectedResults);
2358
+ return /* @__PURE__ */ jsxs("span", { style: {
2359
+ fontSize: 11,
2360
+ padding: "2px 6px",
2361
+ borderRadius: 4,
2362
+ backgroundColor: summary.totalErrors > 0 ? getSeverityBg("error") : summary.totalWarnings > 0 ? getSeverityBg("warning") : "rgba(34, 197, 94, 0.1)",
2363
+ color: summary.totalErrors > 0 ? getSeverityColor("error") : summary.totalWarnings > 0 ? getSeverityColor("warning") : "#22c55e"
2364
+ }, children: [
2365
+ summary.passCount,
2366
+ "/",
2367
+ summary.lensCount,
2368
+ " pass"
2369
+ ] });
2370
+ })()
2371
+ ] }),
2372
+ !selectedPackage && packageNames.length > 1 && /* @__PURE__ */ jsx("div", { style: {
2373
+ padding: 24,
2374
+ textAlign: "center",
2375
+ color: theme.colors.textMuted,
2376
+ backgroundColor: theme.colors.surface,
2377
+ borderRadius: 6
2378
+ }, children: "Select a package above to view lens results" }),
2379
+ selectedPackage && selectedResults.map((result, idx) => {
2380
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2381
+ const lensKey = `${((_a = result.lens) == null ? void 0 : _a.id) ?? "unknown"}-${idx}`;
2382
+ const isExpanded = expandedLens === lensKey;
2383
+ const filesWithIssues = getFilesWithIssues(result.issues ?? []);
2384
+ const hasIssues = (((_b = result.issues) == null ? void 0 : _b.length) ?? 0) > 0;
2385
+ return /* @__PURE__ */ jsxs(
2386
+ "div",
2387
+ {
2388
+ style: {
2389
+ border: `1px solid ${theme.colors.border}`,
2390
+ borderRadius: 6,
2391
+ overflow: "hidden"
2392
+ },
2393
+ children: [
2394
+ /* @__PURE__ */ jsxs(
2395
+ "div",
2396
+ {
2397
+ onClick: () => toggleLens(lensKey),
2398
+ style: {
2399
+ display: "flex",
2400
+ alignItems: "center",
2401
+ justifyContent: "space-between",
2402
+ padding: "10px 12px",
2403
+ backgroundColor: theme.colors.surface,
2404
+ cursor: "pointer",
2405
+ gap: 12
2406
+ },
2407
+ children: [
2408
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
2409
+ /* @__PURE__ */ jsx(
2410
+ "svg",
2411
+ {
2412
+ width: "14",
2413
+ height: "14",
2414
+ viewBox: "0 0 24 24",
2415
+ fill: "none",
2416
+ stroke: theme.colors.textMuted,
2417
+ strokeWidth: "2",
2418
+ style: {
2419
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
2420
+ transition: "transform 0.15s ease"
2421
+ },
2422
+ children: /* @__PURE__ */ jsx("polyline", { points: "9,18 15,12 9,6" })
2423
+ }
2424
+ ),
2425
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 600, color: theme.colors.text }, children: ((_c = result.lens) == null ? void 0 : _c.id) ?? "unknown" }),
2426
+ /* @__PURE__ */ jsxs("span", { style: { color: theme.colors.textMuted }, children: [
2427
+ "(",
2428
+ ((_d = result.lens) == null ? void 0 : _d.command) ?? "",
2429
+ ")"
2430
+ ] })
2431
+ ] }),
2432
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
2433
+ /* @__PURE__ */ jsx("span", { style: {
2434
+ padding: "2px 6px",
2435
+ borderRadius: 4,
2436
+ fontSize: 11,
2437
+ backgroundColor: ((_e = result.execution) == null ? void 0 : _e.success) ? "rgba(34, 197, 94, 0.1)" : "rgba(239, 68, 68, 0.1)",
2438
+ color: ((_f = result.execution) == null ? void 0 : _f.success) ? "#22c55e" : "#ef4444"
2439
+ }, children: ((_g = result.execution) == null ? void 0 : _g.success) ? "pass" : "fail" }),
2440
+ hasIssues && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 6 }, children: [
2441
+ (((_i = (_h = result.metrics) == null ? void 0 : _h.issuesBySeverity) == null ? void 0 : _i.error) ?? 0) > 0 && /* @__PURE__ */ jsxs("span", { style: {
2442
+ padding: "2px 6px",
2443
+ borderRadius: 4,
2444
+ fontSize: 11,
2445
+ backgroundColor: getSeverityBg("error"),
2446
+ color: getSeverityColor("error")
2447
+ }, children: [
2448
+ ((_k = (_j = result.metrics) == null ? void 0 : _j.issuesBySeverity) == null ? void 0 : _k.error) ?? 0,
2449
+ " errors"
2450
+ ] }),
2451
+ (((_m = (_l = result.metrics) == null ? void 0 : _l.issuesBySeverity) == null ? void 0 : _m.warning) ?? 0) > 0 && /* @__PURE__ */ jsxs("span", { style: {
2452
+ padding: "2px 6px",
2453
+ borderRadius: 4,
2454
+ fontSize: 11,
2455
+ backgroundColor: getSeverityBg("warning"),
2456
+ color: getSeverityColor("warning")
2457
+ }, children: [
2458
+ ((_o = (_n = result.metrics) == null ? void 0 : _n.issuesBySeverity) == null ? void 0 : _o.warning) ?? 0,
2459
+ " warnings"
2460
+ ] })
2461
+ ] }),
2462
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: theme.colors.textMuted }, children: [
2463
+ ((_p = result.metrics) == null ? void 0 : _p.filesAnalyzed) ?? 0,
2464
+ " files"
2465
+ ] })
2466
+ ] })
2467
+ ]
2468
+ }
2469
+ ),
2470
+ isExpanded && /* @__PURE__ */ jsxs("div", { style: {
2471
+ padding: 12,
2472
+ backgroundColor: theme.colors.backgroundLight,
2473
+ borderTop: `1px solid ${theme.colors.border}`
2474
+ }, children: [
2475
+ /* @__PURE__ */ jsxs("div", { style: {
2476
+ display: "grid",
2477
+ gridTemplateColumns: "repeat(auto-fit, minmax(120px, 1fr))",
2478
+ gap: 8,
2479
+ marginBottom: 16,
2480
+ padding: 12,
2481
+ backgroundColor: theme.colors.surface,
2482
+ borderRadius: 4
2483
+ }, children: [
2484
+ /* @__PURE__ */ jsxs("div", { children: [
2485
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Files Analyzed" }),
2486
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: ((_q = result.metrics) == null ? void 0 : _q.filesAnalyzed) ?? 0 })
2487
+ ] }),
2488
+ /* @__PURE__ */ jsxs("div", { children: [
2489
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Total Issues" }),
2490
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: ((_r = result.metrics) == null ? void 0 : _r.totalIssues) ?? 0 })
2491
+ ] }),
2492
+ /* @__PURE__ */ jsxs("div", { children: [
2493
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Duration" }),
2494
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: [
2495
+ ((_s = result.execution) == null ? void 0 : _s.duration) ?? 0,
2496
+ "ms"
2497
+ ] })
2498
+ ] }),
2499
+ result.coverage && /* @__PURE__ */ jsxs("div", { children: [
2500
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Coverage" }),
2501
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: [
2502
+ result.coverage.line,
2503
+ "%"
2504
+ ] })
2505
+ ] })
2506
+ ] }),
2507
+ filesWithIssues.size > 0 ? /* @__PURE__ */ jsxs("div", { children: [
2508
+ /* @__PURE__ */ jsxs("div", { style: {
2509
+ fontSize: 12,
2510
+ fontWeight: 600,
2511
+ color: theme.colors.textMuted,
2512
+ marginBottom: 8
2513
+ }, children: [
2514
+ "Files with Issues (",
2515
+ filesWithIssues.size,
2516
+ ")"
2517
+ ] }),
2518
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: Array.from(filesWithIssues.entries()).map(([file, issues]) => {
2519
+ const isFileExpanded = expandedFiles.has(file);
2520
+ return /* @__PURE__ */ jsxs(
2521
+ "div",
2522
+ {
2523
+ style: {
2524
+ border: `1px solid ${theme.colors.border}`,
2525
+ borderRadius: 4,
2526
+ overflow: "hidden"
2527
+ },
2528
+ children: [
2529
+ /* @__PURE__ */ jsxs(
2530
+ "div",
2531
+ {
2532
+ onClick: () => toggleFile(file),
2533
+ style: {
2534
+ display: "flex",
2535
+ alignItems: "center",
2536
+ justifyContent: "space-between",
2537
+ padding: "8px 10px",
2538
+ backgroundColor: theme.colors.surface,
2539
+ cursor: "pointer"
2540
+ },
2541
+ children: [
2542
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
2543
+ /* @__PURE__ */ jsx(
2544
+ "svg",
2545
+ {
2546
+ width: "12",
2547
+ height: "12",
2548
+ viewBox: "0 0 24 24",
2549
+ fill: "none",
2550
+ stroke: theme.colors.textMuted,
2551
+ strokeWidth: "2",
2552
+ style: {
2553
+ transform: isFileExpanded ? "rotate(90deg)" : "rotate(0deg)",
2554
+ transition: "transform 0.15s ease"
2555
+ },
2556
+ children: /* @__PURE__ */ jsx("polyline", { points: "9,18 15,12 9,6" })
2557
+ }
2558
+ ),
2559
+ /* @__PURE__ */ jsx(
2560
+ "span",
2561
+ {
2562
+ style: {
2563
+ color: theme.colors.text,
2564
+ cursor: onFileClick ? "pointer" : "default"
2565
+ },
2566
+ onClick: (e) => {
2567
+ if (onFileClick) {
2568
+ e.stopPropagation();
2569
+ onFileClick(file);
2570
+ }
2571
+ },
2572
+ children: file
2573
+ }
2574
+ )
2575
+ ] }),
2576
+ /* @__PURE__ */ jsxs("span", { style: {
2577
+ fontSize: 11,
2578
+ padding: "2px 6px",
2579
+ borderRadius: 4,
2580
+ backgroundColor: getSeverityBg("error"),
2581
+ color: getSeverityColor("error")
2582
+ }, children: [
2583
+ issues.length,
2584
+ " issues"
2585
+ ] })
2586
+ ]
2587
+ }
2588
+ ),
2589
+ isFileExpanded && /* @__PURE__ */ jsx("div", { style: {
2590
+ padding: 8,
2591
+ backgroundColor: theme.colors.background,
2592
+ borderTop: `1px solid ${theme.colors.border}`,
2593
+ maxHeight: 300,
2594
+ overflow: "auto"
2595
+ }, children: issues.map((issue, issueIdx) => /* @__PURE__ */ jsxs(
2596
+ "div",
2597
+ {
2598
+ onClick: () => onFileClick == null ? void 0 : onFileClick(file, issue.line),
2599
+ style: {
2600
+ display: "flex",
2601
+ gap: 8,
2602
+ padding: "6px 8px",
2603
+ borderRadius: 4,
2604
+ cursor: onFileClick ? "pointer" : "default",
2605
+ transition: "background-color 0.1s ease"
2606
+ },
2607
+ onMouseEnter: (e) => {
2608
+ e.currentTarget.style.backgroundColor = theme.colors.surface;
2609
+ },
2610
+ onMouseLeave: (e) => {
2611
+ e.currentTarget.style.backgroundColor = "transparent";
2612
+ },
2613
+ children: [
2614
+ /* @__PURE__ */ jsxs("span", { style: {
2615
+ fontSize: 11,
2616
+ color: theme.colors.textMuted,
2617
+ minWidth: 45
2618
+ }, children: [
2619
+ "L",
2620
+ issue.line
2621
+ ] }),
2622
+ /* @__PURE__ */ jsx("span", { style: {
2623
+ fontSize: 10,
2624
+ padding: "1px 4px",
2625
+ borderRadius: 3,
2626
+ backgroundColor: getSeverityBg(issue.severity),
2627
+ color: getSeverityColor(issue.severity),
2628
+ textTransform: "uppercase"
2629
+ }, children: issue.severity.charAt(0) }),
2630
+ /* @__PURE__ */ jsx("span", { style: {
2631
+ flex: 1,
2632
+ fontSize: 12,
2633
+ color: theme.colors.text
2634
+ }, children: issue.message }),
2635
+ issue.rule && /* @__PURE__ */ jsx("span", { style: {
2636
+ fontSize: 10,
2637
+ color: theme.colors.textMuted,
2638
+ opacity: 0.7
2639
+ }, children: issue.rule })
2640
+ ]
2641
+ },
2642
+ issueIdx
2643
+ )) })
2644
+ ]
2645
+ },
2646
+ file
2647
+ );
2648
+ }) })
2649
+ ] }) : /* @__PURE__ */ jsx("div", { style: {
2650
+ padding: 16,
2651
+ textAlign: "center",
2652
+ color: theme.colors.textMuted,
2653
+ backgroundColor: theme.colors.surface,
2654
+ borderRadius: 4
2655
+ }, children: "No issues found" }),
2656
+ result.fileMetrics && result.fileMetrics.length > 0 && /* @__PURE__ */ jsxs("div", { style: { marginTop: 16 }, children: [
2657
+ /* @__PURE__ */ jsxs("div", { style: {
2658
+ fontSize: 12,
2659
+ fontWeight: 600,
2660
+ color: theme.colors.textMuted,
2661
+ marginBottom: 8
2662
+ }, children: [
2663
+ "File Metrics (",
2664
+ result.fileMetrics.length,
2665
+ ")"
2666
+ ] }),
2667
+ /* @__PURE__ */ jsx("div", { style: {
2668
+ display: "flex",
2669
+ flexDirection: "column",
2670
+ gap: 2,
2671
+ padding: 8,
2672
+ backgroundColor: theme.colors.surface,
2673
+ borderRadius: 4
2674
+ }, children: result.fileMetrics.map((fm, idx2) => /* @__PURE__ */ jsxs(
2675
+ "div",
2676
+ {
2677
+ style: {
2678
+ display: "flex",
2679
+ alignItems: "center",
2680
+ justifyContent: "space-between",
2681
+ padding: "4px 8px"
2682
+ },
2683
+ children: [
2684
+ /* @__PURE__ */ jsx("span", { style: { color: theme.colors.text, fontSize: 12 }, children: fm.file }),
2685
+ /* @__PURE__ */ jsxs("span", { style: {
2686
+ fontSize: 12,
2687
+ fontWeight: 500,
2688
+ color: fm.score >= 80 ? "#22c55e" : fm.score >= 60 ? "#f59e0b" : "#ef4444"
2689
+ }, children: [
2690
+ fm.score,
2691
+ "%"
2692
+ ] })
2693
+ ]
2694
+ },
2695
+ idx2
2696
+ )) })
2697
+ ] })
2698
+ ] })
2699
+ ]
2700
+ },
2701
+ lensKey
2702
+ );
2703
+ })
2704
+ ]
2705
+ }
2706
+ );
2707
+ }
2708
+ const LensDataDebugPanelContent = ({
2709
+ context,
2710
+ actions
2711
+ }) => {
2712
+ const { theme } = useTheme();
2713
+ const lensResultsSlice = context.getSlice("lensResults");
2714
+ const hasSlice = context.hasSlice("lensResults");
2715
+ const isLoading = (lensResultsSlice == null ? void 0 : lensResultsSlice.loading) ?? false;
2716
+ const handleFileClick = (file, line) => {
2717
+ var _a, _b, _c;
2718
+ const repoPath = (_a = context.currentScope.repository) == null ? void 0 : _a.path;
2719
+ const fullPath = repoPath ? `${repoPath}/${file}` : file;
2720
+ if (line) {
2721
+ (_b = actions.openFile) == null ? void 0 : _b.call(actions, `${fullPath}:${line}`);
2722
+ } else {
2723
+ (_c = actions.openFile) == null ? void 0 : _c.call(actions, fullPath);
2724
+ }
2725
+ };
2726
+ return /* @__PURE__ */ jsxs(
2727
+ "div",
2728
+ {
2729
+ style: {
2730
+ fontFamily: theme.fonts.body,
2731
+ height: "100%",
2732
+ minHeight: 0,
2733
+ backgroundColor: theme.colors.background,
2734
+ color: theme.colors.text,
2735
+ overflowY: "auto",
2736
+ boxSizing: "border-box",
2737
+ display: "flex",
2738
+ flexDirection: "column"
2739
+ },
2740
+ children: [
2741
+ /* @__PURE__ */ jsxs("div", { style: {
2742
+ display: "flex",
2743
+ alignItems: "center",
2744
+ justifyContent: "space-between",
2745
+ height: 40,
2746
+ flexShrink: 0,
2747
+ padding: "0 16px",
2748
+ borderBottom: `1px solid ${theme.colors.border}`,
2749
+ boxSizing: "border-box"
2750
+ }, children: [
2751
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
2752
+ /* @__PURE__ */ jsx(Bug, { size: 18, color: theme.colors.primary }),
2753
+ /* @__PURE__ */ jsx(
2754
+ "h2",
2755
+ {
2756
+ style: {
2757
+ margin: 0,
2758
+ fontSize: 14,
2759
+ fontWeight: 600,
2760
+ color: theme.colors.text
2761
+ },
2762
+ children: "Lens Data Debug"
2763
+ }
2764
+ )
2765
+ ] }),
2766
+ (lensResultsSlice == null ? void 0 : lensResultsSlice.data) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, fontSize: 11, color: theme.colors.textMuted }, children: [
2767
+ /* @__PURE__ */ jsxs("span", { children: [
2768
+ new Set(lensResultsSlice.data.results.map((r2) => {
2769
+ var _a;
2770
+ return ((_a = r2.package) == null ? void 0 : _a.name) ?? "unknown";
2771
+ })).size,
2772
+ " packages"
2773
+ ] }),
2774
+ /* @__PURE__ */ jsxs("span", { children: [
2775
+ lensResultsSlice.data.results.length,
2776
+ " results"
2777
+ ] })
2778
+ ] })
2779
+ ] }),
2780
+ /* @__PURE__ */ jsx(
2781
+ "div",
2782
+ {
2783
+ style: {
2784
+ flex: 1,
2785
+ minHeight: 0,
2786
+ overflow: "auto"
2787
+ },
2788
+ children: isLoading ? /* @__PURE__ */ jsx("div", { style: {
2789
+ padding: 40,
2790
+ textAlign: "center",
2791
+ color: theme.colors.textMuted
2792
+ }, children: "Loading lens results..." }) : !hasSlice || !(lensResultsSlice == null ? void 0 : lensResultsSlice.data) ? /* @__PURE__ */ jsxs("div", { style: {
2793
+ padding: 40,
2794
+ textAlign: "center",
2795
+ color: theme.colors.textMuted
2796
+ }, children: [
2797
+ /* @__PURE__ */ jsx(Bug, { size: 48, color: theme.colors.border, style: { marginBottom: 16 } }),
2798
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 14, marginBottom: 8 }, children: "No lens data available" }),
2799
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 12 }, children: "Run quality-lens-cli or check that the lensResults slice is configured." })
2800
+ ] }) : /* @__PURE__ */ jsx(
2801
+ LensDataDebugPanel$1,
2802
+ {
2803
+ data: lensResultsSlice.data,
2804
+ theme,
2805
+ onFileClick: handleFileClick
2806
+ }
2807
+ )
2808
+ }
2809
+ )
2810
+ ]
2811
+ }
2812
+ );
2813
+ };
2814
+ const LensDataDebugPanel = LensDataDebugPanelContent;
2815
+ function getValueColor(value, key) {
2816
+ const effectiveValue = key === "deadCode" ? 100 - value : value;
2817
+ if (effectiveValue >= 80) return "#2E7D32";
2818
+ if (effectiveValue >= 60) return "#E6A700";
2819
+ return "#C62828";
2820
+ }
2821
+ function getValueBgColor(value, key) {
2822
+ const effectiveValue = key === "deadCode" ? 100 - value : value;
2823
+ if (effectiveValue >= 80) return "rgba(46, 125, 50, 0.1)";
2824
+ if (effectiveValue >= 60) return "rgba(230, 167, 0, 0.1)";
2825
+ return "rgba(198, 40, 40, 0.1)";
2826
+ }
2827
+ function getMetricIcon(key) {
2828
+ const iconProps = {
2829
+ width: 18,
2830
+ height: 18,
2831
+ viewBox: "0 0 24 24",
2832
+ fill: "none",
2833
+ stroke: "currentColor",
2834
+ strokeWidth: 2,
2835
+ strokeLinecap: "round",
2836
+ strokeLinejoin: "round"
2837
+ };
2838
+ switch (key) {
2839
+ case "types":
2840
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2841
+ /* @__PURE__ */ jsx("path", { d: "M12 2L2 7l10 5 10-5-10-5z" }),
2842
+ /* @__PURE__ */ jsx("path", { d: "M2 17l10 5 10-5" }),
2843
+ /* @__PURE__ */ jsx("path", { d: "M2 12l10 5 10-5" })
2844
+ ] });
2845
+ case "documentation":
2846
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2847
+ /* @__PURE__ */ jsx("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
2848
+ /* @__PURE__ */ jsx("polyline", { points: "14,2 14,8 20,8" }),
2849
+ /* @__PURE__ */ jsx("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
2850
+ /* @__PURE__ */ jsx("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
2851
+ /* @__PURE__ */ jsx("line", { x1: "10", y1: "9", x2: "8", y2: "9" })
2852
+ ] });
2853
+ case "tests":
2854
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2855
+ /* @__PURE__ */ jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
2856
+ /* @__PURE__ */ jsx("polyline", { points: "22,4 12,14.01 9,11.01" })
2857
+ ] });
2858
+ case "deadCode":
2859
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2860
+ /* @__PURE__ */ jsx("polyline", { points: "3,6 5,6 21,6" }),
2861
+ /* @__PURE__ */ jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }),
2862
+ /* @__PURE__ */ jsx("line", { x1: "10", y1: "11", x2: "10", y2: "17" }),
2863
+ /* @__PURE__ */ jsx("line", { x1: "14", y1: "11", x2: "14", y2: "17" })
2864
+ ] });
2865
+ case "formatting":
2866
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2867
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "10", x2: "7", y2: "10" }),
2868
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "6", x2: "3", y2: "6" }),
2869
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "14", x2: "3", y2: "14" }),
2870
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "18", x2: "7", y2: "18" })
2871
+ ] });
2872
+ case "linting":
2873
+ return /* @__PURE__ */ jsxs("svg", { ...iconProps, children: [
2874
+ /* @__PURE__ */ jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }),
2875
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
2876
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
2877
+ ] });
2878
+ default:
2879
+ return null;
2880
+ }
2881
+ }
2882
+ const METRIC_CONFIG = [
2883
+ { key: "types", label: "Types", description: "Type safety score" },
2884
+ { key: "documentation", label: "Documentation", description: "Documentation coverage" },
2885
+ { key: "tests", label: "Tests", description: "Test coverage and passing rate" },
2886
+ { key: "deadCode", label: "Dead Code", description: "Unused code detected" },
2887
+ { key: "formatting", label: "Formatting", description: "Code formatting consistency" },
2888
+ { key: "linting", label: "Linting", description: "Linting compliance" }
2889
+ ];
2890
+ function QualityMetricsList({
2891
+ metrics,
2892
+ theme,
2893
+ className,
2894
+ onMetricClick
2895
+ }) {
2896
+ return /* @__PURE__ */ jsx(
2897
+ "div",
2898
+ {
2899
+ className: cn(className),
2900
+ style: {
2901
+ display: "flex",
2902
+ flexDirection: "column",
2903
+ gap: 4
2904
+ },
2905
+ children: METRIC_CONFIG.map(({ key, label, description }) => {
2906
+ const value = metrics[key];
2907
+ const isDeadCode = key === "deadCode";
2908
+ return /* @__PURE__ */ jsxs(
2909
+ "div",
2910
+ {
2911
+ onClick: () => onMetricClick == null ? void 0 : onMetricClick(key),
2912
+ style: {
2913
+ display: "flex",
2914
+ alignItems: "center",
2915
+ gap: 12,
2916
+ padding: "10px 12px",
2917
+ borderRadius: 6,
2918
+ backgroundColor: theme.colors.surface,
2919
+ border: `1px solid ${theme.colors.border}`,
2920
+ cursor: onMetricClick ? "pointer" : "default",
2921
+ transition: "all 0.15s ease"
2922
+ },
2923
+ onMouseEnter: (e) => {
2924
+ if (onMetricClick) {
2925
+ e.currentTarget.style.backgroundColor = theme.colors.backgroundLight;
2926
+ e.currentTarget.style.borderColor = theme.colors.primary;
2927
+ }
2928
+ },
2929
+ onMouseLeave: (e) => {
2930
+ e.currentTarget.style.backgroundColor = theme.colors.surface;
2931
+ e.currentTarget.style.borderColor = theme.colors.border;
2932
+ },
2933
+ children: [
2934
+ /* @__PURE__ */ jsx(
2935
+ "div",
2936
+ {
2937
+ style: {
2938
+ display: "flex",
2939
+ alignItems: "center",
2940
+ justifyContent: "center",
2941
+ width: 32,
2942
+ height: 32,
2943
+ borderRadius: 6,
2944
+ backgroundColor: getValueBgColor(value, key),
2945
+ color: getValueColor(value, key),
2946
+ flexShrink: 0
2947
+ },
2948
+ children: getMetricIcon(key)
2949
+ }
2950
+ ),
2951
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
2952
+ /* @__PURE__ */ jsxs(
2953
+ "div",
2954
+ {
2955
+ style: {
2956
+ fontSize: 14,
2957
+ fontWeight: 500,
2958
+ color: theme.colors.text
2959
+ },
2960
+ children: [
2961
+ label,
2962
+ isDeadCode && /* @__PURE__ */ jsx(
2963
+ "span",
2964
+ {
2965
+ style: {
2966
+ fontSize: 11,
2967
+ color: theme.colors.textMuted,
2968
+ marginLeft: 4
2969
+ },
2970
+ children: "(lower is better)"
2971
+ }
2972
+ )
2973
+ ]
2974
+ }
2975
+ ),
2976
+ /* @__PURE__ */ jsx(
2977
+ "div",
2978
+ {
2979
+ style: {
2980
+ fontSize: 12,
2981
+ color: theme.colors.textMuted,
2982
+ whiteSpace: "nowrap",
2983
+ overflow: "hidden",
2984
+ textOverflow: "ellipsis"
2985
+ },
2986
+ children: description
2987
+ }
2988
+ )
2989
+ ] }),
2990
+ /* @__PURE__ */ jsxs(
2991
+ "div",
2992
+ {
2993
+ style: {
2994
+ display: "flex",
2995
+ alignItems: "center",
2996
+ gap: 8,
2997
+ flexShrink: 0
2998
+ },
2999
+ children: [
3000
+ /* @__PURE__ */ jsx(
3001
+ "div",
3002
+ {
3003
+ style: {
3004
+ width: 60,
3005
+ height: 6,
3006
+ borderRadius: 3,
3007
+ backgroundColor: theme.colors.border,
3008
+ overflow: "hidden"
3009
+ },
3010
+ children: /* @__PURE__ */ jsx(
3011
+ "div",
3012
+ {
3013
+ style: {
3014
+ width: `${isDeadCode ? 100 - value : value}%`,
3015
+ height: "100%",
3016
+ backgroundColor: getValueColor(value, key),
3017
+ borderRadius: 3,
3018
+ transition: "width 0.3s ease"
3019
+ }
3020
+ }
3021
+ )
3022
+ }
3023
+ ),
3024
+ /* @__PURE__ */ jsxs(
3025
+ "span",
3026
+ {
3027
+ style: {
3028
+ fontSize: 14,
3029
+ fontWeight: 600,
3030
+ color: getValueColor(value, key),
3031
+ minWidth: 45,
3032
+ textAlign: "right"
3033
+ },
3034
+ children: [
3035
+ value.toFixed(1),
3036
+ "%"
3037
+ ]
3038
+ }
3039
+ )
3040
+ ]
3041
+ }
3042
+ ),
3043
+ onMetricClick && /* @__PURE__ */ jsx(
3044
+ "svg",
3045
+ {
3046
+ width: "16",
3047
+ height: "16",
3048
+ viewBox: "0 0 24 24",
3049
+ fill: "none",
3050
+ stroke: theme.colors.textMuted,
3051
+ strokeWidth: "2",
3052
+ strokeLinecap: "round",
3053
+ strokeLinejoin: "round",
3054
+ style: { flexShrink: 0 },
3055
+ children: /* @__PURE__ */ jsx("polyline", { points: "9,18 15,12 9,6" })
3056
+ }
3057
+ )
3058
+ ]
3059
+ },
3060
+ key
3061
+ );
3062
+ })
3063
+ }
3064
+ );
3065
+ }
3066
+ function QualityMetricsListCompact({
3067
+ metrics,
3068
+ theme,
3069
+ className,
3070
+ onMetricClick
3071
+ }) {
3072
+ return /* @__PURE__ */ jsx(
3073
+ "div",
3074
+ {
3075
+ className: cn(className),
3076
+ style: {
3077
+ display: "flex",
3078
+ flexDirection: "column",
3079
+ gap: 2
3080
+ },
3081
+ children: METRIC_CONFIG.map(({ key, label }) => {
3082
+ const value = metrics[key];
3083
+ const isDeadCode = key === "deadCode";
3084
+ return /* @__PURE__ */ jsxs(
3085
+ "div",
3086
+ {
3087
+ onClick: () => onMetricClick == null ? void 0 : onMetricClick(key),
3088
+ style: {
3089
+ display: "flex",
3090
+ alignItems: "center",
3091
+ justifyContent: "space-between",
3092
+ gap: 8,
3093
+ padding: "6px 8px",
3094
+ borderRadius: 4,
3095
+ cursor: onMetricClick ? "pointer" : "default",
3096
+ transition: "background-color 0.15s ease"
3097
+ },
3098
+ onMouseEnter: (e) => {
3099
+ if (onMetricClick) {
3100
+ e.currentTarget.style.backgroundColor = theme.colors.surface;
3101
+ }
3102
+ },
3103
+ onMouseLeave: (e) => {
3104
+ e.currentTarget.style.backgroundColor = "transparent";
3105
+ },
3106
+ children: [
3107
+ /* @__PURE__ */ jsxs(
3108
+ "span",
3109
+ {
3110
+ style: {
3111
+ fontSize: 13,
3112
+ color: theme.colors.textMuted
3113
+ },
3114
+ children: [
3115
+ label,
3116
+ isDeadCode && " ↓"
3117
+ ]
3118
+ }
3119
+ ),
3120
+ /* @__PURE__ */ jsxs(
3121
+ "span",
3122
+ {
3123
+ style: {
3124
+ fontSize: 13,
3125
+ fontWeight: 500,
3126
+ color: getValueColor(value, key)
3127
+ },
3128
+ children: [
3129
+ value.toFixed(1),
3130
+ "%"
3131
+ ]
3132
+ }
3133
+ )
3134
+ ]
3135
+ },
3136
+ key
3137
+ );
3138
+ })
3139
+ }
3140
+ );
3141
+ }
2168
3142
  const panels = [
2169
3143
  {
2170
3144
  metadata: {
@@ -2213,6 +3187,32 @@ const panels = [
2213
3187
  onUnmount: async (_context) => {
2214
3188
  console.log("Repository Quality Grid Panel unmounting");
2215
3189
  }
3190
+ },
3191
+ {
3192
+ metadata: {
3193
+ id: "principal-ade.lens-data-debug-panel",
3194
+ name: "Lens Data Debug",
3195
+ icon: "🐛",
3196
+ version: "0.1.0",
3197
+ author: "Principal ADE",
3198
+ description: "Debug panel for inspecting raw lens results from quality-lens-cli. Shows package breakdown, lens results with pass/fail status, and files with issues.",
3199
+ slices: ["lensResults"],
3200
+ tools: []
3201
+ },
3202
+ component: LensDataDebugPanel,
3203
+ onMount: async (context) => {
3204
+ var _a;
3205
+ console.log(
3206
+ "Lens Data Debug Panel mounted",
3207
+ (_a = context.currentScope.repository) == null ? void 0 : _a.path
3208
+ );
3209
+ if (context.hasSlice("lensResults") && !context.isSliceLoading("lensResults")) {
3210
+ await context.refresh("repository", "lensResults");
3211
+ }
3212
+ },
3213
+ onUnmount: async (_context) => {
3214
+ console.log("Lens Data Debug Panel unmounting");
3215
+ }
2216
3216
  }
2217
3217
  ];
2218
3218
  const onPackageLoad = async () => {
@@ -2222,11 +3222,15 @@ const onPackageUnload = async () => {
2222
3222
  console.log("Panel package unloading - Code Quality Panels");
2223
3223
  };
2224
3224
  export {
3225
+ LensDataDebugPanel$1 as LensDataDebugComponent,
3226
+ LensDataDebugPanel,
2225
3227
  QualityHexagon,
2226
3228
  QualityHexagonCompact,
2227
3229
  QualityHexagonDetailed,
2228
3230
  QualityHexagonExpandable,
2229
3231
  QualityHexagonPanel,
3232
+ QualityMetricsList,
3233
+ QualityMetricsListCompact,
2230
3234
  RepositoryQualityGrid,
2231
3235
  RepositoryQualityGridItem,
2232
3236
  RepositoryQualityGridPanel,