feat: dim not played text a bit

This commit is contained in:
zk
2026-05-18 15:36:58 +00:00
parent 1d7a97dc58
commit 23bc63cebe
7 changed files with 33 additions and 14 deletions
@@ -257,11 +257,10 @@ export default function AdminOperationsPage() {
<Card.Header>Recalc game profiles</Card.Header>
<Card.Body>
<p className="text-muted small mb-3">
Enqueues every game profile and every distinct committed score
(user, game) pair into
<code className="mx-1">game_profile_dirty</code>, then drains that
queue until idle (all games). This request waits until processing
finishes.
Enqueues every game profile and every distinct committed score (user,
game) pair into
<code className="mx-1">game_profile_dirty</code>, then drains that queue
until idle (all games). This request waits until processing finishes.
</p>
<Button
onClick={() => {
@@ -1258,7 +1258,7 @@ function TierlistInfoCell({
maxWidth: "60px",
}}
>
{tierlistInfo.score ?? "NOT PLAYED"}
{tierlistInfo.score ?? <Muted>NOT PLAYED</Muted>}
</td>
);
}
@@ -152,7 +152,9 @@ function Row({
<DifficultyCell chart={data} game={game} />
<IndicatorsCell highlight={false} />
<TitleCell chart={data} game={game} song={data.__related.song} />
<td colSpan={7}>Not Played.</td>
<td colSpan={7}>
<Muted>Not Played.</Muted>
</td>
</tr>
);
}
@@ -1,3 +1,4 @@
import Muted from "#components/util/Muted";
import { GPT_CLIENT_IMPLEMENTATIONS } from "#lib/game-implementations";
import { type ComparePBsDataset } from "#types/tables";
import { NumericSOV, StrSOV } from "#util/sorts";
@@ -111,7 +112,9 @@ function Row({ data, game, metric }: { data: ComparePBsDataset[0]; game: V3Game;
{data.base ? (
<ScoreCoreCells chart={data.chart} game={game} score={data.base} short />
) : (
<td colSpan={gptImpl.scoreHeaders.length}>Not Played</td>
<td colSpan={gptImpl.scoreHeaders.length}>
<Muted>Not Played</Muted>
</td>
)}
<PBCompareCell
base={data.base}
@@ -122,7 +125,9 @@ function Row({ data, game, metric }: { data: ComparePBsDataset[0]; game: V3Game;
{data.compare ? (
<ScoreCoreCells chart={data.chart} game={game} score={data.compare} short />
) : (
<td colSpan={gptImpl.scoreHeaders.length}>Not Played</td>
<td colSpan={gptImpl.scoreHeaders.length}>
<Muted>Not Played</Muted>
</td>
)}
</tr>
);
@@ -1,3 +1,4 @@
import Muted from "#components/util/Muted";
import useScoreRatingAlg from "#components/util/useScoreRatingAlg";
import { type RivalChartDataset } from "#types/tables";
import { NumericSOV, StrSOV } from "#util/sorts";
@@ -83,7 +84,9 @@ function Row({
<tr>
<td>N/A</td>
<UserCell game={game} user={data} />
<td colSpan={7}>Not Played.</td>
<td colSpan={7}>
<Muted>Not Played.</Muted>
</td>
</tr>
);
}
@@ -93,13 +93,19 @@ describe("summarizeOrphanRow", () => {
it("appends artist when present in data", () => {
expect(
summarizeOrphanRow({ data: { identifier: "5.1.1.", artist: "dj nagureo" }, context: {} }),
summarizeOrphanRow({
data: { identifier: "5.1.1.", artist: "dj nagureo" },
context: {},
}),
).toBe("5.1.1. (dj nagureo)");
});
it("appends difficulty when present in data", () => {
expect(
summarizeOrphanRow({ data: { identifier: "5.1.1.", difficulty: "ANOTHER" }, context: {} }),
summarizeOrphanRow({
data: { identifier: "5.1.1.", difficulty: "ANOTHER" },
context: {},
}),
).toBe("5.1.1. (ANOTHER)");
});
@@ -131,8 +131,12 @@ export function summarizeOrphanRow(row: Pick<PgOrphanScoreRow, "context" | "data
}
const extras: string[] = [];
if (artist !== null) extras.push(artist);
if (difficulty !== null) extras.push(difficulty);
if (artist !== null) {
extras.push(artist);
}
if (difficulty !== null) {
extras.push(difficulty);
}
if (extras.length === 0) {
return primary.length > 120 ? `${primary.slice(0, 117)}...` : primary;