@in-the-loop-labs/pair-review 5.4.2 → 5.4.4

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 (41) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  5. package/plugin-code-critic/skills/analyze/references/level1-balanced.md +1 -1
  6. package/plugin-code-critic/skills/analyze/references/level1-thorough.md +1 -1
  7. package/plugin-code-critic/skills/analyze/references/level2-balanced.md +2 -2
  8. package/plugin-code-critic/skills/analyze/references/level2-thorough.md +2 -2
  9. package/plugin-code-critic/skills/analyze/references/level3-balanced.md +2 -2
  10. package/plugin-code-critic/skills/analyze/references/level3-thorough.md +2 -2
  11. package/plugin-code-critic/skills/analyze/references/orchestration-balanced.md +3 -3
  12. package/plugin-code-critic/skills/analyze/references/orchestration-fast.md +1 -1
  13. package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +3 -3
  14. package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
  15. package/public/css/pr.css +0 -108
  16. package/public/css/toast.css +147 -0
  17. package/public/index.html +1 -0
  18. package/public/js/components/CouncilProgressModal.js +2 -9
  19. package/public/js/components/Toast.js +39 -4
  20. package/public/js/pr.js +21 -8
  21. package/public/js/utils/category-emoji.js +1 -1
  22. package/public/js/utils/header-anchor.js +38 -0
  23. package/public/local.html +4 -0
  24. package/public/pr.html +4 -0
  25. package/src/ai/antigravity-provider.js +57 -7
  26. package/src/ai/codex-provider.js +65 -17
  27. package/src/ai/executable-provider.js +1 -1
  28. package/src/ai/pi-format.js +42 -1
  29. package/src/ai/pi-style-provider.js +25 -10
  30. package/src/ai/prompts/baseline/consolidation/balanced.js +2 -2
  31. package/src/ai/prompts/baseline/consolidation/thorough.js +2 -2
  32. package/src/ai/prompts/baseline/level1/balanced.js +1 -1
  33. package/src/ai/prompts/baseline/level1/thorough.js +1 -1
  34. package/src/ai/prompts/baseline/level2/balanced.js +2 -2
  35. package/src/ai/prompts/baseline/level2/thorough.js +2 -2
  36. package/src/ai/prompts/baseline/level3/balanced.js +2 -2
  37. package/src/ai/prompts/baseline/level3/thorough.js +2 -2
  38. package/src/ai/prompts/baseline/orchestration/balanced.js +2 -2
  39. package/src/ai/prompts/baseline/orchestration/thorough.js +2 -2
  40. package/src/ai/prompts/shared/output-schema.js +6 -201
  41. package/src/utils/category-emoji.js +1 -1
package/README.md CHANGED
@@ -632,7 +632,7 @@ pair-review integrates with AI providers via their CLI tools:
632
632
 
633
633
  - **Claude**: Uses Claude Code CLI
634
634
  - **Antigravity**: Uses the Antigravity CLI (`agy`), the successor to the Gemini CLI. Install it with `curl -fsSL https://antigravity.google/cli/install.sh | bash` (macOS/Linux; it is not an npm package) — see the [Antigravity docs](https://antigravity.google/docs). Antigravity is an analysis-only provider: it runs as an agentic reviewer in non-interactive print mode and has **no chat/ACP mode**.
635
- - **Codex**: Uses Codex CLI. GPT-5.6 Sol High (`gpt-5.6-sol-high`) remains the recommended default during rollout. GPT-6.1 Sol High (`gpt-6.1-sol-high`) and XHigh (`gpt-6.1-sol-xhigh`) are explicit choices for reviews and chat; Enterprise and Edu administrators must enable GPT-6.1 Sol access. GPT-6.1 Terra XHigh (`gpt-6.1-terra-xhigh`) is an explicit balanced choice; Enterprise access depends on workspace administrator controls.
635
+ - **Codex**: Uses Codex CLI. GPT-5.6 Sol High (`gpt-5.6-sol-high`) remains the recommended default during rollout. GPT-6.2 Sol High (`gpt-6.2-sol-high`) and XHigh (`gpt-6.2-sol-xhigh`), GPT-6.2 Astra High (`gpt-6.2-astra-high`) and XHigh (`gpt-6.2-astra-xhigh`), and GPT-6.1 Sol High (`gpt-6.1-sol-high`) and XHigh (`gpt-6.1-sol-xhigh`) are explicit choices for reviews and chat; Enterprise and Edu administrators must enable GPT-6.1 and GPT-6.2 access, and GPT-6.2 requires Codex CLI 0.170.0 or later. GPT-6.1 Terra XHigh (`gpt-6.1-terra-xhigh`) is an explicit balanced choice; Enterprise access depends on workspace administrator controls.
636
636
  - **GitHub Copilot**: Uses Copilot CLI
637
637
  - **OpenCode**: Uses OpenCode CLI (requires model configuration)
638
638
  - **Cursor**: Uses Cursor Agent CLI (streaming output with sandbox mode)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in-the-loop-labs/pair-review",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "Your AI-powered code review partner - Close the feedback loop with AI coding agents",
5
5
  "main": "src/server.js",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pair-review",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "pair-review app integration — Open PRs and local changes in the pair-review web UI, run server-side AI analysis, and address review feedback. Requires the pair-review MCP server.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-critic",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "AI-powered code review analysis — Run three-level AI analysis directly in your coding agent. Works standalone, no server required.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
@@ -95,7 +95,7 @@ Omit severity for praise items.
95
95
  "description": "Detailed explanation",
96
96
  "suggestion": "How to fix/improve (omit for praise items)",
97
97
  "confidence": 0.0-1.0,
98
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
98
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
99
99
  }],
100
100
  "summary": "Brief summary of findings"
101
101
  }
@@ -117,7 +117,7 @@ Output JSON with this structure:
117
117
  "description": "Detailed explanation",
118
118
  "suggestion": "How to fix/improve (omit this field for praise items - no action needed)",
119
119
  "confidence": 0.0-1.0,
120
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
120
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
121
121
  }],
122
122
  "summary": "Brief summary of findings"
123
123
  }
@@ -97,7 +97,7 @@ Omit severity for praise items.
97
97
  "description": "Explanation mentioning why full file context was needed",
98
98
  "suggestion": "How to fix/improve (omit for praise items)",
99
99
  "confidence": 0.0-1.0,
100
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
100
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
101
101
  }],
102
102
  "fileLevelSuggestions": [{
103
103
  "file": "path/to/file",
@@ -107,7 +107,7 @@ Omit severity for praise items.
107
107
  "description": "File-level observation (architecture, organization, naming, etc.)",
108
108
  "suggestion": "How to address (omit for praise items)",
109
109
  "confidence": 0.0-1.0,
110
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
110
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
111
111
  }],
112
112
  "summary": "Brief summary of file context findings"
113
113
  }
@@ -146,7 +146,7 @@ Output JSON with this structure:
146
146
  "description": "Detailed explanation mentioning why full file context was needed",
147
147
  "suggestion": "How to fix/improve based on file context (omit for praise items)",
148
148
  "confidence": 0.0-1.0,
149
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
149
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
150
150
  }],
151
151
  "fileLevelSuggestions": [{
152
152
  "file": "path/to/file",
@@ -156,7 +156,7 @@ Output JSON with this structure:
156
156
  "description": "Explanation of the file-level observation (architecture, organization, naming, etc.)",
157
157
  "suggestion": "How to address the file-level concern (omit for praise items)",
158
158
  "confidence": 0.0-1.0,
159
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
159
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
160
160
  }],
161
161
  "summary": "Brief summary of file context findings"
162
162
  }
@@ -134,7 +134,7 @@ Output JSON with this structure:
134
134
  "description": "Detailed explanation mentioning why codebase context was needed",
135
135
  "suggestion": "How to fix/improve based on codebase context (omit for praise items)",
136
136
  "confidence": 0.0-1.0,
137
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
137
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
138
138
  }],
139
139
  "fileLevelSuggestions": [{
140
140
  "file": "path/to/file",
@@ -144,7 +144,7 @@ Output JSON with this structure:
144
144
  "description": "Explanation of the file-level observation from codebase perspective",
145
145
  "suggestion": "How to address the file-level concern (omit for praise items)",
146
146
  "confidence": 0.0-1.0,
147
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
147
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
148
148
  }],
149
149
  "summary": "Brief summary of how these changes connect to and impact the codebase"
150
150
  }
@@ -146,7 +146,7 @@ Output JSON with this structure:
146
146
  "description": "Detailed explanation mentioning why codebase context was needed",
147
147
  "suggestion": "How to fix/improve based on codebase context (omit for praise items)",
148
148
  "confidence": 0.0-1.0,
149
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
149
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
150
150
  }],
151
151
  "fileLevelSuggestions": [{
152
152
  "file": "path/to/file",
@@ -156,7 +156,7 @@ Output JSON with this structure:
156
156
  "description": "Explanation of the file-level observation from codebase perspective",
157
157
  "suggestion": "How to address the file-level concern (omit for praise items)",
158
158
  "confidence": 0.0-1.0,
159
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
159
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
160
160
  }],
161
161
  "summary": "Brief summary of how these changes connect to and impact the codebase"
162
162
  }
@@ -50,7 +50,7 @@ Each level provides suggestions as a JSON array with the following schema per it
50
50
  - suggestion: remediation advice
51
51
  - severity: "critical", "medium", or "minor" (omit for praise items)
52
52
  - confidence: 0.0-1.0 score
53
- - reasoning: (optional) array of strings with step-by-step reasoning
53
+ - reasoning: (optional) array of strings with concise code evidence and impact
54
54
  - is_file_level: true if this is a file-level suggestion (no line numbers)
55
55
 
56
56
  **Level 1 - Diff Analysis ([N] suggestions):**
@@ -122,7 +122,7 @@ Output JSON with this structure:
122
122
  "description": "Clear explanation of the issue and why this guidance matters to the human reviewer",
123
123
  "suggestion": "Specific, actionable guidance for the reviewer. For praise items this can be omitted. For other types always include specific, actionable suggestions.",
124
124
  "confidence": 0.0-1.0,
125
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
125
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
126
126
  }],
127
127
  "fileLevelSuggestions": [{
128
128
  "file": "path/to/file",
@@ -132,7 +132,7 @@ Output JSON with this structure:
132
132
  "description": "Explanation of the file-level observation",
133
133
  "suggestion": "How to address the file-level concern (omit for praise items)",
134
134
  "confidence": 0.0-1.0,
135
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
135
+ "reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
136
136
  }],
137
137
  "summary": "Formatted markdown summary following the Summary Structure guidance above."
138
138
  }
@@ -50,7 +50,7 @@ Each level provides suggestions as a JSON array with the following schema per it
50
50
  - suggestion: remediation advice
51
51
  - severity: "critical", "medium", or "minor" (omit for praise items)
52
52
  - confidence: 0.0-1.0 score
53
- - reasoning: (optional) array of strings with step-by-step reasoning
53
+ - reasoning: (optional) array of strings with concise code evidence and impact
54
54
  - is_file_level: true if this is a file-level suggestion (no line numbers)
55
55
 
56
56
  **Level 1 - Diff Analysis ([N] suggestions):**
@@ -55,7 +55,7 @@ Each level provides suggestions as a JSON array with the following schema per it
55
55
  - suggestion: remediation advice
56
56
  - severity: "critical", "medium", or "minor" (omit for praise items)
57
57
  - confidence: 0.0-1.0 score
58
- - reasoning: (optional) array of strings with step-by-step reasoning
58
+ - reasoning: (optional) array of strings with concise code evidence and impact
59
59
  - is_file_level: true if this is a file-level suggestion (no line numbers)
60
60
 
61
61
  **Level 1 - Diff Analysis ([N] suggestions):**
@@ -213,7 +213,7 @@ Output JSON with this structure:
213
213
  "description": "Clear explanation of the issue and why this guidance matters to the human reviewer",
214
214
  "suggestion": "Specific, actionable guidance for the reviewer (omit for praise items)",
215
215
  "confidence": 0.0-1.0,
216
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
216
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
217
217
  }],
218
218
  "fileLevelSuggestions": [{
219
219
  "file": "path/to/file",
@@ -223,7 +223,7 @@ Output JSON with this structure:
223
223
  "description": "Explanation of the file-level observation",
224
224
  "suggestion": "How to address the file-level concern (omit for praise items)",
225
225
  "confidence": 0.0-1.0,
226
- "reasoning": ["Step-by-step reasoning explaining why this issue was flagged"]
226
+ "reasoning": ["Concise code evidence and impact supporting this issue"]
227
227
  }],
228
228
  "summary": "Formatted markdown summary following the Summary Synthesis Guidance above."
229
229
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pair-loop",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "Agent-orchestrated review loop — implement, review with pair-review multi-model councils via the headless CLI, triage, fix, and repeat until a final review returns no blockers. MCP-independent.",
5
5
  "author": {
6
6
  "name": "in-the-loop-labs",
package/public/css/pr.css CHANGED
@@ -5764,114 +5764,6 @@ a.posted-comment-icon:focus-visible {
5764
5764
  border-top-color: #30363d;
5765
5765
  }
5766
5766
 
5767
- /* Toast Notification Styles */
5768
- .toast-container {
5769
- position: fixed;
5770
- top: 16px;
5771
- left: 50%;
5772
- transform: translateX(-50%);
5773
- z-index: 20000;
5774
- display: flex;
5775
- flex-direction: column-reverse;
5776
- gap: 8px;
5777
- pointer-events: none;
5778
- }
5779
-
5780
- .toast {
5781
- padding: 12px 16px;
5782
- border-radius: 8px;
5783
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
5784
- font-size: 14px;
5785
- font-weight: 500;
5786
- opacity: 0;
5787
- transform: translateY(-20px);
5788
- transition: var(--transition-ui-slow);
5789
- pointer-events: auto;
5790
- max-width: 500px;
5791
- }
5792
-
5793
- .toast-show {
5794
- opacity: 1;
5795
- transform: translateY(0);
5796
- }
5797
-
5798
- .toast-fade-out {
5799
- opacity: 0;
5800
- transform: translateY(-10px);
5801
- transition: var(--transition-ui-slow);
5802
- }
5803
-
5804
- .toast-success {
5805
- background-color: #1f883d;
5806
- color: white;
5807
- border: 1px solid #1a7f37;
5808
- }
5809
-
5810
- .toast-error {
5811
- background-color: #d1242f;
5812
- color: white;
5813
- border: 1px solid #cf222e;
5814
- }
5815
-
5816
- .toast-warning {
5817
- background-color: #9a6700;
5818
- color: white;
5819
- border: 1px solid #bf8700;
5820
- }
5821
-
5822
- .toast-info {
5823
- background-color: #0969da;
5824
- color: white;
5825
- border: 1px solid #0550ae;
5826
- }
5827
-
5828
- .toast-content {
5829
- display: flex;
5830
- align-items: center;
5831
- gap: 8px;
5832
- }
5833
-
5834
- .toast-icon {
5835
- flex-shrink: 0;
5836
- }
5837
-
5838
- .toast-message {
5839
- flex: 1;
5840
- line-height: 1.4;
5841
- }
5842
-
5843
- .toast-link {
5844
- color: white;
5845
- text-decoration: underline;
5846
- margin-left: 8px;
5847
- white-space: nowrap;
5848
- }
5849
-
5850
- .toast-link:hover {
5851
- color: rgba(255, 255, 255, 0.9);
5852
- }
5853
-
5854
- /* Dark theme toast styles */
5855
- [data-theme="dark"] .toast-success {
5856
- background-color: #238636;
5857
- border-color: #2ea043;
5858
- }
5859
-
5860
- [data-theme="dark"] .toast-error {
5861
- background-color: #da3633;
5862
- border-color: #f85149;
5863
- }
5864
-
5865
- [data-theme="dark"] .toast-warning {
5866
- background-color: #9e6a03;
5867
- border-color: #d29922;
5868
- }
5869
-
5870
- [data-theme="dark"] .toast-info {
5871
- background-color: #1f6feb;
5872
- border-color: #58a6ff;
5873
- }
5874
-
5875
5767
  /* Loading spinner for buttons */
5876
5768
  .loading-spinner-small {
5877
5769
  width: 16px;
@@ -0,0 +1,147 @@
1
+ /* Copyright 2026 Tim Perkins (tjwp) | SPDX-License-Identifier: Apache-2.0 */
2
+
3
+ /* Toast notifications rendered by js/components/Toast.js.
4
+ * Loaded by every page that loads Toast.js (dashboard, PR, Local), so it must
5
+ * not depend on variables defined only in pr.css.
6
+ *
7
+ * Do NOT load on settings.html or repo-settings.html. Those pages have their
8
+ * own toast system using the same class names (.toast, .toast-container,
9
+ * .toast-icon, .toast-message) and show toasts with `.show`, not `.toast-show`,
10
+ * so `.toast { opacity: 0 }` here would hide them. */
11
+
12
+ .toast-container {
13
+ position: fixed;
14
+ top: 16px;
15
+ left: 50%;
16
+ transform: translateX(-50%);
17
+ z-index: 20000;
18
+ display: flex;
19
+ flex-direction: column-reverse;
20
+ gap: 8px;
21
+ pointer-events: none;
22
+ }
23
+
24
+ .toast {
25
+ padding: 12px 16px;
26
+ border-radius: 8px;
27
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
28
+ font-size: 14px;
29
+ font-weight: 500;
30
+ opacity: 0;
31
+ transform: translateY(-20px);
32
+ transition: opacity 0.3s ease, transform 0.3s ease;
33
+ pointer-events: auto;
34
+ max-width: 500px;
35
+ }
36
+
37
+ .toast-show {
38
+ opacity: 1;
39
+ transform: translateY(0);
40
+ }
41
+
42
+ .toast-fade-out {
43
+ opacity: 0;
44
+ transform: translateY(-10px);
45
+ transition: opacity 0.3s ease, transform 0.3s ease;
46
+ }
47
+
48
+ .toast-success {
49
+ background-color: #1f883d;
50
+ color: white;
51
+ border: 1px solid #1a7f37;
52
+ }
53
+
54
+ .toast-error {
55
+ background-color: #d1242f;
56
+ color: white;
57
+ border: 1px solid #cf222e;
58
+ }
59
+
60
+ .toast-warning {
61
+ background-color: #9a6700;
62
+ color: white;
63
+ border: 1px solid #bf8700;
64
+ }
65
+
66
+ .toast-info {
67
+ background-color: #0969da;
68
+ color: white;
69
+ border: 1px solid #0550ae;
70
+ }
71
+
72
+ .toast-content {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 8px;
76
+ }
77
+
78
+ .toast-icon {
79
+ flex-shrink: 0;
80
+ }
81
+
82
+ .toast-message {
83
+ flex: 1;
84
+ line-height: 1.4;
85
+ }
86
+
87
+ .toast-link {
88
+ color: white;
89
+ text-decoration: underline;
90
+ margin-left: 8px;
91
+ white-space: nowrap;
92
+ }
93
+
94
+ .toast-link:hover {
95
+ color: rgba(255, 255, 255, 0.9);
96
+ }
97
+
98
+ /* Scoped to .toast-content to target only the Toast.js close button */
99
+ .toast-content .toast-close {
100
+ display: flex;
101
+ align-items: center;
102
+ justify-content: center;
103
+ flex-shrink: 0;
104
+ width: 24px;
105
+ height: 24px;
106
+ margin: -4px -8px -4px 4px;
107
+ padding: 0;
108
+ background: transparent;
109
+ border: none;
110
+ border-radius: 4px;
111
+ color: inherit;
112
+ opacity: 0.8;
113
+ cursor: pointer;
114
+ transition: background-color 0.15s ease, opacity 0.15s ease;
115
+ }
116
+
117
+ .toast-content .toast-close:hover {
118
+ background: rgba(255, 255, 255, 0.2);
119
+ opacity: 1;
120
+ }
121
+
122
+ .toast-content .toast-close:focus-visible {
123
+ outline: 2px solid currentColor;
124
+ outline-offset: 1px;
125
+ opacity: 1;
126
+ }
127
+
128
+ /* Dark theme toast styles */
129
+ [data-theme="dark"] .toast-success {
130
+ background-color: #238636;
131
+ border-color: #2ea043;
132
+ }
133
+
134
+ [data-theme="dark"] .toast-error {
135
+ background-color: #da3633;
136
+ border-color: #f85149;
137
+ }
138
+
139
+ [data-theme="dark"] .toast-warning {
140
+ background-color: #9e6a03;
141
+ border-color: #d29922;
142
+ }
143
+
144
+ [data-theme="dark"] .toast-info {
145
+ background-color: #1f6feb;
146
+ border-color: #58a6ff;
147
+ }
package/public/index.html CHANGED
@@ -18,6 +18,7 @@
18
18
  <link rel="icon" type="image/png" href="/favicon.png">
19
19
 
20
20
  <link rel="stylesheet" href="/css/analysis-config.css">
21
+ <link rel="stylesheet" href="/css/toast.css">
21
22
 
22
23
  <style>
23
24
  :root {
@@ -17,7 +17,6 @@ class CouncilProgressModal {
17
17
  this._wsUnsub = null;
18
18
  this._onReconnect = null;
19
19
  this.statusCheckInterval = null;
20
- this.isRunningInBackground = false;
21
20
  this.councilConfig = null;
22
21
 
23
22
  // Track per-voice completion state
@@ -93,22 +92,18 @@ class CouncilProgressModal {
93
92
  }
94
93
 
95
94
  /**
96
- * Hide the modal.
95
+ * Hide the modal. Progress monitoring continues so the analyze button
96
+ * still completes when the analysis finishes.
97
97
  */
98
98
  hide() {
99
99
  this.isVisible = false;
100
100
  this.modal.style.display = 'none';
101
-
102
- if (!this.isRunningInBackground) {
103
- this.stopProgressMonitoring();
104
- }
105
101
  }
106
102
 
107
103
  /**
108
104
  * Run analysis in background.
109
105
  */
110
106
  runInBackground() {
111
- this.isRunningInBackground = true;
112
107
  this.hide();
113
108
  }
114
109
 
@@ -116,7 +111,6 @@ class CouncilProgressModal {
116
111
  * Reopen the modal from background execution.
117
112
  */
118
113
  reopenFromBackground() {
119
- this.isRunningInBackground = false;
120
114
  if (this.currentAnalysisId) {
121
115
  // Don't rebuild — just re-show the existing DOM
122
116
  this.isVisible = true;
@@ -1432,7 +1426,6 @@ class CouncilProgressModal {
1432
1426
  if (cancelBtn) {
1433
1427
  cancelBtn.textContent = 'Cancel';
1434
1428
  }
1435
- this.isRunningInBackground = false;
1436
1429
  }
1437
1430
 
1438
1431
  // ---------------------------------------------------------------------------
@@ -1,9 +1,13 @@
1
1
  // Copyright 2026 Tim Perkins (tjwp) | SPDX-License-Identifier: Apache-2.0
2
2
  /**
3
3
  * Toast Notification Component
4
- * Shows temporary success/error/warning/info messages at the top of the page
4
+ * Shows temporary success/error/warning/info messages at the top of the page.
5
+ * Each toast closes on its timer, or at once when the user clicks its close button.
5
6
  */
6
7
  class Toast {
8
+ // Length of the fade-out animation before the toast node is removed
9
+ static FADE_MS = 300;
10
+
7
11
  constructor() {
8
12
  this.toastContainer = null;
9
13
  this.activeToasts = [];
@@ -134,6 +138,8 @@ class Toast {
134
138
  * @param {number} duration - Duration in ms
135
139
  */
136
140
  showToast(toast, duration) {
141
+ this.addCloseButton(toast);
142
+
137
143
  // Add to container
138
144
  this.toastContainer.appendChild(toast);
139
145
  this.activeToasts.push(toast);
@@ -144,22 +150,46 @@ class Toast {
144
150
  }, 10);
145
151
 
146
152
  // Auto dismiss after duration
147
- setTimeout(() => {
153
+ toast._dismissTimer = setTimeout(() => {
148
154
  this.dismissToast(toast);
149
155
  }, duration);
150
156
  }
151
157
 
158
+ /**
159
+ * Append a close button to the toast's content row
160
+ * @param {HTMLElement} toast - The toast element
161
+ */
162
+ addCloseButton(toast) {
163
+ const content = toast.querySelector('.toast-content');
164
+ if (!content || content.querySelector('.toast-close')) return;
165
+
166
+ const button = document.createElement('button');
167
+ button.type = 'button';
168
+ button.className = 'toast-close';
169
+ button.setAttribute('aria-label', 'Dismiss notification');
170
+ button.innerHTML = `
171
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
172
+ <path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
173
+ </svg>
174
+ `;
175
+ button.addEventListener('click', () => this.dismissToast(toast));
176
+ content.appendChild(button);
177
+ }
178
+
152
179
  /**
153
180
  * Dismiss a specific toast
154
181
  * @param {HTMLElement} toast - The toast element to dismiss
155
182
  */
156
183
  dismissToast(toast) {
157
184
  if (!toast || !toast.parentNode) return;
185
+ if (toast.classList.contains('toast-fade-out')) return;
186
+
187
+ clearTimeout(toast._dismissTimer);
158
188
 
159
189
  // Add fade-out class
160
190
  toast.classList.add('toast-fade-out');
161
191
 
162
- // Remove after fade animation (300ms)
192
+ // Remove after fade animation
163
193
  setTimeout(() => {
164
194
  if (toast.parentNode) {
165
195
  toast.parentNode.removeChild(toast);
@@ -170,7 +200,7 @@ class Toast {
170
200
  if (index > -1) {
171
201
  this.activeToasts.splice(index, 1);
172
202
  }
173
- }, 300);
203
+ }, Toast.FADE_MS);
174
204
  }
175
205
 
176
206
  /**
@@ -190,4 +220,9 @@ if (typeof window !== 'undefined' && !window.toast) {
190
220
  } else {
191
221
  window.toast = new Toast();
192
222
  }
223
+ }
224
+
225
+ // Export for CommonJS testing environments
226
+ if (typeof module !== 'undefined' && module.exports) {
227
+ module.exports = { Toast };
193
228
  }