Skip to content

Conversation

@KATO-Hiro
Copy link
Collaborator

@KATO-Hiro KATO-Hiro commented Jul 13, 2025

close #2321

Summary by CodeRabbit

  • New Features

    • Added a new contest table view for JOI First Qualifying Rounds, enabling focused filtering and enhanced round labeling.
    • Expanded the problem set with numerous new JOI contest problems from 2020 to 2025, available for browsing and practice.
  • Improvements

    • Enhanced table layout customization by introducing adjustable round label column widths for improved readability.
  • Tests

    • Introduced comprehensive tests covering the new JOI First Qualifying Round contest table view and display configurations.

Copilot AI review requested due to automatic review settings July 13, 2025 06:32
@coderabbitai
Copy link

coderabbitai bot commented Jul 13, 2025

"""

Walkthrough

The changes introduce a new contest table provider for JOI first qualification rounds, update display configurations to allow dynamic round label widths, and add numerous JOI contest problems to the tasks dataset. The provider, display logic, and types are updated, and comprehensive tests are added to verify the new functionality and configuration.

Changes

File(s) Change Summary
prisma/tasks.ts Added new JOI contest problems (2020–2025) to the exported tasks array.
src/lib/components/TaskTables/TaskTable.svelte Made round label column width dynamic via display config; updated cell width logic for responsive columns.
src/lib/types/contest_table_provider.ts Added roundLabelWidth property to ContestTableDisplayConfig interface.
src/lib/utils/contest_table_provider.ts Introduced JOIFirstQualRoundProvider for JOI first qualification rounds; updated display config logic; registered new provider group.
src/test/lib/utils/contest_table_provider.test.ts Added tests for JOIFirstQualRoundProvider; extended mocks and assertions for display config and round label width.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TableComponent
    participant JOIFirstQualRoundProvider
    participant DataStore

    User->>TableComponent: Selects JOI First Qual Round Table
    TableComponent->>JOIFirstQualRoundProvider: Request contest table data
    JOIFirstQualRoundProvider->>DataStore: Fetch tasks
    DataStore-->>JOIFirstQualRoundProvider: Return all tasks
    JOIFirstQualRoundProvider->>JOIFirstQualRoundProvider: Filter tasks by JOI first qual round regex
    JOIFirstQualRoundProvider-->>TableComponent: Return filtered tasks and display config
    TableComponent->>TableComponent: Render table with dynamic round label width
Loading

Assessment against linked issues

Objective Addressed Explanation
Enable table display for JOI first qualification rounds (#2321)
Ensure round label column width is configurable for JOI first qualification round tables (#2321)
Add and display new JOI contest problems for first qualification rounds (#2321)
Provide comprehensive tests for new JOI table provider (#2321)

Poem

A table for JOI, now shining bright,
With rounds and widths that fit just right.
Problems aplenty, new tasks abound,
The rabbit hops and spins around!
Dynamic columns, tests galore—
The codebase grows, let’s hop for more!
((_/)
(='.'=)
(")_(")
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between f95ade8 and 50f3957.

📒 Files selected for processing (1)
  • src/lib/utils/contest_table_provider.ts (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/utils/contest_table_provider.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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? Create a ticket on our support page 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 docstrings to generate docstrings for this 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.

@KATO-Hiro KATO-Hiro changed the title ✨ Add tasks to seed (#2321) ✨ Add JOI first qual round to contest table (#2321) Jul 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support and seed data for the JOI First Qualifying Round while introducing a dynamic roundLabelWidth display configuration and updating the task table component to use it.

  • Introduces JOIFirstQualRoundProvider (filtering, metadata, display config) and corresponding tests.
  • Extends ContestTableDisplayConfig with roundLabelWidth and updates TaskTable.svelte to apply it.
  • Populates prisma/tasks.ts with JOI tasks for 2020–2025.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/test/lib/utils/contest_table_provider.test.ts Added tests for the new JOI First Qual Round provider
src/lib/utils/contest_table_provider.ts Implemented JOIFirstQualRoundProvider and roundLabelWidth
src/lib/types/contest_table_provider.ts Added roundLabelWidth to ContestTableDisplayConfig
src/lib/components/TaskTables/TaskTable.svelte Updated classes to use the new roundLabelWidth setting
prisma/tasks.ts Seeded additional JOI tasks across multiple contest years
Comments suppressed due to low confidence (3)

src/lib/utils/contest_table_provider.ts:101

  • [nitpick] Comment refers to "task index column" but this setting controls the round label width; update the wording for clarity.
      roundLabelWidth: 'xl:w-16', // Default width for task index column

src/lib/components/TaskTables/TaskTable.svelte:206

  • Svelte does not support mustache interpolation inside a quoted class string. Use a bound attribute or string concatenation, e.g., class={"w-full " + contestTable.displayConfig.roundLabelWidth + " px-2 text-center"}.
              class="w-full {contestTable.displayConfig.roundLabelWidth} px-2 text-center"

src/lib/components/TaskTables/TaskTable.svelte:236

  • Interpolation inside the class attribute won’t work as written. Switch to a bound class attribute or concatenate the string dynamically.
                      .roundLabelWidth} truncate px-2 py-2 text-center bg-gray-50 dark:bg-gray-800"

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/lib/utils/contest_table_provider.ts (1)

276-276: Consider anchoring the regex pattern for stricter validation.

The regex pattern correctly matches JOI first qualification round contest IDs, but could be made more strict by anchoring the end.

-const regexForJoiFirstQualRound = /^(joi)(\d{4})(yo1)(a|b|c)/i;
+const regexForJoiFirstQualRound = /^(joi)(\d{4})(yo1)(a|b|c)$/i;

This prevents potential partial matches while maintaining the same functionality.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2c4f2a9 and f95ade8.

📒 Files selected for processing (5)
  • prisma/tasks.ts (4 hunks)
  • src/lib/components/TaskTables/TaskTable.svelte (3 hunks)
  • src/lib/types/contest_table_provider.ts (1 hunks)
  • src/lib/utils/contest_table_provider.ts (6 hunks)
  • src/test/lib/utils/contest_table_provider.test.ts (9 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: preview
🔇 Additional comments (10)
src/lib/types/contest_table_provider.ts (1)

128-128: LGTM! Clean interface extension with proper documentation.

The addition of roundLabelWidth property is well-documented and appropriately typed. The JSDoc example clearly demonstrates the expected Tailwind CSS class format.

Also applies to: 134-134

src/lib/components/TaskTables/TaskTable.svelte (2)

109-112: LGTM! Improved responsive design for table cells.

The conditional logic enhances responsive behavior by using more granular breakpoints (md, lg) when there are 5+ columns, which should provide better layout optimization across different screen sizes.


205-210: LGTM! Consistent implementation of dynamic round label width.

The replacement of hardcoded xl:w-16 classes with dynamic contestTable.displayConfig.roundLabelWidth binding is implemented consistently across both header and body cells. This properly enables different contest providers to specify their own round label column widths.

Also applies to: 235-236

prisma/tasks.ts (1)

4823-5128: LGTM! JOI contest problems added correctly.

The new JOI first qualification round problems are properly formatted and follow the established data structure patterns. All entries have correct ID formatting, proper title structure, and are organized by contest and problem index.

src/test/lib/utils/contest_table_provider.test.ts (2)

27-48: Mock implementations updated correctly for JOI contests.

The mock functions properly classify JOI contests and format their labels according to the expected pattern.


281-396: Comprehensive test coverage for JOIFirstQualRoundProvider.

The test suite thoroughly covers all aspects of the new JOI provider including filtering, metadata, display configuration, label formatting, and edge case handling. The tests are well-structured and follow established patterns.

src/lib/utils/contest_table_provider.ts (4)

101-101: LGTM: Good addition of default round label width.

The default roundLabelWidth: 'xl:w-16' provides a sensible baseline for the dynamic width configuration while maintaining backward compatibility.


234-234: LGTM: Consistent empty width configuration for task-index-focused providers.

Setting roundLabelWidth: '' for EDPC and TDPC providers is appropriate since these providers show task indexes instead of round labels, ensuring they don't inherit the default width.

Also applies to: 266-266


278-309: LGTM: Well-implemented JOI provider following established patterns.

The JOIFirstQualRoundProvider implementation is consistent with existing providers:

  • Proper contest type validation before regex filtering
  • Appropriate metadata with Japanese titles
  • Wider round label width (xl:w-28) suitable for longer JOI contest names
  • Clean round label formatting by removing the prefix

The implementation follows the documented step-by-step pattern for adding new providers.


457-461: LGTM: Proper provider registration and export.

The new JOI provider is correctly:

  • Registered in prepareContestProviderPresets() with appropriate labels and aria attributes
  • Exported in contestTableProviderGroups using the expected key naming convention
  • Associated with the correct ContestType.JOI

Also applies to: 470-470

Copy link
Collaborator Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro KATO-Hiro merged commit 674ab7f into staging Jul 13, 2025
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #2321 branch July 13, 2025 08:04
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.

[Feature] JOI・一次予選をテーブル形式で表示できるようにしましょう

2 participants