Commit Graph
209 Commits
Author SHA1 Message Date
Christian Vidal WolfandClaude Sonnet 4.6 31d1755122 fix: use detailLevelBSR in BSR vs Units chart with topLevel fallback
Detail category BSR is more granular and relevant per ASIN. Falls back
to topLevelBSR if detailLevelBSR is null for a record.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 11:07:54 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 f1e11ca79a fix: replace Math.max(...spread) with loop to prevent call stack overflow
Math.max(...largeArray) crashes when combinedAdsData has thousands of
records. Replaced with a simple for-loop to find the max year safely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 11:03:56 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 3e3975cd2b feat: add BSR vs Units correlation chart to Vendor tab
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>
2026-03-09 10:58:01 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 507af94e1a fix: move BuyBoxWarningBadge inside stockMap block to prevent duplication
The badge was rendered outside the stockMap conditional, causing it to
appear independently of the Amazon stock badge. Now it's grouped inside
the block, always appearing immediately next to VendorStockBadge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 10:23:28 +01:00
Christian Vidal WolfandQwen-Coder 826688a3f6 fix: prevent BuyBox badge visual duplication
- Wrap component with memo() to prevent unnecessary re-renders
- Restructure DOM hierarchy to avoid nested inline-flex containers
- Center hover popup with left-1/2 -translate-x-1/2
- Add pointer-events-none to popup to prevent hover flickering
- Improve popup spacing and sizing

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-09 10:10:32 +01:00
Christian Vidal WolfandQwen-Coder c58b246c41 fix: remove duplicate buybox lost badge from SKU column in GRID
The BuyBoxWarningBadge was appearing twice - once next to the SKU and once next to Amazon stock. Now it only appears next to Amazon stock as requested.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-09 09:52:33 +01:00
Christian Vidal Wolf 1c23053e57 feat: replace old detail view entirely with premium dashboard and add safe metric fallbacks 2026-03-04 10:05:39 +01:00
Christian Vidal Wolf be49b0a7af fix: show dashboard when didResults exist even if verdict is missing 2026-03-04 09:57:55 +01:00
Christian Vidal Wolf 7748e869b7 feat: redesign experiment results dashboard to match premium dark theme 2026-03-04 09:53:57 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 07461031b8 fix(VendorDataView): assign distinct color per market in all three charts
Each market line (DE/ES/FR/IT/UK) now renders with its own color across
Top Level BSR, Detail Level BSR, and Average Rating charts, along with
per-market legend entries. Removes hardcoded single-color approach.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 09:06:05 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 1d0ea2f485 fix(vendor): abbreviate large BSR numbers on Y-axis (500000 → 500K, 1.2M)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 08:57:49 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 c49b331e82 fix(vendor): remove duplicate 'Altro' key in category translation map
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 08:52:00 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 110ec13ac4 feat(vendor): translate BSR category names to English
Add translateCategory() with a full DE/FR/IT/ES → EN map covering
all top-level and detail categories found in the BSR data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 08:50:15 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 9af2296a9b fix(vendor): remove gradient fill from BSR and rating charts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 08:42:20 +01:00
Christian Vidal Wolf 8d849dfb63 feat: show category names next to BSR chart headers when single ASIN selected 2026-03-04 08:40:46 +01:00
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