feat(eng-view): overhaul engineer view with track map, weather graph, responsive layout#237
Conversation
… responsive layout Major redesign of the Engineer View for race engineers: Engineer View UI: - Responsive breakpoint system (compact/standard/expanded) with DrawerManager for context drawers on narrow viewports - AG Grid integration with sortable/filterable columns, collapse- toggle per card section, and localStorage persistence - Aggregated tyre wear cell renderers, multi-line driver info cells - Weather table with session-grouped display and auto-refresh Track Map (new): - SVG + Canvas hybrid rendering: sharp SVG track outlines with Canvas driver-dot overlay — supports zoom/pan with mouse wheel and drag - Affine world→SVG coordinate transforms via per-game-year svg_transforms.json files - Tooltip on hover, pinned popup on click, team-color coded dots - Fullscreen track map page at /eng-view/trackmap - Track SVGs reorganized from flat assets/track-maps/ into versioned subdirectories (f1_2023, f1_2024, f1_2025) with transform data Weather Graph (new): - Chart.js-based weather forecast visualization - Session-type grouping with deduplication by time-offset Shared utilities (utils.js): - escapeHtml() for XSS-safe innerHTML insertions - getF1TeamColor() — official F1 team color lookup - groupWeatherSamplesBySessionType() — deduplicate by time-offset - getAdjacentPositions() — reference-row aware instead of player-only Backend: - /eng-view/trackmap route for fullscreen track map page All 660 unit tests green.
There was a problem hiding this comment.
Sorry @PettableCat, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Re-scanned from a live qualifying session to fix incorrect rotation.
Regenerated svg_transforms.json to match the re-scanned Bahrain SVG. Driver dot positions now align with the corrected track outline.
|
Note: Some of the F1 2025 SVG track maps were committed with incorrect rotation/orientation. Currently re-scanning all tracks from live telemetry — Bahrain and Jeddah are already fixed, the rest will follow. Will commit the updated SVGs + affine transforms tomorrow probably. |
|
please add screenshots to the PR description |
Done. |
…mpute affine transforms
|
All 27 F1 2025 track maps have been re-scanned from live telemetry and the affine transform coefficients recomputed. Pushed in 548b1de. |
|
couple of questions.
|
|
Good questions! So I actually compared the raw telemetry coordinates between F1 24 and F1 25 for all shared tracks, and it turns out the world coordinates are genuinely different between game versions. Miami is the most extreme — about 43 meters average deviation, even after trying to align them optimally. Suzuka has a 137m offset, Imola is shifted and rotated ~1.75°, Melbourne and Bahrain are off by 5-6m as well. Since the affine transforms for SVG rendering are computed from those world coordinates, even a few meters of shift breaks the mapping. And going forward, tracks like Singapore had a completely different layout before F1 23, so the per-year folders will be needed there too. As for the reverse layouts — you're right that the geometry is mostly the same, but I'd rather keep them for completeness. The start/finish positions do differ, and if we ever render sector markers or start lines down the road, they'll already be there. |
Code Review —
|
| Priority | Issue |
|---|---|
| 🔴 | Deduplicate CSS between eng-view-trackmap.html inline styles and engView.css |
| 🔴 | refDriverTeam stale-state in standalone trackmap page |
| 🟡 | api_key in <meta> tag — evaluate exposure risk |
| 🟡 | !important overuse in temp/damage classes — consolidate with shared base class |
| 🟡 | German comments in CSS → translate to English |
| 🟢 | innerHTML = '' → prefer replaceChildren() / textContent = '' |
| 🟢 | initCardCollapseToggles buttons → move to HTML |
Overall this is a well-executed feature with good security awareness. The main structural issue is the CSS duplication between the standalone trackmap page and the main stylesheet.
ashwin-nat
left a comment
There was a problem hiding this comment.
Five German comments in the block — please translate to English to match the rest of the codebase.
- store bound document listeners and remove them in destroy() - extract _buildTooltipContent() to eliminate duplicate tooltip DOM code - extract _teardown() shared by clear() and _showFallback() - cache sorted driver array, rebuild only when updateDrivers() runs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 Description
Overhauls the engineer view with a live track map, weather forecast graph, and responsive layout.
Key changes:
eng-view-trackmap.htmlpage with real-time driver position rendering on SVG track mapstrackMap.js: SVG loading, driver dot positioning via affine-transformed coordinatesweatherGraph.js: canvas-based weather forecast timeline with temperature/rain curvesengView.js: responsive grid layout, auto-refresh, session-aware data fetchingsvg_transforms.json) for coordinate mapping/track-mapendpoint intelemetry_web_server.py📂 Type of change
🧪 Backend Test Reports (required for Python/backend changes)
✅ Integration Tests
To run the integration test
🧱
lib/Directory Changeslib/Explain your test updates here:
📋 General Checklist
Screenshots:

