Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Grid extension point #8614

Open
1 task done
riknoll opened this issue Oct 7, 2024 · 1 comment
Open
1 task done

Add Grid extension point #8614

riknoll opened this issue Oct 7, 2024 · 1 comment
Assignees
Labels
issue: feature request Describes a new feature and why it should be added
Milestone

Comments

@riknoll
Copy link
Contributor

riknoll commented Oct 7, 2024

Check for duplicates

  • I have searched for similar issues before opening a new one.

Problem

Currently there is no mechanism I'm aware of for overriding the Grid class that renders the grid background for workspaces. Being able to extend this class would allow for more background options such as a repeating image or other custom patterns.

You can override the background today using CSS, but it won't scroll and scale with the workspace like the grid does.

Request

Add an extension point that lets developers override the Grid class. I believe the parsing code for grid options would also need to be overridden; perhaps it could be moved to a static method on Grid rather than on Options.

Alternatives considered

No response

Additional context

In our MakeCode for Minecraft editor, we use an image as the background instead of a grid. Previously the code for this was in the microsoft/pxt-blockly fork but ever since we deprecated that repo we've lost the ability to do this in a clean manner.

As a temporary fix, I have implemented it with a rather heinous monkey patch.

Also, if this is a desirable change I would be willing to submit a PR!

@riknoll riknoll added issue: feature request Describes a new feature and why it should be added issue: triage Issues awaiting triage by a Blockly team member labels Oct 7, 2024
@cpcallen
Copy link
Contributor

Hi @riknoll. This seems like a perfectly reasonable request, and we'd definitely be willing to take a PR for this. Obviously it's important that the existing functionality be preserved, but otherwise we're happy to consider whatever approach you think is most suitable.

@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Oct 11, 2024
@cpcallen cpcallen added this to the Upcoming milestone Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

2 participants