From 4c2d03fce32b6b56064172e55630322a87aa08d5 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 06:09:28 +0000 Subject: [PATCH] Refine edge labels and layout Improve edge label readability by using red outlines for negated conditions and rounded rectangles for specific conditions. Adjust graph layout to occupy full width for better scaling. --- src/components/DogsBunnyPuzzle.tsx | 97 ++++++++++++++++++------------ 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/src/components/DogsBunnyPuzzle.tsx b/src/components/DogsBunnyPuzzle.tsx index 3988413..9422319 100644 --- a/src/components/DogsBunnyPuzzle.tsx +++ b/src/components/DogsBunnyPuzzle.tsx @@ -344,8 +344,8 @@ const DogsBunnyPuzzle: React.FC = ({
{/* Edges */} @@ -369,50 +369,67 @@ const DogsBunnyPuzzle: React.FC = ({ strokeWidth={isValid ? "3" : "1"} strokeDasharray={isValid ? "none" : "5,5"} /> - {/* Condition icons */} - {edge.conditions.slice(0, 2).map((condition, condIndex) => ( - + {/* Condition labels */} + {edge.conditions.length === 1 ? ( + // Single condition - use circle with red outline for negated + + + {getConditionIcon(edge.conditions[0])} + + {formatCondition(edge.conditions[0])} + + ) : ( + // Multiple conditions - use rounded rectangle + + - - {condition.includes('NOBODY') ? '❌' : ''} - {getConditionIcon(condition)} - - {formatCondition(condition)} - - ))} - {edge.conditions.length > 2 && ( - - - - +{edge.conditions.length - 2} - - {edge.conditions.slice(2).map(formatCondition).join(', ')} + {edge.conditions.slice(0, 3).map((condition, condIndex) => ( + + {getConditionIcon(condition)} + + ))} + {edge.conditions.length > 3 && ( + + +{edge.conditions.length - 3} + + )} + {edge.conditions.map(formatCondition).join(', ')} )}