Skip to content

fix(solo): ask before deleting a workspace - #3282

Closed
jho41 wants to merge 3 commits into
block:mainfrom
jho41:fix/solo-confirm-delete-workspace
Closed

jho41 wants to merge 3 commits into
block:mainfrom
jho41:fix/solo-confirm-delete-workspace

Conversation

@jho41

@jho41 jho41 commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

Delete workspace, in a Solo workspace's … menu, deleted the workspace on the first click, with no confirmation and no Undo. Since #2819 that delete also clears the workspace's instructions, folders and agent list on the relay, so one misclick removes that setup from every device.

Delete workspace now opens an AlertDialog, "Delete {name}?", with Cancel focused:

1 chat moves to Chats. Its instructions, folders and agent list are cleared on all your devices, but your agents aren't deleted. It can't be undone.

The first sentence uses the workspace's real chat count, as Remove section does, and is left out for an empty workspace. "Your agents aren't deleted" matches Delete team: only the workspace's own agent list goes (#2819).

  • Cancel or Escape: nothing is written, and focus returns to the workspace's heading.
  • Confirm: runs the existing preferences.removeSection. The dialog stays open while it runs. If it fails, the dialog shows "Workspace could not be deleted. Try again." and Delete workspace retries. The raw removal errors are developer wording ("recipe", "Outbox"), so they aren't shown. On success, focus moves to Chats, which now holds the workspace's chats.
  • Workspace renamed or deleted on another device while the dialog is open: the title shows the current name, or the dialog closes.
  • docs/buzz-help.md says the delete asks first and lists what it clears.

Before / after

Both runs use the same Playwright flow against the fixture relay, with fixture data only.

Before (main) After (this PR)
Before: Launch workspace in the Solo sidebar After: Delete Launch? dialog with Cancel focused
The Launch workspace, with the Alpha chat in it. Delete workspace opens the confirmation, with focus on Cancel.
Before: Launch deleted on one click After: Launch deleted after confirming
One click deletes it, with no dialog. After confirming, Alpha is under Chats and Chats has focus.
Error state, dark theme, narrow window, large text After: delete error shown inside the dialog After: dialog in dark theme After: dialog at 480 px width After: dialog with 150% text

Why

Every comparable action already asks first: Remove section in the channel sidebar asks even though it deletes nothing, and so do Delete team (#2820) and Delete agent. Delete workspace was the only one that didn't, and it's the one that destroys data. No issue or PR had reported it.

Approach

This reuses the pattern from #2820:

  • The shared AlertDialog with initialFocus on Cancel, as DESIGN.md recommends.
  • A pending guard, the error kept inside the dialog, and an explicit finalFocus.

The dialog opens on the next frame so the menu can restore focus first, as chooseLifecycle in the same file already does. removeSection itself is unchanged. The diff is one production file, its tests and one sentence in the help doc. Failures show one plain message, because removeSection's errors are developer wording.

For reviewers: because the dialog now covers the sidebar for the whole delete, two existing guards can no longer be reached: deleting !== projectId in canRename and !!deleting on the menu item. I left them in to keep this diff small, and I'm happy to remove them here if you prefer.

Testing

  • Unit tests: SoloWorkspaces.test.tsx has 2 new and 2 updated tests. They cover the dialog's copy with and without chats, Cancel and Escape, retry inside the dialog after a failure, and the dialog staying open while the delete runs. All of src/bundled/channels/ and src/features/channel-navigation/ passes, as do the Solo browser specs in Chromium (including solo-region-state, which checks the move refusal), and pnpm run check is clean.
  • Real browsers: a Playwright run that isn't committed, against the production broker and the fixture relay. Chromium and WebKit, by pointer and by keyboard, at 258d209: 22 of 22 passed, including one run where the delete failed and showed the plain message in the dialog. The After screenshots are from that run.
  • Pre-existing issue, not changed here: deleting within about a second of the workspace's last settings write fails with "Please wait a second before saving this recipe again", because of the same-second write guard in channel-templates/capability.ts. main hits it too. With this change the dialog shows the plain message above instead, and retrying succeeds.

Readiness

Back in draft: two agent design reviews (for Morgan Martin and tulsi) asked for copy changes: a plain error message, the real chat count, and saying agents aren't deleted. Those are user-visible, so per AGENTS.md the readiness marker is removed until the PR author re-tests them.

  • Agent review: an independent review found no blockers, and its suggestions are adopted. The two design reviews' copy findings are adopted in 74e80af and 258d209.
  • Agent-exercised: the Chromium and WebKit runs above.
  • Human-tested (PR author): in Chromium against the fixture relay. Creating a workspace, Esc, Cancel and confirming all behaved as described. Since then the branch was rebased onto main twice, with no change to the delete flow. The second rebase also gave the dialog its own error state, because Show disabled plugin chats in Solo #3456 now uses the sidebar's error line for move refusals ("This chat is managed by …"), and that line is kept as it is on main.
  • Not checked: the desktop app's WKWebView and screen-reader announcements. The change is React-only.

🤖 Generated with Claude Code

@jho41
jho41 marked this pull request as ready for review November 11, 2026 17:05
@jho41
jho41 requested a review from a team as a code owner November 11, 2026 17:05
@kazemek21

Copy link
Copy Markdown
Contributor

Instructions to get the build to run:
buzz://message?channel=5909b3f1-fbe6-4f63-9cd2-06440e58b4a1&id=41538c84fc77a64cc0d124407b31805e3d485d331654a91b5185d62dc9245b05&thread=71a8d710754540d5c562226840389021badb3398752eb76d821d2a5b6c2b16ba

@jho41
jho41 force-pushed the fix/solo-confirm-delete-workspace branch from 48a3068 to 4e7d28a Compare November 12, 2026 04:16
@kazemek21

Copy link
Copy Markdown
Contributor

Still working through the community contribution model for UX changes so can't provide a review timeline as of now. Additional context can be found here:
buzz://message?channel=5909b3f1-fbe6-4f63-9cd2-06440e58b4a1&id=8819f5f12686b5cdb17bd7187f32a0824c29dc56fc34afeba9526e9f53ac817a&thread=988d9d10fcedf2b289f815c99d6220033557294d094184d386ec501ab90c6eae

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 This account isn't approving UI changes, so this is a COMMENT. It adds a confirmation dialog and needs a design or core-team reviewer. One docs defect should be fixed first.

Findings:

  • Docs defect: docs/buzz-help.md still contains a leftover conflict-marker line, ||||||| parent of 48a3068 (...), followed by a duplicate "files the chat right away." That ships in the bundled help text. It looks like a bad rebase resolution, so please remove those two lines.
  • Delete paths: in Solo, removeSection has one caller, the Delete workspace menu item, and it now goes through the dialog. The channel sidebar's Remove section is a separate store and path, and it already confirms. The old inline projectError paragraph was only set by delete, so removing it loses no other errors. On main the Solo menu item still deletes on the first click.
  • What a delete removes: the group and all of its chat assignments, which return to Chats. The chats are not deleted. After that, a best-effort write blanks the workspace's settings record (instructions, folders and agents) and renames it "Deleted workspace". That record syncs, so the clear reaches other devices, and it is not undoable. The dialog text matches this. If that second write fails, the settings stay hidden but are not cleared. That is the existing behaviour and is not new here.
  • No FOUNDATION-marked files are touched. A merge-tree against main shows no conflicts, although GitHub reports the PR as conflicting. A rebase would still be tidy.

I read the diff, SoloWorkspaces.tsx, AlertDialog, solo-preferences and SidebarSection. I did not run the tests or the app. I did not check screen-reader behaviour, very long workspace names in the title, or other callers outside src.

Comment thread docs/buzz-help.md Outdated
work in that folder for the rest of the conversation. A chip someone else
sends, or a folder no longer in your repositories folder, grants nothing.
A bare **!**, or **!** before a space, stays text.
||||||| parent of 48a3068 (fix(solo): ask before deleting a workspace)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Stray conflict marker from the rebase. Please delete this line and the duplicate "files the chat right away." line below it.

Solo's "Delete workspace" deleted on the first click. Since block#2819 it also
clears the workspace's instructions, folders and agents on every device, so
a misclick lost that setup for good. Every neighboring destructive action
(Remove section, Delete team, Delete agent) already asks first.

The menu item now opens the shared AlertDialog, "Delete {name}?", with
Cancel focused. Confirming runs the existing removeSection; a failure stays
in the dialog for retry, and focus returns to the heading or to Chats.
Follows the pattern from block#2820.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jonathan Ho <jonathanho@squareup.com>
@jho41
jho41 force-pushed the fix/solo-confirm-delete-workspace branch from 4e7d28a to e215001 Compare November 16, 2026 05:18

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Re-checked at e215001e, which is a rebase onto main plus fixes. The leftover conflict-marker line and the duplicate "files the chat right away." are gone from docs/buzz-help.md, and I found no other conflict markers in the file. The PR touches only its three files.

The one functional change since my last review: a rejected delete now keeps the dialog open and shows the error inside it (deleteError). It's cleared when the dialog closes or on retry. Before, the error was shown in the sidebar under the menu. That fits the dialog better, and the test covers retrying after a rejected delete.

Same stance as before: this adds a confirmation dialog, so it needs a design or core-team reviewer.

@morgmart

Copy link
Copy Markdown
Contributor

🤖 Agent design review for Morgan Martin (not human design sign-off). Reviewed commit e215001e69bcfea359fcf7c08938a384f3eaa3a4.

Intent: stop a single misclick from destroying a Solo workspace's setup on every device by asking first. The diff does that with the shared AlertDialog, Cancel focused, a pending state that can't be dismissed, and the error kept inside the dialog. It matches the existing Delete team / Delete agent pattern. Looks good.

Concrete issue

  • The error shown in the dialog is the raw backend message. In the PR's own screenshot a person sees "Please wait a second before saving this recipe again". "Recipe" means nothing to them and it isn't about deleting. The cause is older than this PR, but the dialog now puts it front and centre. Smallest fix: show this PR's existing fallback ("Workspace could not be deleted. Try again.") for that error, or for any error, rather than error.message.

Design preference (optional)

  • The description has three sentences. "Its chats move to Chats. Its instructions, folders and agents are cleared on all your devices." already covers it. "It can't be undone." is optional, since the destructive button and the word "cleared" say it. Keep it if you'd rather be explicit.

Not checked

  • I didn't run the app. I judged from the diff and the screenshots (light, dark, 480 px, 150% text, error).
  • Not checked: screen-reader announcement of the in-dialog error, WKWebView, or very long workspace names in the title.

@tulsi-builder

Copy link
Copy Markdown
Contributor

🤖 Agent design review for tulsi (tulsi-builder), not human design sign-off. Reviewed e215001.

Intent: stop one misclick on Delete workspace from wiping a Solo workspace's setup on every device, by asking first and keeping any failure inside the confirmation.

Using the shared AlertDialog with Cancel first and a destructive confirm is the right call, and it matches Delete team and Delete plugin. The danger-toned menu item, the pending lock and the error that stays in the dialog all follow DESIGN.md's modal rules. My findings are about the copy.

Failures

  • "agents are cleared" sounds like your agents get deleted. The description says "Its instructions, folders and agents are cleared on all your devices." Only the workspace's own list of agents and teams goes (fix(solo): delete a removed workspace's settings after the groups write #2819). The agents stay in Agents. Delete team spells this out: "Its agents aren't deleted, but they stop getting its instructions." Suggested: "Its chats move to Chats. Its instructions, folders and agent list are cleared on all your devices, but your agents aren't deleted. It can't be undone."
  • The description doesn't match an empty workspace. "Its chats move to Chats" also shows for a new workspace with no chats in it. Remove section in the channel sidebar uses the real count ("3 channels will move back to Channels"). Do the same here: "2 chats move to Chats." / "1 chat moves to Chats.", and leave the sentence out when there are none.
  • The error you documented shows internal wording. "Please wait a second before saving this recipe again" (error screenshot) says "recipe", which nobody in the app calls a workspace, and it has no period. It comes from channel-templates/capability.ts, but this dialog is where people now see it. Smallest fix: map that error here to "Couldn't delete Launch yet. Try again in a moment." and keep the retry in place.

Design preferences

  • Description length: three sentences is a lot for a compact confirmation. You could keep all three, since DESIGN.md keeps destructive consequences, or drop "It can't be undone." because the danger button and "cleared on all your devices" already say it. Either is fine.
  • In the PR's screenshots, the dialog grows both up and down when the error appears: the title moves up about 48 px and the buttons move down about 42 px, measured on the 1440×950 shots. That comes from the shared AlertDialog placement, not from this PR. If it should change, fix it in the component.

Not checked: I didn't render it. I judged from the PR's 8 screenshots (light, dark, error, 480 px, 150% text, before and after) and the diff. Two of the light shots look like they were taken mid-fade, so I judged the surface from the error shot. I didn't check the pending spinner state, a very long workspace name in the title, the desktop WKWebView, or a screen reader.

The delete confirmation showed removeSection's raw error, e.g. "Please wait
a second before saving this recipe again". Those messages are written for
developers ("recipe", "Outbox", "Sidebar section"), and the dialog now puts
them front and centre. Always show "Workspace could not be deleted. Try
again." instead; the dialog stays open, so Delete workspace retries.

Raised in the agent design review on block#3282.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jonathan Ho <jonathanho@squareup.com>
@jho41
jho41 marked this pull request as draft November 17, 2026 19:46
"Its instructions, folders and agents are cleared" read as if the agents
themselves were deleted. Only the workspace's own agent list goes (block#2819);
the agents stay in Agents. The dialog now says "agent list" and "your
agents aren't deleted", matching Delete team.

It also said "Its chats move to Chats" for an empty workspace. It now uses
the real count ("1 chat moves", "2 chats move"), as Remove section does,
and leaves the sentence out when there are none.

Raised in the agent design review on block#3282.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jonathan Ho <jonathanho@squareup.com>
@jho41

jho41 commented Nov 23, 2026

Copy link
Copy Markdown
Author

🤖 Closing this: #3791 added a confirmation to Remove workspace in the unified sidebar, which covers the main case this PR fixed. One gap remains: when a plugin composes the Solo region (e.g. Nexus), Delete workspace in SoloWorkspaces.tsx still calls removeSection on the first click. Happy to reopen a narrowed version if that's worth fixing.

@jho41 jho41 closed this Nov 23, 2026
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.

5 participants