Stronger confirmation when deleting a section #13

Closed
opened 2026-11-09 21:23:50 +00:00 by eric · 1 comment
Owner

Deleting a section (the ✕ in the section's edit header) loses all of its records, items, fields and images, and Cancel (#11) deliberately does not undo it.

Current behavior

rowTools() already asks confirm('Delete this section?') for sections, same as for any record, field or item. The prompt doesn't say which section or how much is lost.

Proposed

  • For sections, name the section and what it holds: e.g. 'Delete the section "Bank Accounts" and its 12 records and 3 images? This cannot be undone with Cancel.' (records / items / sequences / images counts as applicable; empty sections get a short prompt.)
  • Keep the simple prompt for fields, items and records, or add counts for records that hold images (decide when implementing).
  • Pure helper in src/ops.js that summarizes a section's contents for the message, with unit tests (records, items, images, empty, text section).
  • Browser check: the prompt text for a populated section, cancelling the prompt keeps the section, accepting deletes it.

Related: #11.

Deleting a section (the ✕ in the section's edit header) loses all of its records, items, fields and images, and Cancel (#11) deliberately does not undo it. ## Current behavior rowTools() already asks `confirm('Delete this section?')` for sections, same as for any record, field or item. The prompt doesn't say which section or how much is lost. ## Proposed - For sections, name the section and what it holds: e.g. 'Delete the section "Bank Accounts" and its 12 records and 3 images? This cannot be undone with Cancel.' (records / items / sequences / images counts as applicable; empty sections get a short prompt.) - Keep the simple prompt for fields, items and records, or add counts for records that hold images (decide when implementing). - Pure helper in src/ops.js that summarizes a section's contents for the message, with unit tests (records, items, images, empty, text section). - Browser check: the prompt text for a populated section, cancelling the prompt keeps the section, accepting deletes it. Related: #11.
eric closed this issue 2026-11-09 23:37:59 +00:00
Author
Owner

Implemented in 1736548.

Changed

  • Deleting a section now names it and says what is in it, e.g. Delete the section "Banks" and everything in it (2 records)? This cannot be undone with Cancel. Counts cover records, items, visual sequences (#12), images (image fields and sequence steps) and the text of a text section, with singular/plural wording.
  • An empty section gets a short prompt: Delete the empty section "Empty one"?
  • Records, fields, items and steps keep the simple prompt. I did not add counts for records that hold images.
  • New pure helpers in src/ops.js (sectionContents, deleteSectionMessage). rowTools takes an optional confirmation message. Deleting or moving a section still updates 'Last update' as before.
  • docs/MAINTENANCE.md notes the prompt.

Verified

  • Unit tests: 47 (46 pass, 1 skipped as before); 2 new ones cover the empty case, singular/plural, items, sequences, images and text sections.
  • Headless Chromium: the right prompt text for a populated and an empty section; declining keeps the section, accepting deletes it.

Not verified: Firefox and Safari.

Implemented in 1736548. **Changed** - Deleting a section now names it and says what is in it, e.g. `Delete the section "Banks" and everything in it (2 records)? This cannot be undone with Cancel.` Counts cover records, items, visual sequences (#12), images (image fields and sequence steps) and the text of a text section, with singular/plural wording. - An empty section gets a short prompt: `Delete the empty section "Empty one"?` - Records, fields, items and steps keep the simple prompt. I did not add counts for records that hold images. - New pure helpers in src/ops.js (sectionContents, deleteSectionMessage). rowTools takes an optional confirmation message. Deleting or moving a section still updates 'Last update' as before. - docs/MAINTENANCE.md notes the prompt. **Verified** - Unit tests: 47 (46 pass, 1 skipped as before); 2 new ones cover the empty case, singular/plural, items, sequences, images and text sections. - Headless Chromium: the right prompt text for a populated and an empty section; declining keeps the section, accepting deletes it. **Not verified**: Firefox and Safari.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eric/final-wishes#13
No description provided.