Commit Graph
33 Commits
Author SHA1 Message Date
Christian Vidal Wolf 39a3588078 improve cpnp history restore 2026-05-20 15:00:26 +02:00
Christian Vidal Wolf cb913b9d72 restore cpnp values from history 2026-05-20 14:56:55 +02:00
Christian Vidal Wolf 47b9303202 feat: implement manual user validation and user deletion flow 2026-05-20 13:33:37 +02:00
Christian Vidal Wolf 2944e6958c fix(history): paginate all records, number oldest=1 newest=N, display newest first 2026-05-15 10:51:01 +02:00
Christian Vidal Wolfandclaude-flow 2961d3f86a fix: persist CPNP No. across refreshes by saving as 'edited' and restoring in merge
- saveRowToSupabase now accepts optional status param (default 'pending')
- CosmeticItemsView saves CPNP with status 'edited' so resetAllPendingRows
  does not affect it and it survives the startup merge
- Re-added CPNP_NO to editableColumns so the merge restores it from Supabase

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-12 16:03:12 +02:00
Christian Vidal Wolf 311d74b783 fix: ensure saved changes persist across app refreshes by updating status logic and merge check 2026-05-11 11:48:11 +02:00
Christian Vidal Wolf 8ffcae5eef fix: prefer history data over synced data for internal columns 2026-04-23 19:28:25 +02:00
Christian Vidal Wolf cf602fe9a2 debug: add detailed safeFetch and getHistoryDataForMerge logging 2026-04-23 19:23:29 +02:00
Christian Vidal Wolf f15c9fa853 fix: pad rows to match extendedHeaders length so internal cols are readable 2026-04-23 19:17:03 +02:00
Christian Vidal Wolf 7ef9f62497 debug: add diagnostic logs to trace history merge for 59272EN 2026-04-23 19:14:10 +02:00
Christian Vidal Wolf c1e3960a20 fix: merge history data into rows when products table is empty 2026-04-23 19:07:38 +02:00
Christian Vidal Wolf ee94926d04 fix: HistoryEntry.id type changed from number to string (Supabase returns UUID) 2026-04-23 18:58:52 +02:00
Christian Vidal Wolf be2adbfe68 debug: add detailed logging to trace history loading 2026-04-23 18:51:07 +02:00
Christian Vidal WolfandClaude Sonnet 4.6 e1cfaaedfa fix: paginate getAllSyncedRows to fetch all products beyond the 1000 row Supabase cap
With 1005+ products, the old query returned only the top 1000 by updated_at.
Items edited long ago (like 51016DE) were silently missing from syncedData,
so the merge never applied their saved edits. Now paginate by product_id
until we exhaust the table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 16:56:54 +02:00
Christian Vidal WolfandClaude Sonnet 4.6 f3ed3cf147 fix: preserve edited changes after export and on Dropbox reload
resetAllPendingRows was setting status to 'synced' instead of 'edited',
causing the merge logic on reload to skip those rows. Also keep 'edited'
and 'saved' statuses locally after export instead of clearing all.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 16:22:35 +02:00
Christian Vidal Wolf ba5bea44c0 fix: increase synced rows limit to 1000 2026-04-23 16:02:59 +02:00
Christian Vidal Wolf 397023b00d Fix: Restore missing user edits by refining the data merge logic.
- Migrated 126 manual edits to 'edited' status.
- Updated App.tsx to merge rows with 'edited' or 'synced' status.
- Protected manual edits from being overwritten by automated Dropbox syncs.
2026-04-23 15:04:43 +02:00
Christian Vidal Wolf 360baa7f10 feat: increase history limit to 500 entries 2026-04-23 15:00:08 +02:00
Christian Vidal Wolf f6ef573f3a Auth: Implement automatic session refresh logic to prevent 'JWT expired' errors. The app now handles token renewal in the background, allowing users to save changes without interruption. 2026-04-23 12:37:04 +02:00
Christian Vidal WolfandClaude Sonnet 4.6 dec24f52f4 Security: Enable RLS support by passing user JWT in Supabase requests
Replaced hardcoded anon key as Bearer token with authHeaders() helper
that uses the authenticated user's access_token when available, enabling
Row Level Security policies to identify the calling user correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 09:59:46 +02:00
Christian Vidal Wolf dcdf50593d Comprehensive audit: Replace backend JWT dependency universally with anon key and strict cache rules 2026-04-10 19:56:42 +02:00
Christian Vidal Wolf d9cc1f4506 Fix silent failure on getAllSyncedRows by forcing anon key 2026-04-10 19:52:30 +02:00
Christian Vidal Wolf d3c90120f4 Force anon key on getHistory and expose errors visually 2026-04-10 19:48:33 +02:00
Christian Vidal Wolf 1c72eae60a Disable fetch cache to sync history across computers 2026-04-10 19:45:05 +02:00
Christian Vidal Wolf db91aeb842 Improve Supabase error reporting for diagnostic purposes 2026-04-10 12:06:16 +02:00
Christian Vidal Wolf ee73b85100 Fix save changes looping issue and authorize all Supabase API calls 2026-04-10 12:03:12 +02:00
Christian Vidal Wolf 077e78513c fix: use POST with upsert instead of PATCH to handle new products 2026-04-10 10:48:05 +02:00
Christian Vidal Wolf 23f4b508c8 Delete history entry after revert 2026-04-10 09:47:35 +02:00
Christian Vidal Wolf 899016f0a0 feat: add Pending Validation tab showing all pending changes 2026-04-09 09:24:17 +02:00
Christian Vidal WolfandClaude Sonnet 4.6 c544b9b709 feat: persistent multi-step undo system in TopBar
fix: save all changes to Supabase with reliable upsert

- Replace broken PATCH→POST fallback with single atomic upsert (POST +
  Prefer: resolution=merge-duplicates). The old PATCH returned 200 OK
  with empty body for new articles, causing silent data loss on every
  first save per article.
- Fix getAllSyncedRows pagination: add explicit limit=10000 and Range
  header to bypass Supabase's default 1000-row cap.
- Add fetchWithRetry helper (2 retries on 5xx/network errors).
- handleSaveRow now returns Promise<boolean> and closes EditPanel only
  after a confirmed successful save.
- Add 'error' save status: failed rows turn red (border-l-red-500)
  across ProductDescriptions, ArticleDetails, and PricingView.
- EditPanel shows saving spinner, disables buttons while saving, and
  displays inline error message with "Retry Save" on failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 08:22:58 +02:00
Christian Vidal Wolf 72e653e353 feat: persistent validation visibility in DimensionsView and selection fixes 2026-04-08 20:05:24 +02:00
Christian Vidal Wolf 0d47f5be33 feat: implement persistence system with visual highlighting and auto-reset on export 2026-04-08 19:30:41 +02:00
christian.vidal f43d8f367e feat: persist edits to Supabase database 2026-03-27 12:23:35 +01:00