Refine project share filtering of user inputs / add Star Wars to filtered list #67024
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refines our filtering for K-5 'open-ended' projects by only including input fields with keys that indicate user-generated text (excluding dropdown options). We recently received a Zendesk report that a project was blocked from sharing due to the animation name 'grasshopper_1'. Thus, we are updating the filtering logic to only include user-generated text.
We currently only filter Play Lab projects if they include a field name in
USER_ENTERED_TEXT_INDICATORS
. When I first implemented filtering of other Blockly project types, I was unsure which field names mapped to user-generated text. When curriculum writers create Blockly blocks, they also determine the field names. So currently we filter all text that is considered user input including dropdown options.Therefore, @mikeharv and I audited all blocks (https://levelbuilder-studio.code.org/pools) to collect the list of field names that indicate open text (strings) as opposed to dropdown options across all Blockly project types (this took a bit of digging and testing).
While going through all the blocks, we realized that Star Wars's
setScore
block uses a string parameter that is displayed at the top of the visualization when the program is run. Thus we're adding Star Wars Blockly to list of programs to filter.Example:

This update is based on the fact that any block field that supports open text has a field name included in the list above. Thus, we follow up and warn/prevent curriculum writers from making new free-text blocks that break this convention. Thanks Mike!.
Before update
Sprite Lab project being flagged for 'grasshopper_1':

Star Wars project that contains profanity not being flagged:

After update
Sprite Lab project with 'grasshopper_1' animation no longer being blocked from sharing:

Star Wars project that contains profanity blocked from sharing:

Links
Testing story
Tested locally on different project types (Sprite Lab, Poetry Lab, Play Lab, and Star Wars (blockly). See before/after updates above.
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: