Skip to content

Fix: Sorting order in Tournament Index pagination#16

Merged
timrodz merged 1 commit into
mainfrom
fix/pagination-order
Feb 21, 2026
Merged

Fix: Sorting order in Tournament Index pagination#16
timrodz merged 1 commit into
mainfrom
fix/pagination-order

Conversation

@timrodz

@timrodz timrodz commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Fixes a bug where the pagination loop was built backwards.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed pagination display order. Pagination navigation elements now render in the correct visual sequence, improving navigation clarity.

@coderabbitai

coderabbitai Bot commented Feb 21, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

A modification to the pagination_items/2 function changes how ellipsis elements are positioned during pagination construction. The code now prepends ellipsis elements instead of appending them, followed by a final list reversal to maintain correct page order.

Changes

Cohort / File(s) Summary
Pagination Ellipsis Handling
lib/mtg_friends_web/live/tournament_live/index.ex
Modified pagination_items/2 to prepend ellipsis instead of append during page gap detection, with subsequent Enum.reverse() to restore intended ordering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main fix: correcting the sorting order in the Tournament Index pagination logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@timrodz
timrodz merged commit 9209560 into main Feb 21, 2026
2 checks passed
@timrodz
timrodz deleted the fix/pagination-order branch February 21, 2026 08:02
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.

1 participant