Skip to content

Conversation

@ianpaschal
Copy link
Owner

@ianpaschal ianpaschal commented Jul 30, 2025

Improvements

  • Simplified and centralized the logic for displaying user and competitor information in badges, removing internal data fetching and relying on passed-in objects.
  • Streamlined pairing and ranking components to use direct data objects instead of IDs, improving performance and maintainability.

* feat: Add tournament pairing detail page

* feat: Add score to match results

* feat: Improve match result editing and creation for tournaments

* fix: Improve dashboard styling

* feat: Improve match result editing and creation for tournaments (pt2)
* refactor: Tournament actions

* refactor: Remove IDs from <IdentityBadge/> to reduce Convex fn calls
@vercel
Copy link

vercel bot commented Jul 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
combat-command ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 9:43pm

@coderabbitai
Copy link

coderabbitai bot commented Jul 30, 2025

Walkthrough

This change introduces a backend-driven approach for determining available tournament actions, removing local role and state checks from the frontend. Several new backend helpers and queries are added to support this, including functions to fetch tournament actions and player user IDs. The frontend is refactored to consume these backend-provided lists, simplifying identity and pairing components, and updating type definitions accordingly. Some data fetching logic is centralized, and type signatures are streamlined.

Changes

Cohort / File(s) Change Summary
Backend: Tournament Action Availability
convex/_model/tournaments/queries/getAvailableTournamentActions.ts, convex/_model/tournaments/_helpers/getTournamentNextRound.ts, convex/_model/tournaments/_helpers/getTournamentPlayerUserIds.ts, convex/_model/tournaments/_helpers/deepenTournament.ts, convex/_model/tournaments/index.ts, convex/tournaments.ts, src/services/tournaments.ts
Introduces backend helpers and a query to determine available tournament actions (getAvailableTournamentActions), including logic for next round calculation and player user ID extraction. Exports are updated, and a new frontend query hook is provided.
Frontend: Tournament Actions Provider Refactor
src/components/TournamentActionsProvider/TournamentActionsProvider.hooks.tsx
Removes local logic for determining action availability, now relying on backend-provided lists. Updates action definitions and filtering accordingly.
Identity & Player Name Simplification
src/components/IdentityBadge/IdentityBadge.hooks.tsx, src/components/IdentityBadge/IdentityBadge.tsx, src/components/IdentityBadge/IdentityBadge.types.ts, src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.hooks.ts, src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.types.ts
Removes all internal async fetching of user/competitor data in favor of using fully resolved objects passed via props. Type definitions are updated to remove userId/competitorId fields. Player name hooks are simplified to rely on provided objects.
Pairing Row & Utilities Refactor
src/components/TournamentPairingRow/TournamentPairingRow.tsx, src/components/TournamentPairingRow/TournamentPairingRow.utils.tsx
Narrows pairing prop types, removes type guards and support for draft pairings, and simplifies badge rendering logic to use only present competitor objects or placeholders.
Tournament Pairings Page & Dialog Utilities
src/pages/TournamentPairingsPage/TournamentPairingsPage.utils.tsx, src/pages/TournamentPairingsPage/components/ConfirmPairingsDialog/ConfirmPairingsDialog.tsx, src/pages/TournamentPairingsPage/components/ConfirmPairingsDialog/ConfirmPairingsDialog.utils.tsx
Refactors competitor badge rendering to use full competitor objects, introduces a utility for table column definitions, and centralizes column logic for confirm pairings dialog.
Dashboard Rankings Data Fetch
src/pages/DashboardPage/components/ActiveTournament/ActiveTournament.tsx, src/pages/DashboardPage/components/ActiveTournament/ActiveTournament.utils.tsx
Switches from prop-based to hook-based fetching for tournament competitor rankings, updates type usage, and adjusts rendering logic for rankings.
Pairing Detail Page Button Logic
src/pages/TournamentPairingDetailPage/TournamentPairingDetailPage.tsx
Adds a requirement that the tournament's current round be defined before showing the "Add Match Result" button.
Package Version Bump
package.json
Updates the package version from "0.0.0" to "1.8.5".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

  • Complexity is high due to the introduction of new backend logic, significant frontend refactors, type changes, and removal of local state logic in favor of backend-driven data. The review requires careful attention to backend/frontend contract alignment, type safety, and correct removal of legacy logic.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 4f2d473 and b586df6.

⛔ Files ignored due to path filters (2)
  • convex/_generated/api.d.ts is excluded by !**/_generated/**
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (22)
  • convex/_model/tournaments/_helpers/deepenTournament.ts (2 hunks)
  • convex/_model/tournaments/_helpers/getTournamentNextRound.ts (1 hunks)
  • convex/_model/tournaments/_helpers/getTournamentPlayerUserIds.ts (1 hunks)
  • convex/_model/tournaments/index.ts (1 hunks)
  • convex/_model/tournaments/queries/getAvailableTournamentActions.ts (1 hunks)
  • convex/tournaments.ts (1 hunks)
  • package.json (1 hunks)
  • src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.hooks.ts (1 hunks)
  • src/components/FowV4MatchResultDetails/FowV4MatchResultDetails.types.ts (1 hunks)
  • src/components/IdentityBadge/IdentityBadge.hooks.tsx (1 hunks)
  • src/components/IdentityBadge/IdentityBadge.tsx (1 hunks)
  • src/components/IdentityBadge/IdentityBadge.types.ts (1 hunks)
  • src/components/TournamentActionsProvider/TournamentActionsProvider.hooks.tsx (3 hunks)
  • src/components/TournamentPairingRow/TournamentPairingRow.tsx (1 hunks)
  • src/components/TournamentPairingRow/TournamentPairingRow.utils.tsx (1 hunks)
  • src/pages/DashboardPage/components/ActiveTournament/ActiveTournament.tsx (3 hunks)
  • src/pages/DashboardPage/components/ActiveTournament/ActiveTournament.utils.tsx (2 hunks)
  • src/pages/TournamentPairingDetailPage/TournamentPairingDetailPage.tsx (1 hunks)
  • src/pages/TournamentPairingsPage/TournamentPairingsPage.utils.tsx (1 hunks)
  • src/pages/TournamentPairingsPage/components/ConfirmPairingsDialog/ConfirmPairingsDialog.tsx (2 hunks)
  • src/pages/TournamentPairingsPage/components/ConfirmPairingsDialog/ConfirmPairingsDialog.utils.tsx (1 hunks)
  • src/services/tournaments.ts (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Join our Discord community for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ianpaschal ianpaschal merged commit 343fe8f into main Jul 30, 2025
3 checks passed
@ianpaschal ianpaschal deleted the release-v1.8.5 branch July 30, 2025 21:54
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.

2 participants