Commit Graph
134 Commits
Author SHA1 Message Date
Michael cd7b87aef8 feat: date de derniere entree en stock par magasin dans le tooltip des badges 2026-05-26 15:57:16 +02:00
Michael 1b5c260813 feat(grid): add premium semi-blocking glassmorphism loading overlay with real-time stream progression 2026-05-26 14:00:16 +02:00
Michael d75102fb18 perf(grid): optimize state store with O(1) row indexing and debounced summary calculations 2026-05-26 13:53:51 +02:00
Michael e6f40d3d81 feat(grid): implement product streaming with JSON chunks for grid client 2026-05-26 13:31:26 +02:00
MichaelandClaude Sonnet 4.6 dc16beeda4 feat: add no-sales-6-months tab to stock management page
Adds a second tab "Sans vente 6 mois" on the grid page listing all
products with no sale in the last 6 months, sorted by oldest last
sale first. Resolves merge conflicts from upstream refactor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:49:13 +02:00
Michael 6492f93bf4 feat: add NoSalesTab component to display products without sales in the last 6 months 2026-04-14 12:45:21 +02:00
Michael a2c4a065dd feat: add ExportDropdown component with Excel and PDF export functionality for grid data 2026-04-10 13:25:19 +02:00
MichaelandClaude Sonnet 4.6 6b26676836 feat: flag products whose last registered supplier differs from current view
Instead of unreliable preference=1, use artfou1.no_id DESC (most recently
added artfou1 entry) to identify the last supplier for each product.
Shows an amber warning icon in the Désignation column when the last
supplier ≠ current supplier view, with tooltip showing who to attribute
the sales to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:55:42 +02:00
MichaelandClaude Sonnet 4.6 6ef23de317 feat: restrict AI analysis to admin role only
- FloatingSummaryBar: hide BulkAiAnalyzer button for non-admins
- AiInsightBlock: hide individual Analyser button for non-admins
- Both use useSession() to check role === "admin"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:43:48 +02:00
MichaelandClaude Sonnet 4.6 bbb04a4d2a fix: immediate AI loading feedback + auto-fallback for deprecated model
- BulkAiAnalyzer: set isAnalyzing=true immediately on click (before
  context fetch), so the spinner appears instantly instead of after
  1-2 seconds of silence
- analyze/route.ts: if configured model returns 400/404 (e.g., deprecated
  google/gemini-flash-1.5), automatically retry with google/gemini-2.0-flash-001
- batch-analyze/route.ts: same fallback logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:34:14 +02:00
MichaelandClaude Sonnet 4.6 2aa9cbecaa revert: restore grid to pre-infinite-scroll state
Remove infinite grid loading, useInfiniteGrid hook, and server-side
pagination API route. Revert grid components to the simpler version
that avoids 2MB+ cache failures from unstable_cache.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 11:26:13 +02:00
Michael b39e010903 feat: implement infinite grid loading with server-side pagination and client-side integration 2026-04-02 18:39:29 +02:00
Michael 4dfdcc1144 feat: implement infinite scrolling and background data loading for the product grid component 2026-04-02 17:47:10 +02:00
Michael f70249555e feat: implement high-performance virtualized heatmap grid with granular Zustand state management 2026-04-02 17:36:42 +02:00
Michael 88a3121c92 feat: implement grid state management, data fetching, and infinite scroll infrastructure 2026-04-02 17:22:41 +02:00
Michael 2893114fca feat: implement infinite grid pagination with server-side data fetching and custom hook 2026-04-02 17:17:32 +02:00
Michael 7e4b370267 feat: implement PostgreSQL client for bulk data retrieval to replace per-article HTTP requests and configure Claude permissions 2026-04-02 16:31:11 +02:00
MichaelandClaude Sonnet 4.6 ead53db496 feat: restrict gamme/export/exports-page to admin; fix create user button style
- Non-admin users see gamme as read-only badge (no select)
- Export button hidden for non-admin in grid
- Save drafts button hidden for non-admin
- Exports page hidden in sidebar for non-admin
- Create user button: explicit blue style (was unreadable with apple-btn-primary)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 13:29:52 +02:00
Michael 8ecba594cf feat: introduce virtualized heatmap grid component with dynamic monthly data and optimized cell rendering. 2026-03-23 16:20:17 +01:00
Michael ffa257fda1 feat: Implement product heatmap grid with comprehensive data aggregation and PostgreSQL client for product rows. 2026-03-23 16:09:09 +01:00
Michael bba6fe05e8 feat: implement client-side grid orchestrator and core heatmap table component. 2026-03-23 14:13:39 +01:00
Michael 53b85381fa feat: add server-side API for fetching and processing comprehensive product data for the grid. 2026-03-23 14:00:27 +01:00
Michael 99954fb001 feat: Add AI Copilot Zustand store for managing and persisting product insights. 2026-03-23 13:34:36 +01:00
Michael 86df5d6f29 feat: introduce BulkAiAnalyzer component for bulk product classification and AI context profiling. 2026-03-23 12:43:02 +01:00
Michael e391550a30 feat: Introduce product assortment grid client and direct PostgreSQL data access for FF Nancy. 2026-03-20 14:25:30 +01:00
MichaelandClaude Sonnet 4.6 a16ec24cd7 perf+fix: parallelize article pagination, filter inactive articles, add gamme Y
Performance fixes for large suppliers (14k+ articles):
- fetchAllPages now fetches page 1, reads total count from response,
  then fetches remaining pages in parallel (10 at a time) instead of
  sequentially. Falls back to sequential if no count in response.
- getProductRows filters out suspended/inactive articles before calling
  getMensuelByArticles and getReferentielByArticles, reducing API calls
  from N_total to N_active (e.g. 14775→~2500 for S053).
- getRankingByArticles receives only active articles for bulk fetch.
- FfArticle now exposes actif and suspendu fields.

Gamme Y support:
- GammeSelect: add Y option with violet color
- GridFilterBar: add Y filter button with violet color
- BulkActionToolbar: add Y bulk assignment button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:23:38 +01:00
MichaelandClaude Opus 4.6 414bf6133d fix: correct snapshot save to detect all gamme changes (drafts + validated)
handleSnapshot was only looking at active draftChanges to build the
snapshot. After validation (Valider), drafts are cleared but changes
are applied to row.codeGamme via applyDraftsToRows. This caused
handleSnapshot (Camera/Export) to save an empty snapshot that
overwrote the real one, losing all gamme changes on page reload.

Now handleSnapshot compares (draftChanges[codein] ?? row.codeGamme)
vs row.codeGammeInit to detect ALL changes, whether drafted or
already validated. Uses codeGammeInit as "before" reference (API
value, never modified).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 17:13:49 +01:00
Michael 01d2dc8b34 feat: add BulkAiAnalyzer component for automatic product classification and AI context profiling. 2026-03-19 15:52:48 +01:00
Michael aa69637f98 feat: Introduce bulk AI analyzer component to pre-classify products and prepare data for AI analysis, including context profiling. 2026-03-19 13:19:49 +01:00
Michael a4528c6d14 feat: Add HeatmapGrid component for visualizing product data with TanStack Table, virtualization, and performance optimizations. 2026-03-19 13:02:16 +01:00
Michael 8b7d81b20c feat: implement product grid with comprehensive product data fetching, processing, and heatmap display. 2026-03-19 12:41:03 +01:00
Michael d8a9329075 feat: Introduce AI Copilot feature with product analysis engine, state management, and UI components for insights. 2026-03-19 07:53:56 +01:00
Michael 95795ce7e3 feat: Introduce AI analysis engine for product A/Z recommendations based on detailed business rules. 2026-03-18 22:15:14 +01:00
Michael aa02d019bd feat: Implement AI Copilot for product analysis and add comprehensive product grid data fetching. 2026-03-18 21:25:53 +01:00
Michael cefe6060d0 feat: implement virtualized heatmap grid component using TanStack Table and Virtual for product data display. 2026-03-18 20:52:13 +01:00
Michael aa77025d14 feat: introduce virtualized heatmap grid component with client-side filtering, sorting, and optimized Zustand state management. 2026-03-18 20:49:57 +01:00
Michael 9aca3b8ead feat: Add virtualized heatmap grid component with dynamic columns, filtering, and row selection. 2026-03-18 20:34:23 +01:00
Michael 7b209292b9 feat: introduce GridClient component to manage grid state, scoring, and UI orchestration. 2026-03-18 14:35:24 +01:00
Michael 1035489db1 feat: Add FF Nancy API client and status endpoint, implement grid product fetching and draft change saving, and introduce AI Copilot core logic. 2026-03-18 14:31:29 +01:00
Michael 2d3a90d6c7 feat: add floating summary bar component with grid statistics, draft management, snapshot, and export functionality. 2026-03-12 14:25:39 +01:00
Michael f15fbe69ec feat: Implement core grid state management with Zustand, define grid data types, and introduce a heatmap cell component. 2026-03-10 12:56:37 +01:00
Michael 54a4e7f4d1 feat: add bulk AI analyzer component for product scoring and context profiling. 2026-03-06 16:00:42 +01:00
Michael 34e8f4a767 feat: add bulk action toolbar component for applying gamme codes to selected items. 2026-03-06 15:53:24 +01:00
Michael cdc310223c feat: implement virtualized heatmap grid component using TanStack Table and a new Zustand store for product data. 2026-03-06 15:27:18 +01:00
Michael 1ba507da94 feat: implement virtualized heatmap grid component with a Zustand store for managing grid data, filters, and draft product gamme changes. 2026-03-06 15:15:11 +01:00
Michael 38955ab02a feat: introduce HeatmapGrid component for virtualized product data display with gamme selection and performance optimizations. 2026-03-06 15:08:35 +01:00
Michael d75454dd56 feat: Implement virtualized product heatmap grid with data fetching and client integration. 2026-03-06 15:03:25 +01:00
Michael 57449ec603 feat: introduce heatmap grid component for displaying and managing product data with virtualization and performance optimizations. 2026-03-06 11:18:35 +01:00
Michael eb5bceb5bf feat: introduce DropdownMenu UI component and create HeatmapGrid file. 2026-03-06 11:14:56 +01:00
Michael baebf50d7a feat: implement new DropdownMenu UI component and create tsc-errors.txt to log existing TypeScript compilation issues. 2026-03-06 11:04:14 +01:00