Skip to content

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

Merged
evanjacobson merged 4 commits intomainfrom
feat/admin-kiloclaw-user-link
Mar 23, 2026
Merged

feat(admin): add KiloClaw instance link on user profile page#1344
evanjacobson merged 4 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).

@kilo-code-bot
Copy link
Contributor Author

kilo-code-bot bot commented Mar 20, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

No new issues found in the incremental diff.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/app/payments/topup/route.ts 68 Missing authorization check before using organization-id to bill an organization
Files Reviewed (8 files)
  • kiloclaw/worker-configuration.d.ts
  • src/app/(app)/claw/components/ClawDashboard.tsx
  • src/app/(app)/claw/components/InstanceControls.tsx
  • src/app/(app)/claw/components/SettingsTab.tsx
  • src/app/(app)/claw/components/VersionPinCard.tsx
  • src/app/admin/api/kiloclaw-analytics/hooks.ts
  • src/app/admin/api/kiloclaw-analytics/route.ts
  • src/app/admin/components/KiloclawInstances/KiloclawInstanceDetail.tsx

Reviewed by gpt-5.4-20260305 · 850,275 tokens

@evanjacobson evanjacobson requested a review from olearycrew March 21, 2026 03:28
kilo-code-bot bot and others added 4 commits March 23, 2026 10:47
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.
Add activeInstanceId to the exact-shape toEqual assertion and add two
new test cases covering the active/destroyed instance scenarios.
@evanjacobson evanjacobson force-pushed the feat/admin-kiloclaw-user-link branch from 9f5b297 to cfec2d2 Compare March 23, 2026 16:53
@evanjacobson evanjacobson merged commit ee2748f into main Mar 23, 2026
18 checks passed
@evanjacobson evanjacobson deleted the feat/admin-kiloclaw-user-link branch March 23, 2026 17:19
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.

2 participants