Improve usability for various classes
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start by locating the RelativePosition class and reviewing its constructor and callers to understand the existing defaults and usage patterns. Survey other classes with similarly long argument lists before deciding the scope; done means a consistent, agreed usability approach is applied without changing existing behavior.
Written by the indexing model from the issue text.
Description
I came across a minor annoyance when working with the RelativePosition class. It has a fairly long list of arguments, and while they are all defaulted there's no way to declare just e.g. the last variable without also defining all of them so, if you want to specify a minHeight (the final parameter in the list) you have to do something like this:
new RelativePosition("100%", "100%", "0px", "0px", "0px", "0px", "0px")
An alternative design pattern is to use an object for the inputs. The object can be defined with defaults, and would then allow calling the function like this:
new RelativePosition({minHeight: "0px"})
And all other variables become defaulted.
I imagine this pattern may be useful in many places across the codebase.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 4
- Avg merge
- 3d 59m
- Merged PRs (30d)
- 3
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.
More from DiamondLightSource/cs-web-lib
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
DiamondLightSource/cs-web-lib#215 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
DiamondLightSource/cs-web-lib#51 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
priority:3
Difficulty 1/5 Under an hour Newbie friendliness 25/100
-
priority:2
DiamondLightSource/cs-web-lib#37 · 1 assignee ·
All issues in DiamondLightSource/cs-web-lib
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·