@cat-factory/app 0.196.1 → 0.197.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.
- package/README.md +39 -0
- package/app/components/tutorial/TutorialOverlay.logic.spec.ts +126 -0
- package/app/components/tutorial/TutorialOverlay.logic.ts +92 -0
- package/app/components/tutorial/TutorialOverlay.vue +273 -0
- package/app/components/tutorial/TutorialPrompt.vue +102 -0
- package/app/composables/pipelineErrorToast/bespokeConflicts.ts +181 -0
- package/app/composables/useNavContributions.ts +1 -0
- package/app/composables/usePipelineErrorToast.ts +6 -164
- package/app/composables/useTutorialTours.ts +18 -0
- package/app/modular/nav-contributions.spec.ts +4 -0
- package/app/modular/nav-contributions.ts +35 -0
- package/app/modular/nav-gates.ts +7 -0
- package/app/modular/registry.spec.ts +1 -0
- package/app/modular/registry.ts +3 -1
- package/app/modular/slots.ts +7 -0
- package/app/modular/tutorial-tours.spec.ts +107 -0
- package/app/modular/tutorial-tours.ts +147 -0
- package/app/pages/index.vue +61 -0
- package/app/stores/board/dependencies.ts +52 -0
- package/app/stores/board/placement.ts +4 -37
- package/app/stores/execution/pendingGates.ts +109 -0
- package/app/stores/execution.ts +7 -94
- package/app/stores/requirements/recommendations.ts +77 -0
- package/app/stores/requirements.ts +17 -43
- package/app/stores/tutorial.spec.ts +135 -0
- package/app/stores/tutorial.ts +145 -0
- package/app/stores/workspace/commands.ts +77 -0
- package/app/stores/workspace.ts +11 -50
- package/app/utils/tutorial.spec.ts +68 -0
- package/app/utils/tutorial.ts +192 -0
- package/i18n/locales/de.json +89 -2
- package/i18n/locales/en.json +92 -2
- package/i18n/locales/es.json +89 -2
- package/i18n/locales/fr.json +89 -2
- package/i18n/locales/he.json +89 -2
- package/i18n/locales/it.json +89 -2
- package/i18n/locales/ja.json +89 -2
- package/i18n/locales/pl.json +89 -2
- package/i18n/locales/tr.json +89 -2
- package/i18n/locales/uk.json +89 -2
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { ParsedConflict } from '~/composables/usePipelineErrorToast'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The bespoke conflict toasts: the five 409 reasons whose copy interpolates runtime detail and
|
|
5
|
+
* whose remedy is a one-click jump into the panel that fixes them. Split out of
|
|
6
|
+
* {@link usePipelineErrorToast} purely for size — it closes over the SAME toast / ui / i18n
|
|
7
|
+
* handles, so behaviour is identical to the former in-composable functions.
|
|
8
|
+
*/
|
|
9
|
+
export function createBespokeConflictToasts(deps: {
|
|
10
|
+
toast: ReturnType<typeof useToast>
|
|
11
|
+
ui: ReturnType<typeof useUiStore>
|
|
12
|
+
t: ReturnType<typeof useI18n>['t']
|
|
13
|
+
te: ReturnType<typeof useI18n>['te']
|
|
14
|
+
}): (conflict: ParsedConflict) => boolean {
|
|
15
|
+
const { toast, ui, t, te } = deps
|
|
16
|
+
// The headline case: a pipeline step's model has no usable provider. Name the
|
|
17
|
+
// offending model(s), explain no provider is available, and offer the one-click jump
|
|
18
|
+
// to the AI setup — the same remedy the startup "No AI model configured" banner gives.
|
|
19
|
+
function presentProvidersUnconfigured(conflict: ParsedConflict): void {
|
|
20
|
+
const models = Array.isArray(conflict.details.models) ? conflict.details.models : []
|
|
21
|
+
const list = models.join(', ')
|
|
22
|
+
toast.add({
|
|
23
|
+
title: t('errors.conflict.providersUnconfigured.title'),
|
|
24
|
+
description: list
|
|
25
|
+
? t('errors.conflict.providersUnconfigured.body', { models: list })
|
|
26
|
+
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
27
|
+
color: 'error',
|
|
28
|
+
icon: 'i-lucide-cpu',
|
|
29
|
+
// Stay until dismissed: an actionable toast whose remedy button vanishes on the ~5s
|
|
30
|
+
// auto-dismiss takes the one-click fix with it before the user can reach it.
|
|
31
|
+
duration: 0,
|
|
32
|
+
actions: [
|
|
33
|
+
{
|
|
34
|
+
label: t('errors.conflict.providersUnconfigured.action'),
|
|
35
|
+
icon: 'i-lucide-settings',
|
|
36
|
+
onClick: () => ui.openAiProviderSetup(),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// A pipeline step relies on binary-artifact storage (the UI Tester uploads screenshots)
|
|
43
|
+
// but the account has none configured. Explain it and offer the jump to the content-storage
|
|
44
|
+
// settings — the same shape as the providers-unconfigured case above. Prefer the localized
|
|
45
|
+
// body (it carries no runtime interpolation) so non-English users see translated copy; the
|
|
46
|
+
// raw backend prose is only the last-resort fallback when the locale lacks the key.
|
|
47
|
+
function presentBinaryStorageUnconfigured(conflict: ParsedConflict): void {
|
|
48
|
+
toast.add({
|
|
49
|
+
title: t('errors.conflict.binaryStorageUnconfigured.title'),
|
|
50
|
+
description: te('errors.conflict.binaryStorageUnconfigured.body')
|
|
51
|
+
? t('errors.conflict.binaryStorageUnconfigured.body')
|
|
52
|
+
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
53
|
+
color: 'error',
|
|
54
|
+
icon: 'i-lucide-image',
|
|
55
|
+
// Sticky, like the providers-unconfigured toast above: keep the "Configure storage"
|
|
56
|
+
// remedy reachable instead of letting it auto-dismiss.
|
|
57
|
+
duration: 0,
|
|
58
|
+
actions: [
|
|
59
|
+
{
|
|
60
|
+
label: t('errors.conflict.binaryStorageUnconfigured.action'),
|
|
61
|
+
icon: 'i-lucide-settings',
|
|
62
|
+
onClick: () => ui.openContentStorageSettings(),
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// A pipeline includes a Deployer, but the SERVICE's ephemeral-environment config (the in-repo
|
|
69
|
+
// "what/where") is incomplete for its declared type. Steer the user straight to THAT service's
|
|
70
|
+
// environment config — the compose wizard for docker-compose, the service inspector otherwise —
|
|
71
|
+
// falling back to the workspace infrastructure window if the frame id wasn't carried.
|
|
72
|
+
function presentDeployerServiceConfig(conflict: ParsedConflict): void {
|
|
73
|
+
const frameId =
|
|
74
|
+
typeof conflict.details.frameId === 'string' ? conflict.details.frameId : undefined
|
|
75
|
+
const provisionType =
|
|
76
|
+
typeof conflict.details.provisionType === 'string'
|
|
77
|
+
? conflict.details.provisionType
|
|
78
|
+
: undefined
|
|
79
|
+
const missing = Array.isArray(conflict.details.missing)
|
|
80
|
+
? conflict.details.missing.join(', ')
|
|
81
|
+
: ''
|
|
82
|
+
toast.add({
|
|
83
|
+
title: t('errors.conflict.deployerServiceConfig.title'),
|
|
84
|
+
description: missing
|
|
85
|
+
? t('errors.conflict.deployerServiceConfig.body', { missing })
|
|
86
|
+
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
87
|
+
color: 'error',
|
|
88
|
+
icon: 'i-lucide-server',
|
|
89
|
+
// Sticky, like the other actionable conflicts: keep the "Fix configuration" jump reachable.
|
|
90
|
+
duration: 0,
|
|
91
|
+
actions: [
|
|
92
|
+
{
|
|
93
|
+
label: t('errors.conflict.deployerServiceConfig.action'),
|
|
94
|
+
icon: 'i-lucide-settings',
|
|
95
|
+
onClick: () => {
|
|
96
|
+
if (frameId && provisionType === 'docker-compose') ui.openEnvironmentSetup(frameId)
|
|
97
|
+
else if (frameId) ui.select(frameId)
|
|
98
|
+
else ui.openProviderConnection('environment')
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// A pipeline includes a Deployer and the service config is sound, but no WORKSPACE handler
|
|
106
|
+
// resolves for the service's provision type (missing or ambiguous). Steer to the Infrastructure
|
|
107
|
+
// window's Test-environments tab. (Also raised by the Tester start gate — same fix applies.)
|
|
108
|
+
function presentProvisionTypeUnhandled(conflict: ParsedConflict): void {
|
|
109
|
+
const type =
|
|
110
|
+
typeof conflict.details.provisionType === 'string' ? conflict.details.provisionType : ''
|
|
111
|
+
toast.add({
|
|
112
|
+
title: t('errors.conflict.provisionTypeUnhandled.title'),
|
|
113
|
+
description: type
|
|
114
|
+
? t('errors.conflict.provisionTypeUnhandled.body', { type })
|
|
115
|
+
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
116
|
+
color: 'error',
|
|
117
|
+
icon: 'i-lucide-server-cog',
|
|
118
|
+
duration: 0,
|
|
119
|
+
actions: [
|
|
120
|
+
{
|
|
121
|
+
label: t('errors.conflict.provisionTypeUnhandled.action'),
|
|
122
|
+
icon: 'i-lucide-settings',
|
|
123
|
+
onClick: () => ui.openProviderConnection('environment'),
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// A pipeline includes a Deployer, the config is structurally complete, but the live connection
|
|
130
|
+
// probe of the resolved deployment integration failed (unreachable endpoint / apiserver, bad
|
|
131
|
+
// token). Surface the provider's failure detail and steer to the handler to fix + re-test it.
|
|
132
|
+
function presentDeployerConnectionFailed(conflict: ParsedConflict): void {
|
|
133
|
+
const detail = typeof conflict.details.detail === 'string' ? conflict.details.detail : undefined
|
|
134
|
+
toast.add({
|
|
135
|
+
title: t('errors.conflict.deployerConnectionFailed.title'),
|
|
136
|
+
description: detail
|
|
137
|
+
? t('errors.conflict.deployerConnectionFailed.body', { detail })
|
|
138
|
+
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
139
|
+
color: 'error',
|
|
140
|
+
icon: 'i-lucide-plug',
|
|
141
|
+
duration: 0,
|
|
142
|
+
actions: [
|
|
143
|
+
{
|
|
144
|
+
label: t('errors.conflict.deployerConnectionFailed.action'),
|
|
145
|
+
icon: 'i-lucide-settings',
|
|
146
|
+
onClick: () => ui.openProviderConnection('environment'),
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Dispatch the bespoke conflict reasons (a runtime-interpolated body + a "configure X" action,
|
|
154
|
+
* each with its own key namespace — the ones excluded from `CONFLICT_INFO`). Returns `true` when
|
|
155
|
+
* the reason was one of them (and the toast was raised), `false` to fall through to the generic
|
|
156
|
+
* map. The reason values are mutually exclusive, so dispatch order is irrelevant.
|
|
157
|
+
*/
|
|
158
|
+
function presentBespokeConflict(conflict: ParsedConflict): boolean {
|
|
159
|
+
switch (conflict.reason) {
|
|
160
|
+
case 'providers_unconfigured':
|
|
161
|
+
presentProvidersUnconfigured(conflict)
|
|
162
|
+
return true
|
|
163
|
+
case 'binary_storage_unconfigured':
|
|
164
|
+
presentBinaryStorageUnconfigured(conflict)
|
|
165
|
+
return true
|
|
166
|
+
case 'deployer_service_provisioning_incomplete':
|
|
167
|
+
presentDeployerServiceConfig(conflict)
|
|
168
|
+
return true
|
|
169
|
+
case 'provision_type_unhandled':
|
|
170
|
+
presentProvisionTypeUnhandled(conflict)
|
|
171
|
+
return true
|
|
172
|
+
case 'deployer_connection_test_failed':
|
|
173
|
+
presentDeployerConnectionFailed(conflict)
|
|
174
|
+
return true
|
|
175
|
+
default:
|
|
176
|
+
return false
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return presentBespokeConflict
|
|
181
|
+
}
|
|
@@ -47,6 +47,7 @@ export function useNavContributions() {
|
|
|
47
47
|
operatorDashboard: () => ui.openOperatorDashboard(),
|
|
48
48
|
reports: () => ui.openReports(),
|
|
49
49
|
shortcuts: () => ui.openShortcutsHelp(),
|
|
50
|
+
tutorial: () => useTutorialStore().openPrompt(),
|
|
50
51
|
// No-op under an env pin (`setMode` refuses), so the palette entry matches the sidebar
|
|
51
52
|
// switcher's read-only state rather than pretending to flip a tier the resolver fixes.
|
|
52
53
|
toggleUiMode: () => useUiModeStore().toggleMode(),
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* added — which is exactly why the detail stays reachable rather than being dropped).
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
+
import { createBespokeConflictToasts } from '~/composables/pipelineErrorToast/bespokeConflicts'
|
|
27
28
|
import type { ApiErrorCode, ConflictReason } from '@cat-factory/contracts'
|
|
28
29
|
import { apiErrorEnvelope, apiErrorStatus } from './api/errors'
|
|
29
30
|
|
|
@@ -244,7 +245,7 @@ export function parseConflict(
|
|
|
244
245
|
}
|
|
245
246
|
|
|
246
247
|
/** The non-null parsed shape of a backend conflict, as returned by {@link parseConflict}. */
|
|
247
|
-
type ParsedConflict = NonNullable<ReturnType<typeof parseConflict>>
|
|
248
|
+
export type ParsedConflict = NonNullable<ReturnType<typeof parseConflict>>
|
|
248
249
|
|
|
249
250
|
/**
|
|
250
251
|
* Generic translated description per STATUS CLASS, for a failure no `reason` code narrows.
|
|
@@ -332,169 +333,10 @@ export function usePipelineErrorToast() {
|
|
|
332
333
|
const ui = useUiStore()
|
|
333
334
|
const { t, te } = useI18n()
|
|
334
335
|
|
|
335
|
-
// The
|
|
336
|
-
//
|
|
337
|
-
//
|
|
338
|
-
|
|
339
|
-
const models = Array.isArray(conflict.details.models) ? conflict.details.models : []
|
|
340
|
-
const list = models.join(', ')
|
|
341
|
-
toast.add({
|
|
342
|
-
title: t('errors.conflict.providersUnconfigured.title'),
|
|
343
|
-
description: list
|
|
344
|
-
? t('errors.conflict.providersUnconfigured.body', { models: list })
|
|
345
|
-
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
346
|
-
color: 'error',
|
|
347
|
-
icon: 'i-lucide-cpu',
|
|
348
|
-
// Stay until dismissed: an actionable toast whose remedy button vanishes on the ~5s
|
|
349
|
-
// auto-dismiss takes the one-click fix with it before the user can reach it.
|
|
350
|
-
duration: 0,
|
|
351
|
-
actions: [
|
|
352
|
-
{
|
|
353
|
-
label: t('errors.conflict.providersUnconfigured.action'),
|
|
354
|
-
icon: 'i-lucide-settings',
|
|
355
|
-
onClick: () => ui.openAiProviderSetup(),
|
|
356
|
-
},
|
|
357
|
-
],
|
|
358
|
-
})
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// A pipeline step relies on binary-artifact storage (the UI Tester uploads screenshots)
|
|
362
|
-
// but the account has none configured. Explain it and offer the jump to the content-storage
|
|
363
|
-
// settings — the same shape as the providers-unconfigured case above. Prefer the localized
|
|
364
|
-
// body (it carries no runtime interpolation) so non-English users see translated copy; the
|
|
365
|
-
// raw backend prose is only the last-resort fallback when the locale lacks the key.
|
|
366
|
-
function presentBinaryStorageUnconfigured(conflict: ParsedConflict): void {
|
|
367
|
-
toast.add({
|
|
368
|
-
title: t('errors.conflict.binaryStorageUnconfigured.title'),
|
|
369
|
-
description: te('errors.conflict.binaryStorageUnconfigured.body')
|
|
370
|
-
? t('errors.conflict.binaryStorageUnconfigured.body')
|
|
371
|
-
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
372
|
-
color: 'error',
|
|
373
|
-
icon: 'i-lucide-image',
|
|
374
|
-
// Sticky, like the providers-unconfigured toast above: keep the "Configure storage"
|
|
375
|
-
// remedy reachable instead of letting it auto-dismiss.
|
|
376
|
-
duration: 0,
|
|
377
|
-
actions: [
|
|
378
|
-
{
|
|
379
|
-
label: t('errors.conflict.binaryStorageUnconfigured.action'),
|
|
380
|
-
icon: 'i-lucide-settings',
|
|
381
|
-
onClick: () => ui.openContentStorageSettings(),
|
|
382
|
-
},
|
|
383
|
-
],
|
|
384
|
-
})
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// A pipeline includes a Deployer, but the SERVICE's ephemeral-environment config (the in-repo
|
|
388
|
-
// "what/where") is incomplete for its declared type. Steer the user straight to THAT service's
|
|
389
|
-
// environment config — the compose wizard for docker-compose, the service inspector otherwise —
|
|
390
|
-
// falling back to the workspace infrastructure window if the frame id wasn't carried.
|
|
391
|
-
function presentDeployerServiceConfig(conflict: ParsedConflict): void {
|
|
392
|
-
const frameId =
|
|
393
|
-
typeof conflict.details.frameId === 'string' ? conflict.details.frameId : undefined
|
|
394
|
-
const provisionType =
|
|
395
|
-
typeof conflict.details.provisionType === 'string'
|
|
396
|
-
? conflict.details.provisionType
|
|
397
|
-
: undefined
|
|
398
|
-
const missing = Array.isArray(conflict.details.missing)
|
|
399
|
-
? conflict.details.missing.join(', ')
|
|
400
|
-
: ''
|
|
401
|
-
toast.add({
|
|
402
|
-
title: t('errors.conflict.deployerServiceConfig.title'),
|
|
403
|
-
description: missing
|
|
404
|
-
? t('errors.conflict.deployerServiceConfig.body', { missing })
|
|
405
|
-
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
406
|
-
color: 'error',
|
|
407
|
-
icon: 'i-lucide-server',
|
|
408
|
-
// Sticky, like the other actionable conflicts: keep the "Fix configuration" jump reachable.
|
|
409
|
-
duration: 0,
|
|
410
|
-
actions: [
|
|
411
|
-
{
|
|
412
|
-
label: t('errors.conflict.deployerServiceConfig.action'),
|
|
413
|
-
icon: 'i-lucide-settings',
|
|
414
|
-
onClick: () => {
|
|
415
|
-
if (frameId && provisionType === 'docker-compose') ui.openEnvironmentSetup(frameId)
|
|
416
|
-
else if (frameId) ui.select(frameId)
|
|
417
|
-
else ui.openProviderConnection('environment')
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
})
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// A pipeline includes a Deployer and the service config is sound, but no WORKSPACE handler
|
|
425
|
-
// resolves for the service's provision type (missing or ambiguous). Steer to the Infrastructure
|
|
426
|
-
// window's Test-environments tab. (Also raised by the Tester start gate — same fix applies.)
|
|
427
|
-
function presentProvisionTypeUnhandled(conflict: ParsedConflict): void {
|
|
428
|
-
const type =
|
|
429
|
-
typeof conflict.details.provisionType === 'string' ? conflict.details.provisionType : ''
|
|
430
|
-
toast.add({
|
|
431
|
-
title: t('errors.conflict.provisionTypeUnhandled.title'),
|
|
432
|
-
description: type
|
|
433
|
-
? t('errors.conflict.provisionTypeUnhandled.body', { type })
|
|
434
|
-
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
435
|
-
color: 'error',
|
|
436
|
-
icon: 'i-lucide-server-cog',
|
|
437
|
-
duration: 0,
|
|
438
|
-
actions: [
|
|
439
|
-
{
|
|
440
|
-
label: t('errors.conflict.provisionTypeUnhandled.action'),
|
|
441
|
-
icon: 'i-lucide-settings',
|
|
442
|
-
onClick: () => ui.openProviderConnection('environment'),
|
|
443
|
-
},
|
|
444
|
-
],
|
|
445
|
-
})
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// A pipeline includes a Deployer, the config is structurally complete, but the live connection
|
|
449
|
-
// probe of the resolved deployment integration failed (unreachable endpoint / apiserver, bad
|
|
450
|
-
// token). Surface the provider's failure detail and steer to the handler to fix + re-test it.
|
|
451
|
-
function presentDeployerConnectionFailed(conflict: ParsedConflict): void {
|
|
452
|
-
const detail = typeof conflict.details.detail === 'string' ? conflict.details.detail : undefined
|
|
453
|
-
toast.add({
|
|
454
|
-
title: t('errors.conflict.deployerConnectionFailed.title'),
|
|
455
|
-
description: detail
|
|
456
|
-
? t('errors.conflict.deployerConnectionFailed.body', { detail })
|
|
457
|
-
: (conflict.message ?? t('errors.conflict.fallbackMessage')),
|
|
458
|
-
color: 'error',
|
|
459
|
-
icon: 'i-lucide-plug',
|
|
460
|
-
duration: 0,
|
|
461
|
-
actions: [
|
|
462
|
-
{
|
|
463
|
-
label: t('errors.conflict.deployerConnectionFailed.action'),
|
|
464
|
-
icon: 'i-lucide-settings',
|
|
465
|
-
onClick: () => ui.openProviderConnection('environment'),
|
|
466
|
-
},
|
|
467
|
-
],
|
|
468
|
-
})
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Dispatch the bespoke conflict reasons (a runtime-interpolated body + a "configure X" action,
|
|
473
|
-
* each with its own key namespace — the ones excluded from `CONFLICT_INFO`). Returns `true` when
|
|
474
|
-
* the reason was one of them (and the toast was raised), `false` to fall through to the generic
|
|
475
|
-
* map. The reason values are mutually exclusive, so dispatch order is irrelevant.
|
|
476
|
-
*/
|
|
477
|
-
function presentBespokeConflict(conflict: ParsedConflict): boolean {
|
|
478
|
-
switch (conflict.reason) {
|
|
479
|
-
case 'providers_unconfigured':
|
|
480
|
-
presentProvidersUnconfigured(conflict)
|
|
481
|
-
return true
|
|
482
|
-
case 'binary_storage_unconfigured':
|
|
483
|
-
presentBinaryStorageUnconfigured(conflict)
|
|
484
|
-
return true
|
|
485
|
-
case 'deployer_service_provisioning_incomplete':
|
|
486
|
-
presentDeployerServiceConfig(conflict)
|
|
487
|
-
return true
|
|
488
|
-
case 'provision_type_unhandled':
|
|
489
|
-
presentProvisionTypeUnhandled(conflict)
|
|
490
|
-
return true
|
|
491
|
-
case 'deployer_connection_test_failed':
|
|
492
|
-
presentDeployerConnectionFailed(conflict)
|
|
493
|
-
return true
|
|
494
|
-
default:
|
|
495
|
-
return false
|
|
496
|
-
}
|
|
497
|
-
}
|
|
336
|
+
// The five bespoke conflict reasons (a runtime-interpolated body + a "configure X" jump each)
|
|
337
|
+
// live in a sibling factory over the same toast/ui/i18n handles, so this composable stays
|
|
338
|
+
// within the per-function line budget.
|
|
339
|
+
const presentBespokeConflict = createBespokeConflictToasts({ toast, ui, t, te })
|
|
498
340
|
|
|
499
341
|
/**
|
|
500
342
|
* Per-reason copy from the exhaustive map: a translated title + description, and a jump
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
import { useReactiveSlots } from '@modular-vue/runtime'
|
|
3
|
+
import { sortTours } from '~/utils/tutorial'
|
|
4
|
+
import type { TutorialTour } from '~/utils/tutorial'
|
|
5
|
+
import type { AppSlots } from '~/modular/nav-contributions'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The tours the current user may take: the merged `tutorialTours` slot (first-party +
|
|
9
|
+
* consumer-contributed), already gated per tour by `navSlotFilter` (each tour's `when`
|
|
10
|
+
* runs over the reactive gates service, so a permission flip shows/hides tours live),
|
|
11
|
+
* in deterministic catalog order. The single source both the launch prompt and the
|
|
12
|
+
* coach-mark overlay resolve tours from.
|
|
13
|
+
*/
|
|
14
|
+
export function useTutorialTours() {
|
|
15
|
+
const slots = useReactiveSlots<AppSlots>()
|
|
16
|
+
const tours = computed<TutorialTour[]>(() => sortTours(slots.value.tutorialTours ?? []))
|
|
17
|
+
return { tours }
|
|
18
|
+
}
|
|
@@ -25,6 +25,7 @@ const NO_GATES: NavGates = {
|
|
|
25
25
|
// The permission axis is what these cases vary; keep the interface tier at `advanced`
|
|
26
26
|
// so a dropped item is unambiguously an RBAC/availability drop, not a tier drop.
|
|
27
27
|
advancedMode: true,
|
|
28
|
+
boardHasService: false,
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
const ALL_GATES: NavGates = {
|
|
@@ -37,6 +38,7 @@ const ALL_GATES: NavGates = {
|
|
|
37
38
|
accountsEnabled: true,
|
|
38
39
|
isAccountAdmin: true,
|
|
39
40
|
advancedMode: true,
|
|
41
|
+
boardHasService: true,
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
const slots = (): AppSlots => ({
|
|
@@ -47,6 +49,7 @@ const slots = (): AppSlots => ({
|
|
|
47
49
|
taskTypes: [],
|
|
48
50
|
taskTypeFormPanels: [],
|
|
49
51
|
appOverlays: [],
|
|
52
|
+
tutorialTours: [],
|
|
50
53
|
})
|
|
51
54
|
const ids = (s: unknown) => (s as AppSlots).nav.map((i) => i.id)
|
|
52
55
|
|
|
@@ -312,6 +315,7 @@ describe('nav grouping helpers', () => {
|
|
|
312
315
|
'sandbox',
|
|
313
316
|
'keyboard-shortcuts',
|
|
314
317
|
'ui-mode',
|
|
318
|
+
'tutorial',
|
|
315
319
|
])
|
|
316
320
|
})
|
|
317
321
|
|
|
@@ -81,6 +81,14 @@ export interface NavGates {
|
|
|
81
81
|
* available to a `gate` predicate that needs to combine it with something else.
|
|
82
82
|
*/
|
|
83
83
|
advancedMode: boolean
|
|
84
|
+
/**
|
|
85
|
+
* The open board has at least one service frame. Availability, not permission: a
|
|
86
|
+
* surface that operates ON a service (today the task-creation tutorial tour) has
|
|
87
|
+
* nothing to point at until one exists, and offering it anyway means a walkthrough
|
|
88
|
+
* that hunts for absent controls. Reactive like the rest, so it flips the moment a
|
|
89
|
+
* service lands on the board.
|
|
90
|
+
*/
|
|
91
|
+
boardHasService: boolean
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
/** Command-palette placement + copy for a contribution that appears in the palette. */
|
|
@@ -119,6 +127,7 @@ export const NAV_ACTIONS = [
|
|
|
119
127
|
'operatorDashboard',
|
|
120
128
|
'reports',
|
|
121
129
|
'shortcuts',
|
|
130
|
+
'tutorial',
|
|
122
131
|
'toggleUiMode',
|
|
123
132
|
] as const
|
|
124
133
|
|
|
@@ -445,6 +454,25 @@ export const NAV_CONTRIBUTIONS: readonly NavContribution[] = [
|
|
|
445
454
|
testId: 'nav-reports',
|
|
446
455
|
sidebar: { group: 'configuration', order: 45 },
|
|
447
456
|
},
|
|
457
|
+
{
|
|
458
|
+
// Deliberately NOT `advanced`: the tours exist for exactly the users basic mode serves,
|
|
459
|
+
// and the palette entry is the way back to them after the launch prompt was declined
|
|
460
|
+
// or dismissed. Ungated: every tour gates itself via its own `when` predicate, and the
|
|
461
|
+
// prompt is worth reaching even when it can only list some tours.
|
|
462
|
+
id: 'tutorial',
|
|
463
|
+
labelKey: 'layout.commandBar.cmd.tutorial',
|
|
464
|
+
icon: 'i-lucide-graduation-cap',
|
|
465
|
+
surfaces: S('command'),
|
|
466
|
+
action: 'tutorial',
|
|
467
|
+
testId: 'nav-tutorial',
|
|
468
|
+
command: {
|
|
469
|
+
// After the pre-slice-1 tail (the workspace group pins that order): genuinely new
|
|
470
|
+
// entries append rather than interleave.
|
|
471
|
+
group: 'workspace',
|
|
472
|
+
order: 100,
|
|
473
|
+
keywordsKey: 'layout.commandBar.keywords.tutorial',
|
|
474
|
+
},
|
|
475
|
+
},
|
|
448
476
|
{
|
|
449
477
|
id: 'keyboard-shortcuts',
|
|
450
478
|
labelKey: 'layout.commandBar.cmd.shortcuts',
|
|
@@ -503,6 +531,7 @@ export const navigationModule = defineModule({
|
|
|
503
531
|
export function navSlotFilter(slots: AppSlots, deps: { gates?: NavGates }): AppSlots {
|
|
504
532
|
const gates = deps.gates
|
|
505
533
|
const nav = slots.nav ?? []
|
|
534
|
+
const tutorialTours = slots.tutorialTours ?? []
|
|
506
535
|
return {
|
|
507
536
|
...slots,
|
|
508
537
|
// No gates service wired (tests / bare install) ⇒ show everything, matching
|
|
@@ -512,6 +541,12 @@ export function navSlotFilter(slots: AppSlots, deps: { gates?: NavGates }): AppS
|
|
|
512
541
|
(i) => (i.advanced ? gates.advancedMode : true) && (i.gate ? i.gate(gates) : true),
|
|
513
542
|
)
|
|
514
543
|
: nav,
|
|
544
|
+
// Tutorial tours gate over the same reactive service, so a tour about a surface the
|
|
545
|
+
// caller can't reach (e.g. creating tasks without board write) never shows. Same
|
|
546
|
+
// gates-absent pass-through as `nav`.
|
|
547
|
+
tutorialTours: gates
|
|
548
|
+
? tutorialTours.filter((t) => (t.when ? t.when(gates) : true))
|
|
549
|
+
: tutorialTours,
|
|
515
550
|
}
|
|
516
551
|
}
|
|
517
552
|
|
package/app/modular/nav-gates.ts
CHANGED
|
@@ -25,6 +25,10 @@ export function createNavGates(): NavGates {
|
|
|
25
25
|
const auth = useAuthStore()
|
|
26
26
|
const providerConnections = useProviderConnectionsStore()
|
|
27
27
|
const uiMode = useUiModeStore()
|
|
28
|
+
const board = useBoardStore()
|
|
29
|
+
|
|
30
|
+
// A top-level frame IS a service (see `app/types/domain.ts`); modules are sub-frames.
|
|
31
|
+
const hasService = computed(() => board.blocks.some((b) => b.level === 'frame' && !b.parentId))
|
|
28
32
|
|
|
29
33
|
const infrastructureAvailable = computed(
|
|
30
34
|
() =>
|
|
@@ -65,5 +69,8 @@ export function createNavGates(): NavGates {
|
|
|
65
69
|
get advancedMode() {
|
|
66
70
|
return uiMode.isAdvanced
|
|
67
71
|
},
|
|
72
|
+
get boardHasService() {
|
|
73
|
+
return hasService.value
|
|
74
|
+
},
|
|
68
75
|
}
|
|
69
76
|
}
|
package/app/modular/registry.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AnyModuleDescriptor } from '@modular-vue/core'
|
|
|
2
2
|
import { createRegistry } from '@modular-vue/runtime'
|
|
3
3
|
import { journeysPlugin } from '@modular-vue/journeys'
|
|
4
4
|
import { navigationModule } from '~/modular/nav-contributions'
|
|
5
|
+
import { tutorialToursModule } from '~/modular/tutorial-tours'
|
|
5
6
|
import type { NavGates } from '~/modular/nav-contributions'
|
|
6
7
|
import type { AppSlots } from '~/modular/slots'
|
|
7
8
|
|
|
@@ -37,7 +38,7 @@ export type AppDeps = {
|
|
|
37
38
|
* First-party modules the layer always registers. Real feature modules land
|
|
38
39
|
* here as each area is converted; slice 1 adds the navigation catalog.
|
|
39
40
|
*/
|
|
40
|
-
const FIRST_PARTY_MODULES: readonly AnyModuleDescriptor[] = [navigationModule]
|
|
41
|
+
const FIRST_PARTY_MODULES: readonly AnyModuleDescriptor[] = [navigationModule, tutorialToursModule]
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Consumer-contributed modules, collected before the layer resolves its
|
|
@@ -109,6 +110,7 @@ export function createAppRegistry(
|
|
|
109
110
|
taskTypes: [],
|
|
110
111
|
taskTypeFormPanels: [],
|
|
111
112
|
appOverlays: [],
|
|
113
|
+
tutorialTours: [],
|
|
112
114
|
},
|
|
113
115
|
}).use(journeysPlugin())
|
|
114
116
|
for (const mod of [...FIRST_PARTY_MODULES, ...extraModules, ...consumerModules]) {
|
package/app/modular/slots.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Component } from 'vue'
|
|
2
2
|
import type { ComponentEntry, PanelEntry } from '@modular-vue/core'
|
|
3
3
|
import type { Block, CustomAgentKind, CustomTaskType } from '~/types/domain'
|
|
4
|
+
import type { TutorialTour } from '~/utils/tutorial'
|
|
4
5
|
import type { NavContribution } from './nav-contributions'
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -31,6 +32,11 @@ import type { NavContribution } from './nav-contributions'
|
|
|
31
32
|
* per custom task type, addressed by the type's `formPanel` id and paired via
|
|
32
33
|
* `resolveComponentRegistry` (same shape as `resultViews`); shown INSTEAD of the
|
|
33
34
|
* descriptor-driven `fields`. An unpaired id degrades to the descriptor fields.
|
|
35
|
+
* - `tutorialTours` — the in-app tutorial catalog ({@link TutorialTour}: data-only
|
|
36
|
+
* guided tours anchored to `data-testid`s, no components). First-party tours come
|
|
37
|
+
* from `modular/tutorial-tours.ts`; a consumer contributes its own to the same slot
|
|
38
|
+
* and they appear in the launch prompt beside the built-ins, gated per tour by its
|
|
39
|
+
* `when(gates)` predicate in the same reactive `slotFilter` that gates `nav`.
|
|
34
40
|
* - `appOverlays` (extension slice D) — top-level modals/overlays a consumer module
|
|
35
41
|
* contributes ({@link OverlayContribution}, an id → component `ComponentEntry`),
|
|
36
42
|
* opened by `ui.openOverlay(id, subject?)` / `useAppOverlays().open(...)` and
|
|
@@ -52,6 +58,7 @@ export interface AppSlots {
|
|
|
52
58
|
taskTypes: CustomTaskType[]
|
|
53
59
|
taskTypeFormPanels: ResultViewContribution[]
|
|
54
60
|
appOverlays: OverlayContribution[]
|
|
61
|
+
tutorialTours: TutorialTour[]
|
|
55
62
|
[key: string]: unknown[]
|
|
56
63
|
}
|
|
57
64
|
|