mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 03:05:32 +02:00
feat: implement entry deletion
- database: cascade_cached_bytes_after_subtree_delete — one-pass set-aware SQL that excludes the entire subtree simultaneously, avoiding sibling-blob cross-counting bug - database: delete_entry — collects subtree IDs, runs set-aware cascade, NULLs archive_run_items.produced_entry_id (FK blocker), deletes children then root; ON DELETE CASCADE handles artifacts/tags/collections - server: DELETE /api/archives/:archive_id/entries/:entry_uid route, wrapped in a transaction for atomicity - frontend: deleteEntry API call, handleEntryDeleted callback in App.jsx (optimistic list removal + selection clear), Delete entry button in ContextRail with confirm guard - tests: 4 database tests (unknown uid, subtree removal, run_item nulling, cached_bytes recalculation) + 3 route tests (204+gone, 404, 401)
This commit is contained in:
parent
cad3ae9885
commit
ed1f883ff1
15 changed files with 416 additions and 128 deletions
|
|
@ -527,6 +527,31 @@ select {
|
|||
background: var(--accent-2);
|
||||
}
|
||||
|
||||
/* ── Rail delete zone ───────────────────────────────────────────────────── */
|
||||
.rail-delete-zone {
|
||||
margin-top: 24px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid var(--line-soft);
|
||||
}
|
||||
.rail-delete-btn {
|
||||
width: 100%;
|
||||
padding: 8px 14px;
|
||||
background: none;
|
||||
border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
|
||||
color: var(--accent);
|
||||
border-radius: var(--r);
|
||||
cursor: pointer;
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
transition: background 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
.rail-delete-btn:hover {
|
||||
background: color-mix(in srgb, var(--accent) 8%, transparent);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
/* ── Capture dialog ──────────────────────────────────────────────────────── */
|
||||
.capture-dialog {
|
||||
border: 1px solid var(--line);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue