Show simple class names on blocks#397
Merged
lizlooney merged 6 commits intowpilibsuite:mainfrom Apr 21, 2026
Merged
Conversation
Modify TabContent to call Editor.updateShowSimpleClassNames when showSimpleClassNames is changed. Add updateShowSimpleClassNames to Editor. Editor calls mrcShowSimpleClassNames on blocks that have that function when blocks are loaded, created, and when showSimpleClassNames is changed. Toolbox blocks are also updated when showSimpleClassNames is changed.
…component, mrc_get_python_enum_value, mrc_get_python_variable, and mrc_set_python_variable): Use a mixin member instead of the value of the field that shows the class name, for tooltip, generating python code, etc. Added mrcShowSimpleClassNames to update the value of the field that shows the class name according to showSimpleClassName. Added showSimpleClassNames parameter to functions that create blocks and use it when setting the field that shows the class name. mrc_call_python_function.ts: Added moduleOrClassName to CallPythonFunctionExtraState and mrcModuleOrClassName to CallPythonFunctionMixin, since the FIELD_MODULE_OR_CLASS_NAME field value might not be the full class name. Added upgrade_0012_to_0013 to set mrcModuleOrClassName. mrc_component.ts: Added className to ComponentExtraState and mrcClassName to ComponentMixin, since the FIELD_TYPE field value might not be the class name. Added upgrade_0012_to_0013 to set mrcClassName. mrc_mechanism.ts: Pass showSimpleClassName to valueForComponentArgInput since it might create an mrc_get_python_enum_value block.
alan412
approved these changes
Apr 20, 2026
Collaborator
alan412
left a comment
There was a problem hiding this comment.
LGTM. At first, I didn't like the check mark in front, but that is what Apple does. I wonder if there is some way we could show an "empty" icon so the line doesn't move in or out. But I think that is a minor nit and something we could deal with later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 feature is on by default, but the user can change it from the Settings menu.
I ran through the checklist.
I also tested it with a project that uses all the types of blocks that show class names:


With full names:
With simple names: