4.0 KiB
4.0 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |||
|---|---|---|---|---|---|---|---|---|---|---|
| TASK-186-polish-ranking-metric-ux-and-limits | Polish ranking metric UX and limits | pending | frontend | Frontend Senior |
|
foundation | high |
TASK-186-polish-ranking-metric-ux-and-limits - Polish ranking metric UX and limits
Goal
Update the Ranking page UX so it exposes the backend-supported metric set clearly, improves limit handling and error messaging, and preserves the separation between global tops and player-specific Stats.
Context
The current Ranking UI is limited to kills, only exposes a small set of limits, and handles invalid limit through a generic error path. If backend metric expansion is delivered, the frontend must expose the new metric set safely, keep annual constraints clear, and improve the explanatory UX without changing backend architecture.
Preserve the current product identity: Spanish-speaking HLL Vietnam community, military/Vietnam/tactical/sober visual direction and controlled repository evolution.
Steps
- Read the listed files first.
- Update
ranking.html,ranking.jsand styling only as needed to expose the supported Ranking metric set. - Allow selecting:
killsdeathsteamkillsmatches_consideredkd_ratiokills_per_match
- Make the UI clearly show:
- the active metric
- the active timeframe
- the active server
- If annual remains
kills-only, hide, disable or clearly message unsupported annual metrics without breaking the flow. - Improve limit UX so the available UI limits are reasonable and aligned with backend constraints.
- Add a clearer message for invalid
limitif it arrives from manual URL or parameter manipulation. - Keep or improve the message for unsupported metric and unsupported timeframe.
- Preserve the guidance that
Statsis for one-player lookup andRankingis for global tops. - Add only minimal cross-linking between
RankingandStatsif helpful and already aligned with existing page patterns.
Files to Read First
AGENTS.mdai/repo-context.mdai/architecture-index.mddocs/global-ranking-page-plan.mdfrontend/ranking.htmlfrontend/assets/js/ranking.jsfrontend/assets/css/styles.cssfrontend/stats.htmlfrontend/assets/js/stats.jsbackend/app/routes.pyai/tasks/done/TASK-185-add-ranking-extra-metrics-backend-support.md
Expected Files to Modify
frontend/ranking.htmlfrontend/assets/js/ranking.jsfrontend/assets/css/styles.cssfrontend/stats.htmlscripts/run-stats-validation.ps1ai/tasks/done/TASK-186-polish-ranking-metric-ux-and-limits.md
Constraints
- Do not modify backend files.
- Do not create endpoints.
- Do not modify the database.
- Do not reactivate Elo/MMR.
- Do not reintroduce Comunidad Hispana #03.
- Do not introduce frameworks.
- Keep HTML/CSS/JS vanilla.
- Maintain the military/Vietnam/tactical/sober visual identity.
- Do not break Stats.
- Do not duplicate complex logic unnecessarily.
Validation
Before completing the task ensure:
node --check frontend/assets/js/ranking.jsnode --check frontend/assets/js/stats.jspowershell -ExecutionPolicy Bypass -File scripts/run-stats-validation.ps1powershell -ExecutionPolicy Bypass -File scripts/run-integration-tests.ps1- serve frontend with
python -m http.serverand confirm HTTP200for:ranking.htmlassets/js/ranking.jsstats.htmlindex.html
- if local backend is available, validate real metric selection against the supported backend contract
- if backend is unavailable, validate the offline fallback path explicitly
- confirm
git diff --name-onlystays within scope
Outcome
Document:
- metrics exposed in UI
- annual behavior in the UX
- UI limit choices
- error states covered
- validations executed
- recommended follow-ups, if any
Change Budget
- Prefer fewer than 5 modified files.
- Prefer changes under 200 lines when feasible.
- Split the work into follow-up tasks if limits are exceeded.