Replace resource number spinners with preset dropdowns in container Resources#419
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix storage inputs in the Resources for better user experience
Replace resource number spinners with preset dropdowns in container Resources
Jul 17, 2026
runleveldev
marked this pull request as ready for review
July 23, 2026 18:10
runleveldev
approved these changes
Jul 23, 2026
runleveldev
approved these changes
Jul 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the container Resources editor UX by replacing the raw number-spinner inputs (especially painful for MB-scale values) with a preset dropdown + “Custom…” numeric entry flow, while keeping arbitrary values supported.
Changes:
- Added a new
ResourceValueInputcomponent that renders common-size presets (with MB presets displayed as whole GB when evenly divisible) plus a “Custom…” option that reveals a number input. - Updated
ResourcesSectionto useResourceValueInputand to define per-resource preset lists and custom-edit stepping behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| create-a-container/client/src/components/containers/ResourceValueInput.tsx | New component implementing preset selection + optional custom numeric entry with ARIA labels. |
| create-a-container/client/src/components/containers/ResourcesSection.tsx | Wires the new component into the Resources editor and defines per-resource preset/step/min configuration. |
Comments suppressed due to low confidence (1)
create-a-container/client/src/components/containers/ResourcesSection.tsx:45
- For RootFS,
min=5andstep=10makes many common values (e.g. 10, 20, 50) fail the HTML step/min alignment rules, which can lead to surprising spinner behavior in the Custom number input. Using a step that divides the preset values (e.g. 5) keeps stepping consistent.
key: 'rootfs',
label: 'RootFS Storage',
unit: 'GB',
step: 10,
min: 5,
presets: [5, 10, 20, 50, 100, 200, 500],
| key: 'memory', | ||
| label: 'RAM', | ||
| unit: 'MB', | ||
| step: 1024, |
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.
The RAM/Swap/Storage editors used a raw number input whose up/down arrows nudged megabyte values by a single step, making it tedious to reach useful sizes like 4096 MB.
Changes
ResourceValueInputcomponent — a preset dropdown of common sizes with a Custom… option that reveals a number input for precise editing. MB presets that divide evenly render as whole GB (e.g.4096→4 GB).ResourcesSectionwiring — added per-resourcepresetsand bumped the custom-editstepto multiples of 1024 (RAM/Swap) and 10 (RootFS); swapped the inline number input forResourceValueInput.Presets: RAM
256 MB–32 GB, Swap0 MB–16 GB, CPUs1–32, RootFS5–500 GB.The editable number field is retained via Custom…, so arbitrary values are still supported. Both the dropdown and input carry ARIA labels.