Conversation
…05–2026) - Rename aoj_icpc_labels.ts → aoj_labels.ts, neutralising all exported names (formatAojIcpcTitle → formatAojTitle, ICPC_LABEL_OVERRIDES → AOJ_LABEL_OVERRIDES, etc.) so ICPC and JAG providers can share the same helpers - Fix regexForJag to match JAGPrelim2016A / JAGPrelim2016B (trailing bare letter) - Add JagPrelimProvider (Pattern 4) with optional suffix param for the 2016 A/B split - Register aojJagPrelim group (2005–2026, 23 providers) in contest_table_provider_groups - Seed 169 JAGPrelim tasks (2005–2026) into prisma/tasks.ts - Add aoj_jag_providers.test.ts covering metadata, filter isolation, label assignment, 2016 A/B split, and year boundary behaviour - Update aoj_icpc_providers.ts/test.ts and TaskTableBodyCell.svelte to use renamed exports Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ementation learnings - Skill: add note to skip Layers 1–2 when an existing ContestType covers the family - Guide: update AOJ_LABEL_OVERRIDES / formatAojTitle references (aoj_icpc_labels rename) - Guide: document suffix-based A/B split pattern (JAGPrelim2016A/B) with code example - Guide: add troubleshooting entry for silent regex miss on new contest_id shapes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAOJ JAG国内予選のテーブル処理を追加するため、ラベル処理をAOJ汎用へ統合し、新規プロバイダとプリセットを実装しました。分類regexを拡張し、JAG Prelimの大量データ、参照ケース、実装ガイドも更新されています。 ChangesAOJラベル汎用化
AOJ JAG Prelim プロバイダ
データと参照ケース
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
…DisplayConfig Previously untested after the aoj_icpc_labels → aoj_labels rename. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/features/tasks/utils/contest-table/aoj_labels.test.ts (1)
3-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
sortAojHeaderIdsとbuildAojDisplayConfigの隣接ユニットテストを追加すべき
aoj_labels.tsから export されている4関数のうち、formatAojTitleとbuildAojLetterMapには直接テストが存在しますが、sortAojHeaderIdsとbuildAojDisplayConfigにはこのテストファイル内に直接テストがありません。プロバイダーテストで間接的に検証されていますが、パスインストラクション(src/**/*utils/**の各関数には隣接ユニットテストが必須)に照らすと不足しています。♻️ 提案するテスト追加
describe('formatAojTitle', () => { // ...existing tests... }); +describe('sortAojHeaderIds', () => { + test('deduplicates and sorts task_table_index numerically ascending', () => { + const filtered = [ + { task_table_index: '1665' }, + { task_table_index: '1664' }, + { task_table_index: '1665' }, + ] as unknown as TaskResults; + const result = sortAojHeaderIds(filtered); + expect(result).toEqual(['1664', '1665']); + }); + + test('returns empty array for empty input', () => { + expect(sortAojHeaderIds([] as unknown as TaskResults)).toEqual([]); + }); +}); + +describe('buildAojDisplayConfig', () => { + test('returns config with AOJ-specific settings', () => { + const config = buildAojDisplayConfig(); + expect(config).toEqual({ + isShownHeader: false, + isShownRoundLabel: false, + roundLabelWidth: '', + tableBodyCellsWidth: 'w-1/2 xs:w-1/3 sm:w-1/4 md:w-1/5 lg:w-1/6 px-1 py-2', + isShownTaskIndex: true, + columnWrapThreshold: 6, + }); + }); +}); + describe('buildAojLetterMap', () => {🤖 Prompt for 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. In `@src/features/tasks/utils/contest-table/aoj_labels.test.ts` around lines 3 - 143, Add direct adjacent unit tests in aoj_labels.test.ts for the exported sortAojHeaderIds and buildAojDisplayConfig helpers, since they are currently only covered indirectly. Use the existing aoj_labels symbols and mirror the style of the formatAojTitle and buildAojLetterMap suites to verify their core behavior explicitly, including any ordering and display-config output expected from each function.Source: Path instructions
🤖 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 `@src/features/tasks/utils/contest-table/aoj_jag_providers.ts`:
- Around line 24-25: The suffix field in the AOJ/JAG provider class is typed too
loosely compared to its intended values. Update the `suffix` member on
`AojJagProviders` to use the narrower `'' | 'A' | 'B'` type, and make sure the
constructor assignment and any related usages still align with that union so the
type information from the constructor is preserved.
In `@src/lib/utils/contest.ts`:
- Line 3: regexForJag currently allows an optional trailing uppercase letter
even when no -day suffix is present, which can widen matching too much. Update
the regexForJag pattern in contest.ts so the optional single-letter suffix is
only accepted when it follows a -day segment, keeping the existing JAG year/type
matching intact while preventing unknown standalone suffixes from being
classified as AOJ_JAG.
---
Outside diff comments:
In `@src/features/tasks/utils/contest-table/aoj_labels.test.ts`:
- Around line 3-143: Add direct adjacent unit tests in aoj_labels.test.ts for
the exported sortAojHeaderIds and buildAojDisplayConfig helpers, since they are
currently only covered indirectly. Use the existing aoj_labels symbols and
mirror the style of the formatAojTitle and buildAojLetterMap suites to verify
their core behavior explicitly, including any ordering and display-config output
expected from each function.
🪄 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: df1a957f-93e4-4d92-8eec-be74a5e2b74a
📒 Files selected for processing (16)
.claude/skills/add-contest-table-provider/instructions.mddocs/guides/how-to-add-contest-table-provider.mdprisma/tasks.tssrc/features/tasks/components/contest-table/TaskTableBodyCell.sveltesrc/features/tasks/utils/contest-table/aoj_icpc_providers.test.tssrc/features/tasks/utils/contest-table/aoj_icpc_providers.tssrc/features/tasks/utils/contest-table/aoj_jag_providers.test.tssrc/features/tasks/utils/contest-table/aoj_jag_providers.tssrc/features/tasks/utils/contest-table/aoj_labels.test.tssrc/features/tasks/utils/contest-table/aoj_labels.tssrc/features/tasks/utils/contest-table/contest_table_provider.tssrc/features/tasks/utils/contest-table/contest_table_provider_groups.test.tssrc/features/tasks/utils/contest-table/contest_table_provider_groups.tssrc/lib/utils/contest.tssrc/test/lib/utils/test_cases/contest_name_labels.tssrc/test/lib/utils/test_cases/contest_type.ts
… 'B' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
close #3828
Summary by CodeRabbit