2025-11-10 12:12:50 +00:00
|
|
|
|
import React, { useState } from 'react';
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
import { WizardStep, WizardStepProps } from '../../../ui/WizardModal/WizardModal';
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
import { AdvancedOptionsSection } from '../../../ui/AdvancedOptionsSection';
|
|
|
|
|
|
import Tooltip from '../../../ui/Tooltip/Tooltip';
|
|
|
|
|
|
import { Info } from 'lucide-react';
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
|
|
|
|
|
interface WizardDataProps extends WizardStepProps {
|
|
|
|
|
|
data: Record<string, any>;
|
|
|
|
|
|
onDataChange: (data: Record<string, any>) => void;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Single comprehensive step with all fields
|
|
|
|
|
|
const InventoryDetailsStep: React.FC<WizardDataProps> = ({ data, onDataChange }) => {
|
|
|
|
|
|
const [inventoryData, setInventoryData] = useState({
|
|
|
|
|
|
// Required fields
|
|
|
|
|
|
name: data.name || '',
|
|
|
|
|
|
unitOfMeasure: data.unitOfMeasure || '',
|
|
|
|
|
|
productType: data.productType || 'ingredient',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Basic fields
|
|
|
|
|
|
sku: data.sku || '',
|
|
|
|
|
|
barcode: data.barcode || '',
|
|
|
|
|
|
ingredientCategory: data.ingredientCategory || '',
|
|
|
|
|
|
productCategory: data.productCategory || '',
|
|
|
|
|
|
description: data.description || '',
|
|
|
|
|
|
brand: data.brand || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Pricing fields
|
|
|
|
|
|
averageCost: data.averageCost || '',
|
|
|
|
|
|
lastPurchasePrice: data.lastPurchasePrice || '',
|
|
|
|
|
|
standardCost: data.standardCost || '',
|
|
|
|
|
|
sellingPrice: data.sellingPrice || '',
|
|
|
|
|
|
minimumPrice: data.minimumPrice || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Inventory management
|
|
|
|
|
|
lowStockThreshold: data.lowStockThreshold || '',
|
|
|
|
|
|
reorderPoint: data.reorderPoint || '',
|
|
|
|
|
|
reorderQuantity: data.reorderQuantity || '',
|
|
|
|
|
|
maxStockLevel: data.maxStockLevel || '',
|
|
|
|
|
|
leadTimeDays: data.leadTimeDays || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Product information
|
|
|
|
|
|
packageSize: data.packageSize || '',
|
|
|
|
|
|
shelfLifeDays: data.shelfLifeDays || '',
|
|
|
|
|
|
displayLifeHours: data.displayLifeHours || '',
|
|
|
|
|
|
storageTempMin: data.storageTempMin || '',
|
|
|
|
|
|
storageTempMax: data.storageTempMax || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Storage and handling
|
|
|
|
|
|
storageInstructions: data.storageInstructions || '',
|
|
|
|
|
|
isPerishable: data.isPerishable ?? true,
|
|
|
|
|
|
handlingInstructions: data.handlingInstructions || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
// Supplier information
|
|
|
|
|
|
preferredSupplierId: data.preferredSupplierId || '',
|
|
|
|
|
|
supplierProductCode: data.supplierProductCode || '',
|
|
|
|
|
|
|
|
|
|
|
|
// Quality and compliance
|
|
|
|
|
|
allergenInfo: data.allergenInfo || '',
|
|
|
|
|
|
nutritionalInfo: data.nutritionalInfo || '',
|
|
|
|
|
|
certifications: data.certifications || '',
|
|
|
|
|
|
|
|
|
|
|
|
// Physical properties
|
|
|
|
|
|
weight: data.weight || '',
|
|
|
|
|
|
volume: data.volume || '',
|
|
|
|
|
|
dimensions: data.dimensions || '',
|
|
|
|
|
|
color: data.color || '',
|
|
|
|
|
|
|
|
|
|
|
|
// Status and tracking
|
|
|
|
|
|
isActive: data.isActive ?? true,
|
|
|
|
|
|
trackByLot: data.trackByLot ?? false,
|
|
|
|
|
|
trackByExpiry: data.trackByExpiry ?? true,
|
|
|
|
|
|
allowNegativeStock: data.allowNegativeStock ?? false,
|
|
|
|
|
|
|
|
|
|
|
|
// Metadata
|
|
|
|
|
|
notes: data.notes || '',
|
|
|
|
|
|
tags: data.tags || '',
|
|
|
|
|
|
customFields: data.customFields || '',
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
// Update parent whenever local state changes
|
|
|
|
|
|
const handleDataChange = (newInventoryData: any) => {
|
|
|
|
|
|
setInventoryData(newInventoryData);
|
|
|
|
|
|
onDataChange({ ...data, ...newInventoryData });
|
|
|
|
|
|
};
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="space-y-6">
|
|
|
|
|
|
<div className="text-center pb-4 border-b border-[var(--border-primary)]">
|
|
|
|
|
|
<h3 className="text-lg font-semibold text-[var(--text-primary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Inventory Item Details
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</h3>
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
<p className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Fill in the required information to create an inventory item
|
|
|
|
|
|
</p>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
{/* Required Fields */}
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div className="md:col-span-2">
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Name *
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
value={inventoryData.name}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, name: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="E.g., All-Purpose Flour, Sourdough Bread"
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Product Type *
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<select
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
value={inventoryData.productType}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, productType: e.target.value })}
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
>
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
<option value="ingredient">Ingredient</option>
|
|
|
|
|
|
<option value="finished_product">Finished Product</option>
|
|
|
|
|
|
<option value="packaging">Packaging</option>
|
|
|
|
|
|
<option value="consumable">Consumable</option>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Unit of Measure *
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<select
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
value={inventoryData.unitOfMeasure}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, unitOfMeasure: e.target.value })}
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
>
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
<option value="">Select...</option>
|
|
|
|
|
|
<option value="kg">Kilograms (kg)</option>
|
|
|
|
|
|
<option value="g">Grams (g)</option>
|
|
|
|
|
|
<option value="l">Liters (L)</option>
|
|
|
|
|
|
<option value="ml">Milliliters (ml)</option>
|
|
|
|
|
|
<option value="units">Units</option>
|
|
|
|
|
|
<option value="dozen">Dozen</option>
|
|
|
|
|
|
<option value="lb">Pounds (lb)</option>
|
|
|
|
|
|
<option value="oz">Ounces (oz)</option>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
{/* Basic Information */}
|
|
|
|
|
|
<div className="border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h4 className="text-sm font-semibold text-[var(--text-primary)] mb-3">Basic Information</h4>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
2025-11-10 12:12:50 +00:00
|
|
|
|
SKU (Optional)
|
|
|
|
|
|
<Tooltip content="Leave empty to auto-generate from backend, or enter custom SKU">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.sku}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, sku: e.target.value })}
|
2025-11-10 12:12:50 +00:00
|
|
|
|
placeholder="Leave empty for auto-generation"
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Barcode
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
value={inventoryData.barcode}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, barcode: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Barcode/UPC/EAN"
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
{inventoryData.productType === 'ingredient' ? 'Ingredient Category' : 'Product Category'}
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
<select
|
|
|
|
|
|
value={inventoryData.productType === 'ingredient' ? inventoryData.ingredientCategory : inventoryData.productCategory}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
...inventoryData,
|
|
|
|
|
|
[inventoryData.productType === 'ingredient' ? 'ingredientCategory' : 'productCategory']: e.target.value
|
|
|
|
|
|
})}
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
>
|
|
|
|
|
|
<option value="">Select...</option>
|
|
|
|
|
|
{inventoryData.productType === 'ingredient' ? (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<option value="flour">Flours</option>
|
|
|
|
|
|
<option value="dairy">Dairy</option>
|
|
|
|
|
|
<option value="eggs">Eggs</option>
|
|
|
|
|
|
<option value="fats">Fats & Oils</option>
|
|
|
|
|
|
<option value="sweeteners">Sweeteners</option>
|
|
|
|
|
|
<option value="additives">Additives</option>
|
|
|
|
|
|
<option value="fruits">Fruits</option>
|
|
|
|
|
|
<option value="nuts">Nuts & Seeds</option>
|
|
|
|
|
|
<option value="spices">Spices</option>
|
|
|
|
|
|
<option value="leavening">Leavening Agents</option>
|
|
|
|
|
|
</>
|
|
|
|
|
|
) : (
|
|
|
|
|
|
<>
|
|
|
|
|
|
<option value="bread">Bread</option>
|
|
|
|
|
|
<option value="pastry">Pastry</option>
|
|
|
|
|
|
<option value="cake">Cakes</option>
|
|
|
|
|
|
<option value="cookies">Cookies</option>
|
|
|
|
|
|
<option value="specialty">Specialty Items</option>
|
|
|
|
|
|
</>
|
|
|
|
|
|
)}
|
|
|
|
|
|
</select>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
Brand
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.brand}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, brand: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Brand name"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="md:col-span-2">
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Description
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={inventoryData.description}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, description: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Detailed description of the inventory item"
|
|
|
|
|
|
rows={2}
|
2025-11-09 21:25:36 +00:00
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
|
|
|
|
|
|
{/* Advanced Options */}
|
|
|
|
|
|
<AdvancedOptionsSection
|
|
|
|
|
|
title="Advanced Options"
|
|
|
|
|
|
description="Optional fields for comprehensive inventory management"
|
|
|
|
|
|
>
|
|
|
|
|
|
{/* Pricing Information */}
|
|
|
|
|
|
<div className="space-y-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Pricing Information
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Average Cost (€)
|
|
|
|
|
|
<Tooltip content="Average cost per unit based on purchase history">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.averageCost}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, averageCost: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Last Purchase Price (€)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.lastPurchasePrice}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, lastPurchasePrice: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Standard Cost (€)
|
|
|
|
|
|
<Tooltip content="Standard/expected cost per unit for costing calculations">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.standardCost}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, standardCost: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Selling Price (€)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.sellingPrice}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, sellingPrice: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Minimum Price (€)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.minimumPrice}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, minimumPrice: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Inventory Management */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Inventory Management
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Low Stock Threshold
|
|
|
|
|
|
<Tooltip content="Alert when stock falls below this level">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.lowStockThreshold}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, lowStockThreshold: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="10"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Reorder Point
|
|
|
|
|
|
<Tooltip content="Trigger reorder when stock reaches this level">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.reorderPoint}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, reorderPoint: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="20"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Reorder Quantity
|
|
|
|
|
|
<Tooltip content="Standard quantity to order when reordering">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.reorderQuantity}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, reorderQuantity: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="100"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Max Stock Level
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.maxStockLevel}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, maxStockLevel: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="500"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Lead Time (days)
|
|
|
|
|
|
<Tooltip content="Time between order placement and delivery">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.leadTimeDays}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, leadTimeDays: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="7"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Product Information */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Product Information
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Package Size
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.packageSize}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, packageSize: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="E.g., 25kg bag, 12-pack"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Shelf Life (days)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.shelfLifeDays}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, shelfLifeDays: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="365"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Display Life (hours)
|
|
|
|
|
|
<Tooltip content="Hours product can be displayed before quality degrades">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.displayLifeHours}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, displayLifeHours: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="24"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Storage Temp Range (°C)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<div className="flex gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.storageTempMin}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, storageTempMin: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Min"
|
|
|
|
|
|
step="0.1"
|
|
|
|
|
|
className="w-1/2 px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.storageTempMax}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, storageTempMax: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Max"
|
|
|
|
|
|
step="0.1"
|
|
|
|
|
|
className="w-1/2 px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Storage & Handling */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Storage & Handling
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Storage Instructions
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={inventoryData.storageInstructions}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, storageInstructions: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="E.g., Store in cool, dry place away from direct sunlight"
|
|
|
|
|
|
rows={2}
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Handling Instructions
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={inventoryData.handlingInstructions}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, handlingInstructions: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Special handling requirements"
|
|
|
|
|
|
rows={2}
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={inventoryData.isPerishable}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, isPerishable: e.target.checked })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
className="rounded border-[var(--border-secondary)] text-[var(--color-primary)] focus:ring-[var(--color-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Perishable Item
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Supplier Information */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Supplier Information
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Preferred Supplier ID
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.preferredSupplierId}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, preferredSupplierId: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Supplier ID"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Supplier Product Code
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.supplierProductCode}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, supplierProductCode: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Supplier's product code"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Quality & Compliance */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Quality & Compliance
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Allergen Information
|
|
|
|
|
|
<Tooltip content="Comma-separated list: e.g., gluten, milk, eggs, nuts">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.allergenInfo}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, allergenInfo: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="gluten, milk, eggs"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Nutritional Information
|
|
|
|
|
|
<Tooltip content="Key nutrition facts as comma-separated list">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.nutritionalInfo}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, nutritionalInfo: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="calories:250, protein:8g, carbs:45g"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Certifications
|
|
|
|
|
|
<Tooltip content="Comma-separated list: e.g., Organic, Non-GMO, Kosher">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.certifications}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, certifications: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Organic, Non-GMO, Kosher"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Physical Properties */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Physical Properties
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Weight (kg)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.weight}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, weight: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Volume (L)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
value={inventoryData.volume}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, volume: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="0.00"
|
|
|
|
|
|
step="0.01"
|
|
|
|
|
|
min="0"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Dimensions (L×W×H cm)
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.dimensions}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, dimensions: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="30×20×15"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Color
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.color}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, color: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Product color"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Status & Tracking */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Status & Tracking
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={inventoryData.isActive}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, isActive: e.target.checked })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
className="rounded border-[var(--border-secondary)] text-[var(--color-primary)] focus:ring-[var(--color-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Active Item
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={inventoryData.trackByLot}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, trackByLot: e.target.checked })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
className="rounded border-[var(--border-secondary)] text-[var(--color-primary)] focus:ring-[var(--color-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Track by Lot/Batch
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={inventoryData.trackByExpiry}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, trackByExpiry: e.target.checked })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
className="rounded border-[var(--border-secondary)] text-[var(--color-primary)] focus:ring-[var(--color-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Track by Expiry Date
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex items-center gap-2">
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
checked={inventoryData.allowNegativeStock}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, allowNegativeStock: e.target.checked })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
className="rounded border-[var(--border-secondary)] text-[var(--color-primary)] focus:ring-[var(--color-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<label className="text-sm text-[var(--text-secondary)]">
|
|
|
|
|
|
Allow Negative Stock
|
|
|
|
|
|
</label>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{/* Additional Information */}
|
|
|
|
|
|
<div className="space-y-4 border-t border-[var(--border-primary)] pt-4">
|
|
|
|
|
|
<h5 className="text-xs font-semibold text-[var(--text-secondary)] uppercase tracking-wider">
|
|
|
|
|
|
Additional Information
|
|
|
|
|
|
</h5>
|
|
|
|
|
|
<div className="grid grid-cols-1 gap-4">
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Notes
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={inventoryData.notes}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, notes: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="Additional notes about this item"
|
|
|
|
|
|
rows={3}
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Tags
|
|
|
|
|
|
<Tooltip content="Comma-separated tags for easier search and filtering">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
value={inventoryData.tags}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, tags: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder="organic, premium, seasonal"
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)]"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<label className="block text-sm font-medium text-[var(--text-secondary)] mb-2">
|
|
|
|
|
|
Custom Fields (JSON)
|
|
|
|
|
|
<Tooltip content="Additional custom data in JSON format">
|
|
|
|
|
|
<Info className="inline w-4 h-4 ml-1 text-[var(--text-tertiary)]" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<textarea
|
|
|
|
|
|
value={inventoryData.customFields}
|
fix: Critical - Remove infinite re-render loops from all wizards
CRITICAL BUG FIX: The useEffect hooks syncing wizard state with parent were
causing infinite re-render loops, completely blocking all UI interactions
(text inputs, clicks, selections, etc.).
Root cause: useEffect(() => onDataChange({...data, ...localState}), [localState])
creates infinite loop because localState is recreated on every render, triggering
the effect again, which updates parent, which re-renders component, repeat forever.
Solution: Remove problematic useEffect sync hooks and instead:
1. Create handler functions that update both local state AND parent state together
2. Call these handlers directly in onChange events (not in useEffect)
3. Only sync auto-generated fields (SKU, order number) in useEffect with proper deps
Files fixed:
- InventoryWizard.tsx: Added handleDataChange() function, updated all onChange
- QualityTemplateWizard.tsx: Added handleDataChange() function, updated all onChange
- CustomerOrderWizard.tsx: Fixed all 3 steps:
* Step 1: handleCustomerChange(), handleNewCustomerChange()
* Step 2: updateOrderItems()
* Step 3: handleOrderDataChange()
Testing: All text inputs, select dropdowns, checkboxes, and buttons now work correctly.
UI is responsive and performant without infinite re-rendering.
This was blocking all user interactions - highest priority fix.
2025-11-10 09:50:33 +00:00
|
|
|
|
onChange={(e) => handleDataChange({ ...inventoryData, customFields: e.target.value })}
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
placeholder='{"custom_field": "value"}'
|
|
|
|
|
|
rows={2}
|
|
|
|
|
|
className="w-full px-3 py-2 border border-[var(--border-secondary)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] bg-[var(--bg-primary)] text-[var(--text-primary)] font-mono text-xs"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</AdvancedOptionsSection>
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export const InventoryWizardSteps = (
|
|
|
|
|
|
data: Record<string, any>,
|
|
|
|
|
|
setData: (data: Record<string, any>) => void
|
|
|
|
|
|
): WizardStep[] => [
|
|
|
|
|
|
{
|
feat: Rewrite InventoryWizard with comprehensive field support
Complete rewrite following the established pattern from Recipe, Customer,
and Supplier wizards. Key improvements:
- Reduced from 3 steps to 1 streamlined comprehensive step
- Removed all duplicate "Continuar" buttons
- Added validate prop with required field checks (name, unitOfMeasure, productType)
- Real-time data sync with parent wizard using useEffect
- Auto-generation of SKU from name (SKU-XXX-1234)
- Added ALL 44 backend fields from research:
* Required: name, unitOfMeasure, productType
* Basic: sku, barcode, ingredient/product category, brand, description
* Pricing: averageCost, lastPurchasePrice, standardCost, sellingPrice, minimumPrice
* Inventory Management: lowStockThreshold, reorderPoint, reorderQuantity,
maxStockLevel, leadTimeDays
* Product Info: packageSize, shelfLifeDays, displayLifeHours,
storageTempMin/Max
* Storage & Handling: storageInstructions, handlingInstructions, isPerishable
* Supplier Info: preferredSupplierId, supplierProductCode
* Quality & Compliance: allergenInfo, nutritionalInfo, certifications
* Physical Properties: weight, volume, dimensions, color
* Status & Tracking: isActive, trackByLot, trackByExpiry, allowNegativeStock
* Metadata: notes, tags, customFields
- Organized fields using AdvancedOptionsSection for progressive disclosure
- Added tooltips for complex fields using existing Tooltip component
- Dynamic category selection based on product type
- Comprehensive validation for required fields only
2025-11-10 07:41:26 +00:00
|
|
|
|
id: 'inventory-details',
|
|
|
|
|
|
title: 'Inventory Details',
|
|
|
|
|
|
component: (props) => <InventoryDetailsStep {...props} data={data} onDataChange={setData} />,
|
|
|
|
|
|
validate: () => {
|
|
|
|
|
|
return !!(data.name && data.unitOfMeasure && data.productType);
|
|
|
|
|
|
},
|
feat: Add JTBD-driven Unified Add Wizard system
Implemented a comprehensive unified wizard system to consolidate all "add new content"
actions into a single, intuitive, step-by-step guided experience based on Jobs To Be Done
(JTBD) methodology.
## What's New
### Core Components
- **UnifiedAddWizard**: Main orchestrator component that routes to specific wizards
- **ItemTypeSelector**: Beautiful visual card-based selection for 9 content types
- **9 Individual Wizards**: Step-by-step flows for each content type
### Priority Implementations (P0)
1. **SalesEntryWizard** ⭐ (MOST CRITICAL)
- Manual entry with dynamic product lists and auto-calculated totals
- File upload placeholder for CSV/Excel bulk import
- Critical for small bakeries without POS systems
2. **InventoryWizard**
- Type selection (ingredient vs finished product)
- Context-aware forms based on inventory type
- Optional initial lot entry
### Placeholder Wizards (P1/P2)
- Customer Order, Supplier, Recipe, Customer, Quality Template, Equipment, Team Member
- Proper structure in place for incremental enhancement
### Dashboard Integration
- Added prominent "Agregar" button in dashboard header
- Opens wizard modal with visual type selection
- Auto-refreshes dashboard after wizard completion
### Design Highlights
- Mobile-first responsive design (full-screen on mobile, modal on desktop)
- Touch-friendly with 44px+ touch targets
- Follows existing color system and design tokens
- Progressive disclosure to reduce cognitive load
- Accessibility-compliant (WCAG AA)
## Documentation
Created comprehensive documentation:
- `JTBD_UNIFIED_ADD_WIZARD.md` - Full JTBD analysis and research
- `WIZARD_ARCHITECTURE_DESIGN.md` - Technical design and specifications
- `UNIFIED_WIZARD_IMPLEMENTATION_SUMMARY.md` - Implementation guide
## Files Changed
- New: `frontend/src/components/domain/unified-wizard/` (15 new files)
- Modified: `frontend/src/pages/app/DashboardPage.tsx` (added wizard integration)
## Next Steps
- [ ] Connect wizards to real API endpoints (currently mock/placeholder)
- [ ] Implement full CSV upload for sales entry
- [ ] Add comprehensive form validation
- [ ] Enhance P1 priority wizards based on user feedback
## JTBD Alignment
Main Job: "When I need to expand or update my bakery operations, I want to quickly add
new resources to my management system, so I can keep my business running smoothly."
Key insights applied:
- Prioritized sales entry (most bakeries lack POS)
- Mobile-first (bakery owners are on their feet)
- Progressive disclosure (reduce overwhelm)
- Forgiving interactions (can go back, save drafts)
2025-11-09 08:40:01 +00:00
|
|
|
|
},
|
|
|
|
|
|
];
|