Skip to content

Commit 25d5db6

Browse files
committed
Enh(viewer): Better styling for results table winner col
1 parent 2969ce2 commit 25d5db6

3 files changed

Lines changed: 98 additions & 17 deletions

File tree

.cursor/rules/viewer.mdc

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ two AI agent in a round-based game against each other.
1919
* Organize JavaScript into logical modules: clipboard.js, experiment.js, readme.js, json-editors.js, etc.
2020
* The application consists of two main pages: the viewer and the game picker
2121

22+
### Design System & Styling
23+
24+
* **Consistent Section Formatting**: All main sections (Overview, Analysis, Rounds) use the same styling with consistent margins, headers, and layout
25+
* **Color System**:
26+
- Success states: Bright neon green (`#00ff88`) for submitted/successful statuses. This is also the accent color.
27+
- Error/Warning states: Bright neon pink-red (`#ff1188`) for failed/error statuses
28+
- Both colors maintain similar brightness and vibrancy for visual consistency
29+
* **Status Indicators**: Exit statuses are consistently colored across all views (overview table, detailed trajectories)
30+
* **Section Headers**: All sections use h2 headers with icons and consistent styling (font-size: 1.5rem, accent color)
31+
* **Responsive Layout**: Flexbox layouts that adapt from column (mobile) to row (desktop) as space allows
32+
2233
### Template Organization
2334

2435
* **Main templates**: `index.html`, `picker.html`, `no_logs.html` are in the templates root
@@ -34,6 +45,7 @@ two AI agent in a round-based game against each other.
3445
* `includes/readme.html` - Editable readme section
3546
* `includes/setup.html` - Agent info, metadata, and tournament log foldouts
3647
* `includes/overview.html` - Results summary table with round navigation
48+
* `includes/analysis.html` - Analysis section with line counting charts and data visualization
3749
* `includes/trajectory.html` - Player trajectory display with messages, diffs, and files
3850
* `includes/rounds.html` - Main rounds section that includes trajectories and simulation logs
3951

@@ -260,8 +272,9 @@ The application has two main pages:
260272

261273
* **Floating Table of Contents**: A floating navigation panel that provides quick navigation (always visible by default)
262274
- **Go to Top button**: Smooth scroll to the top of the page
263-
- **Round Navigation**: Quick links to jump to specific round sections
264-
- **Section Navigation**: Quick links to Overview and Rounds sections
275+
- **Flat Navigation Structure**: Simple, flat navigation without nested sections
276+
- **Section Navigation**: Direct links to Overview, Analysis, and individual Round sections
277+
- **Round Navigation**: Direct links to each round (Round 0, Round 1, etc.) without grouping
265278
- **Close Button**: × button in the header to hide the navigation panel
266279
- **Keyboard Toggle**: `t` key to show/hide the navigation panel
267280
- **Positioning**: Fixed position in bottom-right corner
@@ -351,7 +364,12 @@ The application has two main pages:
351364
* At the top, we show the content of `metadata.json`
352365
* There's a foldout that displays main.log (hidden by default)
353366
* **Overview table**: Shows results summary with round navigation
354-
- **Header formatting**: Column headers should show player names directly followed by "Steps" (e.g., "sonnet-4-more-prescriptive Steps"), not "Player sonnet-4-more-prescriptive Steps"
367+
- **Header formatting**: Column headers show just the model/player names (e.g., "sonnet-4-more-prescriptive"), not including "Steps"
368+
- **Cell format**: Each player cell shows `<steps>/$<price> <exit_status>` with emphasis on performance metrics
369+
- Steps/price is prominent (larger, bold text)
370+
- Exit status is smaller and secondary
371+
- Uses responsive flexbox layout (side-by-side on desktop, stacked on mobile)
372+
- **Status coloring**: Exit statuses use consistent color scheme (green for "Submitted", neon red for errors)
355373
- **Navigation buttons**: Each row includes a button to jump to the specific round details
356374
* **All Logs section**: Shows all available log files with individual foldouts and scroll containers
357375
- **tournament.log**: Tournament-level logging
@@ -361,6 +379,15 @@ The application has two main pages:
361379
- Each log foldout includes a "Copy path" button and has its own scroll container with max-height of 500px for large logs
362380
- Logs are displayed in a dedicated section with proper styling and scrollbars
363381

382+
#### Analysis Section
383+
384+
* **Line Counting Analysis**: Interactive charts showing code evolution over time
385+
- File selector dropdown to choose which file to analyze
386+
- Chart.js-powered line charts showing changes across rounds
387+
- Data visualization for understanding code development patterns
388+
* **Consistent Styling**: Uses same section formatting as Overview and Rounds sections
389+
* **Foldout Structure**: Analysis content is contained in collapsible foldouts for space efficiency
390+
364391
#### Rounds
365392

366393
First, show a foldout of `round_1.log`.
@@ -390,6 +417,8 @@ This is implemented as its own jinja template (`includes/trajectory.html`) that
390417
The trajectory template displays:
391418

392419
* **Trajectory Stats**: API calls, cost, and exit status from the `info` section
420+
- **Exit Status Styling**: Non-"Submitted" statuses appear in bright neon red for immediate error identification
421+
- **Consistent Coloring**: Uses same color scheme as overview table and other status indicators
393422
* **Messages Foldout**: All trajectory messages with role badges and content preview/expand functionality
394423
* **Diff Foldouts**: Full diff and incremental diff sections (if available)
395424
* **Modified Files**: Changed files during the trajectory (if available)

codeclash/viewer/static/css/style.css

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
--success-color: var(--bs-success);
2525
--warning-color: var(--bs-warning);
2626
--danger-color: var(--bs-danger);
27+
--neon-red: #ff1188;
2728
--code-bg: #0a0a0a;
2829
--shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.8);
2930
--shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.9);
@@ -290,7 +291,8 @@ body {
290291
font-weight: 500;
291292
}
292293

293-
.score-breakdown {
294+
.score-breakdown,
295+
.winner-breakdown {
294296
display: flex;
295297
flex-wrap: wrap;
296298
gap: 0.5rem;
@@ -310,6 +312,39 @@ body {
310312
color: var(--accent-color);
311313
}
312314

315+
.cost-steps {
316+
font-size: 0.875rem;
317+
color: var(--text-muted);
318+
font-weight: 400;
319+
}
320+
321+
.steps-price {
322+
font-size: 1rem;
323+
font-weight: 600;
324+
color: var(--text-primary);
325+
}
326+
327+
.exit-status-small {
328+
font-size: 0.75rem;
329+
font-weight: 400;
330+
}
331+
332+
.overview-cell-content {
333+
display: flex;
334+
flex-direction: column;
335+
gap: 0.25rem;
336+
align-items: flex-start;
337+
}
338+
339+
@media (min-width: 768px) {
340+
.overview-cell-content {
341+
flex-direction: row;
342+
gap: 0.5rem;
343+
align-items: center;
344+
flex-wrap: wrap;
345+
}
346+
}
347+
313348
.no-result {
314349
color: var(--text-muted);
315350
font-style: italic;
@@ -586,12 +621,19 @@ details summary {
586621
color: var(--success-color);
587622
}
588623

624+
/* All non-submitted statuses should be neon red */
625+
.stat-value[class*="status-"]:not(.status-submitted),
626+
.exit-status-small[class*="status-"]:not(.status-submitted) {
627+
color: var(--neon-red) !important;
628+
font-weight: 600;
629+
}
630+
589631
.status-failed {
590-
color: var(--danger-color);
632+
color: var(--neon-red);
591633
}
592634

593635
.status-timeout {
594-
color: var(--warning-color);
636+
color: var(--neon-red);
595637
}
596638

597639
/* Messages */
@@ -779,7 +821,8 @@ details summary {
779821
padding: 0.5rem;
780822
}
781823

782-
.score-breakdown {
824+
.score-breakdown,
825+
.winner-breakdown {
783826
flex-direction: column;
784827
gap: 0.25rem;
785828
}
@@ -1213,7 +1256,7 @@ summary:focus {
12131256
}
12141257

12151258
.readme-status.error {
1216-
color: var(--danger-color);
1259+
color: var(--neon-red);
12171260
}
12181261

12191262
.copy-path-btn-small {

codeclash/viewer/templates/includes/overview.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h2><i class="bi bi-bar-chart"></i> Overview</h2>
1010
<th>Winner</th>
1111
<th>Results</th>
1212
{% for trajectory in trajectories_by_round.get(1, []) %}
13-
<th>{{ trajectory.player_id }} Steps</th>
13+
<th>{{ trajectory.player_id }}</th>
1414
{% endfor %}
1515
<th>Actions</th>
1616
</tr>
@@ -21,13 +21,15 @@ <h2><i class="bi bi-bar-chart"></i> Overview</h2>
2121
<td>{{ round_data.round_num }}</td>
2222
<td>
2323
{% if round_data.results and round_data.results.winner %}
24-
<span class="winner-badge">{{ round_data.results.winner }}</span>
25-
{% if round_data.results.winner_percentage %}
26-
<span class="winner-percentage">({{ round_data.results.winner_percentage }}%)</span>
27-
{% endif %}
28-
{% if round_data.results.p_value is not none %}
29-
<span class="p-value">(p={{ "%.2f"|format(round_data.results.p_value) }})</span>
30-
{% endif %}
24+
<div class="winner-breakdown">
25+
<span class="winner-badge">{{ round_data.results.winner }}</span>
26+
{% if round_data.results.winner_percentage %}
27+
<span class="score-item">{{ round_data.results.winner_percentage }}%</span>
28+
{% endif %}
29+
{% if round_data.results.p_value is not none %}
30+
<span class="score-item">p={{ "%.2f"|format(round_data.results.p_value) }}</span>
31+
{% endif %}
32+
</div>
3133
{% else %}
3234
<span class="no-result">-</span>
3335
{% endif %}
@@ -46,7 +48,14 @@ <h2><i class="bi bi-bar-chart"></i> Overview</h2>
4648
{% if trajectories_by_round.get(round_data.round_num) %}
4749
{% for trajectory in trajectories_by_round[round_data.round_num] %}
4850
<td>
49-
<span class="steps-count">{{ trajectory.api_calls }}</span>
51+
<div class="overview-cell-content">
52+
<span class="steps-price">{{ trajectory.api_calls }}/${{ "%.2f"|format(trajectory.cost) }}</span>
53+
{% if trajectory.exit_status %}
54+
<span class="exit-status-small status-{{ trajectory.exit_status.lower() }}">{{ trajectory.exit_status }}</span>
55+
{% else %}
56+
<span class="no-result">-</span>
57+
{% endif %}
58+
</div>
5059
</td>
5160
{% endfor %}
5261
{% else %}

0 commit comments

Comments
 (0)