Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
526fdc0
make clients route group specific
kantord Sep 2, 2025
1dd62cc
.
kantord Sep 2, 2025
6c22807
fix icon
kantord Sep 2, 2025
74e0383
make clients page group specific
kantord Sep 2, 2025
dfdebee
first step of group awareness for clients
kantord Sep 2, 2025
5703e19
.
kantord Sep 2, 2025
4e9ac0a
.
kantord Sep 2, 2025
609ab03
.
kantord Sep 2, 2025
2d3d718
Revert "."
kantord Sep 3, 2025
7167dea
Revert "."
kantord Sep 3, 2025
bf0d404
Revert "."
kantord Sep 3, 2025
141d09b
add some tests
kantord Sep 3, 2025
921d6ac
Merge branch 'main' into make-clients-group-specific
kantord Sep 3, 2025
8fcf979
.
kantord Sep 3, 2025
b513935
.
kantord Sep 3, 2025
90e5445
.
kantord Sep 3, 2025
0b05116
.
kantord Sep 3, 2025
56ebc8d
merge main
kantord Sep 4, 2025
17a8419
Revert "merge main"
kantord Sep 4, 2025
55841ea
Merge branch 'main' into make-clients-group-specific
kantord Sep 4, 2025
b56f9ca
cleanup
kantord Sep 4, 2025
9f0fdef
.
kantord Sep 4, 2025
573197d
Merge branch 'main' into make-clients-group-specific
kantord Sep 4, 2025
56eaaa2
add new group handling hooks
kantord Sep 4, 2025
c8a8608
.
kantord Sep 4, 2025
619e55f
.
kantord Sep 4, 2025
085b9f2
.
kantord Sep 4, 2025
2830264
.
kantord Sep 4, 2025
b1a1220
.
kantord Sep 4, 2025
8767a02
.
kantord Sep 5, 2025
d605ae8
extract button
kantord Sep 5, 2025
e936ebb
.
kantord Sep 5, 2025
6ebdd17
.
kantord Sep 5, 2025
9c24e20
.
kantord Sep 5, 2025
0edd769
.
kantord Sep 5, 2025
4afc92c
.
kantord Sep 5, 2025
3185158
remove outdated stuff
kantord Sep 5, 2025
153b1e6
.
kantord Sep 5, 2025
538f6bc
.
kantord Sep 5, 2025
c0536d0
cleanup
kantord Sep 5, 2025
8716f57
.
kantord Sep 5, 2025
051de74
.
kantord Sep 5, 2025
a38f5e7
.
kantord Sep 5, 2025
2d6dd70
.
kantord Sep 5, 2025
18592c9
.
kantord Sep 5, 2025
d20bdf8
.
kantord Sep 5, 2025
f9196fc
.
kantord Sep 5, 2025
a350979
.
kantord Sep 5, 2025
f646f89
.
kantord Sep 5, 2025
f99c936
simplify logic
kantord Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 1 addition & 25 deletions renderer/src/common/components/layout/top-nav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,7 @@ function TopNavLinks() {
<LinkViewTransition to="/registry">Registry</LinkViewTransition>
</NavigationMenuLink>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuLink
className="app-region-no-drag text-muted-foreground
hover:text-foreground focus:text-foreground
data-[status=active]:text-foreground
data-[status=active]:before:bg-foreground
focus-visible:ring-ring/50 relative px-3 py-2 text-sm
transition-all outline-none hover:bg-transparent
focus:bg-transparent focus-visible:ring-[3px]
focus-visible:outline-1 data-[status=active]:bg-transparent
data-[status=active]:before:absolute
data-[status=active]:before:right-3
data-[status=active]:before:bottom-[-14px]
data-[status=active]:before:left-3
data-[status=active]:before:h-0.5
data-[status=active]:before:rounded-t-[1px]
data-[status=active]:before:opacity-90
data-[status=active]:before:content-['']
data-[status=active]:hover:bg-transparent
data-[status=active]:focus:bg-transparent"
asChild
>
<LinkViewTransition to="/clients">Clients</LinkViewTransition>
</NavigationMenuLink>
</NavigationMenuItem>

{isPlaygroundEnabled && (
<NavigationMenuItem>
<NavigationMenuLink
Expand Down
8 changes: 1 addition & 7 deletions renderer/src/common/components/link-view-transition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import { Link, useRouterState } from '@tanstack/react-router'
import { forwardRef, type ComponentProps } from 'react'

type Route = FileRouteTypes['fullPaths']

const ORDERED_ROUTES: Route[] = [
'/group/$groupName',
'/registry',
'/clients',
'/secrets',
]
const ORDERED_ROUTES: Route[] = ['/group/$groupName', '/registry', '/secrets']

type TransitionType = 'slide-left' | 'slide-right'

Expand Down
96 changes: 96 additions & 0 deletions renderer/src/common/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,102 @@ export const handlers = [
return HttpResponse.json(clientsFixture)
}),

// Client registration endpoint
http.post(mswEndpoint('/api/v1beta/clients'), async ({ request }) => {
try {
const body = (await request.json()) as { name: string; groups: string[] }
const { name, groups } = body

if (!name) {
return HttpResponse.json(
{ error: 'Client name is required' },
{ status: 400 }
)
}

if (!groups || groups.length === 0) {
return HttpResponse.json(
{ error: 'Groups parameter is required' },
{ status: 400 }
)
}

return HttpResponse.json(
{
name,
groups: groups || ['default'],
},
{ status: 200 }
)
} catch {
return HttpResponse.json(
{ error: 'Invalid request body' },
{ status: 400 }
)
}
}),

// Client unregistration endpoint
http.delete(mswEndpoint('/api/v1beta/clients/:name'), ({ params }) => {
const { name } = params

if (!name) {
return HttpResponse.json(
{ error: 'Client name is required' },
{ status: 400 }
)
}

// For DELETE requests, we need to check if the group is provided in the request body
// Since DELETE requests typically don't have a body, we'll check the URL or require it
// For now, let's assume the group should be provided in the path or query params
// This is a simplified approach - in a real scenario, you might want to check the request body

return new HttpResponse(null, { status: 204 })
}),

// Client group-specific removal endpoint
http.delete(
mswEndpoint('/api/v1beta/clients/:name/groups/:group'),
({ params }) => {
const { name, group } = params

if (!name) {
return HttpResponse.json(
{ error: 'Client name is required' },
{ status: 400 }
)
}

if (!group) {
return HttpResponse.json(
{ error: 'Group name is required' },
{ status: 400 }
)
}

return new HttpResponse(null, { status: 204 })
}
),

// Get all clients endpoint
http.get(mswEndpoint('/api/v1beta/clients'), () => {
return HttpResponse.json([
{
name: { name: 'vscode' },
groups: ['default'],
},
{
name: { name: 'cursor' },
groups: ['default', 'research'],
},
{
name: { name: 'claude-code' },
groups: ['research'],
},
])
}),

http.get(mswEndpoint('/api/v1beta/registry/:name/servers'), () => {
return HttpResponse.json({ servers: MOCK_REGISTRY_RESPONSE })
}),
Expand Down
Loading