# UI Improvements: Before & After Examples Visual comparison of key UI improvements with code examples. --- ## 1. Button States - Primary Action ### BEFORE ```tsx ``` **Issues:** - Grayscale filter on disabled state looks unprofessional - No active/press state feedback - No focus state for keyboard navigation - Generic blue color, not semantic - Rounded corners too subtle (4px) ### AFTER ```tsx ``` **Improvements:** - Semantic color token (primary) - Clear disabled state (gray, no grayscale filter) - Press feedback (scale down on click) - Visible focus ring for accessibility - Slightly larger border radius (8px) - ARIA label for screen readers - Smooth transitions **Visual Impact:** ``` BEFORE: [Connect to Machine] → (hover) [Connect to Machine] → (disabled) [Connect to Machine] Normal appearance Darker blue + shadow Washed out grayscale AFTER: [Connect to Machine] → (hover) [Connect to Machine] → (disabled) [Connect to Machine] Blue with shadow Lighter blue, grows 2% Clean gray appearance ``` --- ## 2. Color Block Status - Progress Monitor ### BEFORE ```tsx
Thread {block.colorIndex + 1} {isCompleted ? : null} {isCurrent ? : null} {!isCompleted && !isCurrent ? : null} {block.stitchCount.toLocaleString()}
{isCurrent && (
)}
``` **Issues:** - Small color swatch (20px) - Thin progress bar (4px) - Small stitch count text (12px) - Minimal visual distinction between states - Upcoming blocks just fade (opacity-60) - Tight spacing (gap-2) ### AFTER ```tsx
Thread {block.colorIndex + 1} {isCompleted && } {isCurrent && } {!isCompleted && !isCurrent && } {block.stitchCount.toLocaleString()}
{isCurrent && (
)}
``` **Improvements:** - Larger color swatch (24px) - easier to see - Thicker progress bar (6px) - clearer progress indication - Larger stitch count (14px) - more readable - Current block has ring + glow + slight scale - More spacing (gap-3, p-3) - ARIA labels for accessibility - Semantic color tokens - Better rounded corners on swatch **Visual Impact:** ``` BEFORE - Upcoming: [■ Thread 1 ○ 1,234] Faded gray box, small swatch BEFORE - Current: [■ Thread 2 → 2,456] Blue border, thin progress bar BEFORE - Complete: [■ Thread 3 ✓ 1,890] Green border AFTER - Upcoming: [■ Thread 1 ○ 1,234] Subtle gray, clear upcoming state AFTER - Current: [■ Thread 2 → 2,456] Blue glow ring, prominent, thicker progress AFTER - Complete: [■ Thread 3 ✓ 1,890] Green with subtle shadow, completed ``` --- ## 3. Section Headers ### BEFORE ```tsx

Pattern Preview

``` **Issues:** - Heavy bottom border (2px) but weak separation - Border too dark (gray-300) - Font weight only semibold (not bold) - No container grouping ### AFTER ```tsx

Pattern Preview

``` **Improvements:** - Lighter, more subtle border (1px, neutral-200) - Bolder heading (font-bold) - Explicit text color (neutral-900) - More bottom padding (pb-3) - Wrapped in container for flex control **Visual Impact:** ``` BEFORE: Pattern Preview ================== (thick dark line) AFTER: Pattern Preview ___________________ (thin subtle line) ``` --- ## 4. Workflow Stepper ### BEFORE ```tsx {/* Progress line */}
{/* Step circles */}
{isComplete ? : step.id}
{/* Labels */}
{step.label}
``` **Issues:** - Thin progress line (0.5px) - barely visible - Small step circles (32px) - Tiny text (12px) - Poor contrast for upcoming steps (blue-300 on blue-700) ### AFTER ```tsx {/* Progress line - thicker, more visible */}
{/* Step circles - larger */}
{isComplete ? : step.id}
{/* Labels - larger, better contrast */}
{step.label}
``` **Improvements:** - Thicker progress line (4px vs 2px) - Larger circles (40px vs 32px) - Bigger text (14px vs 12px) - Better contrast for text (blue-100/50 instead of 300/200) - Shadow on current step - Semantic color tokens - Letter spacing for readability **Visual Impact:** ``` BEFORE: ①---②---③---④---⑤---⑥---⑦ (small, thin line, small labels) AFTER: ①━━━②━━━③━━━④━━━⑤━━━⑥━━━⑦ (larger, bold line, bigger labels) ``` --- ## 5. Machine Connection - Status Badge ### BEFORE ```tsx {stateVisual.icon} {machineStatusName} ``` **Issues:** - No border (looks flat) - Minimal padding - No explicit inline-flex ### AFTER ```tsx {stateVisual.icon} {machineStatusName} ``` **Improvements:** - Subtle border using current color (adds depth) - Slightly more padding (3.5 vs 3, py-2 vs 1.5) - Explicit inline-flex for better alignment **Visual Impact:** ``` BEFORE: [🔄 Sewing] Flat badge, no border AFTER: [🔄 Sewing] Badge with subtle outline, more prominent ``` --- ## 6. Pattern Canvas - Overlays ### BEFORE ```tsx {/* Thread Legend */}

Threads

{/* ... */}
{/* Zoom Controls */}
{/* ... */}
``` **Issues:** - Inconsistent border radius (rounded-lg vs none) - No border on overlays - Small touch targets (32px buttons) - Mixed font sizes (13px) ### AFTER ```tsx {/* Thread Legend - unified styling */}

Threads

{pesData.threads.map((thread, index) => (
Thread {index + 1}
))}
{/* Zoom Controls - larger touch targets */}
{zoom}%
``` **Improvements:** - Unified overlay style (rounded-xl, border, neutral colors) - Larger touch targets (40px vs 32px) - Visual separators between controls - Consistent font sizes (text-sm) - ARIA labels for accessibility - Better thread swatch styling (with ring) **Visual Impact:** ``` BEFORE: ┌───────────┐ [+] 100% [-] [↻] │ Threads │ │ ■ Thread 1│ └───────────┘ AFTER: ╔═══════════╗ [+] │ 100% │ [-] [↻] ║ Threads ║ ║ ■ Thread 1║ ╚═══════════╝ (rounder, border) (larger, separated) ``` --- ## 7. FileUpload - Pattern Information ### BEFORE ```tsx
File Name: {displayFileName}
Pattern Size: {size}
{/* ... */}
``` **Issues:** - All in one gray box (low hierarchy) - Labels and values on same line (can overflow) - Tight spacing ### AFTER ```tsx
File Name
{displayFileName}
Size
{size} mm
Colors
{pesData.colorCount}
Stitches
{pesData.stitchCount.toLocaleString()}
``` **Improvements:** - 2×2 grid layout - better scannability - Individual cards for each stat - Clear label/value hierarchy - Uppercase labels with tracking - Truncation for long filenames - Better visual separation **Visual Impact:** ``` BEFORE: ┌─────────────────────────────────┐ │ File Name: pattern.pes │ │ Size: 100 × 50 mm │ │ Colors: 5 │ │ Stitches: 12,345 │ └─────────────────────────────────┘ AFTER: ┌──────────────┐ ┌──────────────┐ │ FILE NAME │ │ SIZE │ │ pattern.pes │ │ 100 × 50 mm │ └──────────────┘ └──────────────┘ ┌──────────────┐ ┌──────────────┐ │ COLORS │ │ STITCHES │ │ 5 │ │ 12,345 │ └──────────────┘ └──────────────┘ ``` --- ## 8. Progress Bar - Unified Style ### BEFORE (Upload) ```tsx
``` **Issues:** - Only upload has shimmer effect - Sewing progress bar is plain - Different bar heights in different places - Non-semantic colors ### AFTER (Unified) ```tsx {/* Reusable progress bar component */}
``` **Improvements:** - Consistent height (10px/2.5) - Shimmer on all progress bars - Semantic colors (primary) - ARIA attributes - Rounded ends (rounded-full) - Same gradient style everywhere --- ## Summary of Key Visual Changes | Element | Before | After | Impact | |---------|--------|-------|--------| | **Buttons** | Grayscale disabled, no press feedback | Clean gray disabled, scale press | Professional, accessible | | **Colors** | Mixed blues (blue-600, blue-700, cyan-600) | Semantic tokens (primary, success) | Consistent, meaningful | | **Typography** | 10-12px text common | 12-14px minimum | More readable | | **Spacing** | Varied (gap-2 to gap-6) | Standardized (2/3/4/6) | Cleaner layout | | **Touch Targets** | 32px buttons | 44px minimum | Better mobile UX | | **Borders** | Heavy (2px) or none | Subtle (1px) everywhere | Cohesive design | | **Focus States** | Missing on many elements | Ring on all interactive | Accessible | | **Shadows** | Inconsistent use | Strategic depth | Better hierarchy | | **Color Blocks** | Minimal distinction | Strong visual hierarchy | Clear progress | | **Overlays** | Mixed styles | Unified rounded-xl + border | Professional | --- ## Color Token Reference ```css Primary (actions): #2563eb (blue-600) Success (complete): #16a34a (green-600) Warning (wait): #d97706 (amber-600) Danger (errors): #dc2626 (red-600) Info (active): #0891b2 (cyan-600) Neutral text: #111827 (gray-900) Secondary text: #4b5563 (gray-600) Borders: #d1d5db (gray-300) Backgrounds: #f9fafb (gray-50) ``` --- ## Implementation Order 1. Create design tokens file 2. Update all button classes 3. Fix typography sizes 4. Standardize spacing 5. Add accessibility attributes 6. Polish details (shadows, borders) 7. Test all states (hover, active, focus, disabled) Total time: ~2.5 hours