Skip to content

feat(admin): add KiloClaw subscription management and tabbed user detail layout - #2196

Merged
jeanduplessis merged 2 commits into
mainfrom
admin-kiloclaw-subs
Apr 8, 2026
Merged

feat(admin): add KiloClaw subscription management and tabbed user detail layout#2196
jeanduplessis merged 2 commits into
mainfrom
admin-kiloclaw-subs

Conversation

@jeanduplessis

@jeanduplessis jeanduplessis commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Tabbed layout: Admin user detail page now has a persistent account info header with URL-backed tabs (Billing, Organizations, KiloClaw, Gas Town, Admin Tools)
  • Full subscription visibility: KiloClaw tab shows all subscription rows with status badges, metadata, and a hide-inactive toggle
  • Admin cancellation: New cancel action with period-end and immediate modes, audit logged

Verification

  • Manual verification of UI layout and tab navigation

Visual Changes

Before After
Flat single-page layout with all sections visible Helium 2026-04-08 18 02 08
Cancel at the end of subscription Helium 2026-04-08 18 02 09
Cancel Immediately Helium 2026-04-08 18 02 10

Reviewer Notes

Code Reviewer Notes
  • getKiloClawState now returns all subscription rows with joined instance metadata alongside the existing subscription (effective) field.
  • cancelKiloClawSubscription mutation handles Stripe schedule release, Stripe subscription cancellation (no refund), and local DB state transitions. Writes kiloclaw.subscription.admin_cancel audit log entries.
  • Stripe-funded cancel paths are tested end-to-end in the billing-router test suite. Admin-router tests cover pure-credit paths and validation/authorization, because the admin-router's Stripe client mock doesn't take effect in the Jest worker context (SWC transform + module caching).
  • New audit action kiloclaw.subscription.admin_cancel added to KiloClawAdminAuditAction in schema-types.ts.

…ail layout

- Reorganize admin user detail into persistent account info header with
  URL-backed tabs (Billing, Organizations, KiloClaw, Gas Town, Admin Tools)
- Expand getKiloClawState to return all subscription rows with instance metadata
- Add cancelKiloClawSubscription mutation (period_end + immediate modes)
- Rewrite KiloClaw UI with subscription list, hide-inactive toggle, cancel dialog
- Inline external links (Stripe, HIBP, Gravatar) into account info card
- Merge Danger Zone into Admin Tools tab
Comment thread apps/web/src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx Outdated
Comment thread apps/web/src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx
@kilo-code-bot

kilo-code-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

CRITICAL

File Line Issue
apps/web/src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx 146 Trial update/reset actions are still scoped only by userId, so acting on one subscription row can update the wrong row and the reset path can rewrite all of the user's subscriptions to trialing.

WARNING

File Line Issue
apps/web/src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx 293 past_due rows render the standard cancel flow, but the mutation rejects period-end cancellation unless the subscription is active, so the default submit path fails for those rows.
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
N/A N/A None.
Files Reviewed (8 files)
  • apps/web/src/app/admin/components/UserAdmin/UserAdminAccountInfo.tsx - 0 issues
  • apps/web/src/app/admin/components/UserAdmin/UserAdminDashboard.tsx - 0 issues
  • apps/web/src/app/admin/components/UserAdmin/UserAdminExternalLinks.tsx - 0 issues
  • apps/web/src/app/admin/components/UserAdmin/UserAdminKiloClaw.tsx - 2 issues
  • apps/web/src/app/admin/components/UserAdmin/UserAdminTabbedSections.tsx - 0 issues
  • apps/web/src/routers/admin-kiloclaw-user-router.test.ts - 0 issues
  • apps/web/src/routers/admin-router.ts - 0 issues
  • packages/db/src/schema-types.ts - 0 issues

Reviewed by gpt-5.4-20260305 · 831,660 tokens

…ancel flow

- Add subscriptionId to UpdateKiloClawTrialEndAtSchema and scope the
  backend query/update to the specific subscription row
- Default past_due rows to immediate-only cancel mode in the dialog
- Update tests to pass subscriptionId for all trial mutation calls
@jeanduplessis
jeanduplessis merged commit 34d2dd6 into main Apr 8, 2026
34 checks passed
@jeanduplessis
jeanduplessis deleted the admin-kiloclaw-subs branch April 8, 2026 20:05
pandemicsyn pushed a commit that referenced this pull request Aug 28, 2026
…5636)

chore(admin): remove unused UserAdminExternalLinks component

This component was superseded by UserAdminAccountInfo, which
reimplements the same Stripe/HIBP/Gravatar links inline, and is the
one actually rendered by UserAdminTabbedSections. UserAdminExternalLinks
has had no importers since the tabbed user-detail layout was introduced
in #2196.

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
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