Skip to content

Commit 2b0a27e

Browse files
authored
feat: add shared workspaces view (#991)
Add a Shared Workspaces tree view that queries shared:true and filters out the signed-in user's own workspaces client-side, since the server also returns workspaces we own and shared out. Rework session state to support this safely: SessionStore owns the deployment session and replaces the immutable SessionData object on every sign-in/out, so providers detect concurrent session changes by comparing object identity and drop stale fetches. Per-view behavior (owner column, metadata watchers, owner filtering) is driven by a WORKSPACE_QUERY_CONFIG table. A fetch that goes stale or is requested mid-flight queues a re-fetch that runs once the current request settles, so requests never run in parallel and every session change ends with fresh data. Same-user token rotations refresh client credentials in place without tearing down the trees.
1 parent a402fb6 commit 2b0a27e

10 files changed

Lines changed: 1302 additions & 229 deletions

File tree

package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@
317317
"visibility": "visible",
318318
"icon": "media/logo-white.svg"
319319
},
320+
{
321+
"id": "sharedWorkspaces",
322+
"name": "Shared Workspaces",
323+
"visibility": "visible",
324+
"icon": "media/logo-white.svg",
325+
"when": "coder.authenticated"
326+
},
320327
{
321328
"id": "allWorkspaces",
322329
"name": "All Workspaces",
@@ -459,6 +466,12 @@
459466
"category": "Coder",
460467
"icon": "$(search)"
461468
},
469+
{
470+
"command": "coder.searchSharedWorkspaces",
471+
"title": "Search",
472+
"category": "Coder",
473+
"icon": "$(search)"
474+
},
462475
{
463476
"command": "coder.searchAllWorkspaces",
464477
"title": "Search",
@@ -585,6 +598,10 @@
585598
"command": "coder.searchMyWorkspaces",
586599
"when": "false"
587600
},
601+
{
602+
"command": "coder.searchSharedWorkspaces",
603+
"when": "false"
604+
},
588605
{
589606
"command": "coder.searchAllWorkspaces",
590607
"when": "false"
@@ -628,6 +645,16 @@
628645
"when": "coder.authenticated && view == myWorkspaces",
629646
"group": "navigation@3"
630647
},
648+
{
649+
"command": "coder.refreshWorkspaces",
650+
"when": "coder.authenticated && view == sharedWorkspaces",
651+
"group": "navigation@2"
652+
},
653+
{
654+
"command": "coder.searchSharedWorkspaces",
655+
"when": "coder.authenticated && view == sharedWorkspaces",
656+
"group": "navigation@3"
657+
},
631658
{
632659
"command": "coder.searchAllWorkspaces",
633660
"when": "coder.authenticated && view == allWorkspaces",

src/core/commandManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const CODER_COMMAND_IDS = [
2222
"coder.viewLogs",
2323
"coder.exportTelemetry",
2424
"coder.searchMyWorkspaces",
25+
"coder.searchSharedWorkspaces",
2526
"coder.searchAllWorkspaces",
2627
"coder.manageCredentials",
2728
"coder.applyRecommendedSettings",

0 commit comments

Comments
 (0)