Skip to content

Commit d77bf6a

Browse files
jdonelsonclaude
andcommitted
console: Cut the comments that say nothing
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent e98a522 commit d77bf6a

11 files changed

Lines changed: 26 additions & 32 deletions

‎console/src/components/ThresholdLineGraph/ThresholdInput.test.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe("ThresholdInput", () => {
7272
await userEvent.clear(field());
7373
await userEvent.type(field(), "7");
7474

75-
// Shown immediately, whatever the debounce is doing.
7675
expect(field()).toHaveValue(7);
7776
});
7877
});

‎console/src/components/ThresholdLineGraph/thresholdLineGraphHelpers.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ export function generateRainbowPalette(
5656
* Whether the line's judged value reaches the threshold.
5757
*
5858
* Inclusive, so a value exactly at the threshold breaches. The shaded band
59-
* stops at the threshold line, so a point sitting on it is drawn touching the
60-
* band, and anything else would have it look breaching while counting as
61-
* healthy. Monitoring's Objects page reads its own threshold the same way.
59+
* stops at the threshold line, so such a point is drawn touching the band.
60+
* Monitoring's Objects page reads its own threshold the same way.
6261
*/
6362
export function isBreaching<Datum>(
6463
line: ThresholdLineSeries<Datum>,

‎console/src/components/ThresholdLineGraph/useThresholdControl.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ describe("useThresholdControl", () => {
5757
// `commit` usually reaches this hook through react-router's
5858
// `setSearchParams`, which is rebuilt whenever any search param changes.
5959
// Changing another control mid-edit therefore hands the hook a new
60-
// function. Depending on it used to rebuild the timer and discard the call
61-
// in flight, along with the state reset riding on that call: the controls
62-
// then stayed on the edited value and `committed` could never move them.
60+
// function. Holding it as a dependency rebuilds the timer and discards the
61+
// call in flight, along with the state reset riding on that call, leaving
62+
// the controls on the edited value with no way for `committed` to move
63+
// them.
6364
const replacement: (value: number) => void = vi.fn();
6465
const original: (value: number) => void = vi.fn();
6566
const { result, rerender } = renderHook(

‎console/src/platform/environment-overview/ClusterFreshness.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ const ClusterFreshnessTable = ({
176176
as={Link}
177177
to={absoluteFreshnessPath(regionSlug, clusterId)}
178178
title={`Freshness details for ${clusterName}`}
179-
// The link text is a bare duration, which does not say
180-
// where the link goes when read on its own.
181179
aria-label={`Freshness details for ${clusterName}`}
182180
>
183181
{tableText}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const renderWithClusters = async (state: {
3131
describe("FreshnessPage cluster states", () => {
3232
it("waits rather than claiming there are no clusters", async () => {
3333
// An empty list before the subscribe lands is not the same as an empty
34-
// environment, and the page used to report both as the latter.
34+
// environment.
3535
await renderWithClusters({ data: [], snapshotComplete: false });
3636

3737
expect(await screen.findByTestId("loading-spinner")).toBeVisible();

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ const FreshnessContent = ({
136136
hydrationByObjectId,
137137
typeFilters,
138138
predicate,
139-
// The settled threshold, so a drag does not rebuild a row per object on
140-
// every pointer move.
141139
threshold: thresholdControl.settled,
142140
});
143141

@@ -252,7 +250,6 @@ const FreshnessPage = () => {
252250
} = useFreshnessParams();
253251
const thresholdControl = useThresholdControl(threshold, setThreshold);
254252

255-
// Filter out system clusters
256253
const selectable = clusters
257254
.filter((c) => !isSystemCluster(c.id))
258255
.sort((a, b) => a.name.localeCompare(b.name));

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ describe("FreshnessTable", () => {
148148
});
149149

150150
it("pages rather than mounting a row per object", async () => {
151-
// A cluster can carry thousands of objects. Before pagination this mounted
152-
// a `tr` for every one of them.
151+
// A cluster can carry thousands of objects, and a `tr` each would be
152+
// mounted for all of them.
153153
const many = Array.from({ length: 60 }, (_, i) =>
154154
buildRow({
155155
key: `u${i + 10}`,

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@ const FreshnessTableInner = ({
180180
const table = useUniversalTable({
181181
data: rows,
182182
columns,
183-
// No initial sorting: `buildFreshnessRows` already orders worst first by
184-
// `breachValue`, which is whichever statistic the active predicate judges.
185-
// Naming a column here would instead fix the order to one statistic, and
186-
// would put the rows with nothing to judge at the top, since a descending
187-
// sort reverses the nulls-last comparators.
183+
// `buildFreshnessRows` orders worst first by `breachValue`, which is
184+
// whichever statistic the active predicate judges, so the incoming order
185+
// already follows the predicate.
186+
//
187+
// NOTE: a descending sort reverses the nulls-last comparators, so naming a
188+
// column here puts the rows with nothing to judge at the top.
188189
initialSorting: [],
189190
pageSize: PAGE_SIZE,
190191
getRowId: (row) => row.key,

‎console/src/platform/freshness/freshnessRows.test.ts‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,13 @@ describe("computeStats", () => {
155155
);
156156
// The graph breaks its line at these readings rather than drawing them.
157157
expect(accessorFor("unreadable")(data[4]!)).toBeNull();
158-
// The statistics still see them, as the worst value there is.
159158
expect(stats.peak).toBe(UNREADABLE);
160159
expect(stats.current).toBe(UNREADABLE);
161160
});
162161

163162
it('takes "Now" from the latest reading, not the worst in the last bin', () => {
164-
// The reviewer's case: at a wide range the final bin is a maximum over
165-
// many minutes, so it reads high for an object that has already recovered.
163+
// At a wide range the final bin is a maximum over many minutes, so it
164+
// reads high for an object that has already recovered.
166165
const lastBinMax = Math.max(
167166
...(SERIES.spiky as number[]).map((r) => r as number),
168167
);
@@ -174,8 +173,8 @@ describe("computeStats", () => {
174173
});
175174

176175
it("lets one unreadable reading in sixty pass p90", () => {
177-
// The reviewer's case: unreadable once about twenty hours ago, healthy
178-
// since. It has to still breach "at any moment", because that reading was
176+
// Unreadable once about twenty hours ago, healthy since. It has to still
177+
// breach "at any moment", because that reading was
179178
// the worst thing in the window. It must not breach "right now", and one
180179
// bad reading in sixty is not more than 10% of them.
181180
const series = buildData(

‎console/src/platform/freshness/freshnessRows.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ export function computeStats(
101101
/**
102102
* A reading whose lag came back NULL: the object could not be read.
103103
*
104-
* `Infinity` rather than a flag, so it sorts, ranks and compares against a
105-
* threshold as the worst possible lag without any statistic needing to know
106-
* about it. It is never formatted; a cell checks for it and names the state.
104+
* Sorts, ranks and compares against a threshold as the worst possible lag, so
105+
* no statistic needs to know about it. Never formatted: a cell checks for it
106+
* and names the state.
107107
*/
108108
export const UNREADABLE = Infinity;
109109

0 commit comments

Comments
 (0)