Changed rawData prop from rawData to ytdFilteredData so the Top Movers
component respects all active filters (customer, year, month, week,
product line, SKU, title, ASIN, stock)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
filteredAdsData applies PAN_EU default when no marketplace is selected,
cutting UK/other spend and showing 118k instead of the full 151k.
mktAdsData skips the PAN_EU restriction: no customer filter = all
countries, still respects explicit customer/year/week selections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MktDataView now receives filteredData/filteredAdsData so the global
FilterBar controls the tab's data. Removed the local "All Categories"
dropdown that previously sat next to the Include COGS toggle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace all mock data in the Profitability Dashboard with live data:
- Add 3 new API routes (fetch-deals, fetch-promos, fetch-chargebacks) proxying Dropbox Excel files
- MktDataView now accepts rawData/adsData props and fetches+parses the 3 new files on mount
- SELL OUT and units aggregated globally across all marketplaces from rawData
- PPC Spend aggregated globally from adsData; ACoS calculated as spend/sales
- Deals (col A→C), Promos (col E→K), Chargebacks (col AN→B) parsed and summed per ASIN
- Category filter populated from product line metadata
- Loading skeleton shown while files are fetching
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use React's useDeferredValue to decouple UI responsiveness from
expensive data reprocessing. Checkboxes now update immediately on
click; filterData/filterAdsData/filterBsrData and all downstream
useMemos run as a low-priority background pass. Added local optimistic
state in MultiSelectDropdown as a belt-and-suspenders layer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New BSRUnitsCorrelationChart component added to the Vendor tab showing:
- Per-marketplace tabs (DE, ES, FR, IT, UK) with market accent colors
- Dual-axis combo chart: bars (units sold, right axis) + line (BSR rank, left axis)
- Inverted BSR axis by default (lower rank = top) with toggle to flip
- Pearson r correlation calculated and displayed with strength interpretation
- Wired to existing combinedAdsData (filtered) and filteredBsrData
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Agregar tarjeta con SKU, ASIN y título al inicio de los gráficos
- Incluir Buy Box Warning Badge si el producto tiene issues
- Solo se muestra cuando hay un único ASIN seleccionado
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
All vendor files are linked via Dropbox, making manual upload unnecessary.
Removes the Upload Vendor CSV button, handleVendorUpload handler, and processVendorCSV import.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
VendorDataView was refactored to receive BSR data as a prop but App.tsx
was not updated to pass it, causing the component to crash on undefined
and show a blank screen. Also fixes supabase.ts type errors and removes
dead code.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the basic CRUD experiment tracker with a scientifically rigorous A/B testing system:
- Add DiD analysis engine (services/experimentAnalysis.ts) that computes treatment vs control
group comparisons across 7 metrics (units, sessions, CVR, CTR, ROAS, revenue, ACOS)
- Implement Bayesian verdict system (Winner/Loser/Inconclusive) using posterior probability
with normal CDF approximation (Abramowitz & Stegun erf, no external deps)
- Build counterfactual time series for trend charts (actual vs estimated without change)
- Rewrite ExperimentsView as single component with 3 inline sub-views (list, detail, create)
replacing the previous modal-based ExperimentDetail and ExperimentForm
- Add control group support, change annotations (before→after diffs), and SEO experiment type
- New types: ExperimentChangeAnnotation, DiDMetricResult, DifferenceInDifferencesResult,
ExperimentVerdict
- Simplify App.tsx by removing experiment modal state (5 useState hooks eliminated)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Performance improvements:
- Fetch traffic, stock, vendor stock, buybox, and experiments data in parallel using Promise.all
- Reduces initial loading time significantly
- Non-blocking background fetches after sales data loads
Bug fixes:
- Pass availableLines from App.tsx to ExperimentForm as prop
- Remove localStorage dependency for product lines
- Product lines now correctly populated from rawData
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add option to target entire product line instead of specific ASINs
- Support pasting multiple ASINs separated by spaces OR commas
- Add ASIN format validation (9-10 alphanumeric characters)
- Load available product lines from cached sales data
- Add handleCreateExperimentForLine function in App.tsx
- Update ExperimentForm with target type selector (ASIN vs Line)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Add experimentMap/onOpenExperiment props to WeeklyRow component
- Export VendorDailyRow type from supabase.ts
- Fix type errors in experiments.ts (unknown[] to string[])
- Add type annotation for allAsins in App.tsx
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
New Features:
- Experiments tab with full CRUD operations
- Create experiments by ASIN or product line groups
- Track pricing, advertising, content, and promotion experiments
- Performance analytics with baseline vs experiment comparison
- Visual experiment badges in Weekly Sales grid
- Experiment detail view with metrics and learnings
Technical Changes:
- Add Supabase experiments table migration
- New services/experiments.ts for CRUD + calculations
- New components: ExperimentsView, ExperimentDetail, ExperimentForm, ExperimentBadge
- Integrate experiment indicators in WeeklyGrid
- Add navigation tab (desktop + mobile)
- Type definitions in types.ts
Usage:
1. Run SQL migration in Supabase
2. Navigate to Experiments tab
3. Create experiments with ASINs, dates, hypothesis
4. View performance lift after completion
5. See active experiments marked in Weekly Sales
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
- Create vendor_daily_data table schema and Supabase client service
- Add upload API route for Vendor Central CSV parsing and upsert
- Add VendorDataView with BSR trend, ratings, and buy box charts
- Integrate new Vendor tab into app navigation (desktop + mobile)
- Add vendor CSV upload card to FileUpload modal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add bottom navigation bar (6 tabs) for mobile, hidden on desktop
- Compact header with smaller logo and reduced padding on mobile
- Collapsible filter bar with active filter count badge on mobile
- Bottom-sheet style dropdowns with overlay and larger touch targets
- Fullscreen AI chat on mobile, floating window on desktop
- Responsive dashboard cards with always-visible expand button
- Smaller table text and touch-friendly scroll on all data grids
- iPhone safe-area support and thinner scrollbars on mobile
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create new API endpoint api/fetch-uk-inventory.ts
- Add processUKInventoryExcel function in dataProcessor.ts
- Update handleVendorStockFetch to load PANEU + UK in parallel
- Configure Vite proxy for UK inventory endpoint
- UK stock correctly populates 'uk' field in vendorStockMap