posit-dev / posit-dev/py-shiny
UI inputs: Use a more unique name for the label's auto-generated ID
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 135
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 21
Description
When an input is created, a label tag is created along it, with an ID of {input_ID}-label. I've noticed this in R-Shiny but never mentioned it because it seemed too late, but since py-shiny is starting from 0 it would be nice to avoid this altogether.
I have personally seen several clients have code where they have an input with an id test and nearby an explanation of that input with an id of test-label. And I don't blame them - it can be very tempting to do so, and there's no documented reason not to.
I propose instead of using {input_ID}-label using something that's much less likely to be used, even if it's just adding appending a couple of underscores.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Start by locating the code that generates the label ID for UI inputs, then determine how its tests cover generated IDs; done means the label ID is less likely to collide with a user-created input ID and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100