From 3455b2fdaa5972c64e88204415d8ed02cbef76e2 Mon Sep 17 00:00:00 2001 From: Zeus-Deus Date: Wed, 27 May 2026 20:38:30 +0200 Subject: [PATCH 1/2] chore: sync package-lock.json to 0.7.1 The npm version in package.json was bumped to 0.7.1 in f8976da but the lock file was left at 0.7.0. Running 'npm install' brings the lock file back in sync. --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2965b7fb..4c2b6a7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codemux", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codemux", - "version": "0.7.0", + "version": "0.7.1", "license": "Elastic-2.0", "dependencies": { "@codemirror/commands": "^6.10.3", From b5942a022b2923e973bd07541e31028045c52119 Mon Sep 17 00:00:00 2001 From: Zeus-Deus Date: Wed, 27 May 2026 20:46:08 +0200 Subject: [PATCH 2/2] fix(workspaces-overview): keep configured-host buckets visible even when empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The overview pre-creates a bucket for every configured host so that a device the user has set up shows in the overview the moment it's added — the comment at the bucket-build step says exactly that. But the final filter pass on the bucket list then stripped any bucket whose `items.length` and `totalCount` were both zero, which silently contradicted that intent. A device the user just added (or had configured for ages but never landed a workspace on) was invisible until the first workspace pushed to it bumped totalCount above zero. That's why the only known workaround was "push any workspace to it" — the push made the bucket non-empty. The fix carves out configured-host buckets (those carrying a local host row id) from the empty-bucket filter. The local 'This device' bucket and orphan buckets (workspaces referencing an unknown host_server_id) still follow the items/totalCount rule, so the overview doesn't render a dangling 'This device' row for a brand-new account with zero rows. Adds a regression test that fails on the old filter and passes on the new one. --- .../workspaces-overview-section.test.tsx | 17 +++++++++++++++++ .../workspaces-overview-section.tsx | 18 ++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/components/workspaces-overview/workspaces-overview-section.test.tsx b/src/components/workspaces-overview/workspaces-overview-section.test.tsx index a0dc869f..16755aa8 100644 --- a/src/components/workspaces-overview/workspaces-overview-section.test.tsx +++ b/src/components/workspaces-overview/workspaces-overview-section.test.tsx @@ -281,6 +281,23 @@ describe("WorkspacesOverviewSection", () => { expect(getByText("lost-and-found")).toBeInTheDocument(); }); + it("shows a configured host's bucket even when no workspaces live on it yet", () => { + // Regression for the "I added a device, it doesn't show up in the + // overview until I push a workspace" bug. The host has a server_id + // (i.e. it's synced cross-device), there are no workspaces on it, + // and there's a local workspace so the local bucket is non-empty. + // The configured-host bucket must still render — otherwise the + // user has no way to discover the device from the overview, nor + // any obvious target to push to. + mockHosts = [makeHost(7, "pandora")]; + mockWorkspaces = [ + makeWorkspace({ workspace_id: "local-1", title: "alpha" }), + ]; + const { getByText } = render(); + expect(getByText("This device")).toBeInTheDocument(); + expect(getByText("pandora")).toBeInTheDocument(); + }); + it("renders the bucket-level 'all hidden by filter' message when filters hide every workspace in a known device bucket", () => { // Intentional: when the user has a bucket they recognise but // every row in it is filtered out, the bucket stays visible diff --git a/src/components/workspaces-overview/workspaces-overview-section.tsx b/src/components/workspaces-overview/workspaces-overview-section.tsx index e5f6e150..ef3f0c81 100644 --- a/src/components/workspaces-overview/workspaces-overview-section.tsx +++ b/src/components/workspaces-overview/workspaces-overview-section.tsx @@ -352,9 +352,23 @@ export function WorkspacesOverviewSection() { bucket.items.sort(sorter); } - // Hide buckets that have neither items nor any unfiltered rows. + // Keep configured-host buckets (localHostId != null) even when + // empty — matches the intent stated above at the pre-create step: + // a device the user has set up should be visible in the overview + // the moment it's configured, not only after the first workspace + // lands on it. Without this, an empty pandora bucket gets created + // and then immediately stripped here, which is why the user only + // ever saw "This device" until they pushed a workspace. + // + // Orphan buckets (localHostId == null, hostServerId != null) and + // the special "local" bucket still follow the items/totalCount + // rule so the overview doesn't render a dangling "This device" + // row when the user has zero workspaces and zero remote rows. return Array.from(byKey.values()) - .filter((b) => b.items.length > 0 || b.totalCount > 0) + .filter( + (b) => + b.localHostId !== null || b.items.length > 0 || b.totalCount > 0, + ) .sort((a, b) => a.sortRank - b.sortRank); }, [allItems, filtered, hosts, sortBy, activeWorkspaceId]);