feat(elements): rename desc -> label on all UI elements, with deprecation - #135
Merged
Merged
Conversation
…tion 'desc' was a poor name for what's actually the caption/text shown on a Slider, Label, Button, Select, Checkbox, or Radio -- 'label' says what it is directly. Renamed the constructor param and property across all six SwiftElement subclasses, plus the wire-protocol dict key ui.js reads. 'desc' keeps working everywhere (constructor kwarg and property, get and set) via a deprecation shim that forwards to 'label' and emits a DeprecationWarning -- nothing is removed, existing code (including RTB's) keeps running, just with a warning pointing at the new name. Also renamed Slider's internal desc DOM id/JS field to label, matching how Button/Select/Checkbox/Radio/Label already name their own caption element -- Slider was the only one still called desc client-side too.
2 tasks
petercorke
added a commit
to petercorke/robotics-toolbox-python
that referenced
this pull request
Aug 22, 2026
Follow-up to this same PR's teach panel: swift-sim renamed desc to label on all SwiftElement subclasses (jhavl/swift#135) while this was in flight -- desc still works via a deprecation shim, but update to the new name rather than carry the warning forward.
This was referenced Aug 22, 2026
…label # Conflicts: # examples/box_sliders.py # examples/panda_ik_sliders.py # examples/two_link_arm.py # src/swift/SwiftElement.py
petercorke
added a commit
to jbkahrs/robotics-toolbox-python-csc376
that referenced
this pull request
Aug 22, 2026
swift-sim renamed the desc constructor kwarg/property to label on all SwiftElement subclasses (jhavl/swift#135) -- desc still works via a deprecation shim, but update RTB's own usages to the new name rather than carry the warning forward.
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.
Summary
descwas a poor name for what's actually the caption/text shown on a Slider, Label, Button, Select, Checkbox, or Radio —labelsays what it is directlySwiftElementsubclasses, plus the wire-protocol dict keyui.jsreadsdesckeeps working everywhere (constructor kwarg and property, get and set) via a deprecation shim that forwards tolabeland emits aDeprecationWarning— nothing is removed, existing user code (including RTB's) keeps running, just with a warning pointing at the new namedescDOM id/JS field tolabel, matching how Button/Select/Checkbox/Radio/Label already name their own caption element — Slider was the only one still calleddescclient-side toolabel=kwarg; added parametrized tests covering the deprecateddesc=constructor kwarg and property on every element classTest plan
pytest— no regressions (one pre-existing, unrelated failure:test_add_path_sends_points_radius_and_linewidth, caused by the installedspatialgeometryPyPI release lagging behind an unreleasedPolylinerename)node --test src/swift/public/js/*.test.js— no regressions🤖 Generated with Claude Code