Skip to content

Commit ec8464c

Browse files
committed
style: game review UI polish and arrow key navigation
1 parent ab62469 commit ec8464c

5 files changed

Lines changed: 62 additions & 22 deletions

File tree

apps/frontend/src/components/review/ReviewControlPanel/ReviewControlPanel.module.css

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
overflow-y: auto;
2525
display: flex;
2626
flex-direction: column;
27-
gap: var(--space-sm);
27+
gap: var(--space-md);
2828
padding: var(--space-sm);
2929
}
3030

@@ -40,23 +40,24 @@
4040
font-family: var(--font-body);
4141
font-size: var(--text-sm);
4242
font-weight: 600;
43-
background: var(--surface-3);
44-
border: 1px solid var(--border-subtle);
43+
background: transparent;
44+
border: 1px solid var(--error);
4545
border-radius: var(--radius-md);
46-
color: var(--text-secondary);
46+
color: var(--error);
4747
cursor: pointer;
4848
transition:
4949
background var(--transition-fast),
5050
color var(--transition-fast);
5151
}
5252

5353
.exitButton:hover {
54-
background: var(--surface-4);
55-
color: var(--text-primary);
54+
background: var(--error);
55+
color: var(--surface-0);
5656
}
5757

5858
.exitButton:active {
59-
background: var(--surface-4);
59+
background: var(--error);
60+
color: var(--surface-0);
6061
transform: scale(0.97);
6162
}
6263

apps/frontend/src/components/review/ReviewEvalGraph/ReviewEvalGraph.module.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
}
88

99
.evalGraphHeader {
10+
display: flex;
11+
align-items: center;
12+
justify-content: space-between;
1013
padding: var(--space-sm) var(--space-md) 0;
1114
font-size: var(--text-sm);
1215
font-weight: 600;
@@ -15,6 +18,30 @@
1518
letter-spacing: 0.05em;
1619
}
1720

21+
.evalLegend {
22+
display: flex;
23+
align-items: center;
24+
gap: 4px;
25+
}
26+
27+
.evalLegendDot {
28+
width: 6px;
29+
height: 6px;
30+
border-radius: var(--radius-full);
31+
}
32+
33+
.evalLegendLabel {
34+
font-size: 10px;
35+
font-weight: 500;
36+
color: var(--text-muted);
37+
letter-spacing: 0;
38+
margin-right: 4px;
39+
}
40+
41+
.evalLegendLabel:last-child {
42+
margin-right: 0;
43+
}
44+
1845
.graphArea {
1946
position: relative;
2047
padding: 0 var(--space-sm);
@@ -63,6 +90,10 @@
6390
transition: opacity 0.15s ease;
6491
}
6592

93+
.graphArea + .evalGraphHeader {
94+
margin-top: var(--space-md);
95+
}
96+
6697
.timingGraphArea {
6798
position: relative;
6899
padding: 0 var(--space-sm) var(--space-sm);

apps/frontend/src/components/review/ReviewEvalGraph/ReviewEvalGraph.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ const ReviewEvalGraph: Component<ReviewEvalGraphProps> = (props) => {
2020
const heightPx = Math.max(2, (Math.abs(clamped) / EVAL_CLAMP) * MID_Y);
2121
const isWhiteAdvantage = clamped >= 0;
2222
const topPx = isWhiteAdvantage ? MID_Y - heightPx : MID_Y;
23+
const isWhite = p.side === 'w';
2324

24-
let color = 'var(--accent)';
25-
if (p.quality === 'blunder') color = 'var(--move-blunder)';
26-
else if (p.quality === 'mistake') color = 'var(--move-mistake)';
27-
else if (p.quality === 'inaccuracy') color = 'var(--move-inaccuracy)';
25+
const color = isWhite ? 'var(--text-secondary)' : 'var(--text-muted)';
2826

2927
return {
3028
moveIndex: p.moveIndex,
@@ -64,7 +62,15 @@ const ReviewEvalGraph: Component<ReviewEvalGraphProps> = (props) => {
6462

6563
return (
6664
<div class={styles.evalGraphContainer}>
67-
<div class={styles.evalGraphHeader}>Evaluation</div>
65+
<div class={styles.evalGraphHeader}>
66+
<span>Evaluation</span>
67+
<span class={styles.evalLegend}>
68+
<span class={styles.evalLegendDot} style={{ background: 'var(--text-secondary)' }} />
69+
<span class={styles.evalLegendLabel}>W</span>
70+
<span class={styles.evalLegendDot} style={{ background: 'var(--text-muted)' }} />
71+
<span class={styles.evalLegendLabel}>B</span>
72+
</span>
73+
</div>
6874
<div class={styles.graphArea} style={{ height: `${GRAPH_HEIGHT}px` }}>
6975
<div class={styles.midLine} />
7076
<div class={styles.barContainer}>
@@ -106,7 +112,7 @@ const ReviewEvalGraph: Component<ReviewEvalGraphProps> = (props) => {
106112
style={{
107113
height: `${bar.heightPx}px`,
108114
top: `${bar.topPx}px`,
109-
background: bar.isWhite ? 'var(--text-muted)' : 'var(--text-secondary)',
115+
background: bar.isWhite ? 'var(--text-secondary)' : 'var(--text-muted)',
110116
opacity: bar.isCurrent ? '1' : '0.6',
111117
}}
112118
/>

apps/frontend/src/components/review/ReviewSummaryPanel/ReviewSummaryPanel.module.css

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.summaryContainer {
22
display: flex;
33
flex-direction: column;
4-
gap: var(--space-sm);
4+
gap: var(--space-md);
55
padding: var(--space-sm) var(--space-md);
66
background: var(--surface-2);
77
border-radius: var(--radius-md);
@@ -30,8 +30,8 @@
3030
}
3131

3232
.ringSvg {
33-
width: 64px;
34-
height: 64px;
33+
width: 80px;
34+
height: 80px;
3535
transform: rotate(-90deg);
3636
}
3737

@@ -58,9 +58,9 @@
5858

5959
.accuracyValue {
6060
position: absolute;
61-
top: 50%;
61+
top: 40px;
6262
left: 50%;
63-
transform: translate(-50%, -70%);
63+
transform: translate(-50%, -50%);
6464
font-family: var(--font-display);
6565
font-size: var(--text-base);
6666
font-weight: 700;
@@ -79,6 +79,7 @@
7979
display: flex;
8080
flex-direction: column;
8181
gap: var(--space-sm);
82+
margin-top: var(--space-xs);
8283
}
8384

8485
.distributionRow {
@@ -168,11 +169,12 @@
168169
}
169170

170171
.ringSvg {
171-
width: 56px;
172-
height: 56px;
172+
width: 68px;
173+
height: 68px;
173174
}
174175

175176
.accuracyValue {
177+
top: 34px;
176178
font-size: var(--text-sm);
177179
}
178180

apps/frontend/src/shared/hooks/useKeyboardNavigation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ export const useKeyboardNavigation = (options: KeyboardNavigationOptions): void
3232
} else if (e.key === 'ArrowRight') {
3333
e.preventDefault();
3434
onNext();
35-
} else if (e.key === 'Home') {
35+
} else if (e.key === 'Home' || e.key === 'ArrowUp') {
3636
e.preventDefault();
3737
onFirst();
38-
} else if (e.key === 'End') {
38+
} else if (e.key === 'End' || e.key === 'ArrowDown') {
3939
e.preventDefault();
4040
onLast();
4141
} else if (e.key === 'f') {

0 commit comments

Comments
 (0)