Skip to content

Context menu improvements#677

Merged
lawsie merged 4 commits into
flipcomputing:mainfrom
lawsie:context-menu-improvements
Jun 10, 2026
Merged

Context menu improvements#677
lawsie merged 4 commits into
flipcomputing:mainfrom
lawsie:context-menu-improvements

Conversation

@lawsie

@lawsie lawsie commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Consolidate/rename options in right click context menus, both on the workspace itself and for blocks.

Workspace

right-click-new2
  • Renamed 'Delete' to 'Delete all blocks'
  • Expand all / Collapse all now a single toggle option for clarity

Block

right-click-new1
  • Renamed 'External inputs' to 'Stack inputs / Inline inputs'
  • Added dividers for clarity
  • Moved 'Help' to the bottom since there isn't actually any per-block help (yet!)

AI usage

Claude Sonnet 4.6 used throughout, changes approved individually by a human.

Summary by CodeRabbit

  • New Features

    • Added new context menu options for blocks: delete all blocks, toggle input display (inline vs. stacked), collapse/expand controls for individual and all blocks, and enable/disable actions.
    • Added visual separators to organize context menu items.
  • Localization

    • Added translations for new context menu options across German, English, Spanish, French, Italian, Polish, Portuguese, and Swedish.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds nine new context menu translation keys across eight languages (German, English, Spanish, French, Italian, Polish, Portuguese, Swedish) for block and workspace operations. Blockly's context menu structure is reconfigured with visual separators, menu item weights adjusted, and a single unified collapse/expand toggle replaces redundant workspace menu items. Translation function is updated to apply the new localized labels to Blockly's standard message keys.

Changes

Context menu localization and structure

Layer / File(s) Summary
Translation keys definition (all locales)
locale/de.js, locale/en.js, locale/es.js, locale/fr.js, locale/it.js, locale/pl.js, locale/pt.js, locale/sv.js
Nine new translation keys are added to all locale files for context menu options: context_delete_all_blocks_option, context_inline_inputs_option, context_external_inputs_option, context_collapse_option, context_expand_option, context_collapse_all_option, context_expand_all_option, context_disable_option, context_enable_option.
Blockly context menu structure and separators
main/blocklyinit.js
Block context menu weights are reordered so help moves to the bottom; redundant workspace menu items (undo/redo, clean, collapse/expand) are unregistered; a single flockCollapseExpandWorkspace toggle is registered with label reflecting current block expansion state, collapsing or expanding all top-level blocks; workspace delete label is localized to use the new "delete all blocks" key; visual separators are added to group block menu sections after clipboard and before delete, export, and help.
Apply translations to Blockly labels
main/translation.js
applyContextMenuShortcutTranslations() is updated to apply the new localized keys to Blockly's standard message labels for delete, inline/external inputs, and block collapse/expand/disable/enable operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

codex


🐰 Nine keys unlock the menu,
Workspace blocks fold as one,
Translations bloom bright,
Separators guide the path—
A simpler dance awaits! 🎨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Context menu improvements' directly aligns with the main objective to consolidate and rename options in right-click context menus for both workspace and blocks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lawsie lawsie merged commit 9427419 into flipcomputing:main Jun 10, 2026
2 checks passed
@lawsie lawsie deleted the context-menu-improvements branch June 10, 2026 15:42
This was referenced Jun 18, 2026
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