@cat-factory/app 0.196.0 → 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 +49 -3
- package/app/components/brainstorm/BrainstormWindow.vue +11 -4
- package/app/components/clarity/ClarityReviewWindow.vue +11 -4
- package/app/components/initiative/InitiativePlanReview.vue +44 -37
- package/app/components/initiative/InitiativeTrackerWindow.vue +12 -9
- package/app/components/layout/SideBar.vue +13 -2
- package/app/components/layout/UiModeSwitcher.vue +66 -39
- package/app/components/panels/ResultWindowShell.logic.spec.ts +174 -0
- package/app/components/panels/ResultWindowShell.logic.ts +31 -0
- package/app/components/panels/ResultWindowShell.vue +37 -8
- package/app/components/prReview/PrReviewWindow.vue +15 -7
- package/app/components/requirements/RequirementsReviewWindow.vue +15 -5
- package/app/components/spec/ServiceSpecWindow.vue +7 -4
- package/app/components/testing/TestReportWindow.vue +11 -6
- 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 +38 -3
- 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 +90 -2
- package/i18n/locales/en.json +96 -2
- package/i18n/locales/es.json +90 -2
- package/i18n/locales/fr.json +90 -2
- package/i18n/locales/he.json +90 -2
- package/i18n/locales/it.json +90 -2
- package/i18n/locales/ja.json +90 -2
- package/i18n/locales/pl.json +90 -2
- package/i18n/locales/tr.json +90 -2
- package/i18n/locales/uk.json +90 -2
- package/package.json +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
import {
|
|
5
|
+
PROSE_MEASURE_CLASS,
|
|
6
|
+
RESULT_WINDOW_WIDTH_CLASS,
|
|
7
|
+
type ResultWindowWidth,
|
|
8
|
+
} from './ResultWindowShell.logic'
|
|
9
|
+
|
|
10
|
+
// The width decision is a per-window LAYOUT judgement that lives on each window's
|
|
11
|
+
// `<ResultWindowShell width="…">`, which means nothing in the type system can ask a window author
|
|
12
|
+
// to justify it — and the `full` bucket carries an obligation (continuous prose takes its own
|
|
13
|
+
// reading measure) the shell explicitly cannot enforce on its slot content. That combination is
|
|
14
|
+
// what this file pins, the way `nav-contributions.spec.ts` pins the advanced-nav set: a table
|
|
15
|
+
// naming every window's bucket AND the reason, asserted against what the components actually pass.
|
|
16
|
+
//
|
|
17
|
+
// It caught its own motivating bug — the tracker, spec and tester windows moved to `full` with no
|
|
18
|
+
// measure anywhere in them, so their agent-written summaries ran the width of the display.
|
|
19
|
+
|
|
20
|
+
/** The default the shell applies when a window passes no `width` (`withDefaults`). */
|
|
21
|
+
const SHELL_DEFAULT_WIDTH: ResultWindowWidth = '3xl'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Every `ResultWindowShell` consumer, its bucket, and why that bucket. The reason is the point:
|
|
25
|
+
* `full` is for a body that lays out in COLUMNS, where the width buys visible layout, and a
|
|
26
|
+
* one-column verdict or reader keeps a bucket. A row that cannot state which of those it is has
|
|
27
|
+
* not made the decision.
|
|
28
|
+
*/
|
|
29
|
+
const WINDOWS: Record<string, { width: ResultWindowWidth; why: string }> = {
|
|
30
|
+
'brainstorm/BrainstormWindow.vue': {
|
|
31
|
+
width: 'full',
|
|
32
|
+
why: 'options column + the choose/dismiss action rail',
|
|
33
|
+
},
|
|
34
|
+
'clarity/ClarityReviewWindow.vue': {
|
|
35
|
+
width: 'full',
|
|
36
|
+
why: 'findings column + the answer/dismiss action rail',
|
|
37
|
+
},
|
|
38
|
+
'consensus/ConsensusSessionWindow.vue': {
|
|
39
|
+
width: '5xl',
|
|
40
|
+
why: 'one stacked column of participant prose — no rail competing with it, so width would only lengthen lines',
|
|
41
|
+
},
|
|
42
|
+
'docs/DocInterviewWindow.vue': { width: '3xl', why: 'one column of interview question + answer' },
|
|
43
|
+
'followUp/FollowUpWindow.vue': { width: '3xl', why: 'a short list of follow-up items' },
|
|
44
|
+
'forkDecision/ForkDecisionWindow.vue': {
|
|
45
|
+
width: '3xl',
|
|
46
|
+
why: 'two proposals and a choice between them',
|
|
47
|
+
},
|
|
48
|
+
'gates/GateResultView.vue': { width: '3xl', why: 'a gate verdict — one column, short' },
|
|
49
|
+
'humanTest/HumanTestWindow.vue': {
|
|
50
|
+
width: '3xl',
|
|
51
|
+
why: 'one instruction plus a pass/fail control',
|
|
52
|
+
},
|
|
53
|
+
'initiative/InitiativePlanningWindow.vue': {
|
|
54
|
+
width: '4xl',
|
|
55
|
+
why: 'a planning-progress readout, one column',
|
|
56
|
+
},
|
|
57
|
+
'initiative/InitiativeTrackerWindow.vue': {
|
|
58
|
+
width: 'full',
|
|
59
|
+
why: 'tracker column + run-metadata rail, and it hands its whole body to the three-column plan review while a plan is parked',
|
|
60
|
+
},
|
|
61
|
+
'judge/JudgeResultView.vue': { width: '3xl', why: 'a rubric verdict — one column, short' },
|
|
62
|
+
'panels/GenericStructuredResultView.vue': {
|
|
63
|
+
width: '4xl',
|
|
64
|
+
why: 'the fallback structured-result reader, one column of sections',
|
|
65
|
+
},
|
|
66
|
+
'panels/MergerResultView.vue': {
|
|
67
|
+
width: '3xl',
|
|
68
|
+
why: 'the merge verdict and its scores — one column, short (the slice-5 pilot)',
|
|
69
|
+
},
|
|
70
|
+
'prReview/PrReviewWindow.vue': {
|
|
71
|
+
width: 'full',
|
|
72
|
+
why: 'per-file findings with paths, line numbers and suggested fixes, + a rail',
|
|
73
|
+
},
|
|
74
|
+
'ralph/RalphLoopResultView.vue': { width: '3xl', why: 'a loop status readout, one column' },
|
|
75
|
+
'requirements/RequirementsReviewWindow.vue': {
|
|
76
|
+
width: 'full',
|
|
77
|
+
why: 'findings column + the answer/dismiss action rail',
|
|
78
|
+
},
|
|
79
|
+
'spec/ServiceSpecWindow.vue': {
|
|
80
|
+
width: 'full',
|
|
81
|
+
why: 'module/feature-group nav column + the spec detail column',
|
|
82
|
+
},
|
|
83
|
+
'testing/TestReportWindow.vue': {
|
|
84
|
+
width: 'full',
|
|
85
|
+
why: 'scenario/outcome/concern tree + run-metadata rail',
|
|
86
|
+
},
|
|
87
|
+
'visualConfirm/VisualConfirmationWindow.vue': {
|
|
88
|
+
width: '5xl',
|
|
89
|
+
why: 'a screenshot grid whose full-bleed reading is the nested ArtifactLightbox, not this window',
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Anchored on the vitest root (`frontend/app`) rather than `import.meta.url`: the `happy-dom`
|
|
94
|
+
// environment replaces the global `URL`, and `fileURLToPath` then rejects its own file: URLs.
|
|
95
|
+
const componentsDir = resolve(process.cwd(), 'app/components')
|
|
96
|
+
|
|
97
|
+
/** Every component that mounts the shell, keyed by its path relative to `app/components`. */
|
|
98
|
+
function findConsumers(): Map<string, string> {
|
|
99
|
+
const found = new Map<string, string>()
|
|
100
|
+
for (const entry of readdirSync(componentsDir, { recursive: true, encoding: 'utf8' })) {
|
|
101
|
+
const rel = entry.replace(/\\/g, '/')
|
|
102
|
+
// The shell itself names its own tag in its header comment — it is not a consumer.
|
|
103
|
+
if (!rel.endsWith('.vue') || rel.endsWith('panels/ResultWindowShell.vue')) continue
|
|
104
|
+
const source = readFileSync(`${componentsDir}/${rel}`, 'utf8')
|
|
105
|
+
if (source.includes('<ResultWindowShell')) found.set(rel, source)
|
|
106
|
+
}
|
|
107
|
+
return found
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The bucket a component passes, or the shell's default when it passes none. */
|
|
111
|
+
function declaredWidth(source: string): ResultWindowWidth {
|
|
112
|
+
const match = /<ResultWindowShell[\s\S]*?\swidth="([^"]+)"/.exec(source)
|
|
113
|
+
return (match?.[1] as ResultWindowWidth | undefined) ?? SHELL_DEFAULT_WIDTH
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
describe('result-window width buckets', () => {
|
|
117
|
+
const consumers = findConsumers()
|
|
118
|
+
|
|
119
|
+
it('finds the shell consumers at all (the scan is doing real work)', () => {
|
|
120
|
+
expect(existsSync(componentsDir), `no components dir at ${componentsDir}`).toBe(true)
|
|
121
|
+
expect(consumers.size).toBeGreaterThan(10)
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('covers every consumer, with no stale rows', () => {
|
|
125
|
+
expect([...consumers.keys()].sort()).toEqual(Object.keys(WINDOWS).sort())
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('matches what each window actually passes', () => {
|
|
129
|
+
const actual = [...consumers.entries()].map(([file, source]) => [file, declaredWidth(source)])
|
|
130
|
+
const declared = Object.entries(WINDOWS).map(([file, row]) => [file, row.width])
|
|
131
|
+
expect(Object.fromEntries(actual)).toEqual(Object.fromEntries(declared))
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('makes every window state a reason for its bucket', () => {
|
|
135
|
+
for (const [file, row] of Object.entries(WINDOWS)) {
|
|
136
|
+
expect(row.why.length, `${file} must say why it takes \`${row.width}\``).toBeGreaterThan(20)
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
// The obligation the shell cannot enforce on its own slot content: a `full` window's continuous
|
|
141
|
+
// prose carries the step reader's measure, or the extra width lands as 200-character lines. A
|
|
142
|
+
// window with none anywhere is the shape this catches — it either has no prose (say so by
|
|
143
|
+
// pointing at the measure it does not need) or it forgot.
|
|
144
|
+
it('holds every `full` window to the prose reading measure', () => {
|
|
145
|
+
for (const [file, row] of Object.entries(WINDOWS)) {
|
|
146
|
+
if (row.width !== 'full') continue
|
|
147
|
+
const source = consumers.get(file)
|
|
148
|
+
expect(
|
|
149
|
+
source?.includes(PROSE_MEASURE_CLASS),
|
|
150
|
+
`${file} is \`full\`, so its continuous prose must carry \`${PROSE_MEASURE_CLASS}\``,
|
|
151
|
+
).toBe(true)
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
describe('RESULT_WINDOW_WIDTH_CLASS', () => {
|
|
157
|
+
it('caps every bucket at its own name and leaves `full` uncapped', () => {
|
|
158
|
+
expect(RESULT_WINDOW_WIDTH_CLASS).toEqual({
|
|
159
|
+
'3xl': 'max-w-3xl',
|
|
160
|
+
'4xl': 'max-w-4xl',
|
|
161
|
+
'5xl': 'max-w-5xl',
|
|
162
|
+
// Not a bigger number: the panel's `w-full` spans the backdrop and the variant's gutter
|
|
163
|
+
// (`m-4` / `p-4`) is the only inset. A cap here would reintroduce the indefensible number
|
|
164
|
+
// `full` exists to avoid.
|
|
165
|
+
full: 'max-w-none',
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
it('shares one measure with the step reader', () => {
|
|
170
|
+
// `AgentStepDetail` reads prose at `mx-auto max-w-3xl`; the windows must not hold a second
|
|
171
|
+
// opinion about how wide prose should be.
|
|
172
|
+
expect(PROSE_MEASURE_CLASS).toBe('max-w-3xl')
|
|
173
|
+
})
|
|
174
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// The result-window width vocabulary, extracted from `ResultWindowShell.vue` so it can be
|
|
2
|
+
// asserted (see `ResultWindowShell.logic.spec.ts`, which pins every window's bucket against a
|
|
3
|
+
// table naming its reason — the shape `nav-contributions.spec.ts` uses for the advanced-nav set).
|
|
4
|
+
//
|
|
5
|
+
// WHICH bucket a window takes, and the reading-measure obligation `full` carries, are documented
|
|
6
|
+
// on the shell's `width` prop — that is what a window author reads. This module owns only the
|
|
7
|
+
// vocabulary and its class mapping.
|
|
8
|
+
|
|
9
|
+
/** Card width buckets — see `ResultWindowShell.vue`'s `width` prop for what picks `full`. */
|
|
10
|
+
export type ResultWindowWidth = '3xl' | '4xl' | '5xl' | 'full'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The bucket → cap mapping. `full` is deliberately `max-w-none` rather than a bigger number:
|
|
14
|
+
* the panel's `w-full` then spans the backdrop, which the variant insets by one gutter (`m-4`
|
|
15
|
+
* stretched, `p-4` centered), so the window fills the screen and still reads as a window rather
|
|
16
|
+
* than a repaint of the app. A `Record` over the union, so a new bucket fails to compile until
|
|
17
|
+
* it is mapped.
|
|
18
|
+
*/
|
|
19
|
+
export const RESULT_WINDOW_WIDTH_CLASS: Record<ResultWindowWidth, string> = {
|
|
20
|
+
'3xl': 'max-w-3xl',
|
|
21
|
+
'4xl': 'max-w-4xl',
|
|
22
|
+
'5xl': 'max-w-5xl',
|
|
23
|
+
full: 'max-w-none',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The reading measure a `full` window puts on a run of continuous prose — the step reader's own
|
|
28
|
+
* (`AgentStepDetail`, `mx-auto max-w-3xl` over the same 13px `.reader-prose`), so the surfaces
|
|
29
|
+
* cannot drift into two opinions about how wide prose should be.
|
|
30
|
+
*/
|
|
31
|
+
export const PROSE_MEASURE_CLASS = 'max-w-3xl'
|
|
@@ -26,6 +26,10 @@ import StepRestartControl from '~/components/panels/StepRestartControl.vue'
|
|
|
26
26
|
import StepEffortReport from '~/components/panels/StepEffortReport.vue'
|
|
27
27
|
import StepValidationReport from '~/components/panels/StepValidationReport.vue'
|
|
28
28
|
import { effortBand, effortHint } from '~/utils/effort'
|
|
29
|
+
import {
|
|
30
|
+
RESULT_WINDOW_WIDTH_CLASS,
|
|
31
|
+
type ResultWindowWidth,
|
|
32
|
+
} from '~/components/panels/ResultWindowShell.logic'
|
|
29
33
|
|
|
30
34
|
/** A pipeline step reference — passed by step-result windows to surface the shared
|
|
31
35
|
* "restart from here" control. `StepRestartControl` self-hides for an off-path open
|
|
@@ -42,8 +46,38 @@ const props = withDefaults(
|
|
|
42
46
|
/** Header title (the accessible dialog name) + optional secondary line. */
|
|
43
47
|
title: string
|
|
44
48
|
subtitle?: string
|
|
45
|
-
/**
|
|
46
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Card width bucket + backdrop layout (the two pre-slice-5 chrome variants).
|
|
51
|
+
*
|
|
52
|
+
* `full` is the REVIEW/READING bucket: the panel takes the whole viewport minus the
|
|
53
|
+
* shell's own gutter, the shape the full-bleed step reader (`AgentStepDetail`) already
|
|
54
|
+
* has. It is for a window whose body lays out in COLUMNS — rails plus a fluid main
|
|
55
|
+
* column — where the width buys visible layout: the outline and the review rail stop
|
|
56
|
+
* competing with the document, a findings list stops wrapping every card, a diff or a
|
|
57
|
+
* results table stops scrolling sideways. A window that is one column of prose or a
|
|
58
|
+
* short verdict keeps a bucket: stretching two paragraphs across an ultrawide reads
|
|
59
|
+
* worse, not better.
|
|
60
|
+
*
|
|
61
|
+
* The obligation that comes with it: CONTINUOUS PROSE inside a `full` window carries its
|
|
62
|
+
* own reading measure (`PROSE_MEASURE_CLASS`, the step reader's own, over the same 13px
|
|
63
|
+
* `.reader-prose`), or the width lands as 200-character lines.
|
|
64
|
+
*
|
|
65
|
+
* The unit that obligation attaches to is the PARAGRAPH, not the section — which is the
|
|
66
|
+
* distinction to get right, because "a findings list reads better at the full span" is
|
|
67
|
+
* true of the LIST and false of the prose inside each row. A list's rows, badge rows,
|
|
68
|
+
* control rows, tables, Gherkin blocks, log tails and inputs all take the span; a
|
|
69
|
+
* finding's detail, a recorded answer, an investigator's justification and a summary
|
|
70
|
+
* paragraph are prose wherever they sit, and take the measure. Sizing by section is how a
|
|
71
|
+
* card whose answer control is STACKED under its question — every finding card here —
|
|
72
|
+
* ends up arguing that its question is "beside" something and keeping 200-character lines.
|
|
73
|
+
*
|
|
74
|
+
* What `full` costs: click-outside effectively goes, since the backdrop is then only the
|
|
75
|
+
* shell's own gutter. That is the same trade the full-bleed reader already makes (it has
|
|
76
|
+
* no backdrop close at all), and Escape plus the header's close button — the two paths a
|
|
77
|
+
* keyboard and a pointer user actually reach for — are untouched. A window that wants
|
|
78
|
+
* click-outside to stay hittable is a window that should have kept a bucket.
|
|
79
|
+
*/
|
|
80
|
+
width?: ResultWindowWidth
|
|
47
81
|
variant?: 'stretch' | 'centered'
|
|
48
82
|
/** Provide on step-result windows to show the shared restart control; omit on gates
|
|
49
83
|
* and block-keyed windows (no restart mid-gate / pre-run). */
|
|
@@ -119,18 +153,13 @@ const chipClass = computed(() =>
|
|
|
119
153
|
effortReport.value ? CHIP_CLASS[effortBand(effortReport.value.difficulty)] : '',
|
|
120
154
|
)
|
|
121
155
|
|
|
122
|
-
const WIDTH: Record<'3xl' | '4xl' | '5xl', string> = {
|
|
123
|
-
'3xl': 'max-w-3xl',
|
|
124
|
-
'4xl': 'max-w-4xl',
|
|
125
|
-
'5xl': 'max-w-5xl',
|
|
126
|
-
}
|
|
127
156
|
const backdropClass = computed(() => [
|
|
128
157
|
'fixed inset-0 z-50 flex max-h-[100dvh] justify-center bg-slate-950/70 backdrop-blur-sm',
|
|
129
158
|
props.variant === 'centered' ? 'items-center p-4' : 'items-stretch',
|
|
130
159
|
])
|
|
131
160
|
const panelClass = computed(() => [
|
|
132
161
|
'flex w-full flex-col overflow-hidden rounded-2xl border border-slate-800 bg-slate-900 shadow-2xl',
|
|
133
|
-
|
|
162
|
+
RESULT_WINDOW_WIDTH_CLASS[props.width],
|
|
134
163
|
props.variant === 'centered' ? 'max-h-[90dvh]' : 'm-4',
|
|
135
164
|
])
|
|
136
165
|
</script>
|
|
@@ -266,7 +266,7 @@ async function onDismiss(id: string): Promise<void> {
|
|
|
266
266
|
icon-class="bg-indigo-500/15 text-indigo-300"
|
|
267
267
|
:title="block ? t('prReview.titleWithBlock', { title: block.title }) : t('prReview.title')"
|
|
268
268
|
:subtitle="t('prReview.subtitle')"
|
|
269
|
-
width="
|
|
269
|
+
width="full"
|
|
270
270
|
testid="pr-review-window"
|
|
271
271
|
@close="close"
|
|
272
272
|
>
|
|
@@ -525,10 +525,11 @@ async function onDismiss(id: string): Promise<void> {
|
|
|
525
525
|
</p>
|
|
526
526
|
</div>
|
|
527
527
|
|
|
528
|
-
<!-- The reviewer's overall assessment.
|
|
528
|
+
<!-- The reviewer's overall assessment. Prose, so it takes the reading measure (see the
|
|
529
|
+
shell's `width` prop) — this window is `full`-width. -->
|
|
529
530
|
<p
|
|
530
531
|
v-if="state?.summary"
|
|
531
|
-
class="mb-3 rounded-md bg-slate-800/50 px-3 py-2 text-[12px] text-slate-300"
|
|
532
|
+
class="mb-3 max-w-3xl rounded-md bg-slate-800/50 px-3 py-2 text-[12px] text-slate-300"
|
|
532
533
|
>
|
|
533
534
|
<span class="text-slate-500">{{ t('prReview.summaryLabel') }}</span>
|
|
534
535
|
{{ state.summary }}
|
|
@@ -579,7 +580,7 @@ async function onDismiss(id: string): Promise<void> {
|
|
|
579
580
|
<h3 class="mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-slate-400">
|
|
580
581
|
{{ g.title }}
|
|
581
582
|
</h3>
|
|
582
|
-
<p v-if="g.rationale" class="mb-1.5 text-[11px] text-slate-500">
|
|
583
|
+
<p v-if="g.rationale" class="mb-1.5 max-w-3xl text-[11px] text-slate-500">
|
|
583
584
|
{{ g.rationale }}
|
|
584
585
|
</p>
|
|
585
586
|
<article
|
|
@@ -672,15 +673,22 @@ async function onDismiss(id: string): Promise<void> {
|
|
|
672
673
|
· {{ t('prReview.line', { line: f.line }) }}</template
|
|
673
674
|
>
|
|
674
675
|
</p>
|
|
676
|
+
<!-- The reviewer's prose — what the finding is, what to do about it, and the
|
|
677
|
+
investigator's verdict below. Each takes the reading measure even though
|
|
678
|
+
the card around it takes the span (see the shell's `width` prop: the unit
|
|
679
|
+
is the paragraph, not the section). This window went from the NARROWEST
|
|
680
|
+
bucket to `full`, so these are the three paragraphs the width would
|
|
681
|
+
otherwise have stretched furthest; the path/line row, the badges and the
|
|
682
|
+
per-finding actions are what it is actually for. -->
|
|
675
683
|
<p
|
|
676
|
-
class="mt-1 whitespace-pre-wrap text-[12px] text-slate-300"
|
|
684
|
+
class="mt-1 max-w-3xl whitespace-pre-wrap text-[12px] text-slate-300"
|
|
677
685
|
:class="isRetracted(f) ? 'line-through' : ''"
|
|
678
686
|
>
|
|
679
687
|
{{ f.detail }}
|
|
680
688
|
</p>
|
|
681
689
|
<p
|
|
682
690
|
v-if="f.suggestedFix"
|
|
683
|
-
class="mt-1 whitespace-pre-wrap rounded-md bg-slate-800/50 px-2 py-1 text-[11px] text-slate-300"
|
|
691
|
+
class="mt-1 max-w-3xl whitespace-pre-wrap rounded-md bg-slate-800/50 px-2 py-1 text-[11px] text-slate-300"
|
|
684
692
|
>
|
|
685
693
|
<span class="text-slate-500">{{ t('prReview.suggestedFix') }}</span>
|
|
686
694
|
{{ f.suggestedFix }}
|
|
@@ -691,7 +699,7 @@ async function onDismiss(id: string): Promise<void> {
|
|
|
691
699
|
<p
|
|
692
700
|
v-if="f.challenge?.justification"
|
|
693
701
|
data-testid="pr-review-finding-justification"
|
|
694
|
-
class="mt-1.5 whitespace-pre-wrap rounded-md px-2 py-1 text-[11px]"
|
|
702
|
+
class="mt-1.5 max-w-3xl whitespace-pre-wrap rounded-md px-2 py-1 text-[11px]"
|
|
695
703
|
:class="
|
|
696
704
|
isRetracted(f)
|
|
697
705
|
? 'bg-rose-500/10 text-rose-200'
|
|
@@ -653,7 +653,7 @@ async function resolveExceeded(choice: 'extra-round' | 'proceed' | 'stop-reset')
|
|
|
653
653
|
:subtitle="block?.title"
|
|
654
654
|
:step-ref="{ instanceId, stepIndex }"
|
|
655
655
|
variant="centered"
|
|
656
|
-
width="
|
|
656
|
+
width="full"
|
|
657
657
|
@close="close"
|
|
658
658
|
>
|
|
659
659
|
<template v-if="review" #header-extras>
|
|
@@ -796,7 +796,11 @@ async function resolveExceeded(choice: 'extra-round' | 'proceed' | 'stop-reset')
|
|
|
796
796
|
{{ STATUS_LABELS[item.status] }}
|
|
797
797
|
</UBadge>
|
|
798
798
|
</div>
|
|
799
|
-
|
|
799
|
+
<!-- The reviewer's question is prose, so it takes the measure even though the
|
|
800
|
+
card around it takes the span (see the shell's `width` prop: the unit is
|
|
801
|
+
the paragraph, not the section). The badge row above and the mode buttons
|
|
802
|
+
and textarea below are what the full width is actually for. -->
|
|
803
|
+
<p class="mt-1 max-w-3xl whitespace-pre-line text-sm text-slate-400">
|
|
800
804
|
{{ item.detail }}
|
|
801
805
|
</p>
|
|
802
806
|
|
|
@@ -804,7 +808,7 @@ async function resolveExceeded(choice: 'extra-round' | 'proceed' | 'stop-reset')
|
|
|
804
808
|
ones the answer lives in the textarea below, seeded from the reply) -->
|
|
805
809
|
<div
|
|
806
810
|
v-if="item.reply && item.status !== 'open' && item.status !== 'answered'"
|
|
807
|
-
class="mt-2 rounded-md border-s-2 border-slate-700 bg-slate-950/40 px-3 py-1.5 text-sm text-slate-300"
|
|
811
|
+
class="mt-2 max-w-3xl rounded-md border-s-2 border-slate-700 bg-slate-950/40 px-3 py-1.5 text-sm text-slate-300"
|
|
808
812
|
>
|
|
809
813
|
<span class="text-[10px] uppercase tracking-wide text-slate-500">
|
|
810
814
|
{{ t('requirements.answerLabel') }}
|
|
@@ -925,7 +929,9 @@ async function resolveExceeded(choice: 'extra-round' | 'proceed' | 'stop-reset')
|
|
|
925
929
|
>
|
|
926
930
|
{{ GROUNDING_LABELS[rec.groundedIn] }}
|
|
927
931
|
</UBadge>
|
|
928
|
-
|
|
932
|
+
<!-- The Writer's suggested answer — agent prose, so it takes the
|
|
933
|
+
measure like the finding's own question above it. -->
|
|
934
|
+
<p class="mt-1 max-w-3xl whitespace-pre-line text-sm text-slate-300">
|
|
929
935
|
{{ rec.recommendedText }}
|
|
930
936
|
</p>
|
|
931
937
|
<div class="mt-2 flex flex-wrap items-center gap-2">
|
|
@@ -1037,7 +1043,11 @@ async function resolveExceeded(choice: 'extra-round' | 'proceed' | 'stop-reset')
|
|
|
1037
1043
|
}}
|
|
1038
1044
|
</span>
|
|
1039
1045
|
</button>
|
|
1040
|
-
|
|
1046
|
+
<!-- The same reading measure the findings' own prose takes above (see the shell's
|
|
1047
|
+
`width` prop): the window is `full`-width now, and this is continuous prose that
|
|
1048
|
+
would otherwise run to 200-character lines. Left-aligned rather than centred, so
|
|
1049
|
+
it starts where every finding above it starts. -->
|
|
1050
|
+
<div v-show="!docCollapsed" class="max-w-3xl">
|
|
1041
1051
|
<div v-for="s in outline.sections" :key="s.id" class="mb-2">
|
|
1042
1052
|
<button
|
|
1043
1053
|
v-if="s.title"
|
|
@@ -185,7 +185,7 @@ function kindLabel(item: RequirementItem): string {
|
|
|
185
185
|
:title="t('spec.title')"
|
|
186
186
|
:subtitle="block ? spec?.service || block.title : undefined"
|
|
187
187
|
variant="centered"
|
|
188
|
-
width="
|
|
188
|
+
width="full"
|
|
189
189
|
@close="close"
|
|
190
190
|
>
|
|
191
191
|
<!-- view toggle: Gherkin only when the spec (and its feature files) are on main -->
|
|
@@ -318,7 +318,10 @@ function kindLabel(item: RequirementItem): string {
|
|
|
318
318
|
<!-- service overview -->
|
|
319
319
|
<template v-if="selected === null">
|
|
320
320
|
<h2 class="text-lg font-semibold text-white">{{ spec?.service }}</h2>
|
|
321
|
-
|
|
321
|
+
<!-- The service's own prose, so it takes the reading measure the shell's `full` width
|
|
322
|
+
obliges (see the `width` prop). The requirement rows and Gherkin blocks below keep
|
|
323
|
+
the full span — they are structure, not paragraphs. -->
|
|
324
|
+
<p v-if="spec?.summary" class="mt-2 max-w-3xl whitespace-pre-line text-sm text-slate-300">
|
|
322
325
|
{{ spec.summary }}
|
|
323
326
|
</p>
|
|
324
327
|
<p v-else class="mt-2 text-sm text-slate-500">{{ t('spec.noSummary') }}</p>
|
|
@@ -352,7 +355,7 @@ function kindLabel(item: RequirementItem): string {
|
|
|
352
355
|
{{ selectedModule?.name }}
|
|
353
356
|
</div>
|
|
354
357
|
<h2 class="text-lg font-semibold text-white">{{ selectedGroup.name }}</h2>
|
|
355
|
-
<p v-if="selectedGroup.summary" class="mt-1 text-sm text-slate-400">
|
|
358
|
+
<p v-if="selectedGroup.summary" class="mt-1 max-w-3xl text-sm text-slate-400">
|
|
356
359
|
{{ selectedGroup.summary }}
|
|
357
360
|
</p>
|
|
358
361
|
|
|
@@ -500,7 +503,7 @@ function kindLabel(item: RequirementItem): string {
|
|
|
500
503
|
<UIcon name="i-lucide-shield-check" class="h-3.5 w-3.5" />
|
|
501
504
|
{{ t('spec.domainRules') }}
|
|
502
505
|
</div>
|
|
503
|
-
<ul class="space-y-1.5">
|
|
506
|
+
<ul class="max-w-3xl space-y-1.5">
|
|
504
507
|
<li
|
|
505
508
|
v-for="rule in selectedGroup.rules ?? []"
|
|
506
509
|
:key="rule.id"
|
|
@@ -313,7 +313,7 @@ const GROUP_STATUS_META: Record<ScenarioGroup['status'], { icon: string; text: s
|
|
|
313
313
|
:title="headerTitle"
|
|
314
314
|
:subtitle="t('testing.subtitle')"
|
|
315
315
|
:step-ref="{ instanceId, stepIndex }"
|
|
316
|
-
width="
|
|
316
|
+
width="full"
|
|
317
317
|
testid="tester-report-window"
|
|
318
318
|
@close="close"
|
|
319
319
|
>
|
|
@@ -489,7 +489,7 @@ const GROUP_STATUS_META: Record<ScenarioGroup['status'], { icon: string; text: s
|
|
|
489
489
|
:icon="a.outcome === 'completed' ? 'i-lucide-wrench' : 'i-lucide-circle-x'"
|
|
490
490
|
:icon-class="a.outcome === 'completed' ? 'text-amber-300' : 'text-rose-400'"
|
|
491
491
|
/>
|
|
492
|
-
<p v-if="a.summary" class="mt-1 text-[12px] leading-snug text-slate-400">
|
|
492
|
+
<p v-if="a.summary" class="mt-1 max-w-3xl text-[12px] leading-snug text-slate-400">
|
|
493
493
|
{{ a.summary }}
|
|
494
494
|
</p>
|
|
495
495
|
<div v-if="a.concerns && a.concerns.length" class="mt-1.5">
|
|
@@ -607,8 +607,13 @@ const GROUP_STATUS_META: Record<ScenarioGroup['status'], { icon: string; text: s
|
|
|
607
607
|
</div>
|
|
608
608
|
|
|
609
609
|
<template v-else>
|
|
610
|
-
<!-- Summary
|
|
611
|
-
|
|
610
|
+
<!-- Summary — the tester's own prose, so it takes the reading measure the shell's `full`
|
|
611
|
+
width obliges (see the `width` prop). The scenario rows and log tails below keep the
|
|
612
|
+
full span. -->
|
|
613
|
+
<p
|
|
614
|
+
v-if="report.summary"
|
|
615
|
+
class="mb-4 max-w-3xl text-[13px] leading-relaxed text-slate-300"
|
|
616
|
+
>
|
|
612
617
|
{{ report.summary }}
|
|
613
618
|
</p>
|
|
614
619
|
|
|
@@ -675,7 +680,7 @@ const GROUP_STATUS_META: Record<ScenarioGroup['status'], { icon: string; text: s
|
|
|
675
680
|
/>
|
|
676
681
|
<div class="min-w-0">
|
|
677
682
|
<span class="text-[13px] text-slate-200">{{ o.name }}</span>
|
|
678
|
-
<p v-if="o.detail" class="text-[12px] leading-snug text-slate-400">
|
|
683
|
+
<p v-if="o.detail" class="max-w-3xl text-[12px] leading-snug text-slate-400">
|
|
679
684
|
{{ o.detail }}
|
|
680
685
|
</p>
|
|
681
686
|
</div>
|
|
@@ -705,7 +710,7 @@ const GROUP_STATUS_META: Record<ScenarioGroup['status'], { icon: string; text: s
|
|
|
705
710
|
{{ SEVERITY_LABELS[c.severity] }}
|
|
706
711
|
</span>
|
|
707
712
|
</div>
|
|
708
|
-
<p v-if="c.detail" class="text-[12px] leading-snug text-slate-400">
|
|
713
|
+
<p v-if="c.detail" class="max-w-3xl text-[12px] leading-snug text-slate-400">
|
|
709
714
|
{{ c.detail }}
|
|
710
715
|
</p>
|
|
711
716
|
</div>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
isSafeTargetId,
|
|
4
|
+
isTargetClickAdvance,
|
|
5
|
+
resolveSkip,
|
|
6
|
+
stepTargetIds,
|
|
7
|
+
stepTargetSelectors,
|
|
8
|
+
tourWasAbridged,
|
|
9
|
+
waitBudgetMs,
|
|
10
|
+
} from '~/components/tutorial/TutorialOverlay.logic'
|
|
11
|
+
import { DEFAULT_TARGET_WAIT_MS } from '~/utils/tutorial'
|
|
12
|
+
import type { TutorialStep } from '~/utils/tutorial'
|
|
13
|
+
|
|
14
|
+
const step = (over: Partial<TutorialStep> = {}): TutorialStep => ({
|
|
15
|
+
id: 'a-step',
|
|
16
|
+
titleKey: 'tutorial.tours.x.steps.a.title',
|
|
17
|
+
bodyKey: 'tutorial.tours.x.steps.a.body',
|
|
18
|
+
...over,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('stepTargetIds', () => {
|
|
22
|
+
it('lists the target then its fallbacks, in order', () => {
|
|
23
|
+
expect(
|
|
24
|
+
stepTargetIds(step({ target: 'frame-add-task', altTargets: ['frame-add-task-empty'] })),
|
|
25
|
+
).toEqual(['frame-add-task', 'frame-add-task-empty'])
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('is empty for an untargeted (centered) step', () => {
|
|
29
|
+
expect(stepTargetIds(step())).toEqual([])
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
describe('isSafeTargetId', () => {
|
|
34
|
+
it('accepts the kebab-case ids the repo actually uses', () => {
|
|
35
|
+
for (const id of ['task-card', 'add-task-submit', 'board-fit-view', 'nav-tutorial', 'h2'])
|
|
36
|
+
expect(isSafeTargetId(id), id).toBe(true)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('rejects anything that could end up inside a selector as syntax', () => {
|
|
40
|
+
for (const id of ['od"d', "od'd", 'back\\slash', 'a b', 'a]b', 'Upper', ''])
|
|
41
|
+
expect(isSafeTargetId(id), id).toBe(false)
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
describe('stepTargetSelectors', () => {
|
|
46
|
+
it('builds the data-testid selectors, target first then fallbacks', () => {
|
|
47
|
+
const s = step({ target: 'frame-add-task', altTargets: ['frame-add-task-empty'] })
|
|
48
|
+
expect(stepTargetSelectors(s)).toEqual([
|
|
49
|
+
'[data-testid="frame-add-task"]',
|
|
50
|
+
'[data-testid="frame-add-task-empty"]',
|
|
51
|
+
])
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('drops a malformed id rather than building a selector that could throw', () => {
|
|
55
|
+
// A tour is DATA a consumer deployment authors, so an id arrives from outside this
|
|
56
|
+
// package. A bad one must degrade to "anchor not found" (a skipped step) — NOT to a
|
|
57
|
+
// SyntaxError raised out of the 150ms tracking interval, several times a second.
|
|
58
|
+
const s = step({ target: 'od"d', altTargets: ['task-card'] })
|
|
59
|
+
expect(stepTargetSelectors(s)).toEqual(['[data-testid="task-card"]'])
|
|
60
|
+
for (const selector of stepTargetSelectors(s))
|
|
61
|
+
expect(() => document.querySelector(selector)).not.toThrow()
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('is empty for an untargeted step', () => {
|
|
65
|
+
expect(stepTargetSelectors(step())).toEqual([])
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('waitBudgetMs', () => {
|
|
70
|
+
it('defaults, and honours a step that waits on a just-opened modal', () => {
|
|
71
|
+
expect(waitBudgetMs(step())).toBe(DEFAULT_TARGET_WAIT_MS)
|
|
72
|
+
expect(waitBudgetMs(step({ waitForTargetMs: 8000 }))).toBe(8000)
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
describe('resolveSkip', () => {
|
|
77
|
+
it('continues forward past a missing anchor', () => {
|
|
78
|
+
expect(resolveSkip(1, 'forward', 4)).toEqual({ kind: 'move', index: 2 })
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('completes the tour when the last step is the one that went missing', () => {
|
|
82
|
+
expect(resolveSkip(3, 'forward', 4)).toEqual({ kind: 'complete' })
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('keeps travelling BACK when the user is stepping backwards', () => {
|
|
86
|
+
// Otherwise Back onto a step this deployment does not render bounces the user
|
|
87
|
+
// straight forward again, making the button unusable exactly where it is needed.
|
|
88
|
+
expect(resolveSkip(2, 'back', 4)).toEqual({ kind: 'move', index: 1 })
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
it('reverses to forward rather than pinning on the first step', () => {
|
|
92
|
+
expect(resolveSkip(0, 'back', 4)).toEqual({ kind: 'move', index: 1 })
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('completes a single-step tour whose only anchor never appeared', () => {
|
|
96
|
+
expect(resolveSkip(0, 'back', 1)).toEqual({ kind: 'complete' })
|
|
97
|
+
expect(resolveSkip(0, 'forward', 1)).toEqual({ kind: 'complete' })
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
describe('isTargetClickAdvance', () => {
|
|
102
|
+
const el = document.createElement('button')
|
|
103
|
+
const child = document.createElement('span')
|
|
104
|
+
el.appendChild(child)
|
|
105
|
+
|
|
106
|
+
it('advances on a real click on the highlighted control, or inside it', () => {
|
|
107
|
+
const s = step({ target: 'add-task-submit', advanceOn: 'target-click' })
|
|
108
|
+
expect(isTargetClickAdvance(s, el, el)).toBe(true)
|
|
109
|
+
expect(isTargetClickAdvance(s, el, child)).toBe(true)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('ignores clicks elsewhere, on a Next-advanced step, or with no anchor', () => {
|
|
113
|
+
const s = step({ target: 'add-task-submit', advanceOn: 'target-click' })
|
|
114
|
+
expect(isTargetClickAdvance(s, el, document.createElement('div'))).toBe(false)
|
|
115
|
+
expect(isTargetClickAdvance(s, null, el)).toBe(false)
|
|
116
|
+
expect(isTargetClickAdvance(step({ target: 'x' }), el, el)).toBe(false)
|
|
117
|
+
expect(isTargetClickAdvance(null, el, el)).toBe(false)
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
describe('tourWasAbridged', () => {
|
|
122
|
+
it('is true once any step was skipped, so the finish card can say so', () => {
|
|
123
|
+
expect(tourWasAbridged(new Set())).toBe(false)
|
|
124
|
+
expect(tourWasAbridged(new Set(['addTask']))).toBe(true)
|
|
125
|
+
})
|
|
126
|
+
})
|