Skip to content

Delete flow over the entities slice - #160

Merged
sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/144
Nov 25, 2026
Merged

sgomez merged 3 commits into
frontend-rebuildfrom
agent/frontend/144

Conversation

@sgomez

@sgomez sgomez commented Nov 25, 2026

Copy link
Copy Markdown
Owner

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 inSnapshot

API change. GET /api/entities/{set} rows and GET /api/entities/{set}/entity now carry inSnapshot. 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 always Unreadable. 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/Domain and src/Application are untouched. The SPEC API table says so.

frontend/src/
├── domain/entities/
│   ├── useDeleteEntity.tsx            # texts per SPEC 10.9
│   ├── DeleteDialog.stories.tsx       # dialog as the edit screen's More actions opens it
│   └── Delete*.test.tsx               # moved from screens/, updated
├── pages/Delete.stories.tsx           # from an Unreadable row, with screenshots
└── app/test/StoryMessages.tsx         # one-shot "Deleted." in stories

Stories (Pages/Delete, all screenshot after their play function):

  • Draft: Unreadable, never published, Draft: Unreadable, in the Snapshot, Draft: Deleting, Draft: Deleted, Draft: Not deleted
  • Review: 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

  • Before: an unnamed object's dialog confirmed with "Delete". Every Unreadable object got the short text, even one that nodes serve.
    After: DeleteText.test.tsx covers in and out of the Snapshot for Unpublished, Up to date, disabled and Unreadable objects, on the edit screen and on the list. EntityInSnapshotApiTest.php covers inSnapshot for a published, a published-then-unreadable and a new entity.
  • composer test 607 passed, composer coverage 97.4 %, composer mutate passed, composer static ok, lint and type check clean, npm test 466 passed (lines 99.4 %), npm run test:visual three runs of 152 with zero diffs, composer build committed 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:

Departures

  • Draft: Deleted and Draft: Not deleted wait 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 its aria-labelledby points 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-change label.

@sgomez
sgomez merged commit 6e79d6a into frontend-rebuild Nov 25, 2026
16 checks passed
@sgomez
sgomez deleted the agent/frontend/144 branch November 25, 2026 19:32
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.

1 participant