Skip to content

Commit c8dcc90

Browse files
jdonelsonclaude
andcommitted
console: freshness review nits
Name the memoized statboxes and table components ...Base, keeping Inner for suspense splits, and word the threshold sentence "whose [statistic] freshness exceeds" for current and "exceeded" otherwise. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 67c5e0b commit c8dcc90

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎console/src/platform/freshness/FreshnessPage.test.tsx‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,19 @@ describe("FreshnessPage cluster selection", () => {
164164
expect(within(summary).queryByText(NO_VALUE)).not.toBeInTheDocument();
165165
});
166166

167+
it.each([
168+
["current", "whose", "freshness exceeds"],
169+
["p90", "whose", "freshness exceeded"],
170+
["peak", "whose", "freshness exceeded"],
171+
])("words the threshold sentence for %s", async (predicate, lead, verb) => {
172+
// "current" is now, so its verb is present; the rest span the range.
173+
recordRequests();
174+
await renderAt(`/?cluster=u1&exceeded=${predicate}`);
175+
176+
expect(await screen.findByText(`Highlight objects ${lead}`)).toBeVisible();
177+
expect(screen.getByText(verb)).toBeVisible();
178+
});
179+
167180
it("loads a cluster a link names", async () => {
168181
const requests = recordRequests();
169182
await renderAt("/?cluster=u1");

‎console/src/platform/freshness/FreshnessPage.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const HighlightControls = ({
149149
padding="3"
150150
>
151151
<Text textStyle="text-ui-reg" color={colors.foreground.secondary}>
152-
Highlight objects that had a
152+
Highlight objects whose
153153
</Text>
154154
<Select
155155
size="sm"
@@ -167,7 +167,8 @@ const HighlightControls = ({
167167
))}
168168
</Select>
169169
<Text textStyle="text-ui-reg" color={colors.foreground.secondary}>
170-
freshness exceeding
170+
{/* "Current" is this minute; the others summarize the range. */}
171+
freshness {predicate === "current" ? "exceeds" : "exceeded"}
171172
</Text>
172173
<ThresholdInput
173174
{...thresholdControl.inputProps}

‎console/src/platform/freshness/FreshnessStatboxes.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export interface FreshnessStatboxesProps {
9090
* Pooling dilutes one slow object with the healthy ones' minutes, so these
9191
* describe the scope, not any one object, and never judge by the threshold.
9292
*/
93-
const FreshnessStatboxesInner = ({
93+
const FreshnessStatboxesBase = ({
9494
objectIds,
9595
lookbackMs,
9696
latestPeak,
@@ -144,4 +144,4 @@ const FreshnessStatboxesInner = ({
144144
);
145145
};
146146

147-
export const FreshnessStatboxes = React.memo(FreshnessStatboxesInner);
147+
export const FreshnessStatboxes = React.memo(FreshnessStatboxesBase);

‎console/src/platform/freshness/FreshnessTable.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export interface FreshnessTableProps {
277277
* cluster can carry thousands. It opens in the order it is given, which is
278278
* worst first by whatever the active predicate judges.
279279
*/
280-
const FreshnessTableInner = ({
280+
const FreshnessTableBase = ({
281281
rows,
282282
scope,
283283
itemLabel = "objects",
@@ -312,4 +312,4 @@ const FreshnessTableInner = ({
312312
* stutter. The props it receives are memoized upstream for the same reason: a
313313
* single rebuilt array here would make this memo a no-op.
314314
*/
315-
export const FreshnessTable = React.memo(FreshnessTableInner);
315+
export const FreshnessTable = React.memo(FreshnessTableBase);

0 commit comments

Comments
 (0)