fix(qa): ISSUE-001 — fall back to members.length when usage.user_count is missing
The /subscription endpoint returns usage as {tree_count, session_count_this_month}
without user_count, so the Seats UsageRow rendered as " / ∞" (blank current value).
The TS type declared user_count: number, hiding this API/type drift; the old
card-stack design hid it visually because each stat had its own border. The new
flat layout surfaced the gap.
Owners get a fallback to members.length (already fetched). Non-owners can't
fetch members and don't need seat-count info, so the row hides entirely for
them. Verified live: owner now sees Seats 2 / ∞.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -406,7 +406,12 @@ export function AccountSettingsPage() {
|
||||
current={usage.session_count_this_month}
|
||||
max={limits.max_sessions_per_month}
|
||||
/>
|
||||
<UsageRow label="Seats" current={usage.user_count} max={limits.max_users} />
|
||||
{(() => {
|
||||
const seatCount = usage.user_count ?? (isAccountOwner ? members.length : null)
|
||||
return seatCount !== null ? (
|
||||
<UsageRow label="Seats" current={seatCount} max={limits.max_users} />
|
||||
) : null
|
||||
})()}
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">Plan limits unavailable.</p>
|
||||
|
||||
Reference in New Issue
Block a user