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

Warn if VARIABLES category without the variable blocks #1098

Open
RoboErikG opened this issue May 12, 2017 · 5 comments
Open

Warn if VARIABLES category without the variable blocks #1098

RoboErikG opened this issue May 12, 2017 · 5 comments
Labels
component: variables help wanted External contributions actively solicited issue: feature request Describes a new feature and why it should be added

Comments

@RoboErikG
Copy link
Contributor

Currently, the default implementation for the Variables flyout checks if get_variable, set_variable, and change_variable blocks exist and populates the flyout for the ones that do. This means that if a developer forgets to include all the variables blocks they will end up with an empty variables category and no explanation why.

Should we crash if they aren't all included? If there isn't at least get & set? If there isn't just one of them?

Note: It looks like Blockly Games Turtle hasn't updated in a while and is only using get/set in the last level (no change).

@CoryDCode
Copy link
Contributor

I don't like the idea of crashing, but I do think there should be a console error for it. And I think the only error state should be "There are no variable blocks, but there is a variable category."

@rachel-fenichel
Copy link
Collaborator

I'd vote for console.warn, not an error.

@AnmAtAnm
Copy link
Contributor

AnmAtAnm commented May 20, 2017

crash is a weird thing on web. console error and fail gracefully make more sense.

To the extent that Android and iOS include their block definitions, I think crashing is fine on those platforms (harder to accidentally forget a file; less likely to be deployed without testing). To that point, those platforms should crash as early as possible, ideally without opening that category.

@maribethb maribethb changed the title Should having a VARIABLES category without the variable blocks be a crashing error? Warn if VARIABLES category without the variable blocks Feb 15, 2023
@maribethb
Copy link
Contributor

Decision: console.warn in this case

@maribethb maribethb added help wanted External contributions actively solicited issue: feature request Describes a new feature and why it should be added and removed type: question labels Feb 15, 2023
@rachel-fenichel
Copy link
Collaborator

Places to update code:

  • variables.ts: flyoutCategory or flyoutCategoryBlocks
  • variables_dynamic.ts: flyoutCategory or flyoutCategoryBlocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: variables help wanted External contributions actively solicited issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

5 participants