Skip to content

Ask before deleting a question, naming its answers and the rules that use it - #269

Merged
PhilReinking merged 13 commits into
mainfrom
fix/bits-279-delete-dialogs
Oct 13, 2026
Merged

PhilReinking merged 13 commits into
mainfrom
fix/bits-279-delete-dialogs

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Deleting a question, group, choice, consent policy or rule now asks in the app's dialog instead of the browser's. The dialog names the question, its answer count and the questions whose rules stop working. A choice or policy nobody picked goes at once, also with Cmd+Backspace.

Fixes BITS-279

  • Counts and rules load from the blocks API with includeSubmissions on Delete. If that fails, the dialog still asks and says "and its answers" without a number.
  • The dialogs take the block and its counts as props, so the document editor (BITS-282) can place them.
  • Escape closes only the delete dialog, not the logic panel under it.
  • The rule's trash button now has a name and works with the keyboard.
  • The dialog buttons are 44 px tall on phones, 36 px from lg.

Stacked on #264, so no CI until it targets main.

Tested: Vitest, lint, vue-tsc, build; the new tests fail on the base. By hand at 1440 and 390: all dialogs, Cancel, Escape, real deletes, a failed count load.

Not tested: the PHP suite locally. No PHP changes here; #264 has its own CI.

🤖 Generated with Claude Code

PhilReinking and others added 4 commits October 13, 2026 01:27
…e or rule

The dialog names the question, its answer count and the questions whose
rules stop working. A choice nobody picked is deleted at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 2fcfe3b. No CI (stacked): Vitest, lint, vue-tsc and the build pass locally.

Beyond the PR text: in the logic panel, Cancel, Escape and Delete rule close only the rule dialog, and focus goes back to the trash button. A question's own rules don't count as rules that stop working. A second click on Delete hits nothing, because the buttons leave at once. One should inline.

Comment on lines +79 to +81
const withAnswers = answers
? ` and its ${answers} ${answers === 1 ? "answer" : "answers"}`
: "";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the counts can't load, answers is undefined and the text reads like a question without answers, though it may have 40. The choice dialog already says "The answers that picked it" in that case.

Suggested change
const withAnswers = answers
? ` and its ${answers} ${answers === 1 ? "answer" : "answers"}`
: "";
// unknown when the counts couldn't load: there may still be answers
const withAnswers =
answers === undefined
? " and its answers"
: answers
? ` and its ${answers} ${answers === 1 ? "answer" : "answers"}`
: "";

PhilReinking and others added 6 commits October 13, 2026 01:53
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hoice

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 58c1716. No CI (stacked): Vitest 257, lint, vue-tsc and the build pass locally. The should from the last review is fixed.

3 new tests fail on 2fcfe3b. Beyond that: clicking trash three times fast fetches once and deletes once. When the count can't load, a choice and a policy both ask, and nothing goes. Asking again after Cancel fetches a fresh count. The server sends a count for every policy, and only agreed policies are stored.

PhilReinking and others added 2 commits October 13, 2026 02:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 1f385f3. No CI (stacked): Vitest 258, lint, vue-tsc and the build pass locally.

The 2 changed tests fail on 58c1716. The built CSS has text-pretty (text-wrap: pretty), and the text on its own line renders the same.

PhilReinking added a commit that referenced this pull request Oct 13, 2026
Brings in the delete dialogs (#269) and the save status (#267).

Conflicts: the old Workbench, Sidebar Block and Group stay deleted.
Choice and policy rows keep their in-row delete button, which now asks
first through useDeleteChoice; the list still does the delete so it can
move focus once the row is gone (useDeleteChoice takes that delete).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PhilReinking
PhilReinking changed the base branch from fix/bits-276-rule-references to main October 13, 2026 10:26

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at e8da262, CI green. The merge of main changes only CHANGELOG.md by hand: main's #265 and #278 lines stay as on main, and the #269 line follows them. The PR's own diff against main is byte for byte the reviewed one from 1f385f3. A trial merge after #270 is also clean and keeps every changelog line.

@PhilReinking
PhilReinking merged commit e5fc559 into main Oct 13, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-279-delete-dialogs branch October 13, 2026 12:47
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