dart-decimate 0.0.6 → 0.0.8

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.
@@ -45,6 +45,7 @@ fn mcp_overview_tools() -> Vec<Value> {
45
45
  "config",
46
46
  "since",
47
47
  "changed_since",
48
+ "compare",
48
49
  "baseline",
49
50
  "regression_baseline",
50
51
  "fail_on_regression",
@@ -156,6 +157,7 @@ fn analyze_mcp_tool() -> Value {
156
157
  "workspace",
157
158
  "changed_workspaces",
158
159
  "changed_since",
160
+ "compare",
159
161
  "baseline",
160
162
  "regression_baseline",
161
163
  "fail_on_regression",
@@ -233,6 +235,7 @@ fn dupes_mcp_tool() -> Value {
233
235
  "workspace",
234
236
  "changed_workspaces",
235
237
  "changed_since",
238
+ "compare",
236
239
  "baseline",
237
240
  "regression_baseline",
238
241
  "fail_on_regression",
@@ -266,6 +269,7 @@ fn health_mcp_tool() -> Value {
266
269
  "workspace",
267
270
  "changed_workspaces",
268
271
  "changed_since",
272
+ "compare",
269
273
  "baseline",
270
274
  "regression_baseline",
271
275
  "fail_on_regression",
@@ -363,6 +367,7 @@ fn security_mcp_tool() -> Value {
363
367
  "workspace",
364
368
  "changed_workspaces",
365
369
  "changed_since",
370
+ "compare",
366
371
  "baseline",
367
372
  "regression_baseline",
368
373
  "fail_on_regression",
@@ -394,6 +399,7 @@ fn feature_flags_mcp_tool() -> Value {
394
399
  "workspace",
395
400
  "changed_workspaces",
396
401
  "changed_since",
402
+ "compare",
397
403
  "baseline",
398
404
  "regression_baseline",
399
405
  "fail_on_regression",
@@ -444,6 +450,7 @@ fn fix_preview_mcp_tool() -> Value {
444
450
  "workspace",
445
451
  "changed_workspaces",
446
452
  "changed_since",
453
+ "compare",
447
454
  "production",
448
455
  "action",
449
456
  "no_create_config",
@@ -465,6 +472,7 @@ fn fix_apply_mcp_tool() -> Value {
465
472
  "workspace",
466
473
  "changed_workspaces",
467
474
  "changed_since",
475
+ "compare",
468
476
  "production",
469
477
  "action",
470
478
  "no_create_config",
@@ -489,6 +497,7 @@ fn audit_mcp_tool() -> Value {
489
497
  "workspace",
490
498
  "changed_workspaces",
491
499
  "changed_since",
500
+ "compare",
492
501
  "include_entry_exports",
493
502
  "private_type_leaks",
494
503
  "boundary",
package/src/manifest.rs CHANGED
@@ -147,14 +147,14 @@ fn analysis_commands() -> Value {
147
147
  "kind": "combined",
148
148
  "description": "Run all enabled graph, symbol, dependency, duplicate, health, flag, and security checks.",
149
149
  "schema": SCHEMA_VERSION,
150
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--boundary", "--boundary-coverage", "--boundary-call", "--policy-pack", "--policy-violations", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports", "--include-entry-exports", "--private-type-leaks", "--unused-files", "--unused-exports", "--unused-types", "--unused-deps", "--unlisted-deps", "--private-src-imports", "--duplicate-exports", "--circular-deps", "--re-export-cycles", "--boundary-violations", "--unused-enum-members", "--unused-class-members", "--unresolved-imports", "--stale-suppressions", "--unused-dependency-overrides", "--misconfigured-dependency-overrides"]
150
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--boundary", "--boundary-coverage", "--boundary-call", "--policy-pack", "--policy-violations", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports", "--include-entry-exports", "--private-type-leaks", "--unused-files", "--unused-exports", "--unused-types", "--unused-deps", "--unlisted-deps", "--private-src-imports", "--duplicate-exports", "--circular-deps", "--re-export-cycles", "--boundary-violations", "--unused-enum-members", "--unused-class-members", "--unresolved-imports", "--stale-suppressions", "--unused-dependency-overrides", "--misconfigured-dependency-overrides"]
151
151
  },
152
152
  {
153
153
  "name": "audit",
154
154
  "kind": "audit",
155
155
  "description": "Run changed-code graph checks scoped from a Git base ref.",
156
156
  "schema": SCHEMA_VERSION,
157
- "flags": ["--root", "--brief", "--base", "--gate", "--dead-code-baseline", "--health-baseline", "--dupes-baseline", "--max-decisions", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--boundary", "--boundary-coverage", "--boundary-call", "--policy-pack", "--policy-violations", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports", "--include-entry-exports", "--private-type-leaks"]
157
+ "flags": ["--root", "--brief", "--base", "--gate", "--dead-code-baseline", "--health-baseline", "--dupes-baseline", "--max-decisions", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--boundary", "--boundary-coverage", "--boundary-call", "--policy-pack", "--policy-violations", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports", "--include-entry-exports", "--private-type-leaks"]
158
158
  },
159
159
  {
160
160
  "name": "review",
@@ -175,42 +175,42 @@ fn analysis_commands() -> Value {
175
175
  "kind": "dead-code",
176
176
  "description": "Find unreachable Dart files and conservative symbol-level dead code.",
177
177
  "schema": SCHEMA_VERSION,
178
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--include-entry-exports", "--private-type-leaks", "--unused-files", "--unused-exports", "--unused-types", "--unused-deps", "--unlisted-deps", "--private-src-imports", "--duplicate-exports", "--unused-enum-members", "--unused-class-members", "--unresolved-imports", "--stale-suppressions", "--unused-dependency-overrides", "--misconfigured-dependency-overrides"]
178
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--include-entry-exports", "--private-type-leaks", "--unused-files", "--unused-exports", "--unused-types", "--unused-deps", "--unlisted-deps", "--private-src-imports", "--duplicate-exports", "--unused-enum-members", "--unused-class-members", "--unresolved-imports", "--stale-suppressions", "--unused-dependency-overrides", "--misconfigured-dependency-overrides"]
179
179
  },
180
180
  {
181
181
  "name": "cycles",
182
182
  "kind": "cycles",
183
183
  "description": "Find import/export/part/augment dependency cycles.",
184
184
  "schema": SCHEMA_VERSION,
185
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline"]
185
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline"]
186
186
  },
187
187
  {
188
188
  "name": "dupes",
189
189
  "kind": "dupes",
190
190
  "description": "Find duplicated Dart code blocks.",
191
191
  "schema": SCHEMA_VERSION,
192
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports"]
192
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--mode", "--min-tokens", "--min-lines", "--min-occurrences", "--top", "--threshold", "--cross-language", "--skip-local", "--ignore-imports", "--no-ignore-imports"]
193
193
  },
194
194
  {
195
195
  "name": "health",
196
196
  "kind": "health",
197
197
  "description": "Find complex functions, coverage gaps, hotspots, and refactoring targets.",
198
198
  "schema": SCHEMA_VERSION,
199
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--top"]
199
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--max-cyclomatic", "--max-cognitive", "--complexity-breakdown", "--coverage", "--coverage-gaps", "--max-crap", "--runtime-coverage", "--min-invocations-hot", "--min-observation-volume", "--low-traffic-threshold", "--file-scores", "--hotspots", "--targets", "--ownership", "--min-score", "--top"]
200
200
  },
201
201
  {
202
202
  "name": "flags",
203
203
  "kind": "flags",
204
204
  "description": "Inventory Dart and Flutter feature flag patterns.",
205
205
  "schema": SCHEMA_VERSION,
206
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--top"]
206
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--top"]
207
207
  },
208
208
  {
209
209
  "name": "security",
210
210
  "kind": "security",
211
211
  "description": "Surface local deterministic security review candidates.",
212
212
  "schema": SCHEMA_VERSION,
213
- "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--top", "--surface", "--sarif-file", "--ci", "--fail-on-issues", "--summary", "--gate", "--diff-file", "--diff-stdin", "--changed-since"]
213
+ "flags": ["--root", "--format", "--open", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--regression-baseline", "--save-regression-baseline", "--fail-on-regression", "--tolerance", "--baseline", "--save-baseline", "--top", "--surface", "--sarif-file", "--ci", "--fail-on-issues", "--summary", "--gate", "--diff-file", "--diff-stdin", "--changed-since", "--compare"]
214
214
  },
215
215
  {
216
216
  "name": "impact",
@@ -338,7 +338,7 @@ fn project_support_commands() -> Vec<Value> {
338
338
  "kind": "fix",
339
339
  "description": "Plan or apply safe auto-fixes.",
340
340
  "schema": FIX_SCHEMA_VERSION,
341
- "flags": ["--root", "--format", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--action", "--dry-run", "--apply", "--yes", "--confirm"]
341
+ "flags": ["--root", "--format", "--config", "--entry", "--dart-platform", "--production", "--no-production", "--file", "--workspace", "--changed-workspaces", "--changed-since", "--compare", "--action", "--dry-run", "--apply", "--yes", "--confirm"]
342
342
  }),
343
343
  ]
344
344
  }
@@ -16,6 +16,7 @@ const REPORT_SCOPE_KEYS: &[&str] = &[
16
16
  "workspace",
17
17
  "changed_workspaces",
18
18
  "changed_since",
19
+ "compare",
19
20
  "production",
20
21
  ];
21
22
  const LIST_SCOPE_KEYS: &[&str] = &[
@@ -163,7 +164,7 @@ fn extend_analyze_allowed(allowed: &mut Vec<&'static str>) {
163
164
  }
164
165
 
165
166
  fn extend_check_changed_allowed(allowed: &mut Vec<&'static str>) {
166
- allowed.extend(["since", "changed_since"]);
167
+ allowed.extend(["since", "changed_since", "compare"]);
167
168
  allowed.extend(BASELINE_KEYS);
168
169
  allowed.extend(["dart_platform", "production"]);
169
170
  }
@@ -295,6 +296,7 @@ fn analyze_args(cli: &mut Vec<String>, args: &Map<String, Value>) -> Result<(),
295
296
  fn check_changed_args(cli: &mut Vec<String>, args: &Map<String, Value>) -> Result<(), String> {
296
297
  let since = string_arg(args, "since")?
297
298
  .or(string_arg(args, "changed_since")?)
299
+ .or(string_arg(args, "compare")?)
298
300
  .ok_or_else(|| "check_changed requires since".to_owned())?;
299
301
  cli.extend(["--changed-since".to_owned(), since]);
300
302
  push_baseline_args(cli, args)?;
@@ -603,6 +605,7 @@ fn push_report_scope_args(cli: &mut Vec<String>, args: &Map<String, Value>) -> R
603
605
  push_string_flags(cli, args, "workspace", "--workspace")?;
604
606
  push_string_flag(cli, args, "changed_workspaces", "--changed-workspaces")?;
605
607
  push_string_flag(cli, args, "changed_since", "--changed-since")?;
608
+ push_string_flag(cli, args, "compare", "--compare")?;
606
609
  push_bool_mode(cli, args, "production", "--production", "--no-production")?;
607
610
  Ok(())
608
611
  }
package/src/mcp/tools.rs CHANGED
@@ -52,6 +52,7 @@ fn analyze_tool() -> Value {
52
52
  ("workspace", "array"),
53
53
  ("changed_workspaces", "string"),
54
54
  ("changed_since", "string"),
55
+ ("compare", "string"),
55
56
  ("baseline", "string"),
56
57
  ("regression_baseline", "string"),
57
58
  ("fail_on_regression", "boolean"),
@@ -105,6 +106,7 @@ fn check_changed_tool() -> Value {
105
106
  ("config", "string"),
106
107
  ("since", "string"),
107
108
  ("changed_since", "string"),
109
+ ("compare", "string"),
108
110
  ("baseline", "string"),
109
111
  ("regression_baseline", "string"),
110
112
  ("fail_on_regression", "boolean"),
@@ -294,6 +296,7 @@ fn dupes_tool() -> Value {
294
296
  ("workspace", "array"),
295
297
  ("changed_workspaces", "string"),
296
298
  ("changed_since", "string"),
299
+ ("compare", "string"),
297
300
  ("baseline", "string"),
298
301
  ("regression_baseline", "string"),
299
302
  ("fail_on_regression", "boolean"),
@@ -332,6 +335,7 @@ fn health_tool() -> Value {
332
335
  ("workspace", "array"),
333
336
  ("changed_workspaces", "string"),
334
337
  ("changed_since", "string"),
338
+ ("compare", "string"),
335
339
  ("baseline", "string"),
336
340
  ("regression_baseline", "string"),
337
341
  ("fail_on_regression", "boolean"),
@@ -390,6 +394,7 @@ fn security_tool() -> Value {
390
394
  ("workspace", "array"),
391
395
  ("changed_workspaces", "string"),
392
396
  ("changed_since", "string"),
397
+ ("compare", "string"),
393
398
  ("baseline", "string"),
394
399
  ("regression_baseline", "string"),
395
400
  ("fail_on_regression", "boolean"),
@@ -439,6 +444,7 @@ fn feature_flags_tool() -> Value {
439
444
  ("changed_workspaces", "string"),
440
445
  ("top", "integer"),
441
446
  ("changed_since", "string"),
447
+ ("compare", "string"),
442
448
  ("baseline", "string"),
443
449
  ("regression_baseline", "string"),
444
450
  ("fail_on_regression", "boolean"),
@@ -475,6 +481,7 @@ fn fix_preview_tool() -> Value {
475
481
  ("workspace", "array"),
476
482
  ("changed_workspaces", "string"),
477
483
  ("changed_since", "string"),
484
+ ("compare", "string"),
478
485
  ("production", "boolean"),
479
486
  ("action", "array"),
480
487
  ("no_create_config", "boolean"),
@@ -498,6 +505,7 @@ fn fix_apply_tool() -> Value {
498
505
  ("workspace", "array"),
499
506
  ("changed_workspaces", "string"),
500
507
  ("changed_since", "string"),
508
+ ("compare", "string"),
501
509
  ("production", "boolean"),
502
510
  ("action", "array"),
503
511
  ("no_create_config", "boolean"),
@@ -526,6 +534,7 @@ fn audit_tool() -> Value {
526
534
  ("workspace", "array"),
527
535
  ("changed_workspaces", "string"),
528
536
  ("changed_since", "string"),
537
+ ("compare", "string"),
529
538
  ("include_entry_exports", "boolean"),
530
539
  ("private_type_leaks", "boolean"),
531
540
  ("boundary", "array"),
@@ -0,0 +1,164 @@
1
+ /// Report UI tokens, layout, and static progressive-enhancement behavior.
2
+ pub(super) fn render_style(html: &mut String) {
3
+ html.push_str(
4
+ r#"<style>
5
+ :root {
6
+ color-scheme: dark;
7
+ --bg: #090909;
8
+ --surface: #121212;
9
+ --surface-raised: #181818;
10
+ --line: #2d2d2f;
11
+ --line-strong: #3a3a3d;
12
+ --text: #f4f4f5;
13
+ --muted: #ababaf;
14
+ --accent: #8fdcff;
15
+ --focus: #c7f0ff;
16
+ --error: #ff6b6b;
17
+ --warn: #ffd166;
18
+ --pass: #64d98a;
19
+ }
20
+ * { box-sizing: border-box; }
21
+ [hidden] { display: none !important; }
22
+ body {
23
+ margin: 0;
24
+ background: var(--bg);
25
+ color: var(--text);
26
+ font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
27
+ }
28
+ main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 52px; }
29
+ h1, h2, h3, p { margin: 0; }
30
+ h1 { font-size: 2rem; letter-spacing: 0; line-height: 1.15; }
31
+ h2 { margin-top: 30px; font-size: 1.25rem; }
32
+ .topline { color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
33
+ .hero { border-bottom: 1px solid var(--line); padding-bottom: 22px; }
34
+ .verdict { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; }
35
+ .pass { color: var(--pass); }
36
+ .fail, .error { color: var(--error); }
37
+ .warning { color: var(--warn); }
38
+ .metrics, .groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 18px; margin-top: 22px; }
39
+ .metric { border-top: 1px solid var(--line); padding-top: 10px; }
40
+ .group, .step { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
41
+ .metric span, .group span, .label { color: var(--muted); display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
42
+ .metric strong { display: block; margin-top: 4px; font-size: 1.35rem; }
43
+ .group p { margin-top: 8px; color: var(--text); }
44
+ .finding-tools { display: grid; gap: 12px; margin-top: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
45
+ .finding-tools label, .filter-label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
46
+ .finding-tools input { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; padding: 8px 10px; }
47
+ .finding-tools input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
48
+ .filter-set { display: grid; gap: 8px; }
49
+ .filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
50
+ .type-filter { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--text); cursor: pointer; font: inherit; padding: 8px 10px; text-align: left; }
51
+ .type-filter:hover { border-color: var(--muted); }
52
+ .type-filter:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
53
+ .type-filter[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #10232b; }
54
+ .finding-status, .empty-results { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
55
+ .finding-groups { display: grid; gap: 12px; margin-top: 14px; }
56
+ .finding-group { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
57
+ .finding-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; padding: 14px 16px; }
58
+ .finding-group > summary::-webkit-details-marker { display: none; }
59
+ .finding-group > summary:hover { background: var(--surface-raised); }
60
+ .finding-group > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
61
+ .finding-group[open] > summary { border-bottom: 1px solid var(--line); }
62
+ .summary-title { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
63
+ .summary-text { display: grid; gap: 3px; min-width: 0; }
64
+ .group-number { color: var(--muted); font-variant-numeric: tabular-nums; }
65
+ .summary-title strong { font-size: 1rem; }
66
+ .summary-right { display: inline-flex; align-items: center; gap: 12px; }
67
+ .summary-meta { color: var(--muted); font-size: 13px; text-align: right; }
68
+ .chevron { width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transform-origin: center; }
69
+ .finding-group[open] .chevron { transform: rotate(225deg); }
70
+ .findings { display: grid; gap: 12px; margin-top: 14px; }
71
+ .finding-group .findings { margin-top: 0; padding: 12px; }
72
+ .finding { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
73
+ .finding header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
74
+ .finding h3 { font-size: 1rem; }
75
+ .rule, .location, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
76
+ .rule { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
77
+ .section { margin-top: 10px; }
78
+ .section p { margin-top: 3px; overflow-wrap: anywhere; }
79
+ .evidence { margin: 8px 0 0; padding-left: 18px; color: var(--text); }
80
+ .evidence li { margin: 3px 0; overflow-wrap: anywhere; }
81
+ .command { overflow-wrap: anywhere; color: var(--accent); }
82
+ a { color: var(--accent); text-decoration: none; }
83
+ a:hover { text-decoration: underline; }
84
+ @media (max-width: 720px) {
85
+ main { padding: 24px 16px 44px; }
86
+ h1 { font-size: 1.65rem; }
87
+ .finding-group > summary { align-items: flex-start; flex-direction: column; }
88
+ .summary-right { justify-content: space-between; width: 100%; }
89
+ .summary-meta { text-align: left; }
90
+ }
91
+ @media (prefers-reduced-motion: no-preference) {
92
+ .finding-group > summary, .finding-tools input, .type-filter { transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
93
+ .chevron { transition: transform .16s ease; }
94
+ }
95
+ </style>
96
+ "#,
97
+ );
98
+ }
99
+
100
+ pub(super) fn render_interaction_script(html: &mut String) {
101
+ html.push_str(
102
+ r#"<script>
103
+ (() => {
104
+ const controls = document.querySelector("[data-finding-controls]");
105
+ if (!controls) return;
106
+ const searchInput = controls.querySelector("[data-finding-search]");
107
+ const filterButtons = Array.from(controls.querySelectorAll("[data-finding-filter]"));
108
+ const status = controls.querySelector("[data-finding-status]");
109
+ const emptyResults = document.querySelector("[data-empty-results]");
110
+ const groups = Array.from(document.querySelectorAll("[data-finding-group]"));
111
+ if (!searchInput || filterButtons.length === 0 || !status || groups.length === 0) return;
112
+ const totalFindings = Number(status.dataset.total || 0);
113
+ let selectedType = "";
114
+
115
+ const syncButtons = () => {
116
+ for (const button of filterButtons) {
117
+ button.setAttribute("aria-pressed", button.dataset.kind === selectedType ? "true" : "false");
118
+ }
119
+ };
120
+
121
+ const update = () => {
122
+ const query = searchInput.value.trim().toLowerCase();
123
+ let visibleFindings = 0;
124
+ let visibleGroups = 0;
125
+
126
+ for (const group of groups) {
127
+ const typeMatches = !selectedType || group.dataset.kind === selectedType;
128
+ let groupMatches = 0;
129
+ const findings = Array.from(group.querySelectorAll("[data-finding]"));
130
+
131
+ for (const finding of findings) {
132
+ const textMatches = !query || finding.textContent.toLowerCase().includes(query);
133
+ const visible = typeMatches && textMatches;
134
+ finding.hidden = !visible;
135
+ if (visible) groupMatches += 1;
136
+ }
137
+
138
+ group.hidden = groupMatches === 0;
139
+ if (groupMatches > 0) {
140
+ visibleGroups += 1;
141
+ visibleFindings += groupMatches;
142
+ }
143
+ }
144
+
145
+ status.textContent = `Showing ${visibleFindings} of ${totalFindings} findings in ${visibleGroups} ${visibleGroups === 1 ? "type" : "types"}.`;
146
+ if (emptyResults) emptyResults.hidden = visibleFindings !== 0;
147
+ };
148
+
149
+ searchInput.addEventListener("input", update);
150
+ for (const button of filterButtons) {
151
+ button.addEventListener("click", () => {
152
+ selectedType = button.dataset.kind || "";
153
+ syncButtons();
154
+ if (selectedType) {
155
+ for (const group of groups) group.open = group.dataset.kind === selectedType;
156
+ }
157
+ update();
158
+ });
159
+ }
160
+ })();
161
+ </script>
162
+ "#,
163
+ );
164
+ }