Skip to content

feat(social): show ladder position in /rank and /leaderboard - #29

Merged
raigon-pawa merged 1 commit into
mainfrom
feat/rank-position
Jul 2, 2026
Merged

feat(social): show ladder position in /rank and /leaderboard#29
raigon-pawa merged 1 commit into
mainfrom
feat/rank-position

Conversation

@raigon-pawa

Copy link
Copy Markdown
Owner

Leveling polish:

  • /rank now shows your #position on the server ladder (not just level/XP).
  • /leaderboard appends your rank when you're outside the top 10 (… (you)).

New rank_position(db, guild_id, level, xp) counts members strictly above (level, xp) and adds 1 — ties broken by XP, matching the leaderboard ordering.

Testing

  • New test_rank_position.py: ordering, XP tie-break, new-member-last, above-all, guild isolation.
  • ruff + ruff format + pytest (21 tests) green.

🤖 Generated with Claude Code

Add rank_position(db, guild_id, level, xp): count members strictly above and +1.
/rank now shows "#N"; /leaderboard appends the caller's own rank when they're
outside the top 10. Unit-tested (ties broken by xp, guild isolation, edges).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@raigon-pawa
raigon-pawa merged commit 1e08f42 into main Jul 2, 2026
2 checks passed
@raigon-pawa
raigon-pawa deleted the feat/rank-position branch July 2, 2026 12:16
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