fix(qa): ISSUE-001 — fall back to members.length when usage.user_count is missing
Some checks failed
Mirror to GitHub / mirror (push) Successful in 12s
CI / frontend (pull_request) Successful in 5m30s
CI / e2e (pull_request) Failing after 11m2s
CI / backend (pull_request) Successful in 14m47s

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:
2026-05-05 01:02:44 -04:00
parent 86120423da
commit 07a3f01184

View File

@@ -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>