Commit Graph
100 Commits
Author SHA1 Message Date
Christian Vidal WolfandClaude Opus 4.6 24df5935cc feat: rebuild Experiments tab with Difference-in-Differences analysis and Bayesian verdicts
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>
2026-02-23 15:42:40 +01:00
Christian Vidal Wolf 7ee33671cc feat: add explicit period date ranges and absolute metric differences to experiment summary 2026-02-21 23:05:10 +01:00
Christian Vidal Wolf 09cfc1e6a8 feat: inject unfiltered ad data into experiments & deploy comprehensive KPI summary view 2026-02-21 22:56:37 +01:00
Christian Vidal Wolf 99d524db12 fix: adapt experiment calculation engine to consume both CombinedKPIs and SalesRecord data structures 2026-02-21 22:51:38 +01:00
Christian Vidal Wolf 411448e4d2 fix: resolve NaN algorithm corruption causing empty experiment calculations on save 2026-02-21 22:31:28 +01:00
Christian Vidal Wolf 58cc863748 chore: enable verbose error logging on experiment calculations to reveal silent production errors 2026-02-21 21:56:35 +01:00
Christian Vidal Wolf 9259129f95 fix: add safe generic fallback to date parsers to prevent parse errors 2026-02-21 19:44:18 +01:00
Christian Vidal Wolf aa9a7845b7 fix: resolve UTC date matching and implement per-product ASIN breakdown table for Line experiments 2026-02-21 19:37:07 +01:00
Christian Vidal Wolf 8bd78c2e7f chore: trigger vercel deployment for LINE experiments fix 2026-02-21 19:29:55 +01:00
Christian Vidal Wolf 249dc0c749 fix: resolve LINE level experiments to individual ASINs using salesData so calculation works for product lines 2026-02-21 19:26:45 +01:00
Christian Vidal Wolf c2d516dbfc docs: add new metric columns to supabase migration instructions 2026-02-21 18:08:41 +01:00
Christian Vidal Wolf e44f9b30b3 fix: account for null numeric values from supabase in metric cards to uncrash detail view 2026-02-21 18:05:04 +01:00
Christian Vidal Wolf a6135862c2 fix: resolve primary_metric toUpperCase crash on legacy experiment detail 2026-02-21 17:59:46 +01:00
Christian Vidal Wolf 1a56015f63 fix: resolve asins.map crash in experiment detail for legacy records 2026-02-21 17:56:38 +01:00
Christian Vidal Wolf 4dc4353885 fix: prevent crash on legacy experiments missing ASIN arrays 2026-02-21 17:52:04 +01:00
Christian Vidal Wolf 6319648996 fix: allow calculating results for non-completed experiments 2026-02-21 17:47:03 +01:00
Christian Vidal Wolf d78a88afe1 feat: complete experiments tab analytics optimization with modular kpis and sparklines 2026-02-21 15:31:02 +01:00
Christian Vidal Wolf 67e93f6653 feat: implement experiment tracking in Weekly Sales Grid 2026-02-21 15:14:22 +01:00
Christian Vidal Wolf b2598f4c49 fix: sanitize experiment form data to prevent save failure on empty dates 2026-02-21 11:25:39 +01:00
Christian Vidal Wolf b1346183c9 ui: fix modal z-index conflict in Experiments tab 2026-02-21 11:19:43 +01:00
Christian Vidal WolfandQwen-Coder 8d05173b40 Fix Supabase LockManager timeout error
- Disable auth persistence in Supabase client
- Set autoRefreshToken: false, persistSession: false
- Prevents 'Acquiring an exclusive Navigator LockManager lock' timeout
- Applied to both services/supabase.ts and api/experiments.ts

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 09:29:22 +01:00
Christian Vidal WolfandQwen-Coder d535004a29 Optimize app loading and fix product lines in experiments
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>
2026-02-21 09:25:15 +01:00
Christian Vidal WolfandQwen-Coder 5efc2d519e Fix duplicate handleAddAsin function
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 09:15:16 +01:00
Christian Vidal WolfandQwen-Coder 46d87127c8 Add product line targeting for experiments
- 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>
2026-02-21 00:40:30 +01:00
Christian Vidal WolfandQwen-Coder 9736a3d591 Improve experiment form UI - make it more compact
- Reduced modal max-width and padding
- Changed from buttons to select dropdowns for Type/Marketplace
- Smaller text sizes and spacing throughout
- Shorter placeholder texts
- More compact ASIN tags with max-height scroll
- Reduced textarea rows
- Smaller button labels

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 00:31:26 +01:00
Christian Vidal WolfandQwen-Coder aebebecf1b Fix Vercel function limit - remove unused API endpoints
- Removed fetch-forecast.ts (not used)
- Removed fetch-vendor-stock.ts (not used)
- Removed migrate-experiments.ts (manual SQL migration is sufficient)
- Kept 10 essential API functions (limit is 12 on Hobby plan)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 00:25:04 +01:00
Christian Vidal WolfandQwen-Coder edbde19f3a Fix Supabase credentials error - use API routes
- Create /api/experiments endpoint for server-side Supabase access
- Update experiments service to use fetch instead of direct Supabase client
- Fixes 'Supabase credentials not configured' error in browser

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 00:21:57 +01:00
Christian Vidal WolfandQwen-Coder 2b62bef707 Add experiments table migration instructions
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-21 00:16:06 +01:00
Christian Vidal WolfandQwen-Coder a21c0d532c Fix TypeScript errors in experiments feature
- 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>
2026-02-20 19:39:56 +01:00
Christian Vidal WolfandQwen-Coder f93d92da0b Add complete Experiments tracking system
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>
2026-02-20 19:31:44 +01:00
Christian Vidal WolfandQwen-Coder a4919691b2 Fix Vendor filters: add year, date range, and ASIN search
- Add year filter with multi-select dropdown
- Add date range pickers (from/to)
- Fix tags filter using ilike for partial matching
- Add clear filters button
- Update supabase service with proper year filtering

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-20 14:01:05 +01:00
Christian Vidal Wolf ae6b8bfb9d trigger: redeploy to verify supabase configuration 2026-02-20 13:44:06 +01:00
Christian Vidal Wolf 0b76e587d5 fix(types): resolve lint errors in Supabase filter options 2026-02-20 13:41:20 +01:00
Christian Vidal Wolf 85c789bf52 fix: resolve vendor data upload error by implementing client-side parsing and sequential batching 2026-02-20 13:32:26 +01:00
Christian Vidal WolfandClaude Opus 4.6 a8258398f7 fix: add Upload button to header to open data source modal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:26:39 +01:00
Christian Vidal WolfandClaude Opus 4.6 16f7af7df3 fix: lazy-init Supabase client to prevent crash when env vars missing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:23:29 +01:00
Christian Vidal WolfandClaude Opus 4.6 2bce0a839b feat: add Supabase vendor data integration (BSR, ratings, buy box)
- 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>
2026-02-20 13:19:25 +01:00
Christian Vidal WolfandClaude Opus 4.6 fed39b18be fix: show all marketplaces (incl. Amazon UK) in experiment form
Use a hardcoded ALL_MARKETPLACES list instead of deriving from current
filtered data, so Amazon UK is always available even when viewing PAN-EU.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:12:30 +01:00
Christian Vidal WolfandClaude Opus 4.6 812425a1ef feat: add marketplace differentiation to Experiment Tracker
Each experiment now tracks which marketplace (Amazon DE, UK, etc.) it
applies to. The form defaults to the currently active marketplace filter,
and the delta % calculation filters by both product line and marketplace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:07:34 +01:00
Christian Vidal WolfandClaude Opus 4.6 9a115ff5be feat: add Experiment Tracker to Weekly Sales tab
Log weekly actions (SEO, pricing, ads, etc.) per product line and visualize
their impact with a Recharts line chart showing experiment markers. Includes
a collapsible experiments panel with auto-computed delta % (3-week before vs
after comparison) and editable status tracking. Data persisted in localStorage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 10:58:51 +01:00
Christian Vidal Wolf 557703c5ea feat: enable sorting and filtering by Revenue in Weekly Sales grid 2026-02-19 16:48:48 +01:00
Christian Vidal Wolf ab79f2ca6e feat: implement 1-to-1 metric swap (Units vs Revenue) in Weekly Sales 2026-02-19 16:36:05 +01:00
Christian Vidal Wolf 635850bc5a feat: restore ads spend visibility in Weekly Sales and refine layout 2026-02-19 16:26:47 +01:00
Christian Vidal Wolf 2b9399e7e0 fix: correct revenue metric mapping in Weekly Sales grid (pivot revenue vs ads cost) 2026-02-19 16:22:19 +01:00
Christian Vidal Wolf 079e4130f7 feat: add units/revenue toggle to Weekly Sales and improve traffic data parsing 2026-02-19 16:03:16 +01:00
Christian Vidal WolfandClaude Opus 4.6 31ad7fda21 fix: read all sheets in Traffic Weekly Excel for complete GV data
processTrafficExcel was only reading the first sheet, missing data from
year-based sheets (e.g., "2025", "2026"). Now iterates all sheets with
auto-detection of column layout, matching the processAdsExcel pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:34:00 +01:00
Christian Vidal WolfandClaude Opus 4.6 a1dcb9b9fc chore: force Vercel redeploy with mobile responsive changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:37:40 +01:00
Christian Vidal WolfandClaude Opus 4.6 a8626ae7a6 chore: trigger Vercel redeploy with mobile optimization
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 09:35:31 +01:00
Christian Vidal WolfandClaude Opus 4.6 9895545910 feat: full mobile responsive optimization for Android/iPhone
- 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>
2026-02-16 09:27:46 +01:00
Christian Vidal Wolf fecc7264c8 chore: trigger Vercel redeploy with filter UI optimizations 2026-02-14 10:10:17 +01:00
Christian Vidal Wolf b515bd17b0 chore: add .env to gitignore to protect API keys 2026-02-10 15:39:33 +01:00
Christian Vidal Wolf 1bea36aa74 fix: move Gemini API calls server-side to fix API key issue on Vercel 2026-02-10 15:35:10 +01:00
Christian Vidal Wolf 5e2abfb1e2 fix: read API key from process.env for Vercel builds 2026-02-10 15:32:14 +01:00
Christian Vidal Wolf a259538ff4 fix: exhaustive API key lookup and injection for Vercel 2026-02-10 15:24:52 +01:00
Christian Vidal Wolf 01026da882 fix: support both API_KEY and GEMINI_API_KEY in vite config 2026-02-10 15:18:49 +01:00
Christian Vidal Wolf 3f6fdc8d72 feat: integrate Gemini Pro 1.5 with KAM persona for data analysis 2026-02-10 15:15:44 +01:00
Christian Vidal Wolf 96e9583fdb Refactor ExcelFilter popup UI for a more compact and data-dense experience 2026-02-09 12:16:46 +01:00
Christian Vidal Wolf ee608cd042 Optimize Grid header UI: reduce font sizes, padding, and improve alignment of metric columns 2026-02-09 12:13:51 +01:00
Christian Vidal Wolf 81c946b3e1 Enhance Excel-style filters with numeric operators and integrate into GRID metrics (Sell Out, Units) 2026-02-09 12:09:01 +01:00
Christian Vidal Wolf d5bcbeda1a Fix GRID tab empty table regression by correcting filter logic and prop passing 2026-02-09 12:05:03 +01:00
Christian Vidal Wolf ac791b5265 Implement Excel-style filters (SKU, ASIN, Title, Line) across GRID, WEEKLY SALES, and FC26 tabs 2026-02-09 12:00:39 +01:00
Christian Vidal Wolf 827135a517 fix: force ASIN column B and Reason column N for BB_DE 2026-02-06 10:57:03 +01:00
Christian Vidal Wolf bd8f86007c fix: force Column J for BB_UK reason column 2026-02-06 10:54:06 +01:00
Christian Vidal Wolf 76193fb9bf fix: force Column S for BB_FR reason column 2026-02-06 10:50:18 +01:00
Christian Vidal Wolf 86547bdf0d style: relocate search bar to top toolbar for better visibility 2026-02-06 10:31:37 +01:00
Christian Vidal Wolf 62d4903566 feat: implement bulk search for ASINs/SKUs in DataGrid 2026-02-06 09:22:24 +01:00
Christian Vidal Wolf 3a4410c3b5 Fix Buy Box warning detection for Spain (B0D3874WSD) and update Vite proxies 2026-02-05 10:48:37 +01:00
Christian Vidal Wolf 9f9556af2a debug: Add Spain-specific sheet fallbacks and expose Buy Box data to window.debugBuyBox 2026-02-05 08:52:49 +01:00
Christian Vidal Wolf aeefd76496 feat: Make Buy Box sheet matching even more aggressive 2026-02-05 08:48:27 +01:00
Christian Vidal Wolf 4ead042534 debug: Expand logging for Buy Box parsing to see why Spain rows are skipped 2026-02-05 08:48:17 +01:00
Christian Vidal Wolf 299d2032bc feat: Improve Buy Box header detection and add Spanish aliases 2026-02-05 08:44:33 +01:00
Christian Vidal Wolf 9a042c6478 debug: Add diagnostics for Buy Box warning issue 2026-02-05 08:43:58 +01:00
Christian Vidal Wolf 09e06bad16 feat: Automate Buy Box tracker sync from Dropbox and improve parsing robustness 2026-02-05 08:39:39 +01:00
Christian Vidal Wolf c4ad999619 Update stock fetch to use Dropbox URL for Item Availability 2026-02-03 08:55:45 +01:00
Christian Vidal Wolf ceb389cfb0 feat: Add YTD (Year-To-Date) cumulative lines to chart
- Calculate accumulated Sell Out and Units per week for each year
- Add toggle button to show/hide YTD lines (cyan color)
- YTD lines use thicker stroke with lower opacity for distinction
2026-02-02 11:38:26 +01:00
Christian Vidal Wolf dfe9a88ceb fix: Make expanded chart fill entire screen (vertical + horizontal)
- Updated ExpandableChartCard to use flex-1 + min-h-0 for proper height
- Added CSS selectors to make child divs fill available space
- Chart now expands to fullscreen in both dimensions
2026-02-02 11:31:26 +01:00
Christian Vidal Wolf e1e6f127be feat: Add UK inventory sync from Dropbox
- 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
2026-02-02 09:24:49 +01:00
Christian Vidal Wolf ab9ac4f47e fix: Correct stock column detection for PANEU-Stock.xlsx
- Prioritize 'Sellable On Hand Units' column (was selecting 'Net Received Units')
- Add 'Store code' recognition for marketplace detection
- Improved column search strategy with priority levels
2026-02-02 09:18:32 +01:00
Christian Vidal Wolf 7e58e8aba4 feat: Sync PANEU inventory from Dropbox
- Add new API endpoint for PANEU stock from Dropbox
- Update handleVendorStockFetch to use new endpoint
- Configure Vite proxy for local development
2026-02-02 09:13:20 +01:00
christian.vidal 74f6fa2278 fix: Improve Vendor Stock column detection to prioritize units over cost 2026-02-01 16:00:01 +01:00
christian.vidal f3e13769d7 fix: implement product line seasonality for forecast fallback 2026-02-01 15:47:33 +01:00
Christian Vidal Wolf 01e20eb073 Always show YoY comparison row in tooltips (displays 'No data' when unavailable) 2026-01-31 20:48:47 +01:00
Christian Vidal Wolf b8d589bca1 Enhance tooltips with YoY comparison and English labels 2026-01-31 17:42:59 +01:00
Christian Vidal Wolf 6a83109e1c Add metric tooltips showing comparison details (vs previous week) 2026-01-31 12:51:47 +01:00
Christian Vidal Wolf 3e334c1fde Add numeric column filters for Units, Spend and GV in Weekly Sales 2026-01-31 12:11:33 +01:00
christian.vidal 2a199d397e Implement Custom Numeric Filtering (>10, 5-10) for Stock/WOC columns in Weekly Sales 2026-01-30 19:28:53 +01:00
Christian Vidal Wolf c691d4e9ba fix: restrict actual units to forecast region scope in ForecastView 2026-01-30 09:23:07 +01:00
Christian Vidal Wolf a678880112 fix: improve forecast seasonality logic and catalog data integrity 2026-01-30 09:10:02 +01:00
Christian Vidal Wolf f26ea171ce feat: add Top 50 filter and sorting to DataGrid + fix BuyBox badge hover 2026-01-30 08:51:20 +01:00
christian.vidal efbdfc41e5 Refine YTD Logic: Allow full historical data when Month/Week filters are active 2026-01-29 21:11:29 +01:00
christian.vidal b1c3897cfd Implement Enter key support for quick filtering 2026-01-29 20:59:35 +01:00
christian.vidal 9200c554e1 Fix Forecast Seasonality: Process weights using global data even when filtered 2026-01-29 20:56:19 +01:00
christian.vidal 2060f82348 Fix Forecast View discrepancy: Align Chart/Summary with Search Filters 2026-01-29 20:50:31 +01:00
christian.vidal db2c67060b Implement Dashboard-specific YTD filtering 2026-01-29 20:31:44 +01:00
christian.vidal 7a2b47af21 Fix syntax error in App.tsx: Restore missing useMemo declaration 2026-01-29 20:29:18 +01:00
christian.vidal 2c6b9c9f5a Implement Grid-specific YTD filtering and default sorting 2026-01-29 20:27:19 +01:00
christian.vidal 55c91a7bfc Remove decimals from Dashboard and fix BuyBox badge layout 2026-01-29 20:19:13 +01:00
christian.vidal 0211124879 Set default Grid columns to SKU and Title only 2026-01-29 20:15:14 +01:00
christian.vidal fc941bbac7 Increase Title column width to 450px 2026-01-29 20:12:19 +01:00
christian.vidal 37fa2acf40 Optimize data processing performance with memoization 2026-01-29 20:09:28 +01:00