Repository navigation
fix(app): keep the sandbox resource fields inside the dialog, and explain them - #245
Merged
Merged
Conversation
…lain them The memory box ran past the right edge of the Add sandbox dialog. TextInputV2 sets its own `width: 280px` and `flex: none`, so two of them in a flex row do not share the space — they take 560px of a 448px row and the second one hangs off the end. Neither flex-1 nor min-w-0 helps against a fixed width, and w-full loses to the component's rule; `!w-full` is what the rest of the app uses, and grid tracks size the pair. Measured in the running app: the memory field ended at x=976 against a dialog edge of 880, and now ends at 864 with the row. Both fields were also unexplained. They are optional and both have real defaults, which an empty box cannot convey, so the dialog now shows the default in each placeholder and describes what the numbers buy — including that the memory is held for as long as the sandbox runs, since a sandbox is a VM. The defaults were literals in the vz backend; they are now named constants there and mirrored in the app, so the dialog cannot quote a number the VM does not actually use. The range message is interpolated from the same constants for the same reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The image hint spent a sentence explaining when to pick a file, which the field's own "(optional)" placeholder and the first sentence already convey, and the idle form carried a standing warning that the first sandbox downloads its image — advice that arrives before the user has done anything and stays up while they fill the form in. The status line now speaks only while something is happening: queued, or creating. A download says what it is doing with the byte counter under the progress bar, so nothing is lost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The folder hint ended on "and the agent edits files in them without asking", which reads as a warning at the moment someone is picking a folder — and the permission model is a property of the sandbox, not of this field. Dropped, and the surrounding em-dash aside folded into the sentence so it does not read as though something was cut out of it. "Memory GB (default 4)" put the unit on the label and left the default looking unitless; "Memory (default 4 GB)" reads as the quantity it is. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every other field in Add sandbox is introduced by the line above it; the CPU and memory description sat underneath, so it read as a footnote to boxes the user had already had to guess at. Moved above the pair, and the dialog now reads the same way throughout: what the field is for, then the field. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The hint restated the defaults that each placeholder already carries and the ceilings that the out-of-range message states when they matter, so two thirds of it was there to be skipped. What is left is the part nothing else says: the numbers are a claim on this machine, and a VM holds its memory the whole time it runs. The interpolation goes with it — the string no longer quotes any number, so it no longer needs the constants passed in. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Two problems with the CPU and Memory fields in Add sandbox, both visible in the screenshot: the memory box hung off the right edge, and neither field said what it does or what you get by leaving it empty.
The overflow
TextInputV2sets its ownwidth: 280pxandflex: none:So two of them in a
flexrow don't share the space — they take 560px of a 448px row and the second one hangs off the end.flex-1andmin-w-0are both no-ops against a fixed width on aflex: noneitem, and plainw-fullloses to the component's rule.!w-fullis what the rest of the app already uses for this (dialog-edit-project-v2.tsx,dialog-manage-models.tsx), and agrid grid-cols-2sizes the pair.Measured in the running app rather than eyeballed:
Both now end flush with the row.
I left the project-folder and image rows alone: their input-plus-button layout fits today, and changing them would be unvalidated churn.
The descriptions
Both fields are optional and both have real defaults, which an empty box cannot convey. Each placeholder now carries its default (
CPUs (default 4),Memory GB (default 4)), and a line underneath explains what the numbers buy — including that the memory is held for as long as the sandbox runs, since a sandbox is a virtual machine rather than a container.The defaults were bare literals in the vz backend (
config.cpus ?? 4). They are now named constants there and mirrored in the app, so the dialog cannot quote a number the VM does not actually use; the range message is interpolated from the same constants for the same reason.Why these fields are macOS-only
Unchanged, but worth recording since it prompted the question: only the
vzbackend can apply per-sandbox limits, because each sandbox is its own VM and the values go into its boot config. WSL2 shares one utility VM whose limits live in the user's global.wslconfig, and bubblewrap has no cgroup plumbing here — neither provider readsconfig.cpus/config.memoryMiBat all. Showing the fields there would be offering a setting that silently does nothing.Verified by driving the running desktop app: screenshot confirms both fields inside the dialog with defaults and description.
packages/app675 pass,packages/codev-sandbox146 pass, typecheck clean in app / codev-sandbox / desktop.🤖 Generated with Claude Code