Skip to content

fix(web-ui): never show an unknown remote workspace status - #3886

Merged
bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/fix-remote-workspace-status-pill
Nov 12, 2026
Merged

bobleer merged 1 commit into
openBitFun:mainfrom
bobleer:bob/fix-remote-workspace-status-pill

Conversation

@bobleer

@bobleer bobleer commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Remote workspace rows in the sidebar could show "Status unknown" (状态未知), and the pill for non-connected states glitched when hovered.

Unknown status. In Peer Device Mode, SSHRemoteProvider only recorded a status when a per-workspace event named a remote workspace. A peer's other remote workspaces (a hydrated list emits no per-workspace events) had no status, and WorkspaceItem rendered the missing value as "unknown". The same gap showed briefly at startup before the first check finished.

  • In Peer Device Mode the provider now asks the peer for each connection's state (ssh_is_connected). It does this when Peer mode starts, when another device surface is rendered, and when any workspace change leaves a connection without a status.
    • true → connected, false → disconnected.
    • A peer host that does not report SSH state (a CLI peer refuses the command) keeps the mirrored connected state, which matches the previous peer behavior: the peer owns the workspace it opened.
    • Any other error (unreachable peer) → error.
    • Results are scoped to the surface activation, so a stale device's answer is dropped.
  • A row whose first check has not landed shows "connecting" instead of "unknown". The nav.workspaces.remote.status.unknown label is removed from all locales.

Pill glitch. For non-connected states the pill appended a status text that could not shrink, while the host label could. When the hover actions narrowed the row, the host collapsed to nothing, leaving ● · 状态未知. The pill now keeps the same dot + host shape in every state, like the connected state. The dot color and pill tint carry the status, and the tooltip / aria label spell it out.

Type and Areas

Type: fix

Areas: web UI (navigation sidebar, SSH remote provider), locales

Motivation / Impact

Users no longer see an unknown status for remote workspaces, including peer devices' workspaces. Non-connected rows no longer jump or lose their host label on hover. Status words are now only in the tooltip, not inline.

Remote scenarios: Peer Device Mode is the affected path. It was exercised only with simulated surfaces in unit tests, not with a live Desktop ↔ CLI or Desktop ↔ Desktop peer. Local SSH workspaces only change in the row fallback (connecting instead of unknown).

Verification

  • vitest run src/features/ssh-remote/SSHRemoteProvider.test.tsx src/app/components/NavPanel/sections/workspaces: passed. Three new tests cover:
    • a peer list loaded with no per-workspace events
    • CLI-peer refusal vs. unreachable peer
    • re-reading the status after a device switch
  • pnpm run type-check:web, pnpm run i18n:audit, pnpm run theme:color-audit:all: passed.
  • pnpm run check:web fails only on an existing typography violation in design-system/packages/ui/src/components/Dialog/Dialog.module.css:77, which this PR does not touch.
  • src/app/components/NavPanel/sections/devices has 17 failing tests on unmodified main as well; unrelated to this change.
  • Not verified in the native app or against a live peer.

Reviewer Notes

AI-assisted change, lightly tested (unit/DOM fixtures only).

A CLI peer does not handle ssh_is_connected today, so for CLI peers the row stays mirrored as connected. Adding a CLI handler (plus a registry row change) would give real status there; it is left as a follow-up because it is a cross-version peer capability change.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

In Peer Device Mode the SSH provider only recorded a status when a
per-workspace event named a remote workspace, so a peer's other remote
workspaces (a hydrated list emits none) rendered "Status unknown". Ask the
peer for each connection's state on Peer activation, surface switches, and
any workspace change that leaves a connection without a status. A peer
host that does not report SSH state keeps the mirrored connected state; an
unreachable peer reads as an error.

A row whose first check has not landed shows connecting instead of unknown,
and the unknown label is removed.

The remote pill now keeps the same dot + host shape in every state; the
dot and tint carry the status and the tooltip spells it out. Previously the
hover actions squeezed the host label to nothing while the status text
could not shrink.
@bobleer
bobleer merged commit 30b475f into openBitFun:main Nov 12, 2026
9 checks passed
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