Skip to content

Commit 1584e50

Browse files
committed
Add API Console sidebar link and route exemption
Add an "API Console" entry to the global sidebar (imports Globe icon, computes apiConsoleActive, and links to /api-console). The console menu item is always available and documented to discover endpoints dynamically from the active client/environment. Also update isEnvExemptPath in routes/__root.tsx to treat /api-console and its subpaths as environment-exempt so the route doesn't require an environment selection.
1 parent c0c3046 commit 1584e50

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

apps/studio/src/components/global-sidebar.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
ChevronsUpDown,
2929
Plus,
3030
Boxes,
31+
Globe,
3132
Package as PackageIcon,
3233
Settings,
3334
} from 'lucide-react';
@@ -179,6 +180,7 @@ export function GlobalSidebar() {
179180
const envsActive = pathname === '/environments';
180181
const packagesHref = envId ? `/environments/${envId}/packages` : undefined;
181182
const packagesActive = !!packagesHref && pathname === packagesHref;
183+
const apiConsoleActive = pathname === '/api-console';
182184

183185
return (
184186
<Sidebar collapsible="icon">
@@ -226,6 +228,17 @@ export function GlobalSidebar() {
226228
</SidebarMenuButton>
227229
)}
228230
</SidebarMenuItem>
231+
232+
{/* API Console — always available; the console discovers
233+
endpoints dynamically from the active client/environment. */}
234+
<SidebarMenuItem>
235+
<SidebarMenuButton asChild isActive={apiConsoleActive} tooltip="API Console">
236+
<Link to="/api-console">
237+
<Globe className="size-4" />
238+
<span>API Console</span>
239+
</Link>
240+
</SidebarMenuButton>
241+
</SidebarMenuItem>
229242
</SidebarMenu>
230243
</SidebarGroupContent>
231244
</SidebarGroup>

apps/studio/src/routes/__root.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function isEnvExemptPath(pathname: string): boolean {
5252
pathname.startsWith('/login') ||
5353
pathname.startsWith('/register') ||
5454
pathname.startsWith('/orgs') ||
55-
pathname.startsWith('/environments')
55+
pathname.startsWith('/environments') ||
56+
pathname === '/api-console' ||
57+
pathname.startsWith('/api-console/')
5658
);
5759
}
5860

0 commit comments

Comments
 (0)