From 7cc950fa7d3cd11ef643fda6174fe125c2bccc17 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Wed, 8 Oct 2025 17:26:35 -0700 Subject: frontend: remove others keys from well-defined score displays --- .../displays/DancearoundScoreDisplay.tsx | 33 ++-------------------- .../components/displays/DancerushScoreDisplay.tsx | 30 +------------------- 2 files changed, 3 insertions(+), 60 deletions(-) diff --git a/frontend/src/components/displays/DancearoundScoreDisplay.tsx b/frontend/src/components/displays/DancearoundScoreDisplay.tsx index 26a54fa..a2d18f8 100644 --- a/frontend/src/components/displays/DancearoundScoreDisplay.tsx +++ b/frontend/src/components/displays/DancearoundScoreDisplay.tsx @@ -55,14 +55,13 @@ const DancearoundScoreDisplay: React.FC = ({ clear_status: "Status" }; - const primaryKeys = ["title", "artist", "song"]; const mainStatKeys = [ "score", "difficulty", "lamp", "diff_lamp", ]; - const expandableKeys = ["judgements", "optional"]; + const expandableKeys = ["judgements", "optional", "clear_status"]; const localSkipKeys = ["num_players"] // eslint-disable-next-line @typescript-eslint/no-explicit-any const formatValue = (value: any, key: string): string => { @@ -182,22 +181,12 @@ const DancearoundScoreDisplay: React.FC = ({ ([key]) => !globalSkipKeys.includes(key) && !localSkipKeys.includes(key), ); - const primary = entries.filter(([key]) => primaryKeys.includes(key)); const mainStats = entries.filter(([key]) => mainStatKeys.includes(key)); const expandable = entries.filter(([key]) => expandableKeys.includes(key)); - const others = entries.filter( - ([key]) => - !primaryKeys.includes(key) && - !mainStatKeys.includes(key) && - !expandableKeys.includes(key) && - key !== "timestamp", - ); return { - primary, mainStats, expandable, - others, timestamp: score.timestamp, }; }; @@ -280,7 +269,7 @@ const DancearoundScoreDisplay: React.FC = ({
{sortedScores.map((score, index) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { primary, mainStats, expandable, others, timestamp } = + const { mainStats, expandable, timestamp } = getScoreEntries(score); const chartIdHash = SHA1(`dancearound${score.title}${score.artist}`).toString(); return ( @@ -337,24 +326,6 @@ const DancearoundScoreDisplay: React.FC = ({
))} - {/* Other fields */} - {others.length > 0 && ( -
-
- {others.map(([key, value]) => ( -
- - {getDisplayName(key)}: - - - {renderValue(value, key)} - -
- ))} -
-
- )} - {/* Timestamp */}

diff --git a/frontend/src/components/displays/DancerushScoreDisplay.tsx b/frontend/src/components/displays/DancerushScoreDisplay.tsx index 908880c..35a3968 100644 --- a/frontend/src/components/displays/DancerushScoreDisplay.tsx +++ b/frontend/src/components/displays/DancerushScoreDisplay.tsx @@ -55,7 +55,6 @@ const DancerushScoreDisplay: React.FC = ({ num_players: "Players" }; - const primaryKeys = ["title", "artist", "song"]; const mainStatKeys = [ "score", "difficulty", @@ -186,22 +185,12 @@ const DancerushScoreDisplay: React.FC = ({ ([key]) => !globalSkipKeys.includes(key), ); - const primary = entries.filter(([key]) => primaryKeys.includes(key)); const mainStats = entries.filter(([key]) => mainStatKeys.includes(key)); const expandable = entries.filter(([key]) => expandableKeys.includes(key)); - const others = entries.filter( - ([key]) => - !primaryKeys.includes(key) && - !mainStatKeys.includes(key) && - !expandableKeys.includes(key) && - key !== "timestamp", - ); return { - primary, mainStats, expandable, - others, timestamp: score.timestamp, }; }; @@ -284,7 +273,7 @@ const DancerushScoreDisplay: React.FC = ({

{sortedScores.map((score, index) => { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { primary, mainStats, expandable, others, timestamp } = + const { mainStats, expandable, timestamp } = getScoreEntries(score); const chartIdHash = SHA1(`dancerush${score.title}${score.artist}`).toString(); return ( @@ -341,23 +330,6 @@ const DancerushScoreDisplay: React.FC = ({
))} - {/* Other fields */} - {others.length > 0 && ( -
-
- {others.map(([key, value]) => ( -
- - {getDisplayName(key)}: - - - {renderValue(value, key)} - -
- ))} -
-
- )} {/* Timestamp */}
-- cgit v1.2.3