Skip to content

feat(admin): add KiloClaw instance link on user profile page#1344

Open
kilo-code-bot[bot] wants to merge 3 commits intomainfrom
feat/admin-kiloclaw-user-link
Open

feat(admin): add KiloClaw instance link on user profile page#1344
kilo-code-bot[bot] wants to merge 3 commits intomainfrom
feat/admin-kiloclaw-user-link

Conversation

@kilo-code-bot
Copy link
Contributor

@kilo-code-bot kilo-code-bot bot commented Mar 20, 2026

Summary

  • Add a "View KiloClaw" button to the admin user profile page's KiloClaw section that links directly to the user's active KiloClaw instance admin page (/admin/kiloclaw/[id]).
  • Extends the getKiloClawState tRPC procedure to also query kiloclaw_instances for the user's active instance (where destroyed_at IS NULL) and return the activeInstanceId.
  • The link button appears consistently in all card states (subscription present, earlybird-only, no subscription) whenever the user has an active instance. Uses the same cross-link pattern as Gastown's "Inspect" buttons (Button variant="outline" with ExternalLink icon).

Verification

  • tsgo --noEmit --incremental false — passes with no errors
  • oxlint — passes with 0 warnings and 0 errors
  • Manual code review of both changed files for correctness

Visual Changes

The "View KiloClaw" button appears in the KiloClaw card header on the admin user profile page, next to the existing "Edit Trial End" button (when applicable). It is only visible when the user has an active KiloClaw instance.

Before After
KiloClaw card header has only "Edit Trial End" button (or no buttons) KiloClaw card header includes "View KiloClaw" button with external link icon when active instance exists

Reviewer Notes

  • The activeInstanceId query filters on destroyed_at IS NULL to only return the user's currently active instance. This aligns with the unique index on kiloclaw_instances (UQ_kiloclaw_instances_active).
  • The link is added to both the "has subscription" and "no subscription" card states since a user could have an active instance regardless of subscription status.
  • This mirrors the existing reverse link from KiloClaw instance detail pages back to user profiles (KiloclawInstanceDetail.tsx:1107).

Add a 'View KiloClaw' button to the admin user profile's KiloClaw
section that links directly to the user's active KiloClaw instance
admin page (/admin/kiloclaw/[id]).

Extends getKiloClawState tRPC procedure to also fetch the user's
active kiloclaw_instances record (where destroyed_at IS NULL) and
return the activeInstanceId. The link appears in all card states
(with subscription, earlybird-only, and no subscription) whenever
the user has an active instance.
@kilo-code-bot
Copy link
Contributor Author

kilo-code-bot bot commented Mar 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx
  • src/routers/admin-kiloclaw-user-router.test.ts

Reviewed by gpt-5.4-20260305 · 97,688 tokens

kilo-code-bot bot added 2 commits March 20, 2026 21:30
Add activeInstanceId to the exact-shape toEqual assertion and add two
new test cases covering the active/destroyed instance scenarios.
@evanjacobson evanjacobson requested a review from olearycrew March 21, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant