Description
The leaderboard in frontend/leaderboard.html currently uses a <div>-based grid layout to display rankings. While this renders visually, it completely breaks screen reader navigation — users relying on assistive technology cannot perceive row/column relationships, sort directions, or rank positions.
Additionally, the page has no <h1> heading and the title is only set via JavaScript (document.title), which means the page appears untitled before JS executes.
Proposed Solution
-
Replace the <div> grid with a proper <table> structure:
<table> with <thead> containing <th> elements for Rank, Name, Score, etc.
<tbody> where each row is a <tr> with <td> cells.
- Add
role="columnheader" and aria-sort attributes to sortable columns.
- Add
scope="col" / scope="row" for proper header associations.
-
Add a visible <h1> heading above the table (e.g., "Leaderboard").
-
Preserve all existing visual styling:
- Migrate existing CSS from
.leaderboard-grid, .leaderboard-row etc. to table, th, td, tr selectors.
- Maintain the rank badges, avatar, score formatting exactly as-is.
-
Ensure keyboard navigation works:
- Rows remain focusable via
tabindex="0" or native <tr> focus if needed.
- Sort controls in
<th> are <button> elements (not divs with click handlers).
Acceptance Criteria
Affected Files
frontend/leaderboard.html
frontend/css/main.css
frontend/js/render.js (may need minor selector updates)
Description
The leaderboard in
frontend/leaderboard.htmlcurrently uses a<div>-based grid layout to display rankings. While this renders visually, it completely breaks screen reader navigation — users relying on assistive technology cannot perceive row/column relationships, sort directions, or rank positions.Additionally, the page has no
<h1>heading and the title is only set via JavaScript (document.title), which means the page appears untitled before JS executes.Proposed Solution
Replace the
<div>grid with a proper<table>structure:<table>with<thead>containing<th>elements for Rank, Name, Score, etc.<tbody>where each row is a<tr>with<td>cells.role="columnheader"andaria-sortattributes to sortable columns.scope="col"/scope="row"for proper header associations.Add a visible
<h1>heading above the table (e.g., "Leaderboard").Preserve all existing visual styling:
.leaderboard-grid,.leaderboard-rowetc. totable,th,td,trselectors.Ensure keyboard navigation works:
tabindex="0"or native<tr>focus if needed.<th>are<button>elements (not divs with click handlers).Acceptance Criteria
<table>in the DOM (verify via DevTools).<div>grid.<h1>heading exists on the page.Affected Files
frontend/leaderboard.htmlfrontend/css/main.cssfrontend/js/render.js(may need minor selector updates)