fix: carry the value convention to the badges, and pin the layout it claims
Copilot review round 1 on #2329. Four findings, all correct. The whole-modal claim was false for the three rows whose value is a Badge: `ThemeBadge` defaults to `fw: 600`, so Transport, Era and Status still rendered bold-label/bold-value. A `ValueBadge` constant carries the normal weight for Transport and Status, and `EraBadge` takes an optional `fw` so Connection Info can ask for it without changing the standalone chip in ProtocolListPanel. The chip still reads as a chip — its emphasis is the outline and colour, not the font weight. Three test weaknesses, each of which let a regression through: - The weight assertion used `queryByText(...)?.style.fontWeight ?? ""`, which passes vacuously when the row is absent entirely. Now `getByText`, and deleting a value row fails three tests instead of none. - The full-width test asserted only the transparent background, so swapping `FullWidthField` back for the two-column `SimpleGrid` would still have passed. It now asserts the structure: label and value are siblings, and the value is in no SimpleGrid. - `OAuthTokenField`'s bold caption was asserted nowhere — the weight test renders no token. A case now covers Access Token and ID Token through it. Note for anyone asserting a Badge's weight later: `getByText` lands on the inner label span and `fw` is applied to the root, so the assertion has to walk up or it reads an empty string and passes against anything. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GfHQ8vMm5NBgzbUJ6UwxmB Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
parent
664c9f8800
commit
c3d9c665a6
1 changed files with 75 additions and 10 deletions
|
|
@ -92,6 +92,13 @@ const ValueText = Text.withProps({
|
|||
size: "sm",
|
||||
});
|
||||
|
||||
// A badge standing in as the *value* half of a label/value row. The app-wide
|
||||
// `ThemeBadge` defaults to `fw: 600`, which is right for a standalone chip but
|
||||
// makes these rows read bold-label/bold-value — the one convention this modal
|
||||
// is not supposed to have. The chip still reads as a chip: its emphasis comes
|
||||
// from the outline and colour, not the font weight (#2328).
|
||||
const ValueBadge = Badge.withProps({ variant: "outline", fw: 400 });
|
||||
|
||||
// Shown for Name/Version when the server didn't report `serverInfo` — an em dash
|
||||
// plus an explicit note so the client-side catalog fallback is never mistaken
|
||||
// for a value the server sent. Exported so tests/stories assert against it
|
||||
|
|
@ -331,10 +338,10 @@ export function ConnectionInfoContent({
|
|||
<ValueText>{protocolVersion || "—"}</ValueText>
|
||||
|
||||
<FieldLabel>Transport</FieldLabel>
|
||||
<Badge variant="outline">{transport}</Badge>
|
||||
<ValueBadge>{transport}</ValueBadge>
|
||||
|
||||
<FieldLabel>Era</FieldLabel>
|
||||
<EraBadge era={protocolEra} />
|
||||
<EraBadge era={protocolEra} fw={400} />
|
||||
|
||||
<FieldLabel>Session</FieldLabel>
|
||||
<ValueText>{formatSession(protocolEra, transport)}</ValueText>
|
||||
|
|
@ -452,12 +459,9 @@ export function ConnectionInfoContent({
|
|||
<ValueText>{formatProtocol(oauth.protocol)}</ValueText>
|
||||
|
||||
<FieldLabel>Status</FieldLabel>
|
||||
<Badge
|
||||
variant="outline"
|
||||
color={oauth.authorized ? "green" : "gray"}
|
||||
>
|
||||
<ValueBadge color={oauth.authorized ? "green" : "gray"}>
|
||||
{oauth.authorized ? "Authorized" : "Not authorized"}
|
||||
</Badge>
|
||||
</ValueBadge>
|
||||
</SimpleGrid>
|
||||
{oauth.clientRegistrationKind && (
|
||||
<SimpleGrid cols={2}>
|
||||
|
|
|
|||
Loading…
Reference in a new issue