From 4ae96b0e945b217b21320b36c0c6bd07fd4363ec Mon Sep 17 00:00:00 2001 From: Sylvain Duchesne Date: Sun, 18 Jan 2026 19:43:34 +0100 Subject: [PATCH] Display user story description as multiline in specs pages - GherkinHighlighter: Render user story lines (En tant que, Je peux, Afin de) in a violet card at the top of feature details - FeatureView: Remove duplicate description display (now in GherkinHighlighter) - SpecsPage: Display feature cards in single column layout with multiline user story formatting Co-Authored-By: Claude Opus 4.5 --- src/components/specs/FeatureView.tsx | 7 +---- src/components/specs/GherkinHighlighter.tsx | 31 ++++++++++++++++++--- src/components/specs/SpecsPage.tsx | 23 +++++++++++---- 3 files changed, 46 insertions(+), 15 deletions(-) diff --git a/src/components/specs/FeatureView.tsx b/src/components/specs/FeatureView.tsx index 8f5963a..8c883de 100644 --- a/src/components/specs/FeatureView.tsx +++ b/src/components/specs/FeatureView.tsx @@ -82,14 +82,9 @@ export function FeatureView({ feature, onBack, onSelectScreen, onSelectStory }: )} -

+

{feature.name.replace(/^US-\d+\s*/, '')}

- {feature.description && ( -

- {feature.description} -

- )}
diff --git a/src/components/specs/GherkinHighlighter.tsx b/src/components/specs/GherkinHighlighter.tsx index df50cee..7378853 100644 --- a/src/components/specs/GherkinHighlighter.tsx +++ b/src/components/specs/GherkinHighlighter.tsx @@ -121,8 +121,8 @@ export function GherkinHighlighter({ content, scenarioResults = [] }: GherkinHig
- {/* Scenario/Background Blocks */} - {blocks.filter(b => b.type !== 'header').map((block, blockIndex) => ( + {/* All Blocks including header */} + {blocks.map((block, blockIndex) => ( { + const trimmed = line.trim(); + return trimmed.startsWith('En tant qu') || + trimmed.startsWith('Je peux') || + trimmed.startsWith('Je veux') || + trimmed.startsWith('Et ') || + trimmed.startsWith('Afin '); + }); + + if (userStoryLines.length === 0) return null; + + return ( + + +
+ {userStoryLines.map((line, index) => ( +
+ {line.trim()} +
+ ))} +
+
+
+ ); } const restLines = block.lines.slice(1); diff --git a/src/components/specs/SpecsPage.tsx b/src/components/specs/SpecsPage.tsx index d454d86..d896373 100644 --- a/src/components/specs/SpecsPage.tsx +++ b/src/components/specs/SpecsPage.tsx @@ -4,7 +4,7 @@ import { categoryLabels, categoryColors, priorityLabels, priorityColors, getStor import { getTestStatus, getTestSummary } from '../../data/testResults'; import { FeatureView } from './FeatureView'; import { FeatureFilter } from './FeatureFilter'; -import { Card, CardHeader, CardTitle, CardContent, CardDescription } from '../ui/card'; +import { Card, CardHeader, CardTitle, CardContent } from '../ui/card'; import { Button } from '../ui/button'; import { ArrowLeft, FileText, Monitor, CheckCircle2, XCircle, AlertCircle, ExternalLink } from 'lucide-react'; import type { ParsedFeature } from '../../types/gherkin'; @@ -146,7 +146,7 @@ export function SpecsPage({ selectedFeatureId, onBack, onSelectScreen, onSelectS -
+
{features.map(feature => ( s.trim()) + .filter(Boolean); +} + interface FeatureCardProps { feature: ParsedFeature; onClick: () => void; @@ -230,9 +239,13 @@ function FeatureCard({ feature, onClick }: FeatureCardProps) { {feature.description && ( - - {feature.description} - +
+ {formatUserStory(feature.description).map((line, i) => ( +
+ {line} +
+ ))} +
)}