v0.5.0: Trash (soft-delete) + Keep folder

Delete now moves an artifact to a recoverable Trash instead of hard-removing.

- Model: Artifact.deleted_at (nullable, indexed) = in Trash.
- Soft-delete everywhere: DELETE /api/artifacts/{id} sets deleted_at
  (idempotent 204); session POST /a/{id}/delete for the feed's hover Delete
  icon; POST /a/{id}/undelete restores; POST /feed/empty-trash purges.
- Trashed artifacts are off-quota (deleting frees quota) and eviction-protected
  (never evicted early); hidden from feed, sources, counts, and all API reads
  (list/detail/raw).
- Sidebar: "Deleted" and "Keep" system folders at the bottom (counts, hidden
  when empty); ?folder=deleted / ?folder=keep views reuse the row rendering.
  Deleted view has hover Undelete + an Empty Trash button. Keep = view over
  is_kept. Live-poll disabled in folder views.
- Docs (api.md delete section, CLAUDE.md), 10 new/updated tests. 150 passing;
  API soft-delete lifecycle verified live.

Purge is manual (Empty Trash) this release; auto purge-on-delete (background,
~3-day retention) is the planned fast-follow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
peter 2026-09-07 12:48:43 +01:00
parent 6c1823e65e
commit 4254164bef
14 changed files with 438 additions and 43 deletions

View file

@ -9,7 +9,27 @@ former name, "Daybook".)
_Nothing yet._
## [0.4.1] — 2026-09-05
## [0.5.0] — 2026-09-07
### Added
- **Trash (soft-delete).** Deleting an artifact now moves it to a recoverable
**Trash** instead of removing it. Feed rows get a hover **Delete** icon; a
**"Deleted"** folder at the bottom of the sidebar lists trashed items with a
hover **Undelete**, plus an **Empty Trash** button to purge permanently.
Trashed items are **off-quota** (deleting frees quota immediately) and
eviction-protected. `DELETE /api/artifacts/{id}` is now a soft-delete too
(idempotent); trashed items are hidden from all API reads.
- **Keep folder.** A sidebar folder listing kept artifacts (a view over the
existing `is_kept` flag), mirroring Trash. Both hide when empty.
- Session endpoints `POST /a/{id}/delete`, `/a/{id}/undelete`,
`/feed/empty-trash`; feed `?folder=deleted` / `?folder=keep` views.
### Changed
- `DELETE /api/artifacts/{id}` no longer hard-deletes — see above.
### Note
- Permanent purge is manual (**Empty Trash**) in this release; automatic
purge-on-delete (background, ~3-day retention) is the planned fast-follow.
### Changed
- Live feed updates now also keep the **source sidebar** current: as new posts
@ -165,7 +185,8 @@ First tagged release.
- Dockerised (Gunicorn + whitenoise), SQLite, `git`-based deploy with a
runbook (`deploy/cloud_agent_deploy.md`) and health check.
[Unreleased]: https://git.cygnus.systems/peter/daybook/compare/v0.4.1...HEAD
[Unreleased]: https://git.cygnus.systems/peter/daybook/compare/v0.5.0...HEAD
[0.5.0]: https://git.cygnus.systems/peter/daybook/compare/v0.4.1...v0.5.0
[0.4.1]: https://git.cygnus.systems/peter/daybook/compare/v0.4.0...v0.4.1
[0.4.0]: https://git.cygnus.systems/peter/daybook/compare/v0.3.2...v0.4.0
[0.3.2]: https://git.cygnus.systems/peter/daybook/compare/v0.3.1...v0.3.2