Skip to content

feat(staged): stream Blox workspace bootstrap progress to UI#497

Merged
matt2e merged 6 commits intomainfrom
blox-startup-progress
Mar 26, 2026
Merged

feat(staged): stream Blox workspace bootstrap progress to UI#497
matt2e merged 6 commits intomainfrom
blox-startup-progress

Conversation

@matt2e
Copy link
Copy Markdown
Contributor

@matt2e matt2e commented Mar 26, 2026

Summary

  • Add sq blox ws commands integration to fetch bootstrap command progress for starting workspaces
  • Emit workspace-setup-progress events from the polling loop so the frontend can show which bootstrap step is running (e.g. "Step 2 of 4 · Git checkout")
  • Update BranchCard.svelte to listen for both local worktree and remote workspace progress events, and reset setup state when remote workspace reaches "running"

Test plan

  • Verify that starting a Blox workspace shows step-by-step progress in the branch card
  • Confirm progress resets when workspace transitions to running
  • Check that local worktree setup progress still works as before

🤖 Generated with Claude Code

matt2e and others added 6 commits March 26, 2026 18:34
Poll `sq blox ws commands <name> --json` for workspaces in "starting"
state and emit `workspace-setup-progress` events so BranchCard can show
which bootstrap step is running (starting services, running setup, or
cloning repository) along with "Step X of Y" detail.

Cloning is displayed as the final step since it tends to be the longest
for most users.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show the command_id alongside "Step X of Y" in the workspace setup
progress detail so users can see which bootstrap command is running.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s detail

command_id is a numeric ID (e.g. "126977"), not a human-readable name.
Use the phase label from bootstrap_phase_label instead so the detail
reads e.g. "Step 1 of 3 · Cloning repository…".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ad-hoc phase label strings with stable identifiers matching the
blox orchestrator proto CommandType enum (checkout, project_bootstrap,
provision_workspace). Map these to human-readable display names in the
UI to match the Blox web UI labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show the command display name in the subtitle alongside "Step X of Y"
(e.g. "Step 2 of 3 · Git checkout"). The main label stays as the
generic "Starting workspace…".

Also simplifies command selection to pick the first currently-running
command rather than using a hardcoded sort order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move misplaced doc comment for poll_all_workspace_statuses to correct
  location above the function, separating it from bootstrap_command_type_name
- Add safety comment explaining why the unwrap on current command is safe
- Refactor emit_workspace_setup_progress to accept pre-filtered branch
  IDs instead of re-querying the store, using a HashMap<ws_name, Vec<branch_id>>
  built during the main iteration loop
- Remove unused `unlisten` variable from BranchCard.svelte

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners March 26, 2026 09:13
@matt2e matt2e merged commit fd14e83 into main Mar 26, 2026
6 checks passed
@matt2e matt2e deleted the blox-startup-progress branch March 26, 2026 09:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f520d32cdd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1815 to +1817
tauri::async_runtime::spawn_blocking(move || {
for (ws_name, branch_ids) in &starting_workspaces {
match blox::ws_commands(ws_name) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rate-limit background ws_commands polling tasks

poll_all_workspace_statuses now spawns a fire-and-forget spawn_blocking job on every poll while a workspace is starting, but this command is triggered repeatedly (the UI polls starting workspaces every 3s) and ws_commands itself can block up to the CLI timeout. Because these tasks are not awaited or deduplicated, slow sq blox ws commands calls can overlap and accumulate, causing unnecessary process/thread load and delayed UI responsiveness under normal startup delays.

Useful? React with 👍 / 👎.

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.

1 participant