centre lobby sort-column values and stop sort-triangle shift by CZapin2015 · Pull Request #20271 · lichess-org/lila · GitHub
Skip to content

centre lobby sort-column values and stop sort-triangle shift#20271

Draft
CZapin2015 wants to merge 1 commit intolichess-org:masterfrom
CZapin2015:fix/lobby-sort-no-shift
Draft

centre lobby sort-column values and stop sort-triangle shift#20271
CZapin2015 wants to merge 1 commit intolichess-org:masterfrom
CZapin2015:fix/lobby-sort-no-shift

Conversation

@CZapin2015
Copy link
Copy Markdown
Contributor

Closes #18744.

Problem

The sort triangle (▼) is only rendered inside the currently-active sortable column header. Clicking Rating vs Time moves the triangle between columns, reflowing:

  • the header text (pushed right by the triangle's inline width + margin)
  • the values in the two columns below (since column widths change)

Result: clicking a different sort option makes the whole table shift horizontally.

Fix

ui/lobby/css/app/_hook-list.scss:

  • Render the triangle on every sortable header, toggle it via opacity instead of swapping content. Column widths stay identical regardless of which column is currently the sort.
  • Centre sortable headers and their matching cells (:has(th.sortable) td:nth-child(2|3)) so values sit under the header text instead of left-aligning against the triangle.

No markup change. Only affects the lobby's realtime hook list.

Testing

Verified locally against lila-docker running my branch. Clicked between Rating and Time repeatedly:

  • Triangle moves between columns
  • Cell positions stay identical (sub-pixel jitter only, measured via getBoundingClientRect)
  • Non-sortable Mode column unchanged

Screen recording attached below.

AI disclosure

Parts of this change were drafted with help from Claude (Anthropic). Prompt intent: find why the lobby columns shift on sort change (_hook-list.scss), reserve the triangle's space on all sortable headers, and centre sort-column data so values sit under the header text. All code reviewed by me and verified locally.

Closes lichess-org#18744. The sort triangle was only rendered in the active
sortable column, so clicking Rating vs Time shifted the triangle
between columns and reflowed both the headers and the values below
them. Keep the triangle in the DOM on every sortable header and toggle
it via opacity so column widths stay stable on sort change. Centre
sortable headers and their matching cells so values sit under the
header text.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ornicar
Copy link
Copy Markdown
Collaborator

ornicar commented Apr 21, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centre lobby values under column names, and don't have movement when changing the sort method

2 participants