@prenta/admin 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/__tests__/lib/api.test.d.ts +2 -0
  3. package/dist/__tests__/lib/api.test.d.ts.map +1 -0
  4. package/dist/__tests__/lib/api.test.js +58 -0
  5. package/dist/__tests__/lib/api.test.js.map +1 -0
  6. package/dist/__tests__/lib/seo-service-autopilot.test.d.ts +2 -0
  7. package/dist/__tests__/lib/seo-service-autopilot.test.d.ts.map +1 -0
  8. package/dist/__tests__/lib/seo-service-autopilot.test.js +171 -0
  9. package/dist/__tests__/lib/seo-service-autopilot.test.js.map +1 -0
  10. package/dist/__tests__/lib/seo-service-proposals.test.js +28 -0
  11. package/dist/__tests__/lib/seo-service-proposals.test.js.map +1 -1
  12. package/dist/__tests__/views/redirects-pane.render.test.js +30 -12
  13. package/dist/__tests__/views/redirects-pane.render.test.js.map +1 -1
  14. package/dist/__tests__/views/seo-autopilot-applied.render.test.d.ts +2 -0
  15. package/dist/__tests__/views/seo-autopilot-applied.render.test.d.ts.map +1 -0
  16. package/dist/__tests__/views/seo-autopilot-applied.render.test.js +330 -0
  17. package/dist/__tests__/views/seo-autopilot-applied.render.test.js.map +1 -0
  18. package/dist/__tests__/views/seo-autopilot-card.render.test.d.ts +2 -0
  19. package/dist/__tests__/views/seo-autopilot-card.render.test.d.ts.map +1 -0
  20. package/dist/__tests__/views/seo-autopilot-card.render.test.js +512 -0
  21. package/dist/__tests__/views/seo-autopilot-card.render.test.js.map +1 -0
  22. package/dist/__tests__/views/seo-proposals-tab.render.test.js +139 -0
  23. package/dist/__tests__/views/seo-proposals-tab.render.test.js.map +1 -1
  24. package/dist/__tests__/views/seo-settings.render.test.js +41 -4
  25. package/dist/__tests__/views/seo-settings.render.test.js.map +1 -1
  26. package/dist/lib/api.d.ts +13 -2
  27. package/dist/lib/api.d.ts.map +1 -1
  28. package/dist/lib/api.js +1 -2
  29. package/dist/lib/api.js.map +1 -1
  30. package/dist/lib/seo-service.d.ts +206 -2
  31. package/dist/lib/seo-service.d.ts.map +1 -1
  32. package/dist/lib/seo-service.js +139 -5
  33. package/dist/lib/seo-service.js.map +1 -1
  34. package/dist/prenta-admin.css +1 -1
  35. package/dist/views/SEO.js +1 -1
  36. package/dist/views/SEO.js.map +1 -1
  37. package/dist/views/seo/AutopilotAppliedSection.d.ts +10 -0
  38. package/dist/views/seo/AutopilotAppliedSection.d.ts.map +1 -0
  39. package/dist/views/seo/AutopilotAppliedSection.js +295 -0
  40. package/dist/views/seo/AutopilotAppliedSection.js.map +1 -0
  41. package/dist/views/seo/ProposalsTab.d.ts.map +1 -1
  42. package/dist/views/seo/ProposalsTab.js +53 -17
  43. package/dist/views/seo/ProposalsTab.js.map +1 -1
  44. package/dist/views/seo/RedirectsTab.d.ts +3 -1
  45. package/dist/views/seo/RedirectsTab.d.ts.map +1 -1
  46. package/dist/views/seo/RedirectsTab.js +14 -19
  47. package/dist/views/seo/RedirectsTab.js.map +1 -1
  48. package/dist/views/seo/relative-age.d.ts +7 -0
  49. package/dist/views/seo/relative-age.d.ts.map +1 -0
  50. package/dist/views/seo/relative-age.js +20 -0
  51. package/dist/views/seo/relative-age.js.map +1 -0
  52. package/dist/views/settings/SeoAutopilotCard.d.ts +30 -0
  53. package/dist/views/settings/SeoAutopilotCard.d.ts.map +1 -0
  54. package/dist/views/settings/SeoAutopilotCard.js +375 -0
  55. package/dist/views/settings/SeoAutopilotCard.js.map +1 -0
  56. package/dist/views/settings/SeoSettingsTab.d.ts.map +1 -1
  57. package/dist/views/settings/SeoSettingsTab.js +2 -1
  58. package/dist/views/settings/SeoSettingsTab.js.map +1 -1
  59. package/dist/views/settings/components.d.ts +3 -1
  60. package/dist/views/settings/components.d.ts.map +1 -1
  61. package/dist/views/settings/components.js +2 -2
  62. package/dist/views/settings/components.js.map +1 -1
  63. package/package.json +3 -3
  64. package/src/__tests__/lib/api.test.ts +76 -0
  65. package/src/__tests__/lib/seo-service-autopilot.test.ts +196 -0
  66. package/src/__tests__/lib/seo-service-proposals.test.ts +29 -0
  67. package/src/__tests__/views/redirects-pane.render.test.tsx +36 -16
  68. package/src/__tests__/views/seo-autopilot-applied.render.test.tsx +382 -0
  69. package/src/__tests__/views/seo-autopilot-card.render.test.tsx +610 -0
  70. package/src/__tests__/views/seo-proposals-tab.render.test.tsx +161 -0
  71. package/src/__tests__/views/seo-settings.render.test.tsx +47 -7
  72. package/src/lib/api.ts +19 -3
  73. package/src/lib/seo-service.ts +334 -6
  74. package/src/views/SEO.tsx +1 -1
  75. package/src/views/seo/AutopilotAppliedSection.tsx +597 -0
  76. package/src/views/seo/ProposalsTab.tsx +92 -12
  77. package/src/views/seo/RedirectsTab.tsx +39 -60
  78. package/src/views/seo/relative-age.ts +15 -0
  79. package/src/views/settings/SeoAutopilotCard.tsx +826 -0
  80. package/src/views/settings/SeoSettingsTab.tsx +2 -0
  81. package/src/views/settings/components.tsx +10 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SEO.js","sourceRoot":"","sources":["../../src/views/SEO.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;GAMG;AACH,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EACL,eAAe,EACf,QAAQ,EACR,SAAS,EACT,cAAc,EACd,cAAc,EACd,SAAS,EACT,GAAG,EACH,KAAK,EACL,KAAK,GACN,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAA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AAE,UAAU,EACtB,cAAc,EAAE,QAAQ,CAAC,OAAO,EAChC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,GAClB,CACH,GACY,EACf,KAAC,IAAI,CAAC,OAAO,IAAC,KAAK,EAAC,WAAW,EAAC,QAAQ,EAAE,CAAC,CAAC,YACzC,SAAS,KAAK,WAAW,IAAI,CAC5B,KAAC,YAAY,IACX,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAC5C,UAAU,EAAE,UAAU,GACtB,CACH,GACY,IACD,GACZ,IACI,IACR,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function AutopilotAppliedSection({ onNavigate, onChanged, refreshKey, }: {
2
+ onNavigate?: (path: string) => void;
3
+ /**
4
+ * Fired after a successful revert. The server reopens the originating issue
5
+ * or redirect suggestion, so the parent inbox / overview must refetch.
6
+ */
7
+ onChanged?: () => void;
8
+ refreshKey?: number;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=AutopilotAppliedSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutopilotAppliedSection.d.ts","sourceRoot":"","sources":["../../../src/views/seo/AutopilotAppliedSection.tsx"],"names":[],"mappings":"AAiNA,wBAAgB,uBAAuB,CAAC,EACtC,UAAU,EACV,SAAS,EACT,UAAc,GACf,EAAE;IACD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,2CAuXA"}
@@ -0,0 +1,295 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ /**
4
+ * SEO → Proposals "Applied by autopilot": the ledger of every unattended change
5
+ * (spec §4), newest first, with its gate results and Search Console outcome.
6
+ * Revert is admin-only (`canRevert` from the list payload) and confirmed; a 409
7
+ * conflict re-prompts with the fields a human edited since and offers a forced
8
+ * retry. One mutation is allowed in flight at a time (same guard pattern as
9
+ * `ProposalsTab`).
10
+ */
11
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
12
+ import { ArrowRight, Bot, Undo2 } from 'lucide-react';
13
+ import { toast } from 'sonner';
14
+ import { fetchAutopilotApplied, revertAutopilotChange, } from '../../lib/seo-service.js';
15
+ import { sourceEditPath } from '../../lib/collection-routes.js';
16
+ import { brandAlignmentLabel, brandAlignmentTone } from '../../lib/brand-voice-client.js';
17
+ import { SectionCard, SeoEmptyState, SeoErrorState, SeoLoading, SeoStatusBadge, btnSecondary, } from '../../components/seo/primitives.js';
18
+ import { ConfirmDialog } from '../../components/ui/ConfirmDialog.js';
19
+ import { relativeAge } from './relative-age.js';
20
+ const PAGE_SIZE = 20;
21
+ const SEO_SETTINGS_PATH = '/settings?tab=seo';
22
+ const SELECT_CLASS = 'border-border bg-input-background text-foreground focus-visible:ring-ring rounded-md border px-2 py-1.5 text-sm focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60';
23
+ /** Compact secondary button for table rows (parity with the Settings autopilot card). */
24
+ const ROW_BUTTON_CLASS = 'border-border text-foreground hover:bg-accent focus-visible:ring-ring inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm font-medium whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-60';
25
+ const PAGER_BUTTON_CLASS = 'text-foreground hover:bg-accent focus-visible:ring-ring rounded-md px-3 py-1.5 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50';
26
+ const STATUS_OPTIONS = [
27
+ { value: '', label: 'All statuses' },
28
+ { value: 'applied', label: 'Applied' },
29
+ { value: 'reverted', label: 'Reverted' },
30
+ { value: 'outcome_reverted', label: 'Reverted after regression' },
31
+ { value: 'verify_failed', label: 'Verify failed' },
32
+ ];
33
+ const OUTCOME_OPTIONS = [
34
+ { value: '', label: 'All outcomes' },
35
+ { value: 'pending', label: 'Watching' },
36
+ { value: 'held', label: 'Held' },
37
+ { value: 'regressed', label: 'Regressed' },
38
+ { value: 'insufficient_data', label: 'Not enough data' },
39
+ { value: 'skipped', label: 'Not watched' },
40
+ ];
41
+ function isStatus(v) {
42
+ return STATUS_OPTIONS.some((o) => o.value !== '' && o.value === v);
43
+ }
44
+ function isOutcome(v) {
45
+ return OUTCOME_OPTIONS.some((o) => o.value !== '' && o.value === v);
46
+ }
47
+ function StatusBadge({ status }) {
48
+ switch (status) {
49
+ case 'applied':
50
+ return _jsx(SeoStatusBadge, { label: "Applied", tone: "good" });
51
+ case 'verify_failed':
52
+ return _jsx(SeoStatusBadge, { label: "Verify failed", tone: "poor" });
53
+ case 'reverted':
54
+ return _jsx(SeoStatusBadge, { label: "Reverted", tone: "neutral" });
55
+ case 'outcome_reverted':
56
+ return _jsx(SeoStatusBadge, { label: "Reverted \u00B7 regression", tone: "fair" });
57
+ default: {
58
+ const _exhaustive = status;
59
+ return _exhaustive;
60
+ }
61
+ }
62
+ }
63
+ /** Only outcomes that carry information get a badge; `pending` / `skipped` stay quiet. */
64
+ function OutcomeBadge({ outcome }) {
65
+ switch (outcome) {
66
+ case 'pending':
67
+ case 'skipped':
68
+ return null;
69
+ case 'held':
70
+ return _jsx(SeoStatusBadge, { label: "Held", tone: "good" });
71
+ case 'regressed':
72
+ return _jsx(SeoStatusBadge, { label: "Regressed", tone: "poor" });
73
+ case 'insufficient_data':
74
+ return _jsx(SeoStatusBadge, { label: "Not enough data", tone: "neutral" });
75
+ default: {
76
+ const _exhaustive = outcome;
77
+ return _exhaustive;
78
+ }
79
+ }
80
+ }
81
+ function KindBadge({ kind }) {
82
+ switch (kind) {
83
+ case 'issue-fix':
84
+ return _jsx(SeoStatusBadge, { label: "Issue fix", tone: "neutral" });
85
+ case 'redirect':
86
+ return _jsx(SeoStatusBadge, { label: "Redirect", tone: "neutral" });
87
+ default: {
88
+ const _exhaustive = kind;
89
+ return _exhaustive;
90
+ }
91
+ }
92
+ }
93
+ /** `missing-meta-title` → `Missing meta title`; the redirect pseudo-type names its producer. */
94
+ function issueTypeLabel(issueType) {
95
+ if (issueType === 'redirect')
96
+ return '404 recovery';
97
+ const words = issueType.replace(/[-_]+/g, ' ').trim();
98
+ return words ? words.charAt(0).toUpperCase() + words.slice(1) : issueType;
99
+ }
100
+ /** `metaTitle` → `Meta title`. */
101
+ function fieldLabel(field) {
102
+ const spaced = field.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/[-_]+/g, ' ');
103
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1).toLowerCase();
104
+ }
105
+ function formatValue(v) {
106
+ if (v === null || v === undefined || v === '')
107
+ return '—';
108
+ if (typeof v === 'string')
109
+ return v;
110
+ if (typeof v === 'number' || typeof v === 'boolean')
111
+ return String(v);
112
+ return JSON.stringify(v);
113
+ }
114
+ function displayTitle(row) {
115
+ if (row.kind === 'redirect')
116
+ return formatValue(row.after.source ?? row.entityUrl);
117
+ return row.entityTitle ?? row.entityUrl ?? row.path ?? issueTypeLabel(row.issueType);
118
+ }
119
+ function AppliedTime({ iso }) {
120
+ const absolute = new Date(iso).toLocaleString();
121
+ const relative = relativeAge(iso);
122
+ return (_jsxs("time", { dateTime: iso, title: absolute, children: [relative || absolute, relative ? _jsxs("span", { className: "sr-only", children: [" (", absolute, ")"] }) : null] }));
123
+ }
124
+ function Diff({ row }) {
125
+ if (row.kind === 'redirect') {
126
+ return (_jsxs("p", { className: "text-foreground flex flex-wrap items-center gap-1 font-mono text-sm break-all", children: [_jsx("span", { children: formatValue(row.after.source) }), _jsx(ArrowRight, { className: "text-muted-foreground h-3.5 w-3.5 shrink-0", "aria-hidden": true }), _jsx("span", { className: "sr-only", children: "to" }), _jsx("span", { className: "text-muted-foreground", children: formatValue(row.after.destination) })] }));
127
+ }
128
+ const fields = Object.keys(row.after);
129
+ if (fields.length === 0)
130
+ return _jsx("span", { className: "text-muted-foreground text-sm", children: "\u2014" });
131
+ return (_jsx("ul", { className: "space-y-1 text-sm", children: fields.map((field) => (_jsxs("li", { className: "flex flex-wrap items-baseline gap-x-1.5", children: [_jsxs("span", { className: "text-muted-foreground", children: [fieldLabel(field), ":"] }), _jsx("span", { className: "text-muted-foreground line-through", children: formatValue(row.before?.[field]) }), _jsx(ArrowRight, { className: "text-muted-foreground h-3 w-3 shrink-0 self-center", "aria-hidden": true }), _jsx("span", { className: "sr-only", children: "to" }), _jsx("span", { className: "text-foreground", children: formatValue(row.after[field]) })] }, field))) }));
132
+ }
133
+ function Quality({ gate }) {
134
+ if (gate.brandAlignment !== null) {
135
+ return (_jsxs("span", { className: "border-border bg-muted/40 inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-xs", "aria-label": `Brand voice score ${gate.brandAlignment} out of 100`, children: [_jsxs("span", { className: `font-medium ${brandAlignmentTone(gate.brandAlignment)}`, children: [gate.brandAlignment, "/100"] }), _jsx("span", { className: "text-muted-foreground", children: brandAlignmentLabel(gate.brandAlignment) })] }));
136
+ }
137
+ if (gate.confidence !== null) {
138
+ const pct = Math.round(gate.confidence * 100);
139
+ return (_jsx(SeoStatusBadge, { label: `${pct}%`, tone: pct >= 70 ? 'good' : pct >= 40 ? 'fair' : 'poor' }));
140
+ }
141
+ return _jsx(SeoStatusBadge, { label: "Rule-based", tone: "neutral" });
142
+ }
143
+ export function AutopilotAppliedSection({ onNavigate, onChanged, refreshKey = 0, }) {
144
+ const baseId = useId();
145
+ const [data, setData] = useState(null);
146
+ const [loading, setLoading] = useState(true);
147
+ const [error, setError] = useState(null);
148
+ const [page, setPage] = useState(1);
149
+ const [status, setStatus] = useState('');
150
+ const [outcome, setOutcome] = useState('');
151
+ const [target, setTarget] = useState(null);
152
+ const [conflict, setConflict] = useState(null);
153
+ const [mutation, setMutation] = useState(null);
154
+ /** The one line that changes after a revert — announced via `role="status"`. */
155
+ const [lastReverted, setLastReverted] = useState(null);
156
+ /** Mirrors `mutation` synchronously so a second click in the same tick cannot slip past. */
157
+ const mutationRef = useRef(null);
158
+ const mountedRef = useRef(true);
159
+ /** Ignore responses from a superseded request (filter/page changed mid-flight). */
160
+ const requestRef = useRef(0);
161
+ const busy = mutation !== null;
162
+ useEffect(() => {
163
+ mountedRef.current = true;
164
+ return () => {
165
+ mountedRef.current = false;
166
+ };
167
+ }, []);
168
+ /**
169
+ * `silent` re-reads keep the table on screen (post-revert / parent refresh);
170
+ * the initial load and filter or page changes show the loading state.
171
+ */
172
+ const load = useCallback(async (silent) => {
173
+ const requestId = ++requestRef.current;
174
+ if (!silent) {
175
+ setLoading(true);
176
+ setLastReverted(null);
177
+ }
178
+ setError(null);
179
+ try {
180
+ const next = await fetchAutopilotApplied({
181
+ page,
182
+ pageSize: PAGE_SIZE,
183
+ status: status || undefined,
184
+ outcome: outcome || undefined,
185
+ });
186
+ if (!mountedRef.current || requestId !== requestRef.current)
187
+ return;
188
+ setData(next);
189
+ }
190
+ catch (err) {
191
+ if (!mountedRef.current || requestId !== requestRef.current)
192
+ return;
193
+ setError(err instanceof Error && err.message ? err.message : 'Failed to load autopilot history.');
194
+ }
195
+ finally {
196
+ if (mountedRef.current && requestId === requestRef.current)
197
+ setLoading(false);
198
+ }
199
+ }, [page, status, outcome]);
200
+ useEffect(() => {
201
+ void load(false);
202
+ }, [load]);
203
+ const seenRefreshKeyRef = useRef(refreshKey);
204
+ useEffect(() => {
205
+ if (seenRefreshKeyRef.current === refreshKey)
206
+ return;
207
+ seenRefreshKeyRef.current = refreshKey;
208
+ void load(true);
209
+ }, [load, refreshKey]);
210
+ // A filtered refetch can land on a page that no longer exists (e.g. the
211
+ // only `applied` row on page 3 was just reverted). Snap back to the last page.
212
+ useEffect(() => {
213
+ if (!data || data.docs.length > 0 || page <= 1)
214
+ return;
215
+ setPage(Math.max(1, Math.ceil(data.total / data.pageSize)));
216
+ }, [data, page]);
217
+ const beginMutation = useCallback((kind) => {
218
+ if (mutationRef.current !== null)
219
+ return false;
220
+ mutationRef.current = kind;
221
+ setMutation(kind);
222
+ return true;
223
+ }, []);
224
+ const endMutation = useCallback(() => {
225
+ mutationRef.current = null;
226
+ if (mountedRef.current)
227
+ setMutation(null);
228
+ }, []);
229
+ const doRevert = useCallback(async (row, force) => {
230
+ if (!beginMutation('revert'))
231
+ return;
232
+ try {
233
+ const res = await revertAutopilotChange(row.id, force);
234
+ if (!mountedRef.current)
235
+ return;
236
+ if (res.ok) {
237
+ toast.success('Change reverted.');
238
+ setLastReverted(displayTitle(row));
239
+ onChanged?.();
240
+ await load(true);
241
+ return;
242
+ }
243
+ if (res.conflictFields !== undefined) {
244
+ setConflict({ row, fields: res.conflictFields });
245
+ return;
246
+ }
247
+ toast.error(res.error);
248
+ }
249
+ catch (err) {
250
+ if (mountedRef.current) {
251
+ toast.error(err instanceof Error && err.message ? err.message : 'Request failed.');
252
+ }
253
+ }
254
+ finally {
255
+ endMutation();
256
+ }
257
+ }, [beginMutation, endMutation, load, onChanged]);
258
+ const rows = data?.docs ?? [];
259
+ const total = data?.total ?? 0;
260
+ const pageSize = data?.pageSize ?? PAGE_SIZE;
261
+ const totalPages = Math.max(1, Math.ceil(total / pageSize));
262
+ const rangeStart = total === 0 ? 0 : (page - 1) * pageSize + 1;
263
+ const rangeEnd = Math.min(total, page * pageSize);
264
+ const filtering = status !== '' || outcome !== '';
265
+ const statusId = `${baseId}-status`;
266
+ const outcomeId = `${baseId}-outcome`;
267
+ return (_jsxs(SectionCard, { title: "Applied by autopilot", description: "Every unattended change with its gate results and Search Console outcome. Revert restores the previous values and reopens the issue.", action: _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("label", { htmlFor: statusId, className: "sr-only", children: "Filter by status" }), _jsx("select", { id: statusId, className: SELECT_CLASS, value: status, disabled: busy, onChange: (e) => {
268
+ const v = e.target.value;
269
+ setStatus(isStatus(v) ? v : '');
270
+ setPage(1);
271
+ }, children: STATUS_OPTIONS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) }), _jsx("label", { htmlFor: outcomeId, className: "sr-only", children: "Filter by outcome" }), _jsx("select", { id: outcomeId, className: SELECT_CLASS, value: outcome, disabled: busy, onChange: (e) => {
272
+ const v = e.target.value;
273
+ setOutcome(isOutcome(v) ? v : '');
274
+ setPage(1);
275
+ }, children: OUTCOME_OPTIONS.map((o) => (_jsx("option", { value: o.value, children: o.label }, o.value))) })] }), children: [_jsx("p", { className: `text-muted-foreground text-sm ${lastReverted && !loading ? 'mb-3' : ''}`, role: "status", "aria-live": "polite", children: lastReverted && !loading ? `Reverted the change to “${lastReverted}”.` : '' }), loading ? (_jsx(SeoLoading, { label: "Loading autopilot history\u2026" })) : error ? (_jsx(SeoErrorState, { message: error, onRetry: () => void load(false) })) : rows.length === 0 ? (_jsx(SeoEmptyState, { icon: _jsx(Bot, { size: 24 }), title: filtering ? 'No changes match these filters' : 'Autopilot has not applied anything yet', description: filtering
276
+ ? 'Clear the status or outcome filter to see the full ledger.'
277
+ : 'Enable fix types in Settings → SEO → SEO Autopilot; changes show up here after the daily run.', action: filtering ? (_jsx("button", { type: "button", className: btnSecondary, onClick: () => {
278
+ setStatus('');
279
+ setOutcome('');
280
+ setPage(1);
281
+ }, children: "Clear filters" })) : onNavigate ? (_jsx("button", { type: "button", className: btnSecondary, onClick: () => onNavigate(SEO_SETTINGS_PATH), children: "Open autopilot settings" })) : undefined })) : (_jsxs("div", { className: "space-y-3", children: [_jsx("div", { className: "border-border overflow-x-auto rounded-md border", children: _jsxs("table", { className: "w-full text-sm", "aria-label": "Changes applied by autopilot", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-border bg-muted/40 text-muted-foreground border-b text-left text-xs", children: [_jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Change" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Before \u2192 after" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Quality" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Applied on" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Outcome" }), _jsx("th", { scope: "col", className: "px-3 py-2.5", children: _jsx("span", { className: "sr-only", children: "Actions" }) })] }) }), _jsx("tbody", { className: "divide-border divide-y", children: rows.map((row) => {
282
+ const title = displayTitle(row);
283
+ const editPath = row.entityId !== null
284
+ ? sourceEditPath(row.collection ?? undefined, row.entityId)
285
+ : null;
286
+ return (_jsxs("tr", { className: "hover:bg-accent/20 align-top transition-colors", children: [_jsxs("td", { className: "px-3 py-3", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [editPath && onNavigate ? (_jsx("button", { type: "button", className: "text-foreground focus-visible:ring-ring rounded-sm text-left font-medium hover:underline focus-visible:ring-2 focus-visible:outline-none", onClick: () => onNavigate(editPath), "aria-label": `Open ${title} in editor`, children: title })) : (_jsx("span", { className: "text-foreground font-medium", children: title })), _jsx(KindBadge, { kind: row.kind }), _jsx(StatusBadge, { status: row.status })] }), _jsxs("p", { className: "text-muted-foreground mt-0.5 text-xs", children: [_jsx("span", { children: issueTypeLabel(row.issueType) }), row.entityUrl && row.entityTitle ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, children: " \u00B7 " }), _jsx("span", { children: row.entityUrl })] })) : null] })] }), _jsx("td", { className: "max-w-md px-3 py-3", children: _jsx(Diff, { row: row }) }), _jsx("td", { className: "px-3 py-3", children: _jsx(Quality, { gate: row.gate }) }), _jsx("td", { className: "text-muted-foreground px-3 py-3 text-xs whitespace-nowrap", children: _jsx(AppliedTime, { iso: row.appliedAt }) }), _jsx("td", { className: "px-3 py-3", children: _jsx(OutcomeBadge, { outcome: row.outcome }) }), _jsx("td", { className: "px-3 py-3 text-right", children: data?.canRevert && row.status === 'applied' ? (_jsxs("button", { type: "button", className: ROW_BUTTON_CLASS, onClick: () => setTarget(row), disabled: busy, "aria-label": `Revert change to ${title}`, children: [_jsx(Undo2, { className: "h-4 w-4", "aria-hidden": true }), "Revert"] })) : null })] }, row.id));
287
+ }) })] }) }), total > pageSize ? (_jsxs("nav", { className: "flex items-center justify-between gap-3 text-sm", "aria-label": "Autopilot history pagination", children: [_jsxs("p", { className: "text-muted-foreground", children: [rangeStart, "\u2013", rangeEnd, " of ", total] }), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", className: PAGER_BUTTON_CLASS, disabled: page <= 1 || busy, onClick: () => setPage((p) => Math.max(1, p - 1)), children: "Previous" }), _jsx("button", { type: "button", className: PAGER_BUTTON_CLASS, disabled: page >= totalPages || busy, onClick: () => setPage((p) => Math.min(totalPages, p + 1)), children: "Next" })] })] })) : null] })), _jsx(ConfirmDialog, { open: target !== null, onClose: () => setTarget(null), onConfirm: () => {
288
+ if (target)
289
+ void doRevert(target, false);
290
+ }, title: "Revert this autopilot change?", description: "The previous values are restored (a new version is created) and the issue is reopened. Autopilot will not touch this issue again for 30 days.", confirmLabel: "Revert change", destructive: true }), _jsx(ConfirmDialog, { open: conflict !== null, onClose: () => setConflict(null), onConfirm: () => {
291
+ if (conflict)
292
+ void doRevert(conflict.row, true);
293
+ }, title: "Someone edited this since", description: `These fields were changed after autopilot applied them: ${conflict?.fields.join(', ') ?? ''}. Reverting anyway overwrites those edits.`, confirmLabel: "Revert anyway", destructive: true })] }));
294
+ }
295
+ //# sourceMappingURL=AutopilotAppliedSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutopilotAppliedSection.js","sourceRoot":"","sources":["../../../src/views/seo/AutopilotAppliedSection.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,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IACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,2CA8ZA"}
1
+ {"version":3,"file":"ProposalsTab.d.ts","sourceRoot":"","sources":["../../../src/views/seo/ProposalsTab.tsx"],"names":[],"mappings":"AAiCA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AA4IjE,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,UAAU,GACX,EAAE;IACD,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACpC,2CA6bA"}
@@ -8,7 +8,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
8
8
  * loops client-side while the server reports `remaining > 0`.
9
9
  */
10
10
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
11
- import { ArrowRightLeft, Check, ChevronDown, Inbox, Loader2, Sparkles, Square, X, } from 'lucide-react';
11
+ import { AlertTriangle, ArrowRightLeft, Bot, Check, ChevronDown, Inbox, Loader2, Sparkles, Square, X, } from 'lucide-react';
12
12
  import { toast } from 'sonner';
13
13
  import { bulkApplySeoProposals, dismissRedirectSuggestion, dismissSeoIssueFix, fetchSeoProposals, generateSeoProposals, } from '../../lib/seo-service.js';
14
14
  import { hasPlanFeature } from '../../lib/plan.js';
@@ -17,28 +17,17 @@ import { PlanUpgradeCallout } from '../../components/PlanUpgradeCallout.js';
17
17
  import { ChangePreview } from '../../components/seo/ChangePreview.js';
18
18
  import { SectionCard, SeoEmptyState, SeoErrorState, SeoLoading, SeoStatusBadge, btnPrimary, btnSecondary, } from '../../components/seo/primitives.js';
19
19
  import { ConfirmDialog } from '../../components/ui/ConfirmDialog.js';
20
+ import { AutopilotAppliedSection } from './AutopilotAppliedSection.js';
21
+ import { relativeAge } from './relative-age.js';
20
22
  import { useSeoResource } from './useSeoResource.js';
21
23
  const GENERATE_BATCH_SIZE = 10;
22
24
  const AI_SETTINGS_PATH = '/settings?tab=ai';
25
+ const SEO_SETTINGS_PATH = '/settings?tab=seo';
23
26
  /** Stable empty list so memoised derivations don't recompute while loading. */
24
27
  const NO_PROPOSALS = [];
25
28
  function errorMessage(err) {
26
29
  return err instanceof Error && err.message ? err.message : 'Request failed.';
27
30
  }
28
- function relativeAge(iso) {
29
- if (!iso)
30
- return '';
31
- const ms = Date.now() - new Date(iso).getTime();
32
- if (!Number.isFinite(ms) || ms < 0)
33
- return '';
34
- const minutes = Math.round(ms / 60_000);
35
- if (minutes < 60)
36
- return `${Math.max(1, minutes)}m ago`;
37
- const hours = Math.round(minutes / 60);
38
- if (hours < 48)
39
- return `${hours}h ago`;
40
- return `${Math.round(hours / 24)}d ago`;
41
- }
42
31
  function confidenceTone(c) {
43
32
  return c >= 0.7 ? 'good' : c >= 0.4 ? 'fair' : 'poor';
44
33
  }
@@ -67,6 +56,38 @@ function SourceBadge({ source }) {
67
56
  }
68
57
  }
69
58
  }
59
+ /**
60
+ * Short chip wording for the engine-level pause reasons the server emits
61
+ * (`AutopilotPauseReason`). An unknown value falls through verbatim so a new
62
+ * reason is still visible rather than hidden behind a generic label.
63
+ */
64
+ const CHIP_PAUSE_LABEL = {
65
+ outcome_regression: 'traffic regression',
66
+ owner_unavailable: 'owner unavailable',
67
+ manual: 'paused by admin',
68
+ };
69
+ function chipPauseLabel(reason) {
70
+ return CHIP_PAUSE_LABEL[reason] ?? reason;
71
+ }
72
+ /**
73
+ * Header chip summarising the autopilot's state. Hidden while autopilot is off
74
+ * (nothing to report — including an engine disabled while it was still paused,
75
+ * since `PUT { enabled: false }` does not clear the pause); a paused engine
76
+ * gets the warning tone and names the reason. Clicking opens the Autopilot
77
+ * card in Settings → SEO.
78
+ */
79
+ function AutopilotChip({ autopilot, onNavigate, }) {
80
+ if (!autopilot.enabled)
81
+ return null;
82
+ const paused = autopilot.pausedReason !== null;
83
+ const label = autopilot.pausedReason !== null
84
+ ? `Autopilot paused — ${chipPauseLabel(autopilot.pausedReason)}`
85
+ : `Autopilot on · ${autopilot.appliedLast7d} applied this week`;
86
+ const tone = paused
87
+ ? 'border-warning/40 bg-warning/10 text-foreground hover:bg-warning/20'
88
+ : 'border-border bg-muted/40 text-foreground hover:bg-accent';
89
+ return (_jsxs("button", { type: "button", className: `focus-visible:ring-ring inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none ${tone}`, onClick: () => onNavigate?.(SEO_SETTINGS_PATH), children: [paused ? (_jsx(AlertTriangle, { className: "text-warning h-3.5 w-3.5", "aria-hidden": true })) : (_jsx(Bot, { className: "h-3.5 w-3.5", "aria-hidden": true })), label] }));
90
+ }
70
91
  export function ProposalsTab({ planInfo, onChanged, onNavigate, }) {
71
92
  const { data, loading, error, refetch } = useSeoResource(fetchSeoProposals, []);
72
93
  const [selected, setSelected] = useState(new Set());
@@ -76,6 +97,8 @@ export function ProposalsTab({ planInfo, onChanged, onNavigate, }) {
76
97
  const [mutation, setMutation] = useState(null);
77
98
  const [pendingItems, setPendingItems] = useState([]);
78
99
  const [generating, setGenerating] = useState(null);
100
+ /** Bumped after every mutation so the autopilot ledger below refetches with the inbox. */
101
+ const [refreshKey, setRefreshKey] = useState(0);
79
102
  const stopRef = useRef(false);
80
103
  /** Mirrors `mutation` synchronously so a second call in the same tick cannot slip past. */
81
104
  const mutationRef = useRef(null);
@@ -142,6 +165,16 @@ export function ProposalsTab({ planInfo, onChanged, onNavigate, }) {
142
165
  }, []);
143
166
  const afterMutation = useCallback(() => {
144
167
  setSelected(new Set());
168
+ refetch();
169
+ setRefreshKey((k) => k + 1);
170
+ onChanged?.();
171
+ }, [refetch, onChanged]);
172
+ /**
173
+ * A revert in the ledger reopens its issue / suggestion server-side, so the
174
+ * inbox and the SEO page refetch. Not `afterMutation`: that bumps
175
+ * `refreshKey`, and the ledger already reloads itself after a revert.
176
+ */
177
+ const handleLedgerChanged = useCallback(() => {
145
178
  refetch();
146
179
  onChanged?.();
147
180
  }, [refetch, onChanged]);
@@ -281,12 +314,15 @@ export function ProposalsTab({ planInfo, onChanged, onNavigate, }) {
281
314
  const generateAction = inlineApplyEnabled ? (generating ? (_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", role: "status", "aria-live": "polite", children: [_jsx(Loader2, { className: "h-4 w-4 motion-safe:animate-spin", "aria-hidden": true }), "Generating\u2026 ", generating.done, " of ", generating.total] }), _jsxs("button", { type: "button", className: btnSecondary, onClick: () => {
282
315
  stopRef.current = true;
283
316
  }, children: [_jsx(Square, { className: "h-4 w-4", "aria-hidden": true }), "Stop"] })] })) : (_jsxs("button", { type: "button", className: btnPrimary, onClick: () => setConfirmGenerate(true), disabled: eligible === 0 || loading || busy, children: [_jsx(Sparkles, { className: "h-4 w-4", "aria-hidden": true }), "Generate proposals (", eligible, " eligible)"] }))) : null;
284
- return (_jsxs("div", { className: "space-y-6", children: [!inlineApplyEnabled ? (_jsx(PlanUpgradeCallout, { feature: "seo.inlineApply", upgradeUrl: planInfo?.upgradeUrl })) : null, _jsx(SectionCard, { title: "Proposals", description: "Review, approve, or dismiss what the AI proposes across issue fixes and 404 redirects.", action: generateAction, children: loading ? (_jsx(SeoLoading, {})) : error ? (_jsx(SeoErrorState, { message: error, onRetry: refetch })) : proposals.length === 0 ? (_jsx(SeoEmptyState, { icon: _jsx(Inbox, { size: 24 }), title: "No proposals yet", description: "Generate proposals to draft fixes for open, fixable issues, or run 404 recovery from the Redirects tab." })) : (_jsxs("div", { className: "space-y-3", children: [pendingItems.length > 0 && (_jsxs("div", { className: "border-border bg-muted/40 flex flex-wrap items-center gap-2 rounded-lg border px-3 py-2 text-sm", role: "status", "aria-live": "polite", children: [_jsxs("span", { className: "text-foreground", children: [plural(pendingItems.length, 'proposal'), " not reached within the time budget."] }), _jsxs("button", { type: "button", className: "text-primary hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => void runApply(pendingItems), disabled: busy, children: ["Apply remaining (", pendingItems.length, ")"] }), _jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring ml-auto rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none", onClick: () => setPendingItems([]), children: "Dismiss" })] })), selected.size > 0 && (_jsxs("div", { className: "border-border bg-accent/40 flex flex-wrap items-center gap-2 rounded-lg border px-3 py-2 text-sm", role: "region", "aria-label": "Bulk actions", children: [_jsxs("span", { className: "text-foreground font-medium", children: [selected.size, " selected"] }), _jsx("span", { className: "bg-border mx-1 h-4 w-px", "aria-hidden": true }), _jsx("button", { type: "button", className: "text-foreground hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => setConfirmApply(true), disabled: busy || bulkBlockedReason !== null, children: "Approve selected" }), _jsx("button", { type: "button", className: "text-foreground hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => void handleDismissSelected(), disabled: busy, children: "Dismiss selected" }), _jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring ml-auto rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none", onClick: () => setSelected(new Set()), children: "Clear" }), bulkBlockedReason && (_jsxs("p", { className: "text-muted-foreground basis-full text-sm", role: "status", children: ["Applying several ", bulkBlockedReason, " proposals at once needs \u201CAllow bulk apply\u201D.", onNavigate ? (_jsx("button", { type: "button", onClick: () => onNavigate(AI_SETTINGS_PATH), className: "text-primary focus-visible:ring-ring ml-1 rounded-sm font-medium hover:underline focus-visible:ring-2 focus-visible:outline-none", children: "Open Settings \u2192 AI" })) : null] }))] })), _jsx("div", { className: "border-border overflow-x-auto rounded-md border", children: _jsxs("table", { className: "w-full text-sm", "aria-label": "AI proposals", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-border bg-muted/40 text-muted-foreground border-b text-left text-xs", children: [_jsx("th", { scope: "col", className: "w-10 px-3 py-2.5", children: _jsx("input", { type: "checkbox", checked: allSelected, onChange: toggleSelectAll, disabled: live.length === 0, "aria-label": "Select all proposals", className: "border-border text-primary focus-visible:ring-ring h-4 w-4 rounded" }) }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Proposal" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Change" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Signals" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Age" }), _jsx("th", { scope: "col", className: "px-3 py-2.5", children: _jsx("span", { className: "sr-only", children: "Actions" }) })] }) }), _jsx("tbody", { className: "divide-border divide-y", children: proposals.map((p) => {
317
+ // `data?.autopilot` (not just `data`): a core deployed before autopilot omits the field.
318
+ const autopilotChip = data?.autopilot ? (_jsx(AutopilotChip, { autopilot: data.autopilot, onNavigate: onNavigate })) : null;
319
+ const headerAction = autopilotChip || generateAction ? (_jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2", children: [autopilotChip, generateAction] })) : undefined;
320
+ return (_jsxs("div", { className: "space-y-6", children: [!inlineApplyEnabled ? (_jsx(PlanUpgradeCallout, { feature: "seo.inlineApply", upgradeUrl: planInfo?.upgradeUrl })) : null, _jsx(SectionCard, { title: "Proposals", description: "Review, approve, or dismiss what the AI proposes across issue fixes and 404 redirects.", action: headerAction, children: loading ? (_jsx(SeoLoading, {})) : error ? (_jsx(SeoErrorState, { message: error, onRetry: refetch })) : proposals.length === 0 ? (_jsx(SeoEmptyState, { icon: _jsx(Inbox, { size: 24 }), title: "No proposals yet", description: "Generate proposals to draft fixes for open, fixable issues, or run 404 recovery from the Redirects tab." })) : (_jsxs("div", { className: "space-y-3", children: [pendingItems.length > 0 && (_jsxs("div", { className: "border-border bg-muted/40 flex flex-wrap items-center gap-2 rounded-lg border px-3 py-2 text-sm", role: "status", "aria-live": "polite", children: [_jsxs("span", { className: "text-foreground", children: [plural(pendingItems.length, 'proposal'), " not reached within the time budget."] }), _jsxs("button", { type: "button", className: "text-primary hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => void runApply(pendingItems), disabled: busy, children: ["Apply remaining (", pendingItems.length, ")"] }), _jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring ml-auto rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none", onClick: () => setPendingItems([]), children: "Dismiss" })] })), selected.size > 0 && (_jsxs("div", { className: "border-border bg-accent/40 flex flex-wrap items-center gap-2 rounded-lg border px-3 py-2 text-sm", role: "region", "aria-label": "Bulk actions", children: [_jsxs("span", { className: "text-foreground font-medium", children: [selected.size, " selected"] }), _jsx("span", { className: "bg-border mx-1 h-4 w-px", "aria-hidden": true }), _jsx("button", { type: "button", className: "text-foreground hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => setConfirmApply(true), disabled: busy || bulkBlockedReason !== null, children: "Approve selected" }), _jsx("button", { type: "button", className: "text-foreground hover:bg-accent focus-visible:ring-ring rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none disabled:opacity-60", onClick: () => void handleDismissSelected(), disabled: busy, children: "Dismiss selected" }), _jsx("button", { type: "button", className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring ml-auto rounded-md px-2 py-1 font-medium transition-colors focus-visible:ring-2 focus-visible:outline-none", onClick: () => setSelected(new Set()), children: "Clear" }), bulkBlockedReason && (_jsxs("p", { className: "text-muted-foreground basis-full text-sm", role: "status", children: ["Applying several ", bulkBlockedReason, " proposals at once needs \u201CAllow bulk apply\u201D.", onNavigate ? (_jsx("button", { type: "button", onClick: () => onNavigate(AI_SETTINGS_PATH), className: "text-primary focus-visible:ring-ring ml-1 rounded-sm font-medium hover:underline focus-visible:ring-2 focus-visible:outline-none", children: "Open Settings \u2192 AI" })) : null] }))] })), _jsx("div", { className: "border-border overflow-x-auto rounded-md border", children: _jsxs("table", { className: "w-full text-sm", "aria-label": "AI proposals", children: [_jsx("thead", { children: _jsxs("tr", { className: "border-border bg-muted/40 text-muted-foreground border-b text-left text-xs", children: [_jsx("th", { scope: "col", className: "w-10 px-3 py-2.5", children: _jsx("input", { type: "checkbox", checked: allSelected, onChange: toggleSelectAll, disabled: live.length === 0, "aria-label": "Select all proposals", className: "border-border text-primary focus-visible:ring-ring h-4 w-4 rounded" }) }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Proposal" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Change" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Signals" }), _jsx("th", { scope: "col", className: "px-3 py-2.5 font-medium", children: "Age" }), _jsx("th", { scope: "col", className: "px-3 py-2.5", children: _jsx("span", { className: "sr-only", children: "Actions" }) })] }) }), _jsx("tbody", { className: "divide-border divide-y", children: proposals.map((p) => {
285
321
  const first = p.changes[0];
286
322
  return (_jsx(ProposalRow, { proposal: p, selected: selected.has(p.id), expanded: expanded.has(p.id), summary: first
287
323
  ? `${String(first.before ?? '—')} → ${String(first.after ?? '—')}`
288
324
  : p.justification, onToggleSelect: () => toggleSelect(p.id), onToggleExpanded: () => toggleExpanded(p.id), onApprove: () => void runApply([toBulkItem(p)]), onDismiss: () => void handleDismissOne(p), busy: busy, canApply: inlineApplyEnabled || p.kind === 'redirect' }, p.id));
289
- }) })] }) })] })) }), _jsx(ConfirmDialog, { open: confirmApply, onClose: () => setConfirmApply(false), onConfirm: () => void runApply(selectedProposals.map(toBulkItem)), title: `Apply ${plural(selectedProposals.length, 'proposal')}?`, description: "Approved fixes write SEO fields, content links, or redirects immediately and mark their issues resolved. Each document keeps a version you can restore.", confirmLabel: `Apply ${plural(selectedProposals.length, 'proposal')}` }), _jsx(ConfirmDialog, { open: confirmGenerate, onClose: () => setConfirmGenerate(false), onConfirm: () => void handleGenerate(), title: `Generate proposals for ${plural(eligible, 'eligible issue')}?`, description: `Runs in passes of ${GENERATE_BATCH_SIZE}. AI tokens are spent for each issue; you can stop between passes.`, confirmLabel: "Generate" })] }));
325
+ }) })] }) })] })) }), _jsx(AutopilotAppliedSection, { onNavigate: onNavigate, refreshKey: refreshKey, onChanged: handleLedgerChanged }), _jsx(ConfirmDialog, { open: confirmApply, onClose: () => setConfirmApply(false), onConfirm: () => void runApply(selectedProposals.map(toBulkItem)), title: `Apply ${plural(selectedProposals.length, 'proposal')}?`, description: "Approved fixes write SEO fields, content links, or redirects immediately and mark their issues resolved. Each document keeps a version you can restore.", confirmLabel: `Apply ${plural(selectedProposals.length, 'proposal')}` }), _jsx(ConfirmDialog, { open: confirmGenerate, onClose: () => setConfirmGenerate(false), onConfirm: () => void handleGenerate(), title: `Generate proposals for ${plural(eligible, 'eligible issue')}?`, description: `Runs in passes of ${GENERATE_BATCH_SIZE}. AI tokens are spent for each issue; you can stop between passes.`, confirmLabel: "Generate" })] }));
290
326
  }
291
327
  function ProposalRow({ proposal: p, selected, expanded, summary, onToggleSelect, onToggleExpanded, onApprove, onDismiss, busy, canApply, }) {
292
328
  return (_jsxs(_Fragment, { children: [_jsxs("tr", { className: `${selected ? 'bg-accent/30' : ''} hover:bg-accent/20 transition-colors`, children: [_jsx("td", { className: "px-3 py-3 align-top", children: p.stale ? null : (_jsx("input", { type: "checkbox", checked: selected, onChange: onToggleSelect, "aria-label": `Select proposal ${p.title}`, className: "border-border text-primary focus-visible:ring-ring h-4 w-4 rounded" })) }), _jsxs("td", { className: "px-3 py-3 align-top", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "text-foreground font-medium", children: p.title }), p.severity ? (_jsx(SeoStatusBadge, { label: p.severity, tone: p.severity === 'critical'