Skip to content

fix: restore bulk Delete and Duplicate in the helpful wheel#7799

Merged
walterbender merged 2 commits into
sugarlabs:masterfrom
macayu17:fix/7794-restore-bulk-actions
Jul 12, 2026
Merged

fix: restore bulk Delete and Duplicate in the helpful wheel#7799
walterbender merged 2 commits into
sugarlabs:masterfrom
macayu17:fix/7794-restore-bulk-actions

Conversation

@macayu17

@macayu17 macayu17 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Selection mode still highlights multiple selected blocks, but the helpful wheel no longer provides any way to bulk delete or duplicate them. As a result, the selection workflow reaches a dead end.

The Move to trash and Duplicate wheel items, along with the code in _displayHelpfulWheel() that reveals them when blocks are selected, were accidentally removed during the i18next migration in #4731.

The underlying deleteMultipleBlocks() and copyMultipleBlocks() actions were preserved and now live in SelectionController following #7765, but they no longer had a UI entry point.

This PR restores the two wheel items and their visibility logic while reusing the existing bulk actions as-is.

Related Issue

Fixes #7794

PR Category

  • Bug Fix — Fixes a bug or incorrect behavior

Changes Made

  • Re-register the Move to trash and Duplicate helpful wheel items.
  • Keep both items hidden by default.
  • Connect them to the existing deleteMultipleBlocks() and copyMultipleBlocks() actions.
  • Update _displayHelpfulWheel() to show the items only when at least one selected block is not in the trash, matching the behavior before the regression.

Testing Performed

  • Manually reproduced the issue on master.

  • Verified the fix in the browser using the following flow:

    1. Open Advanced Mode.
    2. Right-click the canvas.
    3. Select Select.
    4. Drag over multiple blocks.
    5. Right-click again.
  • Confirmed that Move to trash and Duplicate appear in the wheel.

  • Confirmed that both actions apply to all selected blocks.

  • Confirmed that both items remain hidden when no blocks are selected.

  • Added js/__tests__/activity_helpful_wheel.test.js covering the restored behavior: both items are registered hidden, appear only when at least one selected block is not in the trash, and disappear once the selection is gone.

  • Ran the full Jest suite:

    • 190 test suites passed.
    • 6,744 tests passed.
  • Ran npm run lint successfully.

  • Ran npx prettier --check . successfully.

  • Confirmed that linting and formatting checks pass through the pre-commit hook.

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have followed the project's coding style guidelines.
  • I have run npm run lint and npx prettier --check . with no errors.

The 'Move to trash' and 'Duplicate' helpful-wheel items, and the code in
_displayHelpfulWheel that reveals them when blocks are multi-selected,
were accidentally dropped in the i18next migration (sugarlabs#4731). Selection
mode still worked but the selected blocks could no longer be deleted or
duplicated in bulk.

Reinstate the two wheel items and the visibility toggle. The underlying
deleteMultipleBlocks/copyMultipleBlocks actions were still intact (now
in SelectionController) and are reused as is.

Fixes sugarlabs#7794
@macayu17 macayu17 requested a review from walterbender as a code owner July 12, 2026 16:40
Copilot AI review requested due to automatic review settings July 12, 2026 16:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added bug fix Fixes a bug or incorrect behavior size/S Small: 10-49 lines changed area/javascript Changes to JS source files labels Jul 12, 2026
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.27%. Comparing base (a76b8bb) to head (8727336).

Files with missing lines Patch % Lines
js/activity.js 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7799      +/-   ##
==========================================
- Coverage   59.28%   59.27%   -0.01%     
==========================================
  Files         176      176              
  Lines       57967    57975       +8     
==========================================
  Hits        34365    34365              
- Misses      23602    23610       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Pin the restored behavior so it cannot silently regress again: the
'Move to trash' and 'Duplicate' items are registered hidden, appear in
the wheel only when at least one selected block is not in the trash,
and disappear once the selection is gone.

Uses the same vm sandbox harness as the other activity.js tests.
@github-actions github-actions Bot added size/L Large: 250-499 lines changed area/tests Changes to test files and removed size/S Small: 10-49 lines changed labels Jul 12, 2026
@walterbender walterbender merged commit e58db21 into sugarlabs:master Jul 12, 2026
13 of 15 checks passed
@walterbender

Copy link
Copy Markdown
Member

Thx for this. Works well. There are some unrelated issues with bulk select -- the highlighting is a bit hit or miss -- and sometimes not every block in a stack is selected, which can cause some inconsistencies. But that is for a separate PR. When I get a chance, I will write up a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/javascript Changes to JS source files area/tests Changes to test files bug fix Fixes a bug or incorrect behavior size/L Large: 250-499 lines changed

Projects

Development

Successfully merging this pull request may close these issues.

[Bug] Regression: Multi-selection bulk Delete and Duplicate actions no longer work after selecting multiple blocks

3 participants