Skip to content

refactor(bulk-ops): split confirmAction into small helpers - #911

Merged
rubenvdlinde merged 2 commits into
developmentfrom
refactor/sig-bulk-ops-confirm
Nov 2, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
refactor/sig-bulk-ops-confirm

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

confirmAction in DashboardBulkOperations.vue sent one of four bulk requests, picked the changed count out of eight possible keys and built the result summary, all in one method (67 lines, McCabe 22). It now reads as small steps:

  • sendBulkRequest picks the request for the pending action from a lookup (Object.hasOwn, so an unknown action still sends nothing).
  • parentUuidOrNull and statusRequestOptions hold the move and status inputs.
  • firstCount, bulkResultSummary and bulkErrorMessage (module functions) build the summary and the error text.

Behaviour is unchanged, including the order in which the count keys are tried, the null handling of ??, and that an unknown action finishes without an await. The literal t() call stays literal.

Review note: this is the bulk delete/move/status path for administrators, so it touches data integrity. No request arguments changed; the golden below pins every call.

SIG (gate 122, lizard 1.24.3)

confirmAction goes from 67 lines / McCabe 22 to 18 lines / McCabe 5; no new unit is above McCabe 4.

vue development this branch this branch + #909 4-star 5-star
CCN >5 24.1% 22.91% 20.53% 20.2% 10.1%
CCN >10 8.81% 7.65% 3.90% 7.3% 3.7%
CCN >25 3.75% 3.75% 0.00% 1.1% 0.55%
size >30 13.72% 12.55% 8.81% 23.1% 11.6%
params >=3 1.39% 1.39% 1.39% 15% 7.5%

Together with #909 this brings vue CCN >10 to 3.90%; vue CCN >5 needs about 19 more unit lines (next PR). Gate 122 ratchet: 0 findings.

Verified

  • Golden DashboardBulkOperations.golden.spec.js: 192 cases (6 actions including an unknown and a prototype key, 18 response shapes, 4 failure shapes, 10 form inputs), recording the API call and its arguments, the result summary, the error text, the selection left behind, reloads and the running flag. Recorded on the old code (first commit) and re-run in plain mode on old and new: pass.
  • Mutants (vitest, timeout 120, 1.5 GB heap, file restored after each): old code 15 of 16 killed, new code 19 of 19 killed. The one survivor on the old code (response?.data || {} to ?? {}) is equivalent. A whitespace-only control survives on both.
  • npx vitest run src/components/admin/__tests__/: 10 files, 55 tests pass. eslint and prettier --check on the changed files: exit 0.

AI disclosure: prepared with Claude Code (claude-opus-5-5) and reviewed by the lane before opening.

🤖 Generated with Claude Code

…rough small helpers

Assisted-by: ClaudeCode:claude-opus-5-5
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/launchpad @ 86abe83

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
check-manifest ✅
format ❌
check-schema-l10n ✅
composer ✅ ✅ 107/107
npm ❌ ✅ 636/636
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ✅ 1962/1962
Newman ✅ 224/224
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-02 06:58 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 36fbc20 into development Nov 2, 2026
39 of 43 checks passed
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