diff --git a/CLAUDE.md b/CLAUDE.md index 51302ae..2bbd888 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,8 @@ bun run steps:extract # Extract step definitions for tooltips - UI labels are in French - User stories are prefixed US-1 to US-26 - Screens use the sketchy component library, not Tailwind -- Specs pages use Tailwind + Shadcn components +- Specs pages use Tailwind + Shadcn components with system font (not sketchy font) +- GherkinHighlighter uses card-based layout, not code/text style --- diff --git a/docs/cucumber-integration.md b/docs/cucumber-integration.md index 0e1887f..724b4a7 100644 --- a/docs/cucumber-integration.md +++ b/docs/cucumber-integration.md @@ -316,11 +316,47 @@ Rather than checking for specific CSS selectors or test IDs, the integration use ## UI Integration -The Specs page (`#/specs`) displays feature files with: -- Collapsible scenarios (failed ones open by default) -- Test status indicators (pass/fail/skip) -- Error messages for failed tests -- Step definition source code tooltips (click "Définitions" button) +The Specs page (`#/specs`) displays feature files using the `GherkinHighlighter` component. + +### GherkinHighlighter Component + +Located at `src/components/specs/GherkinHighlighter.tsx`, this component renders Gherkin content in a card-based UI (not code/text style). + +**Key design decisions:** +- **System font**: Uses system UI font instead of the sketchy handwritten font for better readability of specifications +- **Card-based layout**: Each scenario/background is a collapsible card with colored left border +- **No header duplication**: Feature metadata (title, priority, category) is shown in `FeatureView`, not duplicated in `GherkinHighlighter` +- **Background always visible**: The "Contexte" (Background) block is always expanded since it provides essential context +- **Compact responsive design**: Reduced padding/gaps for both mobile and desktop + +**Visual features:** +- Toolbar with Expand/Collapse all and "Définitions" toggle +- Color-coded keywords: + - Blue: Given/Étant donné (preconditions) + - Amber: When/Quand (actions) + - Green: Then/Alors (assertions) + - Gray: And/Et (continuation) +- Test status icons per scenario (CheckCircle2/XCircle/AlertCircle) +- Error messages displayed inline for failed scenarios +- Step definition tooltips when "Définitions" mode is enabled +- Tables rendered as styled HTML tables with alternating row colors + +**French/English keyword support:** +The component detects both French and English Gherkin keywords for parsing steps (Étant donné/Given, Quand/When, Alors/Then, Et/And, Exemples/Examples). + +**Props:** +```typescript +interface GherkinHighlighterProps { + content: string; // Raw Gherkin file content + scenarioResults?: Array<{ // Test results per scenario + scenarioName: string; + status: 'passed' | 'failed' | 'skipped'; + errorMessage?: string; + }>; +} +``` + +### Data Layer Data is generated by build-time scripts: - `src/data/features.ts` - Parsed feature file content diff --git a/docs/prototyping-tool.md b/docs/prototyping-tool.md index 7597a03..2b5fa51 100644 --- a/docs/prototyping-tool.md +++ b/docs/prototyping-tool.md @@ -106,15 +106,27 @@ BDD specification viewer with test integration: Detailed specification page: +**Header (from FeatureView):** - Priority and category badges - Clickable user story link +- Test status summary (passed/failed/skipped) - Linked screens as buttons -- Gherkin syntax highlighting with: - - Collapsible scenarios - - Color-coded keywords - - Step definition tooltips - - Test status indicators - - Error messages for failed scenarios + +**Gherkin Display (GherkinHighlighter):** +- Card-based layout (not code/text style) for better readability +- System font (not sketchy handwritten font) for clarity +- Expand/Collapse all toolbar with "Définitions" toggle +- Background (Contexte) always visible, scenarios collapsible +- Color-coded step keywords with background highlights: + - Blue: Given/Étant donné + - Amber: When/Quand + - Green: Then/Alors + - Gray: And/Et +- Test status indicators per scenario (pass/fail/skip icons) +- Error messages displayed for failed scenarios +- Step definition tooltips (when "Définitions" mode enabled) +- Tables rendered as styled HTML tables +- Responsive design with compact padding for mobile ## Component Library