feat: refine current match live feed
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# TASK-156 - Current match realtime killfeed and home buttons layout
|
||||
|
||||
Status: pending
|
||||
Status: done
|
||||
|
||||
## Goal
|
||||
|
||||
@@ -178,7 +178,23 @@ The current-match kill feed behaves like a compact real-time combat overlay, and
|
||||
|
||||
## Outcome
|
||||
|
||||
Document the validation performed, notable decisions, and any follow-up task that should be created instead of expanding this task.
|
||||
- Kept the existing `event_id`-based killfeed refresh path and changed only its
|
||||
rendering surface: the capped 15-event panel now reads as a bounded combat
|
||||
screen with three desktop columns, while smaller breakpoints remain bounded.
|
||||
- Removed the home server-card public-scoreboard action from the hydrated markup
|
||||
and left the remaining `Historico` / `Partida actual` actions aligned by the
|
||||
existing status-column layout.
|
||||
- Validated with:
|
||||
- `node --check frontend/assets/js/partida-actual.js`
|
||||
- `node --check frontend/assets/js/main.js`
|
||||
- `git diff --check`
|
||||
- `docker compose up -d --build frontend`
|
||||
- live endpoint checks for `/api/current-match/kills` on Comunidad Hispana
|
||||
`#01` and `#02`
|
||||
- rendered Chrome headless screenshots of the home page, current-match `#01`
|
||||
desktop view and current-match `#02` mobile empty-state view
|
||||
- The in-app Browser automation runtime was not callable after tool discovery,
|
||||
so rendered validation used local headless Chrome against the task URLs.
|
||||
|
||||
## Change Budget
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# TASK-157 - Current match player team colors
|
||||
|
||||
Status: pending
|
||||
Status: done
|
||||
|
||||
## Goal
|
||||
|
||||
@@ -160,7 +160,35 @@ The current-match player/stat section uses team-aware colors consistent with the
|
||||
|
||||
## Outcome
|
||||
|
||||
Document the validation performed, notable decisions, and any follow-up task that should be created instead of expanding this task.
|
||||
- RCA found no backend contract gap: a live
|
||||
`/api/current-match/players?server=comunidad-hispana-01` response observed
|
||||
before the validation rebuild already exposed AdminLog-derived `team` values
|
||||
such as `Allies` and `Axis`; unknown values remain handled by the existing
|
||||
frontend neutral path.
|
||||
- Reused the historical detail player row and team badge CSS modifiers from
|
||||
`historico-scoreboard-detail.css` in the current-match player table instead
|
||||
of adding a parallel style system.
|
||||
- Included `team` in the visible player-table signature so a future team update
|
||||
can rerender an already-visible row without changing its stats.
|
||||
- Validated with:
|
||||
- `node --check frontend/assets/js/partida-actual.js`
|
||||
- `git diff --check`
|
||||
- `docker compose up -d --build frontend`
|
||||
- live `/api/current-match/players` checks on Comunidad Hispana `#01` and
|
||||
`#02`
|
||||
- rendered Chrome headless current-match validation for the available player
|
||||
empty state after the backend restart
|
||||
- served-script check confirming the historical row and badge modifiers are
|
||||
present in `frontend/assets/js/partida-actual.js`
|
||||
- The final rendered validation window had no current player rows after the
|
||||
backend rebuild, so known-team colors were validated from the observed live
|
||||
payload contract plus the reused historical class mapping rather than from a
|
||||
live colored-row screenshot.
|
||||
- Repository-level follow-up validation ran
|
||||
`powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1`.
|
||||
It returned exit code `0`, but its output also printed a historical SQLite
|
||||
`database disk image is malformed` traceback after the pass banner; that
|
||||
historical storage issue is outside this frontend task scope.
|
||||
|
||||
## Change Budget
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: TASK-158
|
||||
title: Current match realtime transport
|
||||
status: pending
|
||||
status: done
|
||||
type: backend
|
||||
team: Backend Senior
|
||||
supporting_teams: [Frontend Senior]
|
||||
@@ -160,7 +160,31 @@ The current-match kill feed updates in near-real-time, without depending on the
|
||||
|
||||
## Outcome
|
||||
|
||||
Document the RCA, transport decision, validation performed, load/freshness limitations, and any follow-up task that should be created instead of expanding this task.
|
||||
RCA:
|
||||
|
||||
- The current page used one `30s` interval in `frontend/assets/js/partida-actual.js` for current-match metadata, player stats and the kill feed together.
|
||||
- The kill feed read path is already safe for higher-frequency reads because it queries normalized persisted `rcon_admin_log_events` rows through `/api/current-match/kills`; it does not query RCON from the browser or expose raw AdminLog lines.
|
||||
- Current match metadata can still call live RCON through the existing payload path, and player stats aggregate the kill feed read model, so those surfaces remain on the slower refresh path.
|
||||
|
||||
Transport decision:
|
||||
|
||||
- Implemented incremental short polling for the kill feed instead of SSE. The backend is still the standard-library JSON route stack, while the existing persisted read model can cheaply support a cursor.
|
||||
- `/api/current-match/kills` now accepts `since_event_id` plus the existing `server` and `limit` inputs. Trusted server validation remains in `routes.py`.
|
||||
- The frontend polls kill-feed rows every `1500ms`, sends the latest event id cursor after the first load, deduplicates by `event_id`, caps the in-memory visible buffer and avoids overlapping kill-feed requests. Metadata and player stats keep the existing `30s` refresh cadence.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `python -m compileall backend/app`
|
||||
- `node --check frontend/assets/js/partida-actual.js`
|
||||
- `git diff --check`
|
||||
- Ran a direct Python smoke check for `list_current_match_kill_feed(..., since_event_id=...)` with temporary AdminLog rows after the focused pytest command could not run.
|
||||
- Attempted focused backend tests with `python -m pytest backend/tests/test_current_match_payload.py backend/tests/test_rcon_admin_log_storage.py`; this environment failed with `No module named pytest`.
|
||||
- Reviewed `git diff --name-only`; task-owned code changes are limited to the allowed current-match backend/frontend files plus the focused storage test and this task transition. The worktree already contained frontend and prior task changes from `TASK-156`/`TASK-157`.
|
||||
|
||||
Load and freshness limit:
|
||||
|
||||
- Browser polling now reads persisted AdminLog rows rather than issuing per-browser RCON calls.
|
||||
- New kill visibility is still bounded by how quickly `app.rcon_historical_worker` or manual AdminLog ingestion persists fresh AdminLog rows. The current documented worker example is a `120s` loop, so operations may need a follow-up cadence decision if that persisted source is not fresh enough for the desired live screen.
|
||||
|
||||
## Change Budget
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: TASK-159
|
||||
title: Current match feed rollback and weapon icons
|
||||
status: pending
|
||||
status: done
|
||||
type: frontend
|
||||
team: Frontend Senior
|
||||
supporting_teams: [Disenador grafico, Experto en interfaz]
|
||||
@@ -162,7 +162,24 @@ The current-match feed returns to the previous preferred live-feed visual direct
|
||||
|
||||
## Outcome
|
||||
|
||||
Document the visual RCA, icon discovery/mapping decision, validation performed, and any follow-up task that should be created instead of expanding this task.
|
||||
Visual RCA:
|
||||
|
||||
- Git history before the compact feed change showed a vertical `historical-match-card` list with one readable event per row/card. The rejected version introduced a fixed multi-column killfeed surface that reads like a grid/table.
|
||||
- The feed was refactored back to a vertical card-like list while keeping the current live buffer, deduplication and no-flicker signature guard.
|
||||
|
||||
Weapon icon decision:
|
||||
|
||||
- Reused local assets already present under `frontend/assets/img/weapons/`.
|
||||
- `partida-actual.js` maps normalized AdminLog weapon names for `M1 GARAND`, `MP40`, `M1A1 THOMPSON`, `GEWEHR 43`, `MG42` and aliases to local PNGs.
|
||||
- Unknown/unmapped weapons keep their label for tooltip/accessibility and render a compact local fallback marker instead of hotlinking assets.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `node --check frontend/assets/js/partida-actual.js`
|
||||
- `git diff --check`
|
||||
- `docker compose build frontend`
|
||||
- Reviewed the history diff for the prior accepted feed direction and inspected local weapon asset filenames.
|
||||
- Rendered Browser verification was attempted through the required Browser workflow but blocked because the Browser JavaScript execution tool was not exposed in this session after tool discovery.
|
||||
|
||||
## Change Budget
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: TASK-160
|
||||
title: Home server card bottom actions
|
||||
status: pending
|
||||
status: done
|
||||
type: frontend
|
||||
team: Frontend Senior
|
||||
supporting_teams: [Experto en interfaz]
|
||||
@@ -143,7 +143,19 @@ The home server cards have a clean structural layout with only Historico and Par
|
||||
|
||||
## Outcome
|
||||
|
||||
Document the structural rendering cleanup, validation performed, and any follow-up task that should be created instead of expanding this task.
|
||||
Structural cleanup:
|
||||
|
||||
- Home server card actions now live in a dedicated bottom row beside the map quickfact rather than inside the status column.
|
||||
- The rendered card action markup keeps only `Historico` and `Partida actual`; trusted URL mappings stay intact for those actions.
|
||||
- Removed the inline server-card layout workaround from `frontend/index.html` and moved the bottom-row layout rules into `frontend/assets/css/styles.css`, with a stacked narrow layout.
|
||||
|
||||
Validation performed:
|
||||
|
||||
- `node --check frontend/assets/js/main.js`
|
||||
- `git diff --check`
|
||||
- `docker compose build frontend`
|
||||
- Checked the existing local frontend and backend endpoints were serving on `127.0.0.1:8080` and `127.0.0.1:8000`.
|
||||
- Rendered Browser verification was attempted through the required Browser workflow but blocked because the Browser JavaScript execution tool was not exposed in this session after tool discovery.
|
||||
|
||||
## Change Budget
|
||||
|
||||
Reference in New Issue
Block a user