Automattic / Automattic/cortext
Archive content without deleting it
- Dominant language
- JavaScript
- Stars
- 51
- Forks
- 2
- Avg merge
- 3h 12m
- Merged PRs (30d)
- 8
Description
## Goal
Trash is currently the only way to remove content from day-to-day view. That works for content on its way to deletion, but not for a finished project or old completed rows that still need to be kept.
Add an archived state for pages, collections, and rows. Archived content should disappear from normal navigation and search while keeping all of its data. Restoring it should put it back exactly where it was.
## Tasks
- [x] Extract shared document cascade behavior so Trash and Archive use the same rules. #424
- [x] Add the server-side archive lifecycle: register the archived status and REST endpoints; cascade through nested pages and collection rows; preserve previous statuses through Archive, Trash, and Restore; block direct document and schema writes and permanent deletion; retain indexes, formulas, relations, Favorites, and Recents; and exclude archived content from normal queries and public rendering. #425
- [ ] Add the workspace archive experience: Archive and Restore actions for pages, collections, and rows; bulk row archiving; an Archived panel next to Trash; Restore and Move to Trash actions; and clear messaging when restoring previously published content.
- [ ] Close the remaining write paths for hidden content: stop Notion import ticks when their collection is archived or trashed, reject manual reordering involving hidden collections or rows, and preserve manual positions through archive and restore.
- [ ] Distinguish archived relation targets with a muted chip in collection views and row details, returning to the normal treatment after restore without hiding existing relations or changing rollup results.
- [ ] Show an archived collection's rows read-only when it is opened from the Archived panel, while continuing to exclude archived rows from normal collection views.
## Out of scope
- Showing archived content in backlinks. This can be added later through an explicit filter.
- Automatically archiving content for specific workflows.
## Implementation notes
- Use `crtxt_archived` rather than `archived`. WordPress post statuses share a global registry, so the namespaced slug avoids collisions with other plugins.
- Register the status with `internal => false`, `public => false`, `protected => true`, and `exclude_from_search => false`. The last flag keeps existing relations to archived rows valid when WordPress resolves targets with `post_status => 'any'`.
- Run the archive cascade from `transition_post_status`, not only from the REST endpoint. The same behavior must apply when status changes come from core REST, WP-CLI, or another plugin.
- Update the field-value index whenever content enters or leaves the archived state.
- Core already remembers the pre-trash status. Archiving, trashing, and restoring therefore returns content to `crtxt_archived` without a separate recovery path.
Contributor guide
Research direction
Start by reviewing the completed archive lifecycle work in #425 and the existing Trash experience before choosing one unchecked task. The remaining work spans workspace actions, hidden-content write paths, relation indicators, and read-only archived collections; it is done only when those behaviors work consistently with archive, restore, trash, search, navigation, and rendering rules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wordpress
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100