Skip to content

Studio: sandbox level picker and Settings > Sandbox cleanup - #12855

Merged
Lyxot merged 3 commits into
mainfrom
studio/sandbox-level-picker
Oct 6, 2026
Merged

Lyxot merged 3 commits into
mainfrom
studio/sandbox-level-picker

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Cleans up the sandbox controls in the composer permission menu and in Settings > Sandbox so they match the rest of Studio.

Permission menu

  • The Sandbox switch is now a "Sandbox High ›" chip. Clicking it opens a small level picker beside the menu. Hovering does not open it, and it shows a rounded pill on hover or while open.
  • The picker stays open until a click outside it, a second click on the chip, or ArrowLeft. Radix closes a submenu as soon as the pointer or focus moves back to the parent menu, so the picker owns its open state.
  • The picker asks "How should code be sandboxed?" with Learn more on the same line, and lists Low and High with one line each:
    • Low: Software only. Risky code asks first
    • High: Adds OS isolation to Python and Terminal
  • The picker sits 8px clear of the menu with the tops aligned, instead of overlapping it: on the right, or on the left when the right has no room. Radix applies one sideOffset to whichever side it lands on, so the side and offsets are worked out once the picker mounts.
  • Under Full access the chip reads "Sandbox Disabled ›". The picker still opens so users can see why: Disabled is ticked and Low and High are locked.

Settings > Sandbox

  • The level switch is now a Low | High segmented toggle, the same control as Follow-up behavior and Scroll while generating.
  • Descriptions name the selected option first, e.g. "Approve for me: Runs routine tool calls..." and "High: OS sandboxing. Python and Terminal run...".
  • Full access adds a Disabled option to the toggle. It stays selected and Low and High are locked until another permission level is picked.
  • Python and Terminal badges are grey with a plain shield icon, sized like the dropdown pills (h-8, text-sm).
  • Refresh moves next to the "This computer" heading via a new optional action slot on SettingsSection. Other callers render as before.
  • The Sandbox tab uses the Hugeicons shield-cog icon. It is newer than the pinned @hugeicons/core-free-icons, so it lives in src/lib/shield-cog-icon.ts like the existing shield-alert icon.

Strings

  • New keys: permissionLabel, levelPickerTitle, levelOff, levelOffShort, levelHighDetail, levelLowDetail. The detail strings reuse the existing translations without the "Low:" / "High:" prefix.
  • levelHighShort / levelLowShort are reworded to be more specific.
  • Removes the now unused levelHelp, levelHighDescription and levelLowDescription.
  • Translated for every locale except sv, which already falls back to English for these strings.

Testing

cd studio/frontend
npm test
npm run typecheck
npm run i18n:check
npm run build
  • npm test: 10699 pass, 0 fail.
  • typecheck: only the two existing errors in tests/settings-deep-open-requests.test.ts (chat-canvas-network scroll target), which this branch does not touch. i18n:check and build pass.
  • Updated account-permissions.test.ts and permission-mode-learn-more.test.ts for the picker, the Full access Disabled state, click to open, and the Settings toggle and descriptions.
  • Checked in a local Studio in light and dark mode:
    • Hovering the chip for 1.5s leaves the picker closed. A click or the right arrow key opens it.
    • Once open, moving the cursor across the menu rows and off both menus keeps it open. Clicking inside the picker keeps it open, and clicking outside closes it.
    • The picker is 312px wide, 8px clear of the menu, and the tick is vertically centred on each row.
    • Learn more matches the heading's font size and top.
    • Full access shows Disabled in both places, and switching back restores the previous level.

Permission menu:
- Replace the Sandbox switch with a "Sandbox High >" chip that opens a level picker on click
- Picker asks "How should code be sandboxed?" with Learn more beside it
- Picker sits beside the menu with a small gap instead of overlapping it

Settings > Sandbox:
- Low | High segmented toggle, same as Follow-up behavior
- Descriptions name the selected option ("Approve for me: ...", "High: ...")
- Full access shows a locked Disabled option in the toggle and the picker
- Grey OS sandbox badges with a shield icon, sized like the dropdowns
- Refresh moved next to the "This computer" heading
- Shield cog icon for the Sandbox tab

Removes now unused levelHelp and levelHigh/LowDescription strings.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T12:36:06.578131Z 3f8fafd Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Radix closes a submenu once the pointer or focus moves back to the parent
menu. The picker now owns its open state and only closes on a click outside
it, a second click on the chip, or ArrowLeft.
Radix applies one sideOffset to whichever side the picker lands on, so an
offset measured for the right overlapped the menu after a flip. Measure the
picker once mounted and use the left offset when only the left fits.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 3f8fafda71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Lyxot Lyxot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Frontend-only change, no dangling references to the removed i18n keys.

@Lyxot
Lyxot merged commit a601a26 into main Oct 6, 2026
@Lyxot
Lyxot deleted the studio/sandbox-level-picker branch October 6, 2026 12:58
danielhanchen added a commit that referenced this pull request Oct 6, 2026
… switch (#12866)

#12855 swapped the permission menu's Sandbox switch for a chip that opens a
Low/High picker, so the permission levels step failed looking for the old
menuitemcheckbox on every OS. Pick the level through the chip and picker and
keep every setup popup and persistence check.
danielhanchen added a commit that referenced this pull request Oct 6, 2026
…#12868)

- Python floor (workflow-trigger lint, Source lint): #8561 imports
  compression.zstd (3.14) inside a try whose ImportError falls back to
  zstandard. That except is the guard; mark the import novermin, as the
  repo does for its other guarded above-floor imports.
- Frontend typecheck: #12804 renamed the chat-canvas-network scroll target
  to browser-html-network on the browser tab, and
  settings-deep-open-requests.test.ts still used the old name.
- ui-font-size-scales-spacing: #12852 added two w-[26px] cells to the
  browser address bar; scale them with --ui-space-scale like the rest of
  that bar.
- Chat UI permission step: #12855 replaced the Sandbox Low/High switch
  (menuitemcheckbox) with a Sandbox chip that opens a level picker. The
  step now reads the chip and picks High from the picker, keeping every
  assertion about what Low, High and the setup popup do.
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.

2 participants