Repository navigation
Forms learn to retire - #33
Merged
Merged
Conversation
A finished form is not a deleted form, and the trash is a place things go to die. Archiving retires a form and everything that belongs to it in one move: the form takes the atf-archived post status and leaves every picker, its entries take a marker and leave the all-forms list and export, and its stats — meta on the form — go wherever it goes. The availability gate closes an archived form for everyone, editors included: the way past the archive is unarchiving. Unarchiving is the same move backwards, exactly: a draft comes back a draft (never surprise-published), a read entry comes back read, and the stats never move at all. The archive's door is the "Start a new form" dialog — restoring a retired form is a way of getting a form — and the Archive button lives in the form's own Settings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An Archive button that moves the form and everything that belongs to it — entries and stats — out of every list in one move, and an Unarchive that puts every one of them back exactly as it was.
The model
atf-archived. Nothing is copied anywhere; meta, revisions and trash behaviour all keep working._atf_prearchive_status), so unarchiving restores what was true — a draft comes back a draft, never surprise-published._atf_archivedmarker instead. Every surface that reaches entries through a form picker is covered the moment the form leaves the pickers; the marker covers the two that don't — the all-forms entry list and the all-forms export, whichatf_query_entries()now filters.atf_form_availability()reports an archived form closed with reasonarchived— checked before the editor bypass, because the way past the archive is unarchiving. It neither renders (closed notice, no<form>) nor accepts submissions.Where it lives
POST /forms/{id}/archive,POST /forms/{id}/unarchive,GET /forms?archived=1(same summary shape, same capability). New actionsatf_form_archived/atf_form_unarchived, documented in hooks-reference.md.Verified on 8889
Archived the 482-entry demo survey from Settings → builder switched to the next form, the picker forgot it; the New-form dialog listed it with "482 entries · 500 submissions · 1200 views"; Restore brought it back open in the builder with everything attached.
Tests
New suite
archive.php: status round-trips (publish→publish, draft→draft), entries leave the global list and return with read/unread intact while another form's entries never move, stats byte-identical across the trip, archived form closed to everyone (render + submit), REST list separation, and loud refusals for wrong moves. 698 PHPUnit + 353 vitest green, PHPCS clean.🤖 Generated with Claude Code
https://claude.ai/code/session_0119U4sRRWGcTQdwYreTwpAp