Commit Graph
194 Commits
Author SHA1 Message Date
Christian Vidal Wolf 5eb42f5e33 feat: show X and Y axis values on Vendor charts 2026-03-04 08:35:00 +01:00
Christian Vidal Wolf bdd65d16d1 fix: perfectly match Vendor tab UI to reference screenshot 2026-03-04 08:29:20 +01:00
Christian Vidal Wolf 8ad1f908b1 feat: redesign Vendor tab with premium AreaCharts and updated UI 2026-03-03 17:15:02 +01:00
Christian Vidal WolfandQwen-Coder 0a2b15615d feat(vendor): update to modern bar charts
- Use BarChart with rounded corners for modern look
- Remove vertical grid lines for cleaner appearance
- Add hover cursor effect on tooltip
- Y-axis reversed for BSR charts (lower = better)
- Normal Y-axis for Rating chart (higher = better)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 16:21:08 +01:00
Christian Vidal WolfandQwen-Coder 4fa8b0f45e feat(vendor): use modern area charts with gradient fills
Replace bar charts with area charts featuring:
- Gradient fill effects for modern look
- Smooth monotone curves
- Proper Y-axis orientation (reversed for BSR where lower is better)
- Color-coded by market with transparency

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 16:16:52 +01:00
Christian Vidal WolfandQwen-Coder 4025cb69a3 feat(vendor): change charts from lines to bars for weekly data
Convert Top Level BSR, Detail Level BSR, and Average Rating charts
from LineChart to BarChart for better week-over-week comparison.
Each market now displays as colored bars per week instead of lines.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-03 16:12:56 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 4afae59de9 fix(DataGrid): show BuyBoxWarningBadge in title dimension
The badge was only rendered for dim==='asin'|'sku'. When pivoting by
title (the default view) the BuyBox warning was silently absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 13:29:41 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 2eed94b94b fix(dataProcessor): parse DD/M/YY dates from column C in sell-out CSV
Add support for European day-first date format (e.g. "23/2/26" = 23 Feb 2026)
in the sell-out CSV pipeline so months and years are correctly extracted from
column C of Amazon Sell Out 2023-2025.csv.

- normalizeMonth: detect DD/MM/YY when first part > 12, return "Mon-YY"
- mapRowToRecord: add 'C', 'Date', 'Fecha', 'DATA' to month column aliases
- validateSellOutHeaders: accept date columns as substitute for YEAR + MONTH

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-03 13:07:59 +01:00
Christian Vidal WolfandQwen-Coder 2814d68716 feat: mostrar detalles del producto en Vendor tab cuando hay un solo ASIN
- 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>
2026-03-03 11:21:14 +01:00
Christian Vidal Wolf 98ba0d1708 feat: sync vendor tab filters with global header filters 2026-03-03 10:52:35 +01:00
christian.vidalandClaude Sonnet 4.6 a6b7503c82 fix(vendor): replace ASIN text input with MultiSelectDropdown for proper filtering
The free-text ASIN search was unclear and not working as expected.
Replace it with a proper MultiSelectDropdown (same as Market/Category
filters) — selecting an ASIN now strictly filters chart data to that
ASIN only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 20:16:27 +01:00
christian.vidalandClaude Sonnet 4.6 7f5aa1b812 feat(vendor): switch BSR charts to daily resolution for smoother trend lines
- Add date? field to BSRRecord (ISO string YYYY-MM-DD)
- processBSRExcel now extracts and stores the Date column as an ISO date
  (handles both Excel serial numbers and string dates)
- VendorDataView groups chart data by date (daily) when dates are available,
  falling back to weekly buckets — eliminates straight-line charts caused
  by only 2 weekly data points

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 18:53:45 +01:00
Christian Vidal Wolf 243c44c7f7 feat: replace Vendor tab with BSR tracker 2026-03-02 15:22:12 +01:00
Christian Vidal Wolf 21ec5b63ab fix(parser): align ad sales and units regexes to capture standard Amazon header 'Sales within X days' 2026-02-26 08:30:23 +01:00
christian.vidal 583bc07dba feat: add Market Gap Report - top 5 DE products not sold in ES 2026-02-25 19:17:07 +01:00
Christian Vidal WolfandClaude Opus 4.6 8b774ae7ba fix(experiments): prevent NaN propagation and ACOS zero-value bug in experiment analysis
- Change ?? to || for salesAds/units/revenue in weekly aggregation to guard against NaN
- Add || 0 fallback to ads-only records in mergeSalesAndAdsData
- Fix parseCurrency to check isNaN on all EU-format return paths
- Handle ACOS edge case: cost > 0 with adRevenue = 0 now returns 100% instead of 0%
- Add diagnostic console logging to computeDiD for data flow tracing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:34:55 +01:00
Christian Vidal WolfandClaude Opus 4.6 487b8e105e feat: bulk ASIN selection via space-separated paste in filters
Allow pasting multiple ASINs separated by spaces in any MultiSelectDropdown
search field and pressing Enter to auto-select all matching options.
Also switch ads CSV/Excel parsing to header-based column mapping for
robustness across different file formats.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:01:11 +01:00
Christian Vidal Wolf 27d4268aff feat(experiments): add edit experiment functionality 2026-02-25 09:26:58 +01:00
Christian Vidal WolfandClaude Opus 4.6 eba6628325 fix: apply dark theme to all form inputs in Experiments create view
Replace undefined input-field CSS class with explicit Tailwind dark theme
classes (bg-slate-800, border-slate-700, text-slate-200) to prevent white
background on form fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 08:25:46 +01:00
Christian Vidal Wolf 4935112a55 feat: enable custom baseline periods for Experiments to solve seasonality 2026-02-23 18:34:04 +01:00
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 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 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 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 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 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 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