Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

fix(console): open the server's page from the sidebar's "Sign in" link (#936)

massimo-sandboxaqac34b07cb3d8
diff --git a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
index 9d9b6cc1c..5ceab9c44 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
+++ b/console/apps/switch-console-desktop/src/renderer/features/sidebar/sidebar-grouped-list.tsx
@@ -196,7 +196,7 @@ const RoomStateDisclosure = observer(function RoomStateDisclosure() {
<DisclosureBar>
Sign in to {signedOut.map((s) => s.name).join(', ')} to see{' '}
{signedOut.length === 1 ? 'its' : 'their'} rooms.{' '}
- <DisclosureAction onClick={() => navigate('server', { serverId: signedOut[0].id })}>
+ <DisclosureAction onClick={() => navigate('server', { serverId: signedOut[0].serverId })}>
Sign in
</DisclosureAction>
</DisclosureBar>
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
index f29e878ce..419cb1d46 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.test.ts
@@ -212,6 +212,20 @@ describe('listed rooms', () => {
serversStore.isConnected = () => true;
});
+ it('names the server to sign in to, not the workspace', async () => {
+ // The sidebar's "Sign in" link opens this server's page; handed the
+ // workspace id instead, it opened nothing.
+ workspaces.activeId = 'ws-b';
+ serversStore.isConnected = (serverId: string) => serverId !== 'srv-b';
+ listRooms.mockImplementation(async () => []);
+
+ const store = new SwitchRoomsStore();
+ await store.loadRoomNames();
+
+ expect(store.workspacesNotSignedIn).toEqual([{ id: 'ws-b', name: 'Beta', serverId: 'srv-b' }]);
+ serversStore.isConnected = () => true;
+ });
+
it('marks a room’s name as blocked on sign-in when its server is signed out', async () => {
workspaces.activeId = 'ws-a';
serversStore.isConnected = () => false;
diff --git a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.ts b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.ts
index 0bfc380e8..77b64476f 100644
--- a/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.ts
+++ b/console/apps/switch-console-desktop/src/renderer/features/switch-servers/switch-rooms-store.ts
@@ -366,13 +366,13 @@ export class SwitchRoomsStore {
* Not a fault and not retryable — the user has to sign in. Reporting it as a
* failure with a retry button offers an action that cannot work.
*/
- get workspacesNotSignedIn(): { id: string; name: string }[] {
- return this.namedWorkspacesInScope(
- this.unreachableWorkspaceIds.filter((id) => {
- const serverId = workspacesStore.serverIdFor(id);
- return serverId !== null && serverAvailability(serverId) === 'signed-out';
- })
- );
+ get workspacesNotSignedIn(): { id: string; name: string; serverId: string }[] {
+ return this.namedWorkspacesInScope(this.unreachableWorkspaceIds).flatMap((workspace) => {
+ const serverId = workspacesStore.serverIdFor(workspace.id);
+ return serverId !== null && serverAvailability(serverId) === 'signed-out'
+ ? [{ ...workspace, serverId }]
+ : [];
+ });
}
private namedWorkspacesInScope(workspaceIds: string[]): { id: string; name: string }[] {