Skip to content

fix(web-ui): emphasize folder names over remote workspace badges - #3693

Merged
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/remote-workspace-badge
Nov 2, 2026
Merged

bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/remote-workspace-badge

Conversation

@bobleer

@bobleer bobleer commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The remote workspace chip in the navigation panel now favors the folder name:

  • Compact label (remoteWorkspaceBadge.ts): the saved connection name or SSH config alias when one exists, otherwise the host without the login user (root@gpu-node... becomes gpu-node...).
  • Remote identity stays unambiguous: a non-default port from fix(remote-ssh): distinguish SSH servers by port #3670's ssh-user@host#port ids (or a host#port workspace host) is shown as host:port. Labels are compared across all opened workspaces, and when two different connections would read the same, both expand to user@host:port (or alias · user@host:port). Folders on the same connection keep the compact label.
  • Less visual weight: the chip may shrink with an ellipsis and is capped at 45% of the row, so the folder name keeps the rest. A connected chip uses the neutral chip surface instead of the filled success surface; the green status dot already reports the state. Error/connecting states keep their colored surfaces.
  • Tooltip and accessible name keep the full connection name and the full user@host:port endpoint.

Fixes #3517

Type and Areas

Type: UI/UX bug fix

Areas: web UI (NavPanel workspace list)

Motivation / Impact

With several remote folders open, a long generated user@host label at fixed width pushed the folder name out of the row, so users could not tell the folders apart. Now the folder name is readable and the host is secondary but still distinguishable.

Verification

  • pnpm --dir src/web-ui run test:run src/app/components/NavPanel/sections/workspaces/ - 14 files, 109 tests pass (new remoteWorkspaceBadge.test.ts: user stripping, alias, port-scoped ids, cross-connection collisions, same-connection folders, equal aliases, legacy records without name/host; updated layout contract in WorkspaceListSectionLayout.test.ts).
  • pnpm run type-check:web - pass.
  • pnpm run i18n:audit - pass (no copy changes; existing tooltip keys reused).
  • pnpm run theme:color-audit:all - all 28 surfaces pass; no new tokens, one success-surface use removed, no baseline changes.
  • Not visually checked against a live SSH workspace.

Remote scenarios: Remote workspace display only. No persisted shape, protocol, or connection id change; older records without connectionName/sshHost fall back to the connection id. Peer Device Mode renders the same workspace list data.

Reviewer Notes

The 45% cap and the neutral connected chip are design choices; happy to tune.

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.

The remote chip in the workspace navigation rendered the full generated
connection name (user@host) at fixed width with a filled success surface,
so a long SSH host pushed the folder name out of the row.

Show a compact label instead: the saved connection name or SSH alias, or
the host without the login user. Non-default ports stay visible so
port-scoped connections remain distinct, and when two different
connections would read the same the badges expand to user@host:port. The
chip may now shrink with an ellipsis and is capped at 45% of the row; a
connected chip stays neutral because the status dot already reports it.
The tooltip keeps the full connection and endpoint.

Fixes GCWing#3517
Strip the login user only when the saved name exactly matches the default user@host[:port] shape for the connection's own user, host and port. Any other name is shown as chosen.

Refs GCWing#3517
@bobleer
bobleer merged commit be2e370 into GCWing:main Nov 2, 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.

[Bug]: 远程工作区徽标优化

1 participant