Skip to content

feat(mobile): hide KiloClaw without an instance - #5039

Merged
iscekic merged 7 commits into
mainfrom
kiloclaw-hide-f6ef
Aug 5, 2026
Merged

feat(mobile): hide KiloClaw without an instance#5039
iscekic merged 7 commits into
mainfrom
kiloclaw-hide-f6ef

Conversation

@iscekic

@iscekic iscekic commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the KiloClaw card and related query work from Home.
  • Show the KiloClaw tab only for users with an instance.
  • Keep KiloClaw routes registered for deep links.

Why

Users without a KiloClaw instance must not see a KiloClaw surface on Home or an empty tab entry.

How

  • Cache ownership in SecureStore and clear it during sign-out.
  • Reconcile ownership from the instance list without layout polling.
  • Hide the tab with href: null and update accessibility labels for three or four tabs.
  • Add ownership, sign-out, Home, mounted composition, and accessibility tests.

Verification

  • Mobile typecheck passed.
  • Mobile lint passed.
  • Mobile unused check passed.
  • Focused mobile tests passed: 5 files, 35 tests.
  • Full mobile test command passed earlier: 353 files, 3,369 tests.
  • Root pnpm test was attempted but failed because the local PostgreSQL test database was unavailable.
  • Bot E2E passed all eight ordered iOS scenarios: A, B1, D1, seed, E, C, B2, D2.
  • Scenario E recorded the accepted first-owner-launch exception and passed the hard second launch.

Visual Changes

Latest iOS E2E screenshots:

  • Empty account, three tabs and Home without KiloClaw:

A.png

B1.png

  • Owner account, four tabs and KiloClaw list:

C.png

D2.png

The first owner launch started at four tabs in this run, which is within the approved exception. The second launch started at four tabs without a shift.

@iscekic iscekic self-assigned this Aug 5, 2026
@kilo-code-bot

kilo-code-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Incremental review at HEAD 40aba25: the branch merged latest main (mobile token-refresh/auth work from #4987), so only 3 of the 14 PR files changed since the last review — the KiloClaw ownership gate/clear changes in auth-context.tsx were verified correctly rebased onto main's new sign-out flow (gateKiloClawOwned() still closes synchronously before the first await; clearKiloClawOwned() remains in the teardown sequence), the new gate regression test correctly exercises the real unmocked ownership module, and no memory leaks, dangling listeners, or logic regressions were introduced.

Files Reviewed (14 files)
  • apps/mobile/src/app/(app)/(tabs)/_layout.tsx
  • apps/mobile/src/components/home/home-screen.mounted.test.tsx
  • apps/mobile/src/components/home/home-screen.test.ts
  • apps/mobile/src/components/home/home-screen.tsx
  • apps/mobile/src/components/home/kiloclaw-promo-card.tsx (deleted)
  • apps/mobile/src/lib/auth/auth-context.test.tsx — re-verified after rebase
  • apps/mobile/src/lib/auth/auth-context.tsx — re-verified after rebase
  • apps/mobile/src/lib/hooks/use-instance-context.ts
  • apps/mobile/src/lib/hooks/use-kiloclaw-tab-visible.ts
  • apps/mobile/src/lib/kiloclaw-tab-ownership.test.ts
  • apps/mobile/src/lib/kiloclaw-tab-ownership.ts
  • apps/mobile/src/lib/storage-keys.ts — re-verified after rebase
  • apps/mobile/src/lib/tab-bar-layout.test.ts
  • apps/mobile/src/lib/tab-bar-layout.ts
Previous Review Summary (commit 50e05c7)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 50e05c7)

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed all 14 changed files in the mobile KiloClaw tab-visibility feature at HEAD 50e05c7 with high confidence: the SecureStore ownership cache, sign-out gate/lock sequencing, tab-bar hiding, and Home surface removal are correct, well-tested, and introduce no memory leaks, dangling references, or breaking changes to useAllKiloClawInstances callers.

Files Reviewed (14 files)
  • apps/mobile/src/app/(app)/(tabs)/_layout.tsx
  • apps/mobile/src/components/home/home-screen.mounted.test.tsx
  • apps/mobile/src/components/home/home-screen.test.ts
  • apps/mobile/src/components/home/home-screen.tsx
  • apps/mobile/src/components/home/kiloclaw-promo-card.tsx (deleted)
  • apps/mobile/src/lib/auth/auth-context.test.tsx
  • apps/mobile/src/lib/auth/auth-context.tsx
  • apps/mobile/src/lib/hooks/use-instance-context.ts
  • apps/mobile/src/lib/hooks/use-kiloclaw-tab-visible.ts
  • apps/mobile/src/lib/kiloclaw-tab-ownership.test.ts
  • apps/mobile/src/lib/kiloclaw-tab-ownership.ts
  • apps/mobile/src/lib/storage-keys.ts
  • apps/mobile/src/lib/tab-bar-layout.test.ts
  • apps/mobile/src/lib/tab-bar-layout.ts

Reviewed by kimi-k3 · Input: 68.3K · Output: 13.5K · Cached: 636.9K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic merged commit 791a3bd into main Aug 5, 2026
20 checks passed
@iscekic
iscekic deleted the kiloclaw-hide-f6ef branch August 5, 2026 15:57
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