Skip to content

feat(contest): add ICPC Prelim contest table provider#3635

Merged
KATO-Hiro merged 7 commits into
stagingfrom
#3633
Jun 10, 2026
Merged

feat(contest): add ICPC Prelim contest table provider#3635
KATO-Hiro merged 7 commits into
stagingfrom
#3633

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

close #3633

Summary by CodeRabbit

  • 新機能

    • ICPC国内予選(1998〜2025年)のタスクデータを追加
    • タスクテーブルにグループのメイン見出しを表示可能に
    • タスクタイトルの見出しスタイル(タグ/サイズ/太さ/余白)を任意指定可能に
    • AOJ ICPC 用のコンテストプリセットを追加
  • ドキュメント

    • Svelteコンポーネント規則とテスト指針、コンテストテーブル実装ガイドを拡充
  • テスト

    • ラベル割当・プロバイダ挙動などの包括的な単体テストを追加

KATO-Hiro and others added 6 commits June 10, 2026 11:37
- Add 28 years (1998-2025) of ICPCPrelim seed data to prisma/tasks.ts
- Implement AojIcpcPrelimProvider with per-year instantiation pattern
- Add buildAojIcpcLetterMap util with override map for judge-gap years
- Add titleFontSize optional field to ContestTableMetaData for per-provider font control
- Register AojIcpcPrelimProvider in contest_table_provider_groups
- Add plan.md under docs/dev-notes/2026-06-10/aoj-icpc-prelim-table/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ading

Replace the single titleFontSize field with a ContestTableTitleStyle struct
(headingTag, fontSize, fontWeight, bottomGap) to allow per-provider heading
customisation. Add optional mainTitle to ContestTablesMetaData and render it
as an h2 above the provider list in TaskTable; set it to 'ICPC 国内予選' for
the ICPC Prelim group.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and guide

Document lessons from the ICPC Prelim implementation: {@const} placement
restriction in Svelte templates, mutable module-level export testing pattern,
and the full Pattern 4 checklist covering year-range constants, generateTable/
getHeaderIdsForTask key alignment, override map testing, titleStyle, and
mainTitle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… refactor

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b11dff1-33dd-4d9d-a2b8-c5d0122291dd

📥 Commits

Reviewing files that changed from the base of the PR and between 9ed1dba and 31141d8.

📒 Files selected for processing (4)
  • .claude/skills/add-contest-table-provider/instructions.md
  • src/features/tasks/types/contest-table/contest_table_provider.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.test.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.ts

📝 Walkthrough

Walkthrough

ICPC国内予選(1998–2025)のコンテストテーブルを実装。年を受け取る AojIcpcPrelimProvider を複数生成し、ラベル上書き、動的見出しスタイル、グループ mainTitle 表示、関連データ・テスト・ドキュメントを追加。

Changes

ICPC国内予選テーブル実装

Layer / File(s) Summary
型定義とメタデータ拡張
src/features/tasks/types/contest-table/contest_table_provider.ts
ContestTableTitleStyle 型を新設(見出しタグ、フォント、ギャップ指定)、ContestTableMetaData.titleStyleContestTablesMetaData.mainTitle を追加。
ラベル生成ロジック
src/features/tasks/utils/contest-table/aoj_icpc_labels.ts, aoj_icpc_labels.test.ts
buildAojIcpcLetterMap が数値昇順で A/B/C… を割り当て、ICPC_PRELIM_LABEL_OVERRIDES で年度別上書きに対応。テストで mock-update パターン(beforeEach/afterEach)を検証。
AojIcpcPrelimProvider実装
src/features/tasks/utils/contest-table/aoj_icpc_providers.ts, aoj_icpc_providers.test.ts
年ベースのコンストラクタで複数インスタンス化。フィルタリング、テーブル生成、メタデータ返却を実装。1998/2023/2025 の境界、タイトル動的組み立て、ラベル上書き統合をテスト。
グループプリセット登録
src/features/tasks/utils/contest-table/contest_table_provider_groups.ts, contest_table_provider_groups.test.ts
ICPC_PRELIM_OLDEST_YEAR/LATEST_YEAR 定数、AojIcpcPrelim プリセット(最新年から降順ループ)、contestTableProviderGroups.aojIcpcPrelim 割り当て。
TaskTable見出しスタイル統合
src/features/tasks/components/contest-table/TaskTable.svelte
providerGroups.getMetadata() から groupMetadata 派生値取得、グループメインタイトル条件付き表示、各プロバイダ見出しを titleStyle で動的組み立て。
ICPC問題データ追加
prisma/tasks.ts
ICPCPrelim1998~2025 の問題データ(多数行)を s8pc-4 と JAGSpring2012 の間に挿入。
モジュール再エクスポート
src/features/tasks/utils/contest-table/contest_table_provider.ts
aoj_icpc_providers・aoj_icpc_labels を export *

実装ガイドとチェックリスト更新

Layer / File(s) Summary
パターン4チェックリスト拡張
.claude/skills/add-contest-table-provider/instructions.md
要件確認・実装チェック・Layer 5 登録手順に Pattern 4 項目追加。定数化、ラベル上書き、titleStyle、mainTitle 指定を明確化。
実装ガイドパターン4説明
docs/guides/how-to-add-contest-table-provider.md
パターン4の詳細説明ブロック新設。降順ループ例、ソート要件、上書きマップテスト手順、グループタイトル表示方法を網羅。
テスト・ドキュメント指針
.claude/rules/testing.md, .claude/rules/svelte-components.md
「Mutable Module-Level Exports」テストパターン、{@const} 制約と $derived 代替方法を記載。

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

📚 年度を積み重ね、ラベルを並べ、
見出しを装い、テーブルが躍る。
1998 から 2025 まで、
マルチインスタンスで光を放つ。
ICPC 国内予選、ついに完成。✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title clearly and concisely summarizes the main change: adding an ICPC Prelim contest table provider. The title is specific, avoids vague terms, and accurately reflects the primary objective.
Linked Issues check ✅ Passed Code changes comprehensively implement ICPC Prelim contest table provider with per-year instantiation, label override mapping, metadata styling support, and seed data. All core coding requirements from issue #3633 are met.
Out of Scope Changes check ✅ Passed All changes are directly scoped to ICPC Prelim provider implementation: documentation rules/guides, type definitions, seed data, provider logic, tests, and UI integration. No unrelated modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3633

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/add-contest-table-provider/instructions.md:
- Around line 32-34: The three long, overloaded sentences should be split into
clear, independent checklist items: one item describing the numeric-string
detection for task_table_index and that getHeaderIdsForTask must sort using
Number(a)-Number(b); a second item stating that display-only title transforms
(e.g. prepending a letter) must be implemented in generateTable and that
getHeaderIdsForTask must derive keys the same way to avoid missing cells; a
third item explaining the override map type (Record<string, Record<string,
string>>) per contest_id and the need to exercise that path in tests using
beforeEach/afterEach mutation. For each item, name the exact symbols to change
or test (getHeaderIdsForTask, generateTable, the override map) and keep each
line short and action-oriented so readers can implement the fixes without
ambiguity.

In `@src/features/tasks/types/contest-table/contest_table_provider.ts`:
- Around line 130-154: The JSDoc/example and provider usage reference a
nonstandard Tailwind class 'text-md' which may not exist; update the code and
docs so font sizes resolve reliably: either replace every occurrence of
'text-md' (e.g. in the ContestTableTitleStyle example/comment and in the
provider that sets fontSize: 'text-md') with a standard Tailwind class such as
'text-base' or 'text-lg', or add a matching entry under theme.extend.fontSize in
your Tailwind config to define 'md' -> desired size; ensure the
ContestTableTitleStyle documentation and the provider (where fontSize is set)
reflect the chosen standard or the newly added custom class so the renderer
applies the expected size.

In `@src/features/tasks/utils/contest-table/aoj_icpc_providers.ts`:
- Around line 51-62: The titleStyle.fontSize value in getMetadata() returns an
invalid Tailwind class 'text-md'; update the fontSize property in the
getMetadata() method (which returns ContestTableMetaData) from 'text-md' to a
valid Tailwind class such as 'text-base' (or 'text-lg' if larger text is
desired) so titleStyle.fontSize uses a supported class.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b41bc26-a8c9-4dcc-b165-92c04fb69de8

📥 Commits

Reviewing files that changed from the base of the PR and between 34998af and 9ed1dba.

📒 Files selected for processing (14)
  • .claude/rules/svelte-components.md
  • .claude/rules/testing.md
  • .claude/skills/add-contest-table-provider/instructions.md
  • docs/guides/how-to-add-contest-table-provider.md
  • prisma/tasks.ts
  • src/features/tasks/components/contest-table/TaskTable.svelte
  • src/features/tasks/types/contest-table/contest_table_provider.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_labels.test.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_labels.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.test.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.ts
  • src/features/tasks/utils/contest-table/contest_table_provider.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.test.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.ts

Comment thread .claude/skills/add-contest-table-provider/instructions.md Outdated
Comment thread src/features/tasks/types/contest-table/contest_table_provider.ts
Comment thread src/features/tasks/utils/contest-table/aoj_icpc_providers.ts
text-md is not a valid Tailwind v4 utility; text-base is the correct
font-size class. Also simplifies the skill instructions for pattern 2/3.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

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 6203e26 into staging Jun 10, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3633 branch June 10, 2026 13:10
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.

[feat] テーブル「ICPC・国内予選」を追加しましょう

1 participant