feat(lists): reorder packing/to-do lists and private packing items (#969, #858)

Add drag-to-reorder to the packing and to-do lists, mirroring the budget
panel's native HTML5 drag pattern. A drag within a filtered/grouped view is
mapped back onto the global order so untouched items keep their place, and the
order persists optimistically via the existing reorder endpoints.

Packing items can now be marked private (#858): a private item is visible only
to its owner. createItem/bulkImport stamp the owner, listItems filters by the
viewer, and the WebSocket broadcasts are scoped to the owner so a private item
never reaches another member's screen — including the public/private toggle
transitions. Owners get a lock toggle and a private indicator on their items.
This commit is contained in:
Maurice
2026-06-30 13:55:03 +02:00
committed by Maurice
parent 7eac5a5a02
commit fac2393388
46 changed files with 726 additions and 76 deletions
+15
View File
@@ -3132,6 +3132,21 @@ function runMigrations(db: Database.Database): void {
if (!err.message?.includes('duplicate column name')) throw err;
}
},
// Private packing items (#858): an item can be hidden from other trip members.
// is_private toggles the visibility; owner_id records who it belongs to so the
// listing can show it only to them. owner_id is NULL on legacy rows (shared).
() => {
for (const stmt of [
'ALTER TABLE packing_items ADD COLUMN is_private INTEGER NOT NULL DEFAULT 0',
'ALTER TABLE packing_items ADD COLUMN owner_id INTEGER REFERENCES users(id) ON DELETE SET NULL',
]) {
try {
db.exec(stmt);
} catch (err: any) {
if (!err.message?.includes('duplicate column name')) throw err;
}
}
},
];
if (currentVersion < migrations.length) {