microsoft / microsoft/pxt

Allow block context menu to be customized

Open
#4,661 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

Is your feature request related to a problem? Please describe.
onShowContextMenu allows the context menu of the workspace to be customized. There should be a similar function to customize the context menu of all blocks.

Describe the solution you'd like
Provide a variable called onShowBlockContextMenu, whose type is (block: Blockly.Block, info: pxtc.BlocksInfo, items: Blockly.ContextMenu.MenuItem[]) => void

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing onShowContextMenu entry point and the code that builds context menus for Blockly blocks. Trace how the workspace callback is exposed, then determine where the proposed onShowBlockContextMenu variable belongs. Done means block menus can be customized through the specified callback signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.