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.
This commit is contained in:
Christian Vidal Wolf
2026-04-23 15:04:43 +02:00
parent 360baa7f10
commit 397023b00d
3 changed files with 15 additions and 11 deletions
+2 -2
View File
@@ -166,8 +166,8 @@ export default function App() {
// Start with Dropbox values (default)
let finalRow = [...row];
// Only preserve Supabase values if there's a PENDING edit for this article
if (synced && synced.status === 'pending') {
// Only preserve Supabase values if there's a PENDING or EDITED edit for this article
if (synced && (synced.status === 'pending' || synced.status === 'edited' || synced.status === 'synced')) {
// Keep the manually edited values from Supabase
editableColumns.forEach(idx => {
if (synced.data[idx] !== undefined && synced.data[idx] !== null) {
+1 -1
View File
@@ -77,7 +77,7 @@ export async function saveRowToSupabase(articleNo: string, rowData: ExcelRow): P
body: JSON.stringify({
product_id: articleNo,
data: rowData,
status: 'synced',
status: 'edited',
updated_at: new Date().toISOString()
})
}