Skip to content

Feature/refactor v 1 be#24

Merged
TVATDCI merged 8 commits into
mainfrom
feature/refactor-v-1-be
Feb 11, 2026
Merged

Feature/refactor v 1 be#24
TVATDCI merged 8 commits into
mainfrom
feature/refactor-v-1-be

Conversation

@TVATDCI
Copy link
Copy Markdown
Owner

@TVATDCI TVATDCI commented Feb 11, 2026

Phase 3: Forms & Auth (Week 3) ✅ COMPLETED

Status: All Phase 3 tasks completed successfully
Date: 2026-02-11

3.1 CharactersForm - Stepper Layout ✅

  • 4-Step Wizard: Basic Info → Stats → Relationships → Equipment
  • Step Indicator: Visual progress with numbered circles and checkmarks
  • Navigation: Previous/Next buttons with validation
  • Inline Fields: Replaced ArrayInput with native inputs for better control
  • Form Structure:
    • Step 1: Name, Species, Homeworld, Affiliation, Height
    • Step 2: Force Rating, Combat Skill, Piloting Ability, Diplomacy Rating, Is Jedi
    • Step 3: Master, Apprentices (comma-separated)
    • Step 4: Weapons, Vehicles, Notable Achievements (comma-separated)

3.2 Login/Register UX Improvements ✅

  • LoginForm.jsx:

    • Added form validation (required fields, min password length)
    • Loading state on submit button
    • Error display with red background
    • "Return to Home" and "Register here" links
    • Space-themed styling with glassmorphism card
  • RegisterForm.jsx:

    • Consistent styling with LoginForm
    • Password confirmation validation
    • Success message after registration
    • Link to login page

3.3 Form Validation ✅

  • CharactersForm:

    • Step 1 validation: Name and Species required
    • Real-time error display
    • Prevents navigation to next step if invalid
  • LoginForm:

    • Email required validation
    • Password minimum 6 characters
    • Server error display
  • RegisterForm:

    • All fields required
    • Password matching confirmation
    • User-friendly error messages

3.4 Loading States ✅

  • CharactersForm: "Saving..." text on submit button during API call
  • LoginForm: Loading state prevents double-submit
  • RegisterForm: Loading feedback during registration
  • CharacterDetail: Loading message while fetching character data

3.5 Critical Bug Fix ✅

Issue: Clicking "Next" on Step 3 jumped to /characters and auto-saved, skipping Step 4
Root Cause: SpaceBtn component wasn't preventing form submission on button click
Fix: Added e.preventDefault() in SpaceBtn's handleClick when type is "button" and no href

const handleClick = (e) => {
  // Prevent default form submission if this is a button inside a form
  if (type === 'button' && !href) {
    e.preventDefault();
  }
  // ... rest of handler
};

Files Modified

  1. frontend/src/components/CharactersForm.jsx - Stepper layout, validation, inline inputs
  2. frontend/src/components/reg-auth/LoginForm.jsx - Improved UX, validation
  3. frontend/src/components/reg-auth/RegisterForm.jsx - Improved UX, validation
  4. frontend/src/components/buttons/SpaceBtn.jsx - Fixed form submission bug
  5. frontend/src/components/form/ArrayInput.jsx - Deprecated (functionality moved inline)

Git Commits

  1. feat(forms): Add stepper layout to CharactersForm
  2. feat(forms): Add form validation to CharactersForm
  3. feat(auth): Improve LoginForm UX with validation
  4. feat(auth): Improve RegisterForm UX with validation
  5. fix(buttons): Prevent SpaceBtn from submitting form
  6. refactor(forms): Replace ArrayInput with inline inputs
  7. feat(forms): Add loading states to forms

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
star-wars-character-data-api Ready Ready Preview, Comment Feb 11, 2026 8:45pm

@TVATDCI TVATDCI merged commit 0d00426 into main Feb 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant