From 49e97ea32383b618f826da759bf564a37ffd31c8 Mon Sep 17 00:00:00 2001 From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com> Date: Thu, 19 Nov 2026 08:28:31 +0000 Subject: [PATCH] fix(ui): YOUR PETS and My pets show HP ? for repos without CI, like every other view --- src/app/api/me/pets/route.ts | 2 ++ src/components/app/MyPets.tsx | 3 ++- src/components/app/PetChips.tsx | 5 +++-- src/hooks/useMe.ts | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/api/me/pets/route.ts b/src/app/api/me/pets/route.ts index 85513c4..c8011b6 100644 --- a/src/app/api/me/pets/route.ts +++ b/src/app/api/me/pets/route.ts @@ -50,6 +50,8 @@ export async function GET(req: Request) { visibility: r.private ? 'private' : 'public', stage: pet?.stage ?? null, hp: pet?.hp ?? null, + // No CI results: the HP is a placeholder, shown as "?" (pet-engine R8.1). + noCi: pet ? pet.recentCi.length === 0 : false, }; }) ); diff --git a/src/components/app/MyPets.tsx b/src/components/app/MyPets.tsx index cbb264b..f277fc6 100644 --- a/src/components/app/MyPets.tsx +++ b/src/components/app/MyPets.tsx @@ -12,6 +12,7 @@ interface Row { visibility: 'public' | 'private'; stage: string | null; hp: number | null; + noCi?: boolean; } type State = { kind: 'loading' } | { kind: 'signed_out' } | { kind: 'error'; message: string } | { kind: 'ready'; login: string; installUrl: string | null; pets: Row[] }; @@ -77,7 +78,7 @@ export function MyPets() { - {p.stage ? `${p.stage} / HP ${p.hp}` : 'not hatched yet'} + {p.stage ? `${p.stage} / HP ${p.noCi ? '? (no CI)' : p.hp}` : 'not hatched yet'} OPEN diff --git a/src/components/app/PetChips.tsx b/src/components/app/PetChips.tsx index 947a7eb..e1add06 100644 --- a/src/components/app/PetChips.tsx +++ b/src/components/app/PetChips.tsx @@ -42,8 +42,9 @@ const STAGE_NAMES: Record = { }; /** Chip text for one of the user's pets. */ -export function myPetChip(p: { key: string; role: string; visibility: string; stage: string | null; hp: number | null }): PetChip { - const state = p.stage ? `${STAGE_NAMES[p.stage] ?? p.stage}, HP ${p.hp}` : 'Not hatched yet'; +export function myPetChip(p: { key: string; role: string; visibility: string; stage: string | null; hp: number | null; noCi?: boolean }): PetChip { + const hp = p.noCi ? 'HP ? (no CI)' : `HP ${p.hp}`; + const state = p.stage ? `${STAGE_NAMES[p.stage] ?? p.stage}, ${hp}` : 'Not hatched yet'; return { key: p.key, label: p.key.toUpperCase(), diff --git a/src/hooks/useMe.ts b/src/hooks/useMe.ts index 4a7bc38..aef6707 100644 --- a/src/hooks/useMe.ts +++ b/src/hooks/useMe.ts @@ -41,6 +41,7 @@ export interface MyPet { visibility: 'public' | 'private'; stage: string | null; hp: number | null; + noCi?: boolean; } let petsPending: Promise | null = null;