Summary
Sessions are rendered by three different table layouts that have drifted apart. They should share one canonical row builder. Canonical target: the list_sessions 6-column table.
Current state
| Where |
Columns |
How rows are built |
games/views/session.py list_sessions |
6: Name, Date, Duration, Device, Created, Actions |
row dict with row_id + hx attrs → TableRow |
games/views/game.py _sessions_section (game detail) |
4: Game, Date, Duration, Actions |
plain list, no row_id, no Device column |
games/views/session.py _session_row_fragment |
4: Name, Start, End, Duration |
hand-built Tr, no row_id |
Each is maintained independently, so a change to the session row (new column, formatting, action button) has to be made in up to three places and silently drifts otherwise. This is the root cause of #53.
Desired state
- One canonical row builder (extracted from
list_sessions, e.g. session_row_data(session, device_list, csrf_token)) used everywhere a session row is rendered.
- The game-detail sessions table migrates onto it (dropping/adapting columns as needed for that context, e.g. it may hide Device/Created but should not re-implement the row).
- No hand-rolled session
<tr> anywhere.
Notes
Summary
Sessions are rendered by three different table layouts that have drifted apart. They should share one canonical row builder. Canonical target: the
list_sessions6-column table.Current state
games/views/session.pylist_sessionsrow_id+ hx attrs →TableRowgames/views/game.py_sessions_section(game detail)row_id, no Device columngames/views/session.py_session_row_fragmentTr, norow_idEach is maintained independently, so a change to the session row (new column, formatting, action button) has to be made in up to three places and silently drifts otherwise. This is the root cause of #53.
Desired state
list_sessions, e.g.session_row_data(session, device_list, csrf_token)) used everywhere a session row is rendered.<tr>anywhere.Notes
_session_row_fragmentno longer matches the live session list table #53 introducessession_row_datafor the list + htmx fragment. This issue tracks finishing the job by also moving the game-detail table onto it.Gameas the first column vsNameand omits Device/Created — standardization needs a way to vary visible columns from one row source.