@burdenoff/microfe-bigconsole 2026.1103.7 → 2026.1103.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.
|
@@ -9,18 +9,19 @@ import { setActiveGenerationContext as ee } from "../assistant/generationContext
|
|
|
9
9
|
import { isNative as te, nativeImpact as o, nativeNotify as ne } from "../../utils/nativeBridge.js";
|
|
10
10
|
import { generationApproval as s } from "../utils/generationApproval.js";
|
|
11
11
|
import { isInsightsDraftDirty as re } from "../utils/insightsDraft.js";
|
|
12
|
-
import {
|
|
12
|
+
import { PromptAnalysisPreview as ie } from "../components/insights/PromptAnalysisPreview.js";
|
|
13
|
+
import { GeneratedFormattingReview as ae, GenerationExecutionStatus as oe } from "../components/insights/GeneratedFormattingReview.js";
|
|
13
14
|
/* empty css */
|
|
14
15
|
import { memo as c, useCallback as l, useEffect as u, useState as d } from "react";
|
|
15
|
-
import { AlertCircle as
|
|
16
|
-
import { AuroraBackground as
|
|
17
|
-
import { useUnsavedChanges as
|
|
18
|
-
import { useI18n as
|
|
19
|
-
import { useMutation as y, useQuery as
|
|
16
|
+
import { AlertCircle as se, ArrowRight as f, Ban as ce, CheckCircle as p, Clock as m, Eye as le, History as ue, Lightbulb as de, Loader2 as h, RefreshCw as fe, Sparkles as g, Trash2 as pe, Wand2 as _, X as me, XCircle as v } from "lucide-react";
|
|
17
|
+
import { AuroraBackground as he, GlassCard as ge, GradientText as _e, IllustratedEmptyState as ve, PagePurpose as ye } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
import { useUnsavedChanges as be } from "@burdenoff/fe-libs/shared/hooks";
|
|
19
|
+
import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
20
|
+
import { useMutation as y, useQuery as Se } from "@apollo/client/react";
|
|
20
21
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
21
22
|
import { gql as S } from "@apollo/client";
|
|
22
23
|
//#region src/bigconsole/pages/InsightsPage.tsx
|
|
23
|
-
var
|
|
24
|
+
var Ce = S`
|
|
24
25
|
query ListPromptGenerations($status: PromptGenerationStatus, $first: Int) {
|
|
25
26
|
listPromptGenerations(status: $status, first: $first) {
|
|
26
27
|
edges {
|
|
@@ -64,7 +65,7 @@ var Se = S`
|
|
|
64
65
|
totalCount
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
`,
|
|
68
|
+
`, we = S`
|
|
68
69
|
query GetPromptSuggestions($category: String, $limit: Int) {
|
|
69
70
|
getPromptSuggestions(category: $category, limit: $limit) {
|
|
70
71
|
id
|
|
@@ -75,7 +76,7 @@ var Se = S`
|
|
|
75
76
|
tags
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
`,
|
|
79
|
+
`, Te = S`
|
|
79
80
|
mutation GenerateDashboardFromPrompt($input: BigConsoleGenerateDashboardFromPromptInput!) {
|
|
80
81
|
generateDashboardFromPrompt(input: $input) {
|
|
81
82
|
id
|
|
@@ -83,24 +84,24 @@ var Se = S`
|
|
|
83
84
|
prompt
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
`,
|
|
87
|
+
`, Ee = S`
|
|
87
88
|
mutation CreateDashboardFromGeneration($input: BigConsoleCreateDashboardFromGenerationInput!) {
|
|
88
89
|
createDashboardFromGeneration(input: $input) {
|
|
89
90
|
id
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
`,
|
|
93
|
+
`, De = S`
|
|
93
94
|
mutation DeletePromptGeneration($generationId: ID!) {
|
|
94
95
|
deletePromptGeneration(generationId: $generationId)
|
|
95
96
|
}
|
|
96
|
-
`,
|
|
97
|
+
`, Oe = S`
|
|
97
98
|
mutation CancelPromptGeneration($generationId: ID!) {
|
|
98
99
|
cancelPromptGeneration(generationId: $generationId) {
|
|
99
100
|
id
|
|
100
101
|
status
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
`,
|
|
104
|
+
`, ke = S`
|
|
104
105
|
mutation RegenerateDashboard($input: BigConsoleRegenerateDashboardInput!) {
|
|
105
106
|
regenerateDashboard(input: $input) {
|
|
106
107
|
id
|
|
@@ -108,7 +109,7 @@ var Se = S`
|
|
|
108
109
|
prompt
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
|
-
`,
|
|
112
|
+
`, Ae = S`
|
|
112
113
|
mutation RefineGeneratedDashboard($input: BigConsoleRefineGeneratedDashboardInput!) {
|
|
113
114
|
refineGeneratedDashboard(input: $input) {
|
|
114
115
|
id
|
|
@@ -120,7 +121,7 @@ var Se = S`
|
|
|
120
121
|
"PENDING",
|
|
121
122
|
"PROCESSING",
|
|
122
123
|
"GENERATING"
|
|
123
|
-
],
|
|
124
|
+
], je = 12, Me = 8, Ne = [
|
|
124
125
|
{
|
|
125
126
|
value: "MODERN",
|
|
126
127
|
label: "Modern"
|
|
@@ -141,7 +142,7 @@ var Se = S`
|
|
|
141
142
|
value: "VIBRANT",
|
|
142
143
|
label: "Vibrant"
|
|
143
144
|
}
|
|
144
|
-
],
|
|
145
|
+
], Pe = [
|
|
145
146
|
{
|
|
146
147
|
value: "GRID",
|
|
147
148
|
label: "Grid"
|
|
@@ -166,13 +167,13 @@ var Se = S`
|
|
|
166
167
|
value: "THREE_COLUMN",
|
|
167
168
|
label: "Three column"
|
|
168
169
|
}
|
|
169
|
-
],
|
|
170
|
+
], Fe = [
|
|
170
171
|
6,
|
|
171
172
|
8,
|
|
172
173
|
12,
|
|
173
174
|
16,
|
|
174
175
|
24
|
|
175
|
-
],
|
|
176
|
+
], Ie = [
|
|
176
177
|
4,
|
|
177
178
|
6,
|
|
178
179
|
8,
|
|
@@ -201,25 +202,25 @@ var Se = S`
|
|
|
201
202
|
border: "1px solid transparent",
|
|
202
203
|
backgroundColor: "var(--color-action-primary-bg)",
|
|
203
204
|
color: "var(--color-action-primary-text)"
|
|
204
|
-
},
|
|
205
|
+
}, Le = {
|
|
205
206
|
...w,
|
|
206
207
|
border: "1px solid var(--color-status-warning-border)",
|
|
207
208
|
backgroundColor: "transparent",
|
|
208
209
|
color: "var(--color-status-warning-text)"
|
|
209
|
-
},
|
|
210
|
+
}, Re = {
|
|
210
211
|
...w,
|
|
211
212
|
minWidth: "var(--size-controlHeight-md)",
|
|
212
213
|
padding: "0 var(--space-controlGap)",
|
|
213
214
|
border: "1px solid var(--color-border-default)",
|
|
214
215
|
backgroundColor: "transparent",
|
|
215
216
|
color: "var(--color-status-error-text)"
|
|
216
|
-
},
|
|
217
|
+
}, D = {
|
|
217
218
|
display: "block",
|
|
218
219
|
marginBottom: "2px",
|
|
219
220
|
fontSize: "var(--font-size-body-sm)",
|
|
220
221
|
fontWeight: "var(--font-weight-medium)",
|
|
221
222
|
color: "var(--color-text-secondary)"
|
|
222
|
-
},
|
|
223
|
+
}, O = {
|
|
223
224
|
width: "100%",
|
|
224
225
|
minHeight: "var(--size-controlHeight-md)",
|
|
225
226
|
padding: "0 var(--space-controlGap)",
|
|
@@ -228,7 +229,7 @@ var Se = S`
|
|
|
228
229
|
backgroundColor: "var(--color-bg-canvas)",
|
|
229
230
|
color: "var(--color-text-primary)",
|
|
230
231
|
fontSize: "var(--font-size-body-sm)"
|
|
231
|
-
},
|
|
232
|
+
}, k = {
|
|
232
233
|
display: "inline-flex",
|
|
233
234
|
alignItems: "center",
|
|
234
235
|
gap: "var(--space-iconGap)",
|
|
@@ -240,7 +241,7 @@ var Se = S`
|
|
|
240
241
|
backgroundColor: "var(--color-bg-sunken)",
|
|
241
242
|
color: "var(--color-text-secondary)"
|
|
242
243
|
};
|
|
243
|
-
function
|
|
244
|
+
function A(e) {
|
|
244
245
|
switch (e) {
|
|
245
246
|
case "COMPLETED": return "success";
|
|
246
247
|
case "FAILED": return "danger";
|
|
@@ -250,7 +251,7 @@ function j(e) {
|
|
|
250
251
|
default: return "neutral";
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
|
-
var
|
|
254
|
+
var j = {
|
|
254
255
|
success: {
|
|
255
256
|
text: "var(--color-status-success-text)",
|
|
256
257
|
bg: "var(--color-status-success-bgSubtle)",
|
|
@@ -272,8 +273,8 @@ var M = {
|
|
|
272
273
|
border: "var(--color-border-subtle)"
|
|
273
274
|
}
|
|
274
275
|
};
|
|
275
|
-
function
|
|
276
|
-
let t =
|
|
276
|
+
function ze(e) {
|
|
277
|
+
let t = j[A(e)].text;
|
|
277
278
|
switch (e) {
|
|
278
279
|
case "COMPLETED": return /* @__PURE__ */ b(p, {
|
|
279
280
|
size: 14,
|
|
@@ -301,7 +302,7 @@ function Le(e) {
|
|
|
301
302
|
});
|
|
302
303
|
}
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function M(e, t) {
|
|
305
306
|
switch (e) {
|
|
306
307
|
case "COMPLETED": return t("bigconsole.insights.status.completed", "Completed");
|
|
307
308
|
case "FAILED": return t("bigconsole.insights.status.failed", "Failed");
|
|
@@ -312,44 +313,44 @@ function N(e, t) {
|
|
|
312
313
|
default: return e;
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
|
-
var
|
|
316
|
-
let { t } =
|
|
316
|
+
var Be = ({ status: e }) => {
|
|
317
|
+
let { t } = xe(), n = j[A(e)];
|
|
317
318
|
return /* @__PURE__ */ x("span", {
|
|
318
319
|
"data-status": e,
|
|
319
320
|
style: {
|
|
320
|
-
...
|
|
321
|
+
...k,
|
|
321
322
|
border: `1px solid ${n.border}`,
|
|
322
323
|
backgroundColor: n.bg,
|
|
323
324
|
color: n.text
|
|
324
325
|
},
|
|
325
|
-
children: [
|
|
326
|
+
children: [ze(e), M(e, t)]
|
|
326
327
|
});
|
|
327
328
|
};
|
|
328
|
-
function
|
|
329
|
-
let t =
|
|
329
|
+
function Ve(e) {
|
|
330
|
+
let t = j[e >= .8 ? "success" : e >= .5 ? "neutral" : "danger"];
|
|
330
331
|
return {
|
|
331
|
-
...
|
|
332
|
+
...k,
|
|
332
333
|
border: `1px solid ${t.border}`,
|
|
333
334
|
backgroundColor: t.bg,
|
|
334
335
|
color: t.text
|
|
335
336
|
};
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
+
function N(e) {
|
|
338
339
|
return e.pages.reduce((e, t) => e + t.widgets.length, 0);
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function He(e) {
|
|
341
342
|
let t = e?.toUpperCase();
|
|
342
343
|
return t === "HIGH" || t === "MEDIUM" || t === "LOW" ? t : null;
|
|
343
344
|
}
|
|
344
|
-
var
|
|
345
|
+
var Ue = {
|
|
345
346
|
HIGH: "success",
|
|
346
347
|
MEDIUM: "neutral",
|
|
347
348
|
LOW: "danger"
|
|
348
349
|
};
|
|
349
|
-
function
|
|
350
|
+
function We(e) {
|
|
350
351
|
return { "--proposal-columns": Math.max(1, Math.min(24, Math.trunc(e))) };
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
+
function Ge(e, t) {
|
|
353
354
|
let n = Math.max(1, Math.min(24, Math.trunc(t))), r = Math.max(0, Math.min(n - 1, Math.trunc(e.x)));
|
|
354
355
|
return {
|
|
355
356
|
"--proposal-column": r + 1,
|
|
@@ -358,10 +359,10 @@ function Ue(e, t) {
|
|
|
358
359
|
"--proposal-height": Math.max(1, Math.min(24, Math.trunc(e.height)))
|
|
359
360
|
};
|
|
360
361
|
}
|
|
361
|
-
function
|
|
362
|
-
let t =
|
|
362
|
+
function Ke(e) {
|
|
363
|
+
let t = j[Ue[e]];
|
|
363
364
|
return {
|
|
364
|
-
...
|
|
365
|
+
...k,
|
|
365
366
|
padding: "0 var(--space-controlGap)",
|
|
366
367
|
fontSize: "var(--font-size-xs)",
|
|
367
368
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -371,97 +372,97 @@ function We(e) {
|
|
|
371
372
|
color: t.text
|
|
372
373
|
};
|
|
373
374
|
}
|
|
374
|
-
var
|
|
375
|
-
let { t: c } =
|
|
376
|
-
|
|
375
|
+
var P = c(function() {
|
|
376
|
+
let { t: c } = xe(), p = e(), m = a(), [v, S] = d(""), [w, A] = d("MODERN"), [j, ze] = d("GRID"), [M, Ue] = d(je), [P, qe] = d(Me), [F, Je] = d(!1), [Ye, I] = d(null), [L, Xe] = d(() => /* @__PURE__ */ new Set()), [R, z] = d(null), [B, V] = d(null), [H, U] = d("");
|
|
377
|
+
be({
|
|
377
378
|
id: "insights-prompt",
|
|
378
379
|
label: c("bigconsole.assistant.unsaved.insightsPrompt", "the dashboard description"),
|
|
379
380
|
dirty: re({
|
|
380
381
|
promptText: v,
|
|
381
|
-
isGenerating:
|
|
382
|
-
refineOpen:
|
|
383
|
-
refineText:
|
|
384
|
-
refineBusy:
|
|
382
|
+
isGenerating: F,
|
|
383
|
+
refineOpen: B !== null,
|
|
384
|
+
refineText: H,
|
|
385
|
+
refineBusy: B !== null && L.has(B.id)
|
|
385
386
|
})
|
|
386
|
-
}), u(() => (ee(
|
|
387
|
-
let
|
|
388
|
-
|
|
389
|
-
}, []),
|
|
390
|
-
|
|
387
|
+
}), u(() => (ee(B?.id ?? R?.id ?? null), () => ee(null)), [B, R]);
|
|
388
|
+
let W = l((e) => {
|
|
389
|
+
Xe((t) => new Set(t).add(e));
|
|
390
|
+
}, []), G = l((e) => {
|
|
391
|
+
Xe((t) => {
|
|
391
392
|
let n = new Set(t);
|
|
392
393
|
return n.delete(e), n;
|
|
393
394
|
});
|
|
394
|
-
}, []), { data:
|
|
395
|
+
}, []), { data: Ze, loading: Qe, error: K, refetch: q, startPolling: $e, stopPolling: J } = Se(Ce, {
|
|
395
396
|
variables: { first: 20 },
|
|
396
397
|
fetchPolicy: "cache-and-network"
|
|
397
|
-
}),
|
|
398
|
-
u(() => (
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
398
|
+
}), Y = Ze?.listPromptGenerations?.edges?.some((e) => C.includes(e.node.status)) ?? !1, { data: et, error: tt, refetch: nt } = Se(we, { variables: { limit: 6 } }), [rt] = y(Te), [it] = y(Ee), [X] = y(De), [at] = y(Oe), [ot] = y(ke), [st] = y(Ae), Z = Ze?.listPromptGenerations?.edges?.map((e) => e.node) || [], ct = et?.getPromptSuggestions || [];
|
|
399
|
+
u(() => (Y || F ? $e(2e3) : J(), () => J()), [
|
|
400
|
+
Y,
|
|
401
|
+
F,
|
|
402
|
+
$e,
|
|
403
|
+
J
|
|
403
404
|
]), u(() => {
|
|
404
|
-
if (!
|
|
405
|
+
if (!R && !B) return;
|
|
405
406
|
let e = (e) => {
|
|
406
|
-
e.key === "Escape" && (
|
|
407
|
+
e.key === "Escape" && (z(null), V(null));
|
|
407
408
|
};
|
|
408
409
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
409
|
-
}, [
|
|
410
|
-
let
|
|
411
|
-
if (!(!v.trim() ||
|
|
410
|
+
}, [R, B]);
|
|
411
|
+
let lt = l(async () => {
|
|
412
|
+
if (!(!v.trim() || F)) {
|
|
412
413
|
if (v.length > 2e3) {
|
|
413
|
-
|
|
414
|
+
I(c("bigconsole.insights.error.promptTooLong", "Prompt is too long (max 2000 characters)."));
|
|
414
415
|
return;
|
|
415
416
|
}
|
|
416
|
-
|
|
417
|
+
I(null), Je(!0);
|
|
417
418
|
try {
|
|
418
|
-
m("bigconsole.ai.generate_clicked", { maxWidgets:
|
|
419
|
-
let e = await
|
|
419
|
+
m("bigconsole.ai.generate_clicked", { maxWidgets: P });
|
|
420
|
+
let e = await rt({ variables: { input: {
|
|
420
421
|
prompt: v.trim(),
|
|
421
422
|
styleType: w,
|
|
422
|
-
layoutType:
|
|
423
|
-
gridColumns:
|
|
424
|
-
maxWidgets:
|
|
423
|
+
layoutType: j,
|
|
424
|
+
gridColumns: M,
|
|
425
|
+
maxWidgets: P
|
|
425
426
|
} } });
|
|
426
427
|
if (t(e, "command")) return;
|
|
427
428
|
let n = e.data?.generateDashboardFromPrompt?.id;
|
|
428
429
|
n && m("bigconsole.ai.dashboard_generated", {
|
|
429
430
|
generationId: n,
|
|
430
|
-
maxWidgets:
|
|
431
|
-
}), S(""),
|
|
431
|
+
maxWidgets: P
|
|
432
|
+
}), S(""), q();
|
|
432
433
|
} catch (e) {
|
|
433
434
|
if (t(e, "command")) return;
|
|
434
|
-
|
|
435
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.generateFailed", "Failed to generate dashboard"));
|
|
435
436
|
} finally {
|
|
436
|
-
|
|
437
|
+
Je(!1);
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
}, [
|
|
440
441
|
m,
|
|
441
442
|
v,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
F,
|
|
444
|
+
rt,
|
|
445
|
+
q,
|
|
445
446
|
w,
|
|
447
|
+
j,
|
|
446
448
|
M,
|
|
447
|
-
|
|
448
|
-
F,
|
|
449
|
+
P,
|
|
449
450
|
c
|
|
450
|
-
]),
|
|
451
|
-
|
|
451
|
+
]), Q = l(async (e) => {
|
|
452
|
+
I(null);
|
|
452
453
|
let n = s(e);
|
|
453
454
|
if (n.kind === "view") {
|
|
454
455
|
p(`/dashboards/${n.dashboardId}`);
|
|
455
456
|
return;
|
|
456
457
|
}
|
|
457
458
|
if (n.kind === "hold") {
|
|
458
|
-
|
|
459
|
+
I(c("bigconsole.insights.error.reviewUnavailable", "Reload the proposal before creating its dashboard."));
|
|
459
460
|
return;
|
|
460
461
|
}
|
|
461
462
|
let r = e.id;
|
|
462
463
|
try {
|
|
463
464
|
m("bigconsole.ai.create_dashboard_clicked", { generationId: r });
|
|
464
|
-
let e = await
|
|
465
|
+
let e = await it({ variables: { input: n.input } });
|
|
465
466
|
if (t(e, "project")) return;
|
|
466
467
|
let i = e.data?.createDashboardFromGeneration?.id;
|
|
467
468
|
i && (m("bigconsole.ai.dashboard_created", {
|
|
@@ -470,84 +471,84 @@ var F = c(function() {
|
|
|
470
471
|
}), p(`/dashboards/${i}`));
|
|
471
472
|
} catch (e) {
|
|
472
473
|
if (t(e, "project")) return;
|
|
473
|
-
|
|
474
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.createFailed", "Failed to create dashboard"));
|
|
474
475
|
}
|
|
475
476
|
}, [
|
|
476
|
-
|
|
477
|
+
it,
|
|
477
478
|
m,
|
|
478
479
|
p,
|
|
479
480
|
c
|
|
480
|
-
]),
|
|
481
|
-
|
|
481
|
+
]), ut = l(async (e) => {
|
|
482
|
+
I(null);
|
|
482
483
|
try {
|
|
483
|
-
await
|
|
484
|
+
await X({ variables: { generationId: e } }), te() && ne("success"), q();
|
|
484
485
|
} catch (e) {
|
|
485
|
-
|
|
486
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.deleteFailed", "Failed to delete generation")), te() && ne("error");
|
|
486
487
|
}
|
|
487
488
|
}, [
|
|
488
|
-
|
|
489
|
-
|
|
489
|
+
X,
|
|
490
|
+
q,
|
|
490
491
|
c
|
|
491
|
-
]),
|
|
492
|
-
|
|
492
|
+
]), dt = l(async (e) => {
|
|
493
|
+
I(null), W(e);
|
|
493
494
|
try {
|
|
494
|
-
await
|
|
495
|
+
await at({ variables: { generationId: e } }), q();
|
|
495
496
|
} catch (e) {
|
|
496
|
-
|
|
497
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.cancelFailed", "Failed to cancel generation"));
|
|
497
498
|
} finally {
|
|
498
|
-
|
|
499
|
+
G(e);
|
|
499
500
|
}
|
|
500
501
|
}, [
|
|
501
|
-
|
|
502
|
-
|
|
502
|
+
at,
|
|
503
|
+
q,
|
|
503
504
|
c
|
|
504
|
-
]),
|
|
505
|
-
|
|
505
|
+
]), ft = l(async (e) => {
|
|
506
|
+
I(null), W(e);
|
|
506
507
|
try {
|
|
507
|
-
if (t(await
|
|
508
|
-
|
|
508
|
+
if (t(await ot({ variables: { input: { generationId: e } } }), "command")) return;
|
|
509
|
+
q();
|
|
509
510
|
} catch (e) {
|
|
510
511
|
if (t(e, "command")) return;
|
|
511
|
-
|
|
512
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.regenerateFailed", "Failed to regenerate dashboard"));
|
|
512
513
|
} finally {
|
|
513
|
-
|
|
514
|
+
G(e);
|
|
514
515
|
}
|
|
515
516
|
}, [
|
|
516
|
-
|
|
517
|
-
|
|
517
|
+
ot,
|
|
518
|
+
q,
|
|
518
519
|
c
|
|
519
|
-
]),
|
|
520
|
-
if (!
|
|
521
|
-
let e =
|
|
522
|
-
|
|
520
|
+
]), pt = l(async () => {
|
|
521
|
+
if (!B || !H.trim()) return;
|
|
522
|
+
let e = B.id;
|
|
523
|
+
I(null), W(e);
|
|
523
524
|
let n = !1;
|
|
524
525
|
try {
|
|
525
|
-
if (t(await
|
|
526
|
+
if (t(await st({ variables: { input: {
|
|
526
527
|
generationId: e,
|
|
527
|
-
refinementPrompt:
|
|
528
|
+
refinementPrompt: H.trim()
|
|
528
529
|
} } }), "command")) {
|
|
529
530
|
n = !0;
|
|
530
531
|
return;
|
|
531
532
|
}
|
|
532
|
-
n = !0,
|
|
533
|
+
n = !0, q();
|
|
533
534
|
} catch (e) {
|
|
534
535
|
if (t(e, "command")) {
|
|
535
536
|
n = !0;
|
|
536
537
|
return;
|
|
537
538
|
}
|
|
538
|
-
|
|
539
|
+
I(e instanceof Error ? e.message : c("bigconsole.insights.error.refineFailed", "Failed to refine generation"));
|
|
539
540
|
} finally {
|
|
540
|
-
n && (
|
|
541
|
+
n && (V(null), U("")), G(e);
|
|
541
542
|
}
|
|
542
543
|
}, [
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
544
|
+
B,
|
|
545
|
+
H,
|
|
546
|
+
st,
|
|
547
|
+
q,
|
|
547
548
|
c
|
|
548
|
-
]),
|
|
549
|
+
]), mt = l((e) => {
|
|
549
550
|
S(e);
|
|
550
|
-
}, []), $ =
|
|
551
|
+
}, []), $ = R?.generatedSpec;
|
|
551
552
|
return /* @__PURE__ */ x("div", {
|
|
552
553
|
"data-tour": "bigconsole-ai-insights",
|
|
553
554
|
className: "min-w-0",
|
|
@@ -555,7 +556,7 @@ var F = c(function() {
|
|
|
555
556
|
children: [
|
|
556
557
|
/* @__PURE__ */ x("header", {
|
|
557
558
|
className: "relative overflow-hidden border-b border-[var(--color-border-seam)] bg-[image:var(--gradient-gloss-card)]",
|
|
558
|
-
children: [/* @__PURE__ */ b(
|
|
559
|
+
children: [/* @__PURE__ */ b(he, { intensity: "subtle" }), /* @__PURE__ */ b("div", {
|
|
559
560
|
style: { padding: "var(--space-pagePadding)" },
|
|
560
561
|
children: /* @__PURE__ */ x("div", {
|
|
561
562
|
style: {
|
|
@@ -585,7 +586,7 @@ var F = c(function() {
|
|
|
585
586
|
style: { minWidth: 0 },
|
|
586
587
|
children: [/* @__PURE__ */ b("h1", {
|
|
587
588
|
className: "m-0 text-2xl font-bold text-text-primary",
|
|
588
|
-
children: /* @__PURE__ */ b(
|
|
589
|
+
children: /* @__PURE__ */ b(_e, { children: c("bigconsole.insights.header.title", "AI Insights") })
|
|
589
590
|
}), /* @__PURE__ */ b("p", {
|
|
590
591
|
className: "m-0 text-sm text-text-secondary",
|
|
591
592
|
children: c("bigconsole.insights.header.subtitle", "Generate dashboards from natural language prompts")
|
|
@@ -596,28 +597,28 @@ var F = c(function() {
|
|
|
596
597
|
}),
|
|
597
598
|
/* @__PURE__ */ x("div", {
|
|
598
599
|
style: { padding: "var(--space-pagePadding)" },
|
|
599
|
-
children: [/* @__PURE__ */ b(
|
|
600
|
+
children: [/* @__PURE__ */ b(ye, {
|
|
600
601
|
className: "mb-[var(--space-sectionGap)]",
|
|
601
602
|
children: "Describe the dashboard you need in plain English and BigConsole proposes the pages, widgets and layout for it. Review the proposal, refine it in place, then create the real dashboard in one step — a generation is only a proposal until you accept it."
|
|
602
603
|
}), /* @__PURE__ */ x(i, { children: [
|
|
603
|
-
|
|
604
|
+
Ye && /* @__PURE__ */ b(r, {
|
|
604
605
|
headingLevel: 2,
|
|
605
606
|
tone: "danger",
|
|
606
607
|
padding: "compact",
|
|
607
608
|
title: "That request did not go through",
|
|
608
|
-
description:
|
|
609
|
-
icon: /* @__PURE__ */ b(
|
|
609
|
+
description: Ye,
|
|
610
|
+
icon: /* @__PURE__ */ b(se, { className: "h-icon-sm w-icon-sm" }),
|
|
610
611
|
"data-testid": "insights-error",
|
|
611
612
|
actions: /* @__PURE__ */ b("button", {
|
|
612
613
|
type: "button",
|
|
613
|
-
onClick: () =>
|
|
614
|
+
onClick: () => I(null),
|
|
614
615
|
"aria-label": c("bigconsole.insights.error.dismiss", "Dismiss error"),
|
|
615
616
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
616
617
|
style: T,
|
|
617
618
|
children: "Dismiss"
|
|
618
619
|
})
|
|
619
620
|
}),
|
|
620
|
-
(
|
|
621
|
+
(K || tt) && /* @__PURE__ */ b("div", {
|
|
621
622
|
role: "alert",
|
|
622
623
|
children: /* @__PURE__ */ b(r, {
|
|
623
624
|
tone: "danger",
|
|
@@ -631,10 +632,10 @@ var F = c(function() {
|
|
|
631
632
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
632
633
|
style: T,
|
|
633
634
|
onClick: () => {
|
|
634
|
-
|
|
635
|
+
K && q().catch(() => void 0), tt && nt().catch(() => void 0);
|
|
635
636
|
},
|
|
636
637
|
children: [
|
|
637
|
-
/* @__PURE__ */ b(
|
|
638
|
+
/* @__PURE__ */ b(fe, {
|
|
638
639
|
size: 14,
|
|
639
640
|
"aria-hidden": "true"
|
|
640
641
|
}),
|
|
@@ -689,7 +690,7 @@ var F = c(function() {
|
|
|
689
690
|
resize: "vertical"
|
|
690
691
|
},
|
|
691
692
|
onKeyDown: (e) => {
|
|
692
|
-
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(),
|
|
693
|
+
e.key === "Enter" && (e.metaKey || e.ctrlKey) && (e.preventDefault(), lt());
|
|
693
694
|
}
|
|
694
695
|
}),
|
|
695
696
|
/* @__PURE__ */ x("div", {
|
|
@@ -704,66 +705,70 @@ var F = c(function() {
|
|
|
704
705
|
children: [
|
|
705
706
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
706
707
|
htmlFor: "prompt-style",
|
|
707
|
-
style:
|
|
708
|
+
style: D,
|
|
708
709
|
children: c("bigconsole.insights.prompt.style", "Style")
|
|
709
710
|
}), /* @__PURE__ */ b("select", {
|
|
710
711
|
id: "prompt-style",
|
|
711
712
|
value: w,
|
|
712
|
-
onChange: (e) =>
|
|
713
|
+
onChange: (e) => A(e.target.value),
|
|
713
714
|
className: n,
|
|
714
|
-
style:
|
|
715
|
-
children:
|
|
715
|
+
style: O,
|
|
716
|
+
children: Ne.map((e) => /* @__PURE__ */ b("option", {
|
|
716
717
|
value: e.value,
|
|
717
718
|
children: e.label
|
|
718
719
|
}, e.value))
|
|
719
720
|
})] }),
|
|
720
721
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
721
722
|
htmlFor: "prompt-layout",
|
|
722
|
-
style:
|
|
723
|
+
style: D,
|
|
723
724
|
children: c("bigconsole.insights.prompt.layout", "Layout")
|
|
724
725
|
}), /* @__PURE__ */ b("select", {
|
|
725
726
|
id: "prompt-layout",
|
|
726
|
-
value:
|
|
727
|
-
onChange: (e) =>
|
|
727
|
+
value: j,
|
|
728
|
+
onChange: (e) => ze(e.target.value),
|
|
728
729
|
className: n,
|
|
729
|
-
style:
|
|
730
|
-
children:
|
|
730
|
+
style: O,
|
|
731
|
+
children: Pe.map((e) => /* @__PURE__ */ b("option", {
|
|
731
732
|
value: e.value,
|
|
732
733
|
children: e.label
|
|
733
734
|
}, e.value))
|
|
734
735
|
})] }),
|
|
735
736
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
736
737
|
htmlFor: "prompt-columns",
|
|
737
|
-
style:
|
|
738
|
+
style: D,
|
|
738
739
|
children: c("bigconsole.insights.prompt.columns", "Columns")
|
|
739
740
|
}), /* @__PURE__ */ b("select", {
|
|
740
741
|
id: "prompt-columns",
|
|
741
|
-
value:
|
|
742
|
-
onChange: (e) =>
|
|
742
|
+
value: M,
|
|
743
|
+
onChange: (e) => Ue(Number(e.target.value)),
|
|
743
744
|
className: n,
|
|
744
|
-
style:
|
|
745
|
-
children:
|
|
745
|
+
style: O,
|
|
746
|
+
children: Fe.map((e) => /* @__PURE__ */ b("option", {
|
|
746
747
|
value: e,
|
|
747
748
|
children: e
|
|
748
749
|
}, e))
|
|
749
750
|
})] }),
|
|
750
751
|
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("label", {
|
|
751
752
|
htmlFor: "prompt-max-widgets",
|
|
752
|
-
style:
|
|
753
|
+
style: D,
|
|
753
754
|
children: c("bigconsole.insights.prompt.maxWidgets", "Max widgets")
|
|
754
755
|
}), /* @__PURE__ */ b("select", {
|
|
755
756
|
id: "prompt-max-widgets",
|
|
756
|
-
value:
|
|
757
|
-
onChange: (e) =>
|
|
757
|
+
value: P,
|
|
758
|
+
onChange: (e) => qe(Number(e.target.value)),
|
|
758
759
|
className: n,
|
|
759
|
-
style:
|
|
760
|
-
children:
|
|
760
|
+
style: O,
|
|
761
|
+
children: Ie.map((e) => /* @__PURE__ */ b("option", {
|
|
761
762
|
value: e,
|
|
762
763
|
children: e
|
|
763
764
|
}, e))
|
|
764
765
|
})] })
|
|
765
766
|
]
|
|
766
767
|
}),
|
|
768
|
+
/* @__PURE__ */ b(ie, {
|
|
769
|
+
prompt: v,
|
|
770
|
+
disabled: F
|
|
771
|
+
}),
|
|
767
772
|
/* @__PURE__ */ x("div", {
|
|
768
773
|
style: {
|
|
769
774
|
display: "flex",
|
|
@@ -788,16 +793,16 @@ var F = c(function() {
|
|
|
788
793
|
]
|
|
789
794
|
}), /* @__PURE__ */ x("button", {
|
|
790
795
|
type: "button",
|
|
791
|
-
onClick:
|
|
792
|
-
disabled: !v.trim() ||
|
|
796
|
+
onClick: lt,
|
|
797
|
+
disabled: !v.trim() || F,
|
|
793
798
|
className: n,
|
|
794
799
|
style: {
|
|
795
800
|
...E,
|
|
796
801
|
marginLeft: "auto",
|
|
797
|
-
cursor: !v.trim() ||
|
|
798
|
-
opacity: !v.trim() ||
|
|
802
|
+
cursor: !v.trim() || F ? "not-allowed" : "pointer",
|
|
803
|
+
opacity: !v.trim() || F ? .5 : 1
|
|
799
804
|
},
|
|
800
|
-
children: [
|
|
805
|
+
children: [F ? /* @__PURE__ */ b(h, {
|
|
801
806
|
size: 16,
|
|
802
807
|
className: "animate-spin",
|
|
803
808
|
"aria-hidden": "true"
|
|
@@ -810,12 +815,12 @@ var F = c(function() {
|
|
|
810
815
|
]
|
|
811
816
|
})
|
|
812
817
|
}),
|
|
813
|
-
|
|
818
|
+
ct.length > 0 && /* @__PURE__ */ b(r, {
|
|
814
819
|
emphasis: "muted",
|
|
815
820
|
headingLevel: 2,
|
|
816
821
|
title: c("bigconsole.insights.suggestions.heading", "Starting points"),
|
|
817
822
|
description: "Pick one to drop it into the prompt box above, then edit it before generating.",
|
|
818
|
-
icon: /* @__PURE__ */ b(
|
|
823
|
+
icon: /* @__PURE__ */ b(de, { className: "h-icon-sm w-icon-sm" }),
|
|
819
824
|
"data-testid": "insights-suggestions",
|
|
820
825
|
children: /* @__PURE__ */ b("div", {
|
|
821
826
|
style: {
|
|
@@ -823,9 +828,9 @@ var F = c(function() {
|
|
|
823
828
|
gridTemplateColumns: "repeat(auto-fill, minmax(min(260px, 100%), 1fr))",
|
|
824
829
|
gap: "var(--space-controlGap)"
|
|
825
830
|
},
|
|
826
|
-
children:
|
|
831
|
+
children: ct.map((e) => /* @__PURE__ */ x("button", {
|
|
827
832
|
type: "button",
|
|
828
|
-
onClick: () =>
|
|
833
|
+
onClick: () => mt(e.prompt),
|
|
829
834
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
830
835
|
style: {
|
|
831
836
|
textAlign: "left",
|
|
@@ -865,7 +870,7 @@ var F = c(function() {
|
|
|
865
870
|
flexWrap: "wrap"
|
|
866
871
|
},
|
|
867
872
|
children: e.tags.slice(0, 3).map((e) => /* @__PURE__ */ b("span", {
|
|
868
|
-
style:
|
|
873
|
+
style: k,
|
|
869
874
|
children: e
|
|
870
875
|
}, e))
|
|
871
876
|
})
|
|
@@ -879,17 +884,17 @@ var F = c(function() {
|
|
|
879
884
|
headingLevel: 2,
|
|
880
885
|
title: c("bigconsole.insights.generations.heading", "Recent generations"),
|
|
881
886
|
description: "Newest first. A generation stays a proposal until you create the dashboard from it.",
|
|
882
|
-
icon: /* @__PURE__ */ b(
|
|
883
|
-
meta:
|
|
884
|
-
style:
|
|
887
|
+
icon: /* @__PURE__ */ b(ue, { className: "h-icon-sm w-icon-sm" }),
|
|
888
|
+
meta: Z.length > 0 ? /* @__PURE__ */ x("span", {
|
|
889
|
+
style: k,
|
|
885
890
|
children: [
|
|
886
|
-
|
|
891
|
+
Z.length,
|
|
887
892
|
" generation",
|
|
888
|
-
|
|
893
|
+
Z.length === 1 ? "" : "s"
|
|
889
894
|
]
|
|
890
895
|
}) : void 0,
|
|
891
896
|
"data-testid": "insights-generations",
|
|
892
|
-
children:
|
|
897
|
+
children: Qe && Z.length === 0 ? /* @__PURE__ */ b(r, {
|
|
893
898
|
emphasis: "muted",
|
|
894
899
|
headingLevel: 3,
|
|
895
900
|
"aria-label": "Loading generations",
|
|
@@ -914,17 +919,17 @@ var F = c(function() {
|
|
|
914
919
|
children: c("bigconsole.insights.generations.loading", "Loading generations…")
|
|
915
920
|
})]
|
|
916
921
|
})
|
|
917
|
-
}) :
|
|
922
|
+
}) : Z.length === 0 && !F && !K ? /* @__PURE__ */ b(ge, {
|
|
918
923
|
treatment: "insight",
|
|
919
924
|
className: "border-[var(--color-border-seam)]",
|
|
920
|
-
children: /* @__PURE__ */ b(
|
|
925
|
+
children: /* @__PURE__ */ b(ve, {
|
|
921
926
|
illustration: "onboarding",
|
|
922
927
|
title: c("bigconsole.insights.generations.emptyTitle", "No generations yet"),
|
|
923
928
|
description: c("bigconsole.insights.generations.emptyDescription", "Describe a dashboard above to get started")
|
|
924
929
|
})
|
|
925
930
|
}) : /* @__PURE__ */ x("div", {
|
|
926
931
|
className: "flex flex-col gap-list-gap",
|
|
927
|
-
children: [
|
|
932
|
+
children: [F && !Y && /* @__PURE__ */ b(r, {
|
|
928
933
|
emphasis: "muted",
|
|
929
934
|
tone: "info",
|
|
930
935
|
padding: "compact",
|
|
@@ -933,14 +938,14 @@ var F = c(function() {
|
|
|
933
938
|
description: "The new generation appears here as soon as the backend accepts it.",
|
|
934
939
|
icon: /* @__PURE__ */ b(h, { className: "h-icon-sm w-icon-sm animate-spin" }),
|
|
935
940
|
"data-testid": "insights-generation-pending"
|
|
936
|
-
}),
|
|
937
|
-
let t = e.generatedSpec, i =
|
|
941
|
+
}), Z.map((e) => {
|
|
942
|
+
let t = e.generatedSpec, i = L.has(e.id), a = C.includes(e.status);
|
|
938
943
|
return /* @__PURE__ */ x(r, {
|
|
939
944
|
emphasis: "standard",
|
|
940
945
|
padding: "compact",
|
|
941
946
|
headingLevel: 3,
|
|
942
947
|
title: t?.name || (a ? c("bigconsole.insights.generations.generating", "Generating…") : "Untitled generation"),
|
|
943
|
-
meta: /* @__PURE__ */ b(
|
|
948
|
+
meta: /* @__PURE__ */ b(Be, { status: e.status }),
|
|
944
949
|
description: e.prompt.length > 160 ? `${e.prompt.slice(0, 160)}…` : e.prompt,
|
|
945
950
|
"data-testid": "insights-generation-card",
|
|
946
951
|
bodyClassName: "flex flex-col gap-control-gap",
|
|
@@ -953,15 +958,15 @@ var F = c(function() {
|
|
|
953
958
|
},
|
|
954
959
|
children: [
|
|
955
960
|
/* @__PURE__ */ x("span", {
|
|
956
|
-
style:
|
|
961
|
+
style: k,
|
|
957
962
|
children: [
|
|
958
|
-
|
|
963
|
+
N(t),
|
|
959
964
|
" widget",
|
|
960
|
-
|
|
965
|
+
N(t) === 1 ? "" : "s"
|
|
961
966
|
]
|
|
962
967
|
}),
|
|
963
968
|
/* @__PURE__ */ x("span", {
|
|
964
|
-
style:
|
|
969
|
+
style: k,
|
|
965
970
|
children: [
|
|
966
971
|
t.pages.length,
|
|
967
972
|
" page",
|
|
@@ -969,7 +974,7 @@ var F = c(function() {
|
|
|
969
974
|
]
|
|
970
975
|
}),
|
|
971
976
|
/* @__PURE__ */ x("span", {
|
|
972
|
-
style:
|
|
977
|
+
style: Ve(t.overallConfidence),
|
|
973
978
|
children: [Math.round(t.overallConfidence * 100), "% confidence"]
|
|
974
979
|
})
|
|
975
980
|
]
|
|
@@ -980,7 +985,7 @@ var F = c(function() {
|
|
|
980
985
|
padding: "compact",
|
|
981
986
|
title: "Generation failed",
|
|
982
987
|
description: e.errorMessage,
|
|
983
|
-
icon: /* @__PURE__ */ b(
|
|
988
|
+
icon: /* @__PURE__ */ b(se, { className: "h-icon-sm w-icon-sm" })
|
|
984
989
|
}),
|
|
985
990
|
/* @__PURE__ */ x("div", {
|
|
986
991
|
style: {
|
|
@@ -995,17 +1000,17 @@ var F = c(function() {
|
|
|
995
1000
|
a && /* @__PURE__ */ x("button", {
|
|
996
1001
|
type: "button",
|
|
997
1002
|
onClick: () => {
|
|
998
|
-
o("medium"),
|
|
1003
|
+
o("medium"), dt(e.id);
|
|
999
1004
|
},
|
|
1000
1005
|
disabled: i,
|
|
1001
1006
|
title: c("bigconsole.insights.actions.cancelTitle", "Cancel generation"),
|
|
1002
1007
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1003
1008
|
style: {
|
|
1004
|
-
...
|
|
1009
|
+
...Le,
|
|
1005
1010
|
cursor: i ? "wait" : "pointer"
|
|
1006
1011
|
},
|
|
1007
1012
|
children: [
|
|
1008
|
-
/* @__PURE__ */ b(
|
|
1013
|
+
/* @__PURE__ */ b(ce, {
|
|
1009
1014
|
size: 14,
|
|
1010
1015
|
"aria-hidden": "true"
|
|
1011
1016
|
}),
|
|
@@ -1015,12 +1020,12 @@ var F = c(function() {
|
|
|
1015
1020
|
}),
|
|
1016
1021
|
e.status === "COMPLETED" && t && /* @__PURE__ */ x("button", {
|
|
1017
1022
|
type: "button",
|
|
1018
|
-
onClick: () =>
|
|
1023
|
+
onClick: () => z(e),
|
|
1019
1024
|
title: c("bigconsole.insights.actions.previewTitle", "Preview proposed layout"),
|
|
1020
1025
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1021
1026
|
style: T,
|
|
1022
1027
|
children: [
|
|
1023
|
-
/* @__PURE__ */ b(
|
|
1028
|
+
/* @__PURE__ */ b(le, {
|
|
1024
1029
|
size: 14,
|
|
1025
1030
|
"aria-hidden": "true"
|
|
1026
1031
|
}),
|
|
@@ -1031,7 +1036,7 @@ var F = c(function() {
|
|
|
1031
1036
|
e.status === "COMPLETED" && t && /* @__PURE__ */ x("button", {
|
|
1032
1037
|
type: "button",
|
|
1033
1038
|
onClick: () => {
|
|
1034
|
-
|
|
1039
|
+
V(e), U("");
|
|
1035
1040
|
},
|
|
1036
1041
|
title: c("bigconsole.insights.actions.refineTitle", "Refine with instructions"),
|
|
1037
1042
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
@@ -1048,7 +1053,7 @@ var F = c(function() {
|
|
|
1048
1053
|
(e.status === "COMPLETED" || e.status === "FAILED" || e.status === "CANCELLED") && /* @__PURE__ */ x("button", {
|
|
1049
1054
|
type: "button",
|
|
1050
1055
|
onClick: () => {
|
|
1051
|
-
o("medium"),
|
|
1056
|
+
o("medium"), ft(e.id);
|
|
1052
1057
|
},
|
|
1053
1058
|
disabled: i,
|
|
1054
1059
|
title: c("bigconsole.insights.actions.regenerateTitle", "Regenerate with the same prompt"),
|
|
@@ -1058,7 +1063,7 @@ var F = c(function() {
|
|
|
1058
1063
|
cursor: i ? "wait" : "pointer"
|
|
1059
1064
|
},
|
|
1060
1065
|
children: [
|
|
1061
|
-
/* @__PURE__ */ b(
|
|
1066
|
+
/* @__PURE__ */ b(fe, {
|
|
1062
1067
|
size: 14,
|
|
1063
1068
|
className: i ? "animate-spin" : "",
|
|
1064
1069
|
"aria-hidden": "true"
|
|
@@ -1082,7 +1087,7 @@ var F = c(function() {
|
|
|
1082
1087
|
}),
|
|
1083
1088
|
e.status === "COMPLETED" && !e.dashboardId && /* @__PURE__ */ x("button", {
|
|
1084
1089
|
type: "button",
|
|
1085
|
-
onClick: () =>
|
|
1090
|
+
onClick: () => Q(e),
|
|
1086
1091
|
disabled: s(e).kind !== "create",
|
|
1087
1092
|
title: s(e).kind === "hold" ? "Reload the proposal before creating its dashboard." : void 0,
|
|
1088
1093
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
@@ -1113,13 +1118,13 @@ var F = c(function() {
|
|
|
1113
1118
|
/* @__PURE__ */ b("button", {
|
|
1114
1119
|
type: "button",
|
|
1115
1120
|
onClick: () => {
|
|
1116
|
-
o("medium"),
|
|
1121
|
+
o("medium"), ut(e.id);
|
|
1117
1122
|
},
|
|
1118
1123
|
title: c("bigconsole.insights.actions.deleteTitle", "Delete generation"),
|
|
1119
1124
|
"aria-label": c("bigconsole.insights.actions.deleteTitle", "Delete generation"),
|
|
1120
1125
|
className: n,
|
|
1121
|
-
style:
|
|
1122
|
-
children: /* @__PURE__ */ b(
|
|
1126
|
+
style: Re,
|
|
1127
|
+
children: /* @__PURE__ */ b(pe, {
|
|
1123
1128
|
size: 14,
|
|
1124
1129
|
"aria-hidden": "true"
|
|
1125
1130
|
})
|
|
@@ -1135,11 +1140,11 @@ var F = c(function() {
|
|
|
1135
1140
|
})
|
|
1136
1141
|
] })]
|
|
1137
1142
|
}),
|
|
1138
|
-
|
|
1143
|
+
R && $ && /* @__PURE__ */ b("div", {
|
|
1139
1144
|
role: "dialog",
|
|
1140
1145
|
"aria-modal": "true",
|
|
1141
1146
|
"aria-label": c("bigconsole.insights.preview.ariaLabel", "Generation preview"),
|
|
1142
|
-
onClick: () =>
|
|
1147
|
+
onClick: () => z(null),
|
|
1143
1148
|
style: {
|
|
1144
1149
|
position: "fixed",
|
|
1145
1150
|
inset: 0,
|
|
@@ -1192,14 +1197,14 @@ var F = c(function() {
|
|
|
1192
1197
|
})]
|
|
1193
1198
|
}), /* @__PURE__ */ b("button", {
|
|
1194
1199
|
type: "button",
|
|
1195
|
-
onClick: () =>
|
|
1200
|
+
onClick: () => z(null),
|
|
1196
1201
|
"aria-label": c("bigconsole.insights.preview.close", "Close preview"),
|
|
1197
1202
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1198
1203
|
style: {
|
|
1199
|
-
...
|
|
1204
|
+
...Re,
|
|
1200
1205
|
color: "var(--color-text-muted)"
|
|
1201
1206
|
},
|
|
1202
|
-
children: /* @__PURE__ */ b(
|
|
1207
|
+
children: /* @__PURE__ */ b(me, {
|
|
1203
1208
|
size: 18,
|
|
1204
1209
|
"aria-hidden": "true"
|
|
1205
1210
|
})
|
|
@@ -1224,15 +1229,15 @@ var F = c(function() {
|
|
|
1224
1229
|
},
|
|
1225
1230
|
children: [
|
|
1226
1231
|
/* @__PURE__ */ x("span", {
|
|
1227
|
-
style:
|
|
1232
|
+
style: k,
|
|
1228
1233
|
children: [
|
|
1229
|
-
|
|
1234
|
+
N($),
|
|
1230
1235
|
" widget",
|
|
1231
|
-
|
|
1236
|
+
N($) === 1 ? "" : "s"
|
|
1232
1237
|
]
|
|
1233
1238
|
}),
|
|
1234
1239
|
/* @__PURE__ */ x("span", {
|
|
1235
|
-
style:
|
|
1240
|
+
style: k,
|
|
1236
1241
|
children: [
|
|
1237
1242
|
$.pages.length,
|
|
1238
1243
|
" page",
|
|
@@ -1240,12 +1245,12 @@ var F = c(function() {
|
|
|
1240
1245
|
]
|
|
1241
1246
|
}),
|
|
1242
1247
|
/* @__PURE__ */ x("span", {
|
|
1243
|
-
style:
|
|
1248
|
+
style: Ve($.overallConfidence),
|
|
1244
1249
|
children: [Math.round($.overallConfidence * 100), "% confidence"]
|
|
1245
1250
|
})
|
|
1246
1251
|
]
|
|
1247
1252
|
}),
|
|
1248
|
-
/* @__PURE__ */ b(
|
|
1253
|
+
/* @__PURE__ */ b(oe, { metadata: R.processingMetadata }),
|
|
1249
1254
|
$.reasoning && /* @__PURE__ */ x("details", {
|
|
1250
1255
|
"data-testid": "preview-reasoning",
|
|
1251
1256
|
children: [/* @__PURE__ */ b("summary", {
|
|
@@ -1274,7 +1279,7 @@ var F = c(function() {
|
|
|
1274
1279
|
headingLevel: 3,
|
|
1275
1280
|
title: e.name,
|
|
1276
1281
|
meta: /* @__PURE__ */ x("span", {
|
|
1277
|
-
style:
|
|
1282
|
+
style: k,
|
|
1278
1283
|
children: [
|
|
1279
1284
|
e.widgets.length,
|
|
1280
1285
|
" widget",
|
|
@@ -1299,13 +1304,13 @@ var F = c(function() {
|
|
|
1299
1304
|
]
|
|
1300
1305
|
}), /* @__PURE__ */ b("div", {
|
|
1301
1306
|
className: "insights-proposal-grid",
|
|
1302
|
-
style:
|
|
1307
|
+
style: We(e.gridColumns),
|
|
1303
1308
|
children: e.widgets.map((t, n) => {
|
|
1304
|
-
let r =
|
|
1309
|
+
let r = He(t.confidence);
|
|
1305
1310
|
return /* @__PURE__ */ x("div", {
|
|
1306
1311
|
className: "insights-proposal-widget",
|
|
1307
1312
|
style: {
|
|
1308
|
-
...
|
|
1313
|
+
...Ge(t.position, e.gridColumns),
|
|
1309
1314
|
display: "flex",
|
|
1310
1315
|
flexDirection: "column",
|
|
1311
1316
|
gap: "2px",
|
|
@@ -1342,7 +1347,7 @@ var F = c(function() {
|
|
|
1342
1347
|
}),
|
|
1343
1348
|
r && /* @__PURE__ */ b("span", {
|
|
1344
1349
|
style: {
|
|
1345
|
-
...
|
|
1350
|
+
...Ke(r),
|
|
1346
1351
|
marginLeft: "auto"
|
|
1347
1352
|
},
|
|
1348
1353
|
"data-testid": "preview-widget-confidence",
|
|
@@ -1359,7 +1364,7 @@ var F = c(function() {
|
|
|
1359
1364
|
},
|
|
1360
1365
|
children: t.reasoning
|
|
1361
1366
|
}),
|
|
1362
|
-
/* @__PURE__ */ b(
|
|
1367
|
+
/* @__PURE__ */ b(ae, { config: t.config })
|
|
1363
1368
|
]
|
|
1364
1369
|
}, n);
|
|
1365
1370
|
})
|
|
@@ -1379,16 +1384,16 @@ var F = c(function() {
|
|
|
1379
1384
|
children: [
|
|
1380
1385
|
/* @__PURE__ */ b("button", {
|
|
1381
1386
|
type: "button",
|
|
1382
|
-
onClick: () =>
|
|
1387
|
+
onClick: () => z(null),
|
|
1383
1388
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1384
1389
|
style: T,
|
|
1385
1390
|
children: "Close"
|
|
1386
1391
|
}),
|
|
1387
|
-
|
|
1392
|
+
R.status === "COMPLETED" && $ && /* @__PURE__ */ x("button", {
|
|
1388
1393
|
type: "button",
|
|
1389
1394
|
onClick: () => {
|
|
1390
|
-
let e =
|
|
1391
|
-
|
|
1395
|
+
let e = R;
|
|
1396
|
+
z(null), V(e), U("");
|
|
1392
1397
|
},
|
|
1393
1398
|
title: c("bigconsole.insights.actions.refineTitle", "Refine with instructions"),
|
|
1394
1399
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
@@ -1402,24 +1407,24 @@ var F = c(function() {
|
|
|
1402
1407
|
c("bigconsole.insights.actions.refine", "Refine")
|
|
1403
1408
|
]
|
|
1404
1409
|
}),
|
|
1405
|
-
|
|
1410
|
+
R.status === "COMPLETED" && s(R).kind === "hold" && /* @__PURE__ */ b("span", {
|
|
1406
1411
|
role: "status",
|
|
1407
1412
|
children: c("bigconsole.insights.error.reviewUnavailable", "Reload the proposal before creating its dashboard.")
|
|
1408
1413
|
}),
|
|
1409
|
-
|
|
1414
|
+
R.dashboardId && /* @__PURE__ */ b("button", {
|
|
1410
1415
|
type: "button",
|
|
1411
1416
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1412
1417
|
style: T,
|
|
1413
|
-
onClick: () => p(`/dashboards/${
|
|
1418
|
+
onClick: () => p(`/dashboards/${R.dashboardId}`),
|
|
1414
1419
|
children: c("bigconsole.insights.actions.viewDashboard", "View dashboard")
|
|
1415
1420
|
}),
|
|
1416
|
-
|
|
1421
|
+
R.status === "COMPLETED" && !R.dashboardId && /* @__PURE__ */ x("button", {
|
|
1417
1422
|
type: "button",
|
|
1418
|
-
disabled: s(
|
|
1419
|
-
title: s(
|
|
1423
|
+
disabled: s(R).kind !== "create",
|
|
1424
|
+
title: s(R).kind === "hold" ? "Reload the proposal before creating its dashboard." : void 0,
|
|
1420
1425
|
onClick: () => {
|
|
1421
|
-
let e =
|
|
1422
|
-
|
|
1426
|
+
let e = R;
|
|
1427
|
+
z(null), Q(e);
|
|
1423
1428
|
},
|
|
1424
1429
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1425
1430
|
style: E,
|
|
@@ -1437,11 +1442,11 @@ var F = c(function() {
|
|
|
1437
1442
|
]
|
|
1438
1443
|
})
|
|
1439
1444
|
}),
|
|
1440
|
-
|
|
1445
|
+
B && /* @__PURE__ */ b("div", {
|
|
1441
1446
|
role: "dialog",
|
|
1442
1447
|
"aria-modal": "true",
|
|
1443
1448
|
"aria-label": c("bigconsole.insights.refine.ariaLabel", "Refine generation"),
|
|
1444
|
-
onClick: () =>
|
|
1449
|
+
onClick: () => V(null),
|
|
1445
1450
|
style: {
|
|
1446
1451
|
position: "fixed",
|
|
1447
1452
|
inset: 0,
|
|
@@ -1501,8 +1506,8 @@ var F = c(function() {
|
|
|
1501
1506
|
emphasis: "muted",
|
|
1502
1507
|
padding: "compact",
|
|
1503
1508
|
headingLevel: 3,
|
|
1504
|
-
title:
|
|
1505
|
-
description:
|
|
1509
|
+
title: B.generatedSpec?.name || "Current proposal",
|
|
1510
|
+
description: B.prompt.length > 240 ? `${B.prompt.slice(0, 240)}…` : B.prompt,
|
|
1506
1511
|
icon: /* @__PURE__ */ b(g, { className: "h-icon-sm w-icon-sm" })
|
|
1507
1512
|
}), /* @__PURE__ */ x("div", {
|
|
1508
1513
|
style: {
|
|
@@ -1521,8 +1526,8 @@ var F = c(function() {
|
|
|
1521
1526
|
children: "What should change?"
|
|
1522
1527
|
}), /* @__PURE__ */ b("textarea", {
|
|
1523
1528
|
id: "refine-input",
|
|
1524
|
-
value:
|
|
1525
|
-
onChange: (e) =>
|
|
1529
|
+
value: H,
|
|
1530
|
+
onChange: (e) => U(e.target.value),
|
|
1526
1531
|
maxLength: 2e3,
|
|
1527
1532
|
rows: 4,
|
|
1528
1533
|
placeholder: c("bigconsole.insights.refine.placeholder", "e.g., Add a revenue-by-region map and remove the duplicate KPI cards"),
|
|
@@ -1552,21 +1557,21 @@ var F = c(function() {
|
|
|
1552
1557
|
},
|
|
1553
1558
|
children: [/* @__PURE__ */ b("button", {
|
|
1554
1559
|
type: "button",
|
|
1555
|
-
onClick: () =>
|
|
1560
|
+
onClick: () => V(null),
|
|
1556
1561
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1557
1562
|
style: T,
|
|
1558
1563
|
children: c("bigconsole.insights.actions.cancel", "Cancel")
|
|
1559
1564
|
}), /* @__PURE__ */ x("button", {
|
|
1560
1565
|
type: "button",
|
|
1561
|
-
onClick: () => void
|
|
1562
|
-
disabled: !
|
|
1566
|
+
onClick: () => void pt(),
|
|
1567
|
+
disabled: !H.trim() || L.has(B.id),
|
|
1563
1568
|
className: "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface",
|
|
1564
1569
|
style: {
|
|
1565
1570
|
...E,
|
|
1566
|
-
cursor: !
|
|
1567
|
-
opacity:
|
|
1571
|
+
cursor: !H.trim() || L.has(B.id) ? "not-allowed" : "pointer",
|
|
1572
|
+
opacity: H.trim() ? 1 : .6
|
|
1568
1573
|
},
|
|
1569
|
-
children: [
|
|
1574
|
+
children: [L.has(B.id) ? /* @__PURE__ */ b(h, {
|
|
1570
1575
|
size: 14,
|
|
1571
1576
|
className: "animate-spin",
|
|
1572
1577
|
"aria-hidden": "true"
|
|
@@ -1583,4 +1588,4 @@ var F = c(function() {
|
|
|
1583
1588
|
});
|
|
1584
1589
|
});
|
|
1585
1590
|
//#endregion
|
|
1586
|
-
export {
|
|
1591
|
+
export { P as InsightsPage, P as default };
|