Skip to content

Replace resource number spinners with preset dropdowns in container Resources#419

Merged
runleveldev merged 3 commits into
mainfrom
copilot/improve-storage-inputs
Jul 23, 2026
Merged

Replace resource number spinners with preset dropdowns in container Resources#419
runleveldev merged 3 commits into
mainfrom
copilot/improve-storage-inputs

Conversation

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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

  • New ResourceValueInput component — 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. 40964 GB).
  • ResourcesSection wiring — added per-resource presets and bumped the custom-edit step to multiples of 1024 (RAM/Swap) and 10 (RootFS); swapped the inline number input for ResourceValueInput.

Presets: RAM 256 MB–32 GB, Swap 0 MB–16 GB, CPUs 1–32, RootFS 5–500 GB.

<ResourceValueInput
  label={opt.label}
  unit={opt.unit}
  min={opt.min}
  step={opt.step}
  presets={opt.presets}
  value={editValue}
  onChange={setEditValue}
/>

The editable number field is retained via Custom…, so arbitrary values are still supported. Both the dropdown and input carry ARIA labels.

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
Copilot AI requested a review from horner July 17, 2026 15:29
@runleveldev
runleveldev marked this pull request as ready for review July 23, 2026 18:10
Copilot AI review requested due to automatic review settings July 23, 2026 18:10
@runleveldev
runleveldev merged commit c5cfab4 into main Jul 23, 2026
8 checks passed
@runleveldev
runleveldev deleted the copilot/improve-storage-inputs branch July 23, 2026 18:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ResourceValueInput component 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 ResourcesSection to use ResourceValueInput and 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=5 and step=10 makes 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,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage Inputs in the Resources are not helpful for most users

4 participants