Repository navigation
Delete flow over the entities slice - #160
Merged
Merged
Conversation
…t only when it is in the current Snapshot
…o variants under review
This was referenced Nov 25, 2026
Merged
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.
Closes #144. Part of #135.
Summary
The delete flow follows SPEC 10.9: the button reads "Delete " (the entity ID when there is no name), and the nodes sentence shows only for an object in the current Snapshot.
useDeleteEntity({ entityId, name, inSnapshot }) domain/entities - confirm: name === null ? 'Delete' : `Delete ${name}` + confirm: `Delete ${name ?? entityId}` - long text unless Unreadable or Unpublished + long text when inSnapshotAPI change.
GET /api/entities/{set}rows andGET /api/entities/{set}/entitynow carryinSnapshot. SPEC wants the long text for an Unreadable object that is in the current Snapshot and the short one for an Unreadable object never published. The client cannot tell these apart: an Unreadable row's state is alwaysUnreadable. The field also gets disabled objects right: To be withdrawn gets the long text, and an object already withdrawn gets the short one. It is built in Infrastructure only (PublicationReader::currentDocument,Repositories::currentContent).src/Domainandsrc/Applicationare untouched. The SPEC API table says so.Stories (
Pages/Delete, all screenshot after their play function):Draft: Unreadable, never published,Draft: Unreadable, in the Snapshot,Draft: Deleting,Draft: Deleted,Draft: Not deletedReview: Delete without the name: the old button, for decision 1.Review: Nodes sentence out of the Snapshot: the long text on an object outside the Snapshot, for decision 2.Domain/Entities/Delete dialog:Draft: In the Snapshot,Draft: Not in the Snapshot,Draft: Unnamed,Cancelled,Draft: Not deleted.Evidence
After:
DeleteText.test.tsxcovers in and out of the Snapshot for Unpublished, Up to date, disabled and Unreadable objects, on the edit screen and on the list.EntityInSnapshotApiTest.phpcoversinSnapshotfor a published, a published-then-unreadable and a new entity.composer test607 passed,composer coverage97.4 %,composer mutatepassed,composer staticok, lint and type check clean,npm test466 passed (lines 99.4 %),npm run test:visualthree runs of 152 with zero diffs,composer buildcommitted with no further diff.Board differences
No board covers the delete dialog. The approved draft (#98) is the reference, and only the two decisions under review depart from it, as SPEC now specifies. Not built here:
Draft: Deletedstory the header keeps "Review 2 changes": the story session's count is fixed.Departures
Draft: DeletedandDraft: Not deletedwait up to 8 s at the end of their play functions. React Aria's live announcer keeps a pending-button announcement for 7 s, and itsaria-labelledbypoints to a button that is gone or hidden once the dialog closes. axe rejects that (role-img-alt).Merge Danger
Door: two-way
Blast Radius: small
Adds a field to two JSON answers; nothing reads it but the delete dialog. Adds 28 reference screenshots, so this waits for the maintainer's
visual-changelabel.