Commit Graph
71 Commits
Author SHA1 Message Date
Christian Vidal Wolf 7a0375fca7 feat: auto-load Traffic data from Dropbox on app startup
- api/fetch-traffic.ts: New endpoint to fetch Traffic Weekly.xlsx from Dropbox
- App.tsx: Added handleTrafficFetch function and auto-fetch on initialization
2026-01-23 09:23:42 +01:00
Christian Vidal Wolf affae9e994 feat: integrate Glance Views (GV) from Traffic Weekly.xlsx
- types.ts: Added TrafficRecord interface and glanceViews field to CombinedKPIs
- dataProcessor.ts: Added processTrafficExcel parser for Traffic Weekly.xlsx
- dataProcessor.ts: Updated mergeSalesAndAdsData to accept and merge traffic data
- App.tsx: Added trafficData state and handleTrafficUpload handler
- FileUpload.tsx: Added Traffic file upload section for GV data
- AdsPerformance.tsx: Added GV and CVR(GV) summary cards
- AdsPerformance.tsx: Added GV column to product table
2026-01-23 09:07:38 +01:00
Christian Vidal Wolf 473174f7e6 feat: add Ad Spend and TACOS totals to Data Grid header
- DataGrid.tsx: Enhanced filteredTotalsByYear to aggregate advertising metrics
- DataGrid.tsx: Updated header row to include Ad Spend and TACOS cells per year
- DataGrid.tsx: Integrated YoY growth for Ad Spend
2026-01-22 15:40:56 +01:00
Christian Vidal Wolf aaca2ffe88 feat: move filtered totals to Data Grid table header
- DataGrid.tsx: Integrated aggregated totals into a new sticky header row
- DataGrid.tsx: Aligned Sell Out and Units totals directly above their respective columns
- DataGrid.tsx: Added YoY growth indicators to the header totals
- DataGrid.tsx: Improved performance with memoized total calculations
- DataGrid.tsx: Fixed syntax errors and TypeScript warnings
2026-01-22 15:26:04 +01:00
Christian Vidal Wolf 235928a588 fix: restore Top 50 button visibility in Weekly Sales tab
- WeeklyGrid.tsx: Corrected visibility condition for top50Ranking object structure
- WeeklyGrid.tsx: Verified and improved Top 50 filtering and sorting logic
2026-01-22 15:01:41 +01:00
Christian Vidal Wolf 183ca6b149 style: improve contrast and legibility for comparison figures
- AdsPerformance.tsx: Updated 'Prev:' labels and figures to indigo-300 for higher contrast
- AdsPerformance.tsx: Brightened secondary labels and product titles across the dashboard
- Ensures clear readability on dark backgrounds as requested by the user
2026-01-22 14:42:09 +01:00
Christian Vidal Wolf 9ebbdcf581 feat: show both current and previous values in Ads comparison view
- AdsPerformance.tsx: Update SummaryCard and TableCell to display 'Prev: [Value]' explicitly
- AdsPerformance.tsx: Standardized formatting using de-DE locale across all comparison metrics
- AdsPerformance.tsx: Improved growth calculation reliability in comparison mode
2026-01-22 14:33:10 +01:00
Christian Vidal Wolf 3ffcd9be44 style: update Ads tab number formatting to match Weekly Sales
- Use de-DE locale (dots for thousands, commas for decimals)
- Round Sales and Spend to integers
- Fix growth calculation to handle locale-specific formatting
2026-01-22 14:21:14 +01:00
Christian Vidal Wolf f774bb47a7 fix: ensure SKU filter applies to Ads data
- dataProcessor.ts: Update filterAdsData to correctly handle SKU filtering using global metadata
- Ensures that drill-down from Weekly Sales correctly isolates the target product in the Ads tab
2026-01-22 14:13:16 +01:00
Christian Vidal Wolf 8832ee0760 feat: enable SKU drill-down from Weekly Sales to Ads tab
- WeeklyGrid.tsx: Make SKU identifiers clickable with hover effects
- App.tsx: Implement handleSkuDrillDown to filter by SKU and switch to Ads view
2026-01-22 14:07:36 +01:00
Christian Vidal Wolf b23b2fba96 feat: allow drill-down from Weekly Sales to Ads tab via SKU
- WeeklyGrid.tsx: Add onDrillDown prop and make SKU identifiers clickable
- App.tsx: Implement handleSkuDrillDown to switch view and filter by SKU
2026-01-22 14:06:53 +01:00
Christian Vidal Wolf 25756ae763 feat: implement period-over-period comparison in Ads tab
- AdsPerformance.tsx: Automatically activate comparison view when 2 periods are selected
- AdsPerformance.tsx: Add growth percentages and trend indicators to table and summary
- AdsPerformance.tsx: Implement chronological sorting for previous vs current periods
- App.tsx: Pass filters to AdsPerformance component
2026-01-22 13:37:07 +01:00
Christian Vidal Wolf 18e003dd80 feat: implement Ads Performance tab
- types.ts: Add conversions field to CombinedKPIs
- dataProcessor.ts: Populate conversions in mergeSalesAndAdsData
- AdsPerformance.tsx: New component with aggregated advertising metrics and detailed product table
- App.tsx: Add Ads view to switcher and render AdsPerformance component
- Icons.tsx: Added icon support for the new Ads tab
2026-01-22 13:25:06 +01:00
Christian Vidal Wolf 9357aed662 fix: ensure Weekly Sales filters update totals and isolate products
- App.tsx: Add globalAsinMetadata to provide context for ad filtering
- dataProcessor.ts: Update filterAdsData to respect product line filters via metadata
- dataProcessor.ts: Update mergeSalesAndAdsData to use global metadata for ads-only records
- Ensures consistent calculation of totals and visibility when filtering by Line or ASIN
2026-01-22 13:07:43 +01:00
Christian Vidal Wolf 0214509ffe feat: implement country-aware Top 50 ranking
- App.tsx: Update top50Ranking2025 to calculate ranks based on active country filters
- App.tsx: Add split Pan-EU vs UK ranking when no filters are active
- WeeklyGrid.tsx: Add support for multiple ranking badges (EU/UK)
- WeeklyGrid.tsx: Enhance Top50Badge with labels and color themes
- WeeklyGrid.tsx: Update sorting and filtering logic for new ranking structure
2026-01-22 13:01:04 +01:00
Christian Vidal Wolf 8005a99a48 style: add custom bounce animation for sort indicators
- Added animate-bounce-subtle to index.html
- Makes the sorting arrow look more dynamic and premium
2026-01-22 12:22:57 +01:00
Christian Vidal Wolf ade6d01df2 feat: add sorting by Top 50 rank in Weekly Sales
- Updated SortConfig to support 'rank' metric
- Implemented sorting logic by 2025 rank (1-50)
- Automatically trigger rank sort when 'Top 50 Only' filter is active
- Added sortable header for 'Product Details' column
- Added subtle animation for sort arrow
2026-01-22 12:22:36 +01:00
Christian Vidal Wolf 2d1f3703c2 feat: add Top 50 Only filter toggle button
- New toggle button in Weekly Sales toolbar to show only Top 50 products
- Button displays with trophy icon and golden gradient when active
- Resets pagination when toggled
- Works in combination with other filters (search, growth)
2026-01-22 12:17:19 +01:00
Christian Vidal Wolf 1c8ec7b835 feat: add Top 50 Best Sellers badge in Weekly Sales
- Calculate static Top 50 ranking based on 2025 Sell Out (independent of filters)
- Display trophy badge with position number for Top 50 ASINs
- Badge shows 🏆 followed by rank (1-50)
- Ranking stays static regardless of date/country filters applied
- Pre-computed ranking based on cumulative 2025 data
2026-01-22 12:02:21 +01:00
Christian Vidal Wolf 15f5b08c71 perf: add lazy loading for heavy components
- Use React.lazy for DataGrid, WeeklyGrid, and TopMovers
- Add Suspense with LoadingSpinner fallback for smooth transitions
- Enables code splitting for faster initial page load
- Combined with previous O(n²) fix, should significantly improve performance
2026-01-22 11:55:23 +01:00
Christian Vidal Wolf fa69a68b57 perf: fix critical O(n²) bottleneck in mergeSalesAndAdsData
- The ads-only metadata lookup was doing a nested forEach (O(ads × sales))
- Now pre-builds asinMetadata map during sales aggregation for O(1) lookups
- This reduces complexity from O(n²) to O(n) for large datasets
- Should dramatically improve loading time for Weekly Sales tab
2026-01-22 11:52:03 +01:00
Christian Vidal Wolf 3586e3cdd4 perf: optimize WeeklyGrid for faster loading
- Limit visible weeks to 8 (configurable MAX_VISIBLE_WEEKS)
- Add debounced search (300ms delay) to reduce re-renders
- Calculate weekTotals in single pass O(rows) instead of O(weeks × rows)
- Memoize callbacks with useCallback (handleSort, renderGrowth, handleExportExcel)
- Export still includes ALL weeks for complete data
2026-01-22 11:44:24 +01:00
Christian Vidal Wolf 17441a9b30 fix: correct ad spend over-calculation in Weekly Grid
- Refactored mergeSalesAndAdsData to aggregate by ASIN+Customer+Year+Week
- Each ASIN/Week now produces exactly one output record
- Updated pivotWeeklySalesData to use ASIN as primary key
- Fixed double-counting when same ASIN had multiple SKUs
- Added support for ads-only records (ASINs with spend but no sales)
- Changed App.tsx to use filtered ads data for accurate totals
2026-01-22 11:37:53 +01:00
Christian Vidal Wolf 8b47ab844e fix: include ads-only ASINs in merge and use unfiltered rows for totals
1. Changed weekTotals to use 'rows' instead of 'filteredRows' so totals
   always show complete sums regardless of search/growth filters
2. Added second pass in mergeSalesAndAdsData to include ads records for
   ASINs that have ad spend but no corresponding sales data
2026-01-22 09:24:40 +01:00
Christian Vidal Wolf 8de4521fbe fix: export Excel data in same order as on-screen sorted view
Changed from filteredRows to sortedRows to preserve current sort order in export
2026-01-22 08:59:31 +01:00
Christian Vidal Wolf 4e2cf857f8 feat: add Excel export and improve table layout in Weekly Sales
- Added Export Excel button to download filtered data as .xlsx
- Increased table container height to maximize visible rows
- Headers remain sticky at viewport top during scroll
2026-01-22 08:53:20 +01:00
Christian Vidal Wolf a4ede0ea5a feat: add growth filtering in Weekly Sales grid
- Added Gaining/Dropping/Stable filter modes with configurable threshold
- Filter compares unit volume between active week and previous week
- Updated toolbar UI with growth filter dropdown and threshold input
2026-01-22 08:43:14 +01:00
Christian Vidal Wolf 82bdf02a35 fix: ensure 100% opaque sticky headers and columns in Weekly Sales grid
- Replaced semi-transparent backgrounds with solid opaque colors.
- Removed backdrop blurs from sticky elements to prevent scroll artifacts.
- Refined z-index layering for sticky intersections.
2026-01-21 17:13:51 +01:00
Christian Vidal Wolf 500eb5aeff feat: display ASIN next to SKU in Weekly Sales grid and enable ASIN search 2026-01-21 17:03:58 +01:00
Christian Vidal Wolf 50fccba432 feat: implement per-column metric sorting in Weekly Sales grid
- Removed global Units/Spend toggle.
- Added separate clickable 'Units' and 'Spend' buttons in each week header.
- Updated handleSort and sort indicators for per-metric control.
- Fixed code duplication in WeeklyGrid.tsx.
2026-01-21 16:56:52 +01:00
Christian Vidal Wolf 7e50a9af65 feat: add explicit metric toggle for Weekly Sales sorting
- Added Units/Spend toggle to the toolbar.
- Refactored column sorting to use the active toggle metric.
- Simplified sort cycling to just toggle direction (DESC/ASC).
- Fixed JSX structure and code duplication.
2026-01-21 16:49:11 +01:00
Christian Vidal Wolf daad27c26d feat: enhance Weekly Sales UI with larger fonts and advanced metric filtering
- Increased font sizes for better readability across the grid.
- Implemented multi-metric sorting (Units DESC/ASC, Spend DESC/ASC) for week columns.
- Added visual indicators for active sort metric and direction.
2026-01-21 16:37:49 +01:00
Christian Vidal Wolf e2e5314b55 feat: optimize Weekly Sales performance and implement Pan-EU default filter
- Implemented pagination and local search in WeeklyGrid to handle large datasets.
- Refactored Weekly Sales tab to show units and ad spend per SKU.
- Added default Pan-EU country filter (DE, FR, IT, ES) when no country is selected.
2026-01-21 16:28:56 +01:00
Christian Vidal Wolf e93da747a3 feat: show ad spend and remove grouping in weekly sales tab 2026-01-21 15:05:59 +01:00
Christian Vidal Wolf ecfa3ee9ec feat: add interactive sorting to weekly sales tab 2026-01-21 13:41:52 +01:00
Christian Vidal Wolf 7e700ea628 style: polish weekly sales UI with grouping and compact styling 2026-01-21 13:31:09 +01:00
Christian Vidal Wolf 01c90ad889 feat: add weekly sales tab with WoW growth 2026-01-21 13:19:13 +01:00
Christian Vidal Wolf cc6fd25065 style: condense advertising performance panel in dashboard 2026-01-21 12:53:21 +01:00
Christian Vidal Wolf 0138b787b2 feat: multi-year ads performance and YoY growth in Dashboard 2026-01-21 12:49:21 +01:00
Christian Vidal Wolf c7cef7954b fix: restore customer field in grid by normalizing CombinedKPIs fields 2026-01-21 11:04:53 +01:00
Christian Vidal Wolf b6573ebe15 feat: enable ads metrics at any grouping level (SKU, Line, etc.) in Grid 2026-01-21 11:02:12 +01:00
Christian Vidal Wolf 1c2a0e86aa fix: increment DB version and improve ads parsing robustness 2026-01-21 10:52:30 +01:00
Christian Vidal Wolf e5c72c48c5 feat: automatic ads data loading and attributed sales line in chart 2026-01-21 10:46:50 +01:00
Christian Vidal Wolf 1c826c2487 feat: Add Amazon Ads Weekly integration with Dashboard KPIs, Grid summary, and chart lines
- Update AdsRecord interface to support weekly data (year, week, cpc, ctr, acos, conversions)
- Rewrite processAdsExcel to parse multiple sheets (2025, 2026) with 12-column format
- Update mergeSalesAndAdsData to match by ASIN+Country+Year+Week
- Add Advertising Performance section to Dashboard with Ad Spend, Attributed Sales, ACOS, ROAS
- Add Ads toggle button and summary bar to DataGrid
- Add Ad Spend lines (fuchsia dashed) to weekly comparison chart
- Fix import paths in Dashboard.tsx and AdvertisingDashboard.tsx
2026-01-21 09:45:50 +01:00
Christian Vidal Wolf 67951bcac8 feat: Implement Pan-EU grouping in Grid tab
- Added applyPanEUGrouping() helper function in dataProcessor.ts
- Groups Amazon DE/IT/FR/ES as 'Pan-EU' when no customer filter applied
- Shows individual countries when specific filter is selected
- Updated DataGrid to accept hasCustomerFilter prop
- Updated App.tsx to pass filter state to DataGrid
- Keeps Amazon UK and Amazon SC separate
- Verified with browser testing: grouping works correctly
2026-01-20 12:59:35 +01:00
Christian Vidal Wolf 98aba3e36b feat: Add European number formatting with dots as thousand separators
- Updated all toLocaleString() calls to use 'de-DE' locale
- Applied to DataGrid, Dashboard, AdvertisingDashboard, TopMovers, geminiService
- Numbers now display as €1.234 instead of €1,234
- Fixed spread operator syntax errors introduced during bulk replacement
- Verified across all tabs: Dashboard, Grid, Advertising
2026-01-20 12:14:13 +01:00
Christian Vidal Wolf 73519791b9 Fix: Resolve array mutation bug preventing Grid sorting from working
- Changed result.sort() to result = [...result].sort() to create new array reference
- React now properly detects changes and re-renders sorted data
- All columns (Sell Out, Units, S.O. Δ%, Units Δ%) now sort correctly
- Verified with comprehensive browser testing
2026-01-20 11:15:35 +01:00
Christian Vidal Wolf 15ad483c25 Fix: Add sorting functionality for growth percentage columns in Grid tab 2026-01-20 11:00:07 +01:00
Christian Vidal Wolf cd2a5a7c4f feat: add YoY growth percentages to filtered totals summary 2026-01-17 11:59:56 +01:00
Christian Vidal Wolf 1de07d3342 feat: add filtered totals summary above Grid table 2026-01-17 11:54:46 +01:00
Christian Vidal Wolf bcb1a7a6d1 fix: add cache versioning to invalidate stale data on schema changes 2026-01-17 11:41:41 +01:00
Christian Vidal Wolf 5630d84e10 fix: map product line to LICENSE column (column T) 2026-01-17 11:28:36 +01:00
Christian Vidal Wolf 84d0291360 refactor: simplified data loading with direct fetch endpoint 2026-01-17 11:12:39 +01:00
Christian Vidal Wolf 9d2d115bd2 fix: resolve syntax error in dropbox proxy 2026-01-16 14:22:38 +01:00
Christian Vidal Wolf 0f07e11ec2 fix: ensure node-fetch is available and report errors 2026-01-16 14:22:27 +01:00
Christian Vidal Wolf 599b0fa8e2 fix: robust handling of Dropbox URLs in proxy with query params 2026-01-16 14:20:08 +01:00
Christian Vidal Wolf 17eb5484c1 fix: update data source URL and force refresh on change 2026-01-16 14:13:47 +01:00
Christian Vidal Wolf a57e166276 refactor: remove Ads tab and view 2026-01-16 13:23:34 +01:00
Christian Vidal Wolf b850803f70 feat: add Smart Range filter for Weeks 2026-01-16 13:11:10 +01:00
Christian Vidal Wolf 0075129d76 feat: add Week filter and Grid Growth % columns 2026-01-16 11:47:59 +01:00
Christian Vidal Wolf 15b44d4d91 fix: add vercel.json for explicit API and SPA routing 2026-01-16 11:13:23 +01:00
Christian Vidal Wolf 3a689ddb13 fix: rename dropbox api to catch-all route [...path] for Vercel support 2026-01-16 11:11:06 +01:00
Christian Vidal Wolf 6a368ffd1f feat: exclude 2023 data & improve weekly sales tooltip (add Sell Out €) 2026-01-16 11:07:35 +01:00
Christian Vidal Wolf e271d9d5ba feat: Vercel serverless proxy for Dropbox (fix deploy issues) && update App.tsx 2026-01-16 10:50:39 +01:00
Christian Vidal Wolf a1ad3aa944 feat: restrict data to Amazon customers only (DE/FR/ES/IT/UK/SC) 2026-01-16 10:44:43 +01:00
Christian Vidal Wolf 470db20458 feat: Automate Dropbox data loading with Vite proxy 2026-01-16 10:20:22 +01:00
Christian Vidal Wolf 135e0d78ed feat: Add ESLint configuration and enhance data fetching with timeouts and improved error handling. 2025-12-12 11:46:04 +01:00
Christian bde9d323f1 feat: Integrate advertising data and dashboard
Adds functionality to process and display advertising data alongside sales data. This includes:
- Introducing a new `AdvertisingDashboard` component.
- Modifying `FileUpload` to accept advertising CSVs.
- Updating `App.tsx` to manage and display both sales and ad data.
- Enhancing `dataProcessor.ts` to handle advertising CSV parsing and merging.
- Adding a `MegaphoneIcon` for advertising-related UI elements.
- Defining new types for advertising records and combined KPIs.
2025-12-11 15:08:01 +01:00
Christian 31eed97ec4 feat: Integrate PapaParse for CSV handling
Adds papaparse as a dependency and updates the data processing service to use it for more robust CSV file parsing. This replaces manual CSV parsing logic with a dedicated library, improving reliability and handling of various CSV formats.

Also renames the `MoversIcon` to `TrendingIcon` to better reflect its usage in indicating trending performance metrics.
2025-12-11 14:03:33 +01:00
Christian 9ba63ab8f8 feat: Initialize Craze Analytix project structure
Sets up the project with Vite, React, Tailwind CSS, Gemini AI integration, and necessary dependencies for data analysis. Includes initial configuration for TypeScript, Tailwind, and project metadata.
2025-12-11 11:25:26 +01:00
ChristianandGitHub 563e6110ce Initial commit 2025-12-11 11:24:27 +01:00