Add sandbox prerequisites status bar item and install modal - #24
Merged
Conversation
Layers a UI surface on top of PR #23's paddleboard_sandbox_prereqs data crate. PR-B (visibility unit) of a planned two-part feature; PR-C (enforcement unit) will gate the sandbox tools and add policy settings. New crate paddleboard_sandbox_prereqs_ui: - SandboxPrereqs is a gpui::Global holding the latest SandboxStatus plus a refreshing flag. Initialised at app startup; views observe it via cx.observe_global and re-render when the probe completes or is rerun. - The async probe runs on tokio's pool via gpui_tokio::Tokio::spawn (needed for tokio::process::Command). The result is written back to the global with cx.update_global on the foreground thread, which is how observers know to notify. - SandboxStatusItem implements workspace::StatusItemView. Renders an IconName::Box colored by severity (Unknown / Ok / Warning / Error). Click dispatches paddleboard::OpenSandboxPrereqs. - SandboxPrereqsModal implements workspace::ModalView. Shows Podman + gVisor status rows, the formatted install instructions from the data crate, a Copy button per command step, and a Refresh button that calls SandboxPrereqs::refresh. - paddleboard_sandbox_prereqs_ui::init(cx) registers the global, kicks off the first probe, and uses cx.observe_new to wire the OpenSandboxPrereqs action into every Workspace as it opens. Wire-up in the paddleboard binary: - Call paddleboard_sandbox_prereqs_ui::init in main.rs right after gpui_tokio::init (the probe needs tokio's handle in scope). - Register the status item in zed.rs's initialize_workspace, tagged with // PaddleBoard: comments at the declaration and the add_right_item call so future upstream merges keep the change. Verified: - cargo check -p paddleboard clean. - ./script/clippy -p paddleboard_sandbox_prereqs_ui -p paddleboard_sandbox_prereqs clean. - cargo build -p paddleboard clean (exit 0). - Pre-existing llm_picker clippy failure on main is unrelated to this PR. - Not interactively driven: status bar icon + modal compile and pass lint, but I haven't clicked through the UI myself. Smoke test before merging. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6 tasks
jasonsmithio
added a commit
that referenced
this pull request
May 31, 2026
Add sandbox prerequisites status bar item and install modal
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.
Summary
Second half of the sandbox-prerequisites feature. PR #23 shipped the detection layer (data + CLI). This PR layers the in-editor UI on top: a status-bar indicator and an install-guidance modal.
PR-C (enforcement: tool gating + settings) is still to come and is intentionally scoped out here.
Architecture
New crate
paddleboard_sandbox_prereqs_ui(~390 lines, one file). Three pieces hang together:SandboxPrereqs— agpui::GlobalholdingOption<SandboxStatus>plus arefreshingflag. The probe runs on tokio's pool viagpui_tokio::Tokio::spawn(necessary because the underlyingcheck()usestokio::process::Command), and the result is written back to the global withcx.update_globalon the foreground thread. Views observe viacx.observe_global::<SandboxPrereqs>and re-render when the probe completes.SandboxStatusItem— implementsworkspace::StatusItemView. AnIconButtonwithIconName::Box, colored by severity (Unknown/Ok/Warning/Error). Click dispatchespaddleboard::OpenSandboxPrereqs. Tooltip is severity-specific ("Sandbox: gVisor not configured","Sandbox: Podman not running", etc.).SandboxPrereqsModal— implementsworkspace::ModalView. Renders the two status rows + the install instructions from the data crate, with a per-step Copy button (writes to clipboard viacx.write_to_clipboard(ClipboardItem::new_string(...))) and a Refresh button that re-runs the probe.init(cx)is the single entry point: registers the global, kicks off the first probe, and usescx.observe_newto wire theOpenSandboxPrereqsaction into every workspace as it opens.Severity → color mapping
Podman = MissingColor::Error)Podman = InstalledNotRunningPodman = Ready,Gvisor = NotConfiguredColor::Warning)Podman = Ready,Gvisor = Available/NotApplicableColor::Success)The
NotApplicablecase is Windows — there's no gVisor path on Windows today, so Podman alone counts as the satisfied state. The user gets a different tooltip pre-merge once we land tool gating; the visibility layer is correct either way.Wire-up
Two-line edit in
crates/paddleboard/src/main.rs(callinitright aftergpui_tokio::init, since the probe needs tokio's handle in scope).Five-line edit in
crates/paddleboard/src/zed.rs:initialize_workspaceto instantiate the status item and register it viastatus_bar.add_right_item. Both edits tagged with// PaddleBoard:comments so future upstream merges keep the change.What's not in this PR (PR-C)
sandbox_tool,sandbox_service_tool, andsandboxed_stdio_transportstill launchpodmanwithout checking the cached prereq status. A user with no Podman installed sees a confusing process-not-found error instead of the modal.sandbox.on_missing_runtimepolicy (block/fall_back_to_host/warn_once) yet.PR-C is the larger piece — it touches three tool entry points and has policy implications worth designing carefully.
Verification
cargo check -p paddleboard— clean.cargo build -p paddleboard— clean (exit 0)../script/clippy -p paddleboard_sandbox_prereqs_ui -p paddleboard_sandbox_prereqs— clean.llm_pickerclippy failure onmainis unrelated to this PR — confirmed by stashing changes and rerunning.Diffstat
Test plan
Boxicon with severity color matchingpaddleboard --check-sandboxoutput.paddleboard::OpenSandboxPrereqsaction in the command palette opens the same modal.Release Notes: