feat(sidebar): show host name on every row in multi-host setups (#1775)

The host name previously appeared only in project grouping mode, and only
for projects shared across hosts. It now shows on every workspace row in
both project and status grouping modes whenever the sidebar spans more than
one host, so you can always tell which machine a workspace lives on. Status
rows read "Project · Host". Single-host setups are unchanged.
This commit is contained in:
Mohamed Boudra
2026-06-28 08:50:04 +07:00
committed by GitHub
parent 276c1f48f1
commit 9b6aa99396
5 changed files with 135 additions and 14 deletions
@@ -351,6 +351,20 @@ export function buildSidebarProjectsFromHostProjects(input: {
}));
}
// Host labels disambiguate which machine a workspace lives on; they only earn their
// space once the visible sidebar spans more than one host. Counting distinct hosts
// across the visible projects (not all connected hosts) keeps labels off when a host
// filter pins the view to a single host.
export function shouldShowSidebarHostLabels(projects: SidebarProjectEntry[]): boolean {
const serverIds = new Set<string>();
for (const project of projects) {
for (const host of project.hosts) {
serverIds.add(host.serverId);
}
}
return serverIds.size >= 2;
}
export function applyStoredOrdering<T>(input: {
items: T[];
storedOrder: string[];