Commit Graph
383 Commits
Author SHA1 Message Date
Christian Vidal Wolf f218db76ad Fix: correctly filter Dashboard revenue by enforcing Marketplace and Unit rules in filterData 2026-04-20 13:04:41 +02:00
Christian Vidal Wolf 8e81fc8500 Fix: restore missing React imports in WeeklyGrid.tsx 2026-04-20 12:58:36 +02:00
Christian Vidal Wolf 1e7c88ffad Fix: Corrected 2026 revenue discrepancy, resolved WeeklyGrid initialization crash, and restored Week Coverage data 2026-04-20 12:54:40 +02:00
Christian Vidal Wolf 11ddcb16c5 fix: add fallback UI to VendorStockBadge to prevent empty WOC lines when data is missing 2026-04-17 12:48:18 +02:00
Christian Vidal Wolf c1cf79cb6b feat: move Week Coverage to its own dedicated sticky column per SKU and clean up totals row 2026-04-17 12:41:05 +02:00
Christian Vidal Wolf 59c4b3a204 fix: resolve ReferenceError by moving aggregateWoc after filteredRows initialization 2026-04-17 12:37:59 +02:00
Christian Vidal Wolf 38f16aac89 feat: improve Week Coverage visibility, calculation robustness, and add aggregate WOC to grid totals and forecast view 2026-04-17 12:35:25 +02:00
Christian Vidal Wolf aa4a916c5d fix: Restore missing top50Ranking2025 definition 2026-04-17 08:14:50 +02:00
Christian Vidal Wolf 5088e04d5f fix: Define missing filteredBsrData to resolve critical ReferenceError 2026-04-17 08:12:18 +02:00
Christian Vidal Wolf 73625526ed fix: exhaustive zero-spread safety audit and render logging 2026-04-16 12:18:52 +02:00
Christian Vidal Wolf fbb6c75197 perf: disable StrictMode and optimize App calculations to handle 120k+ rows 2026-04-16 12:09:52 +02:00
Christian Vidal Wolf 630941c96a fix: resolve white screen by removing stack-unfriendly spread operators and adding diagnostic logs 2026-04-16 12:02:49 +02:00
Christian Vidal Wolf 348821cd49 fix: exhaustive visibility fix for Sales/Ads data including inclusive filtering and permissive header validation 2026-04-16 11:49:48 +02:00
Christian Vidal Wolf adf72f6f96 fix: restore sales visibility by normalizing marketplace names in Sales pipeline 2026-04-16 11:41:58 +02:00
Christian Vidal Wolf 8c0401f3d5 fix: relax data filters and marketplace mapping to restore sales visibility 2026-04-16 11:37:33 +02:00
Christian Vidal WolfandQwen-Coder d2ee6c3bf0 fix: add missing props destructuration in Dashboard component
- Added stockMap, vendorStockMap, buyBoxLostMap, top50Mode to Dashboard props destructuring
- This fixes 'stockMap is not defined' error in TopMovers

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 15:14:11 +01:00
Christian Vidal WolfandQwen-Coder 579e96cf5d fix: add null safety checks for years in TopMovers
- Add || null to years array access to prevent undefined values
- Add !currentYear || !previousYear to insufficient data check
- This prevents errors when filtered data has less than 2 years

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 15:12:10 +01:00
Christian Vidal WolfandQwen-Coder 3c199715b9 fix: remove debug code from BuyBoxWarningBadge causing runtime error
- Removed debug console.log that was accessing data before null check
- Fixed colSpan in TopMovers empty state message (7 -> 10 columns)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 15:09:07 +01:00
Christian Vidal WolfandQwen-Coder 19f1137a30 feat: add stock, vendor and buybox badges to Top Movers table
- Added StockBadge, VendorStockBadge and BuyBoxWarningBadge to TopMovers component
- Updated Dashboard to pass stockMap, vendorStockMap, buyBoxLostMap and top50Mode props
- Updated App.tsx to pass the required maps to Dashboard
- Table now shows 3 new columns: Stock (GMBH), Vendor (Amazon Warehouse), and Buy Box status

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-16 15:05:11 +01:00
Christian Vidal WolfandQwen-Coder 167273e659 fix: Top Movers table now responds to dashboard filters
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>
2026-03-16 14:57:09 +01:00
Christian Vidal Wolf b304e0ddb8 fix: resolve maximum call stack size exceeded error and optimize master table 2026-03-16 13:19:21 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 845a8e0ae6 fix: resolve black screen caused by React hooks violation in WaterfallModal
Move useMemo before early return in WaterfallModal to comply with Rules of Hooks.
Wrap App with ErrorBoundary so future render crashes show an error panel instead of a silent black screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 13:04:42 +01:00
Christian Vidal Wolf 753b312412 fix(mkt): ensure all ad spend is aggregated correctly in MKT tab including unassigned spend 2026-03-12 17:07:13 +01:00
Christian Vidal Wolf eb20fe2878 fix: include ad rows without ASINs to match total PPC spend (Sponsored Brands fix) 2026-03-12 16:59:11 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 777a01e417 fix: use all-country ads for MKT tab to match Excel file total
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>
2026-03-12 16:52:06 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 910e6d2a4d fix: include empty-ASIN ad records so MKT total matches ADs Weekly
Removed the `if (asin)` guard so records without a product ASIN
(e.g. campaign-level rows) accumulate in adsSpendMap and appear as
an 'Unassigned Ad Spend' row, ensuring the total PPC spend is the
same as in the ADs Weekly tab.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:44:36 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 36fa63b6c1 fix: zero out deals/promos/chargebacks when 2025 is not in filtered scope
These Excel files only contain 2025 data. When the top filter excludes
2025 (e.g. year=2024), the maps are ignored so columns show 0 instead
of stale 2025 figures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:26:52 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 0eda5551d8 fix: include all ad-spend ASINs in MKT tab to match ADs Weekly total
Two bugs fixed:
1. Removed hardcoded year===2025 filter (data is already pre-filtered)
2. ASINs with ad spend but no sales records were silently dropped —
   now appended as extra rows so the total PPC spend matches ADs Weekly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12 16:18:46 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 657009a7ba feat: wire MKT tab to top-level filters and remove internal category filter
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>
2026-03-12 14:35:37 +01:00
Christian Vidal WolfandQwen-Coder 12fb15cae3 style: rename MKT tab from 'MKT (preview)' to 'MKT'
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-11 13:20:05 +01:00
Christian Vidal Wolf 9c55d132dd feat(mkt): filter sales and ads to 2025 only and show full product catalog 2026-03-11 13:06:06 +01:00
Christian Vidal Wolf 7240c9998c style: fix mkt tab columns visibility by wrapping product names 2026-03-11 13:00:19 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 6a1cb0e8dd refactor: consolidate 3 MKT fetch routes into fetch-mkt-data to stay within Vercel 12-function limit
Replace fetch-deals, fetch-promos, fetch-chargebacks with a single
/api/fetch-mkt-data?file=deals|promos|chargebacks endpoint.
Update MktDataView fetch calls accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 12:36:45 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 49498c5c51 feat: wire MKT tab to real data sources
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>
2026-03-11 12:34:07 +01:00
Christian Vidal WolfandQwen-Coder 5d0edfba5f ui: rename Gross Sales to SELL OUT in MKT table
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-11 10:34:17 +01:00
Christian Vidal WolfandQwen-Coder ba69375dbe ui: rename MKT tab to MKT (preview)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-11 10:25:57 +01:00
Christian Vidal Wolf f323e2a96e feat: split Incentives into Deals and Promos in MKT tab 2026-03-11 09:31:39 +01:00
Christian Vidal Wolf 455cd8ed08 feat: add MKT tab and integrate profitability dashboard 2026-03-11 09:27:57 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 0e1457bd3d fix: BSR rank line now shows in BSR vs Units Sold chart
BSRRecord.market is stored as short codes ('DE', 'IT', etc.) from the
Excel file, but the chart was comparing against full names ('Amazon DE',
'Amazon IT', etc.) — causing bsrRecordsForMarket to always be empty and
the BSR line to never render. Added normalizeBsrMarket() to map short
codes to full names before filtering. Also removed the debug strip.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 09:08:30 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 dcf77cad2d perf: make filter dropdowns feel instant with useDeferredValue
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>
2026-03-11 09:02:24 +01:00
Christian Vidal WolfandQwen-Coder 8e907f1dff refactor: remove Movers tab (table now integrated in Dashboard)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-10 14:09:39 +01:00
Christian Vidal Wolf cefbc18433 fix: simplify green/red logic for inverted metrics in experiments 2026-03-10 14:07:43 +01:00
Christian Vidal Wolf 74d92b83b5 fix: logic to show BSR improvements (rank drops) in green 2026-03-10 14:04:20 +01:00
Christian Vidal Wolf c15642d62d feat: add Detail Level BSR metric to experiments analysis 2026-03-10 13:58:44 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 2363982144 feat: simplify verdict to winner/unsuccessful with >50% threshold
- winner if posterior probability > 50%, unsuccessful otherwise
- Removes inconclusive — binary outcome based on Bayesian signal
- Label "Loser" renamed to "Unsuccessful"
- Updated all stored experiment verdicts in DB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 13:47:01 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 127fa9c279 fix: show 1-decimal probability and conditional confidence badge
- Display probability with 1 decimal (89.8% instead of 90%) so users
  understand why it's below the 90% winner threshold
- Replace hardcoded "Significant Confidence Reached" badge with
  verdict-aware badge: winner=green, loser=red, inconclusive=amber

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 13:36:23 +01:00
Christian Vidal WolfandQwen-Coder e118d43b3d rename Vendor tab to BSR
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-10 13:36:21 +01:00
Christian Vidal Wolf fdf217c8e6 Implement dynamic annual impact projection in Experiment view 2026-03-10 13:20:20 +01:00
Christian Vidal WolfandClaude Sonnet 4.6 af77a3f5d4 fix: parseAsins splits LINE: names with spaces correctly
Split by comma/semicolon/newline first; only split by spaces for
non-LINE: tokens so "LINE:MAGIC DOUGH" isn't broken into two parts.
Also fix placeholder and repair stored experiment data via API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 13:14:23 +01:00
Christian Vidal Wolf b8c3a6ff49 Remove redundant info cards from Experiment detail view 2026-03-10 13:13:23 +01:00