Skip to content

fix(app): colour the server Delete menu item as destructive - #251

Merged
quickbeard merged 3 commits into
mainfrom
red-server-delete
Aug 17, 2026
Merged

quickbeard merged 3 commits into
mainfrom
red-server-delete

Conversation

@quickbeard

@quickbeard quickbeard commented Aug 17, 2026 •

Copy link
Copy Markdown
Owner

Why

Delete in a server's menu rendered in the same colour as Edit and Set as default, so the one irreversible action in the menu carried no more weight than the rest. The session actions menu already colours its Delete red; this brings the server menus in line.

What changed

Destructive colour on Delete

Applied to two Delete items, both in Settings → Servers (and, for the generic one, the sidebar server rows):

  • packages/app/src/components/server/server-row-menu.tsx — ServerRowMenu, used for the local sidecar, remote, and SSH servers.
  • packages/app/src/wsl/settings.tsx — the WSL server rows, which sit in the same list.
<MenuV2.Item
  style={{ "--menu-v2-fg": "var(--v2-state-fg-danger)" }}
  onSelect={...}
>

It has to be the CSS variable rather than a text utility: menu-v2.css colours the item and its menu-v2-item-content label span from --menu-v2-fg, so a class on the item never reaches the label. The highlighted state only swaps the background, so the colour survives hover, and the disabled state (builtin servers in the generic menu) dims by opacity alone, so it stays recognisably red.

Also carried here: the sandbox seeding fix

fix(app): stop the sandbox seeding effect from reopening a closed folder is cherry-picked from #249, so this branch carries it too. Closing a mounted folder on Work removed the row and then put it straight back. Two independent causes:

  • createServerProjects.close() writes the open list and the recently-closed list as two store writes, and Solid flushes effects between them, so seedSandboxProjects saw a project in neither list and seeded it again. Now batched.
  • The ctx's recentlyClosed is filtered down to directories in sync.data.project, and a folder that has never held a session has no such record — so closed could never carry the user's decision for a freshly mounted folder. The effect now remembers what it seeded, and forgets a folder once it is unmounted.

Two regression tests drive the real project store and the real recentlyClosed shape; the existing fakes in that file were friendly enough to hide both bugs.

Note: this commit is shared with #249. Whichever PR merges second will need a rebase, and CHANGELOG.md may need a one-line dedupe of the "Closing a folder on Work" bullet.

Scope

One Delete surface is deliberately left alone: packages/app/src/components/dialog-select-server.tsx — the legacy DropdownMenu design, a different component from the MenuV2 rows above.

The sandbox row's Delete, and the Mount/Unmount work, stay in #249.

Testing

  • bun typecheck in packages/app — clean.
  • bun run test in packages/app — 675 unit + 94 browser, 0 fail.

Not visually confirmed in a running app.

🤖 Generated with Claude Code

Quickbeard and others added 3 commits August 17, 2026 11:10
Matches the generic server menu in the previous commit. The WSL rows sit in
the same Settings -> Servers list, so leaving theirs uncoloured would have
made the list inconsistent with itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Closing a mounted folder on Work removed the row and then put it straight
back. With Unmount that read as the action doing nothing: the row returned,
then the mount change landed, the folder left conn.mounts, and the menu fell
back to Close.

Two independent causes, both needed:

createServerProjects.close() writes the open list and the recently-closed list
as two store writes. Solid flushes effects between them, so seedSandboxProjects
saw a project that was in neither list and seeded it again. The pair is now one
batch.

That alone only covers folders the guest server has a project record for. The
ctx's recentlyClosed is filtered down to directories in sync.data.project, and
a folder that has never held a session has no record there, so `closed` could
never carry the user's decision for a freshly mounted folder. The effect now
remembers what it has seeded and will not seed the same folder twice, and
forgets a folder once it is unmounted so remounting seeds it again.

Regression cover drives the real project store and the real recentlyClosed
shape; the existing fakes in that file were friendly enough to hide both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit 05a3f7c into main Aug 17, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the red-server-delete branch August 17, 2026 04:10
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