Skip to content

Make the library's trash visible, with Put back - #21

Merged
Abe-Borg merged 2 commits into
mainfrom
claude/youthful-planck-rfpvcx
Dec 1, 2026
Merged

Abe-Borg merged 2 commits into
mainfrom
claude/youthful-planck-rfpvcx

Conversation

@Abe-Borg

@Abe-Borg Abe-Borg commented Dec 1, 2026

Copy link
Copy Markdown
Owner

What changed

The Library's Empty trash button gave no hint of what the trash was or what was in it. It now works like a trash you can see into:

  • Trash (N) replaces Empty trash in the Library header. It shows how many removed pulls are waiting and opens a list of them: section, jurisdiction, pull date and when each was removed.
  • Put back returns a pull to the library with its documents untouched. It is the section's current pull again, unless a newer pull of that section was saved since; then it comes back as an earlier version, and the notice says so (Store.putBack).
  • Empty trash… sits inside the Trash dialog and is disabled when the trash is empty. Its confirmation says how many pulls' PDF and Word files go, and that library pulls and exported files are not touched.
  • Remove on a pull now reads Move to trash, and says the pull can be put back until the trash is emptied.
  • Prune history no longer empties the user's trash. Before, it called emptyTrash() for every removed pull, which permanently deleted pulls the user had removed by hand. It now deletes only the versions it drops (Library.emptyTrash(ids)).
  • Migration 0010_trash.sql adds pulls.removed_at to order the trash. Pulls removed before this change have no time and are listed last.

The trash is defined as removed pulls that still have artifacts rows (Store.trash), the same set the old emptyTrash deleted. No new table, so "Delete all content" is unchanged.

Tests

  • test/library.test.ts: remove, then put back as current; remove and put back an earlier version; put back after a newer pull was saved; prune leaves the trash alone; emptying deletes the files and blocks put back.
  • test/ui-format.test.ts: the new remove and put-back notices.
  • test/review-renderer.electron.cjs: the empty trash explains itself; a pull is moved to the trash and appears in Trash (1); the empty-trash confirmation is opened and cancelled; the pull is put back. New screenshot 05a-trash.png.
  • npm test (224) and npm run test:app (all 9 checks) pass locally. format:check passes.

Docs

README, user guide (new "The trash" section), architecture (step 7) and CLAUDE.md are updated.


Generated by Claude Code

Removed pulls already kept their files until "Empty trash", but nothing
showed what was in the trash, and the button was the only way in. The
Library now has a Trash button with a count that opens a list of removed
pulls, each with Put back, and Empty trash asks first and says what goes
and what stays.

Putting a pull back makes it current again unless a newer pull of its
section was saved since; then it comes back as an earlier version.
Prune history no longer empties the user's trash: it deletes only the
versions it drops. A new column records when a pull was removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34mysav6y1nxUtCUc5Yrf
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T04:39:32.584369Z 17efe16 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17efe16398

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/ui/library.tsx Resolved
Emptying the trash read its list of pulls once, then deleted folders one
by one. A pull put back while that ran was made current again and then
lost its documents and file records. The pulls now leave the trash in
one transaction before any folder is deleted: a pull put back meanwhile
is either back already and kept, or refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T34mysav6y1nxUtCUc5Yrf
@Abe-Borg
Abe-Borg merged commit b24cf1d into main Dec 1, 2026
4 checks passed
@Abe-Borg
Abe-Borg deleted the claude/youthful-planck-rfpvcx branch December 1, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants