Skip to content

feat(contest): add columnWrapThreshold to ContestTableDisplayConfig#3650

Merged
KATO-Hiro merged 5 commits into
stagingfrom
#3649
Jun 13, 2026
Merged

feat(contest): add columnWrapThreshold to ContestTableDisplayConfig#3650
KATO-Hiro merged 5 commits into
stagingfrom
#3649

Conversation

@KATO-Hiro

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

Copy link
Copy Markdown
Collaborator

close #3649

Summary by CodeRabbit

リリースノート

  • 新機能

    • コンテストテーブルの列折り返し動作を columnWrapThreshold で制御可能に。列数が閾値を超える場合の表示をカスタマイズできます。
  • 改善

    • グループメタデータの構造を簡素化。コンテストテーブルのヘッダースタイル表示を改善。
  • ドキュメント

    • コンテストテーブルプロバイダー追加ガイドを更新。新しい設定オプションの使用方法を明確化。
  • テスト

    • 列折り返し機能の検証テストを追加。

KATO-Hiro and others added 4 commits June 13, 2026 02:05
…roup heading

Change heading from h3/text-base/font-normal to h2/text-xl/font-bold to match
the visual hierarchy of other contest table groups. Remove mainTitle from the
provider group registration to avoid redundant heading alongside per-year titles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mainTitle was opt-in but never used in practice — the ICPC Prelim group
that prompted its addition was updated to use per-provider titleStyle instead.
Remove the field, the rendering snippet in TaskTable, and all related docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extracts the hardcoded wrap threshold (8) into a configurable field on
ContestTableDisplayConfig, allowing per-provider overrides. AojIcpcPrelim
sets it to 6 to match its fixed 6-column layout. Also extracts
getBodyRowClasses into a tested utility under _utils/.

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

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

coderabbitai Bot commented Jun 13, 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: 00ea5c9d-00a6-439c-a443-4f63b999ae2c

📥 Commits

Reviewing files that changed from the base of the PR and between 55183c0 and 973991e.

📒 Files selected for processing (12)
  • .claude/rules/svelte-components.md
  • .claude/skills/add-contest-table-provider/instructions.md
  • docs/guides/how-to-add-contest-table-provider.md
  • src/features/tasks/components/contest-table/TaskTable.svelte
  • src/features/tasks/components/contest-table/_utils/contest_table_layout.test.ts
  • src/features/tasks/components/contest-table/_utils/contest_table_layout.ts
  • 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
  • src/features/tasks/utils/contest-table/contest_table_provider_base.test.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.test.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.ts
💤 Files with no reviewable changes (2)
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.test.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.ts

📝 Walkthrough

Walkthrough

型定義から見出し・折り返しロジック、コンポーネント統合、具体的なプロバイダー実装へと進む一連の変更。mainTitle 廃止と columnWrapThreshold 導入により、テーブル体裁を統一制御。

Changes

テーブル見出し・折り返し体裁の統一

Layer / File(s) Summary
型定義:メタデータと表示設定の更新
src/features/tasks/types/contest-table/contest_table_provider.ts
ContestTablesMetaData から mainTitle を削除して buttonLabel/ariaLabel のみに。ContestTableDisplayConfig に columnWrapThreshold?: number(列折り返しの閾値、未指定時デフォルト8)を追加。
レイアウト判定ロジックの実装と検証
src/features/tasks/components/contest-table/_utils/contest_table_layout.ts, _utils/contest_table_layout.test.ts
getBodyRowClasses(totalColumns, wrapThreshold=8) 関数を実装。totalColumns が閾値を超えると flex flex-wrap、以下なら flex flex-wrap xl:table-row を返す。デフォルト・undefined・カスタム閾値(6)の3パターンを検証。
コンポーネント統合:TaskTable の更新
src/features/tasks/components/contest-table/TaskTable.svelte
getBodyRowClasses をユーティリティから import。groupMetadata の mainTitle 派生データを削除し、グループ見出しブロック自体も削除。TableBodyRow の class 計算へ contestTable.displayConfig.columnWrapThreshold を引数として追加。
ICPC予選プロバイダーの見出し・折り返し設定
src/features/tasks/utils/contest-table/aoj_icpc_providers.ts, aoj_icpc_providers.test.ts
AojIcpcPrelimProvider の titleStyle を h3/text-base/font-normal から h2/text-xl/font-bold に更新。getDisplayConfig() で columnWrapThreshold: 6 を明示。テスト期待値も一致するよう修正。
プロバイダー基盤・グループプリセットの検証
src/features/tasks/utils/contest-table/contest_table_provider_base.test.ts, contest_table_provider_groups.ts, contest_table_provider_groups.test.ts
ContestTableProviderBase テストで columnWrapThreshold がデフォルト undefined になることを確認。AojIcpcPrelim プリセットから mainTitle 削除。グループメタデータテストを mainTitle から buttonLabel/ariaLabel 中心に更新。
実装ガイド・規則ドキュメントの更新
.claude/rules/svelte-components.md, .claude/skills/add-contest-table-provider/instructions.md, docs/guides/how-to-add-contest-table-provider.md
実装チェックリストに columnWrapThreshold(デフォルト8、AOJ系は6が標準)の説明を追加。mainTitle 廃止に代わり getMetadata() で titleStyle(headingTag/fontSize/fontWeight)を指定する方法を記載。テスト例・設定例も columnWrapThreshold を明示。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

グループのタイトルはもう古い 📜
wrapThreshold は数えて判定 🔢
h2 に見出し格上げ ⬆️
titleStyle で見た目調整🎨
テーブルの体裁、すっきり統一✨

🚥 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 PR タイトルは columnWrapThresholdContestTableDisplayConfig に追加することを明確に示しており、変更の主要な目的と一致しています。
Linked Issues check ✅ Passed PR は #3649 で指摘されたテーブルの体裁修正(titleStyle の変更、mainTitle の削除、columnWrapThreshold の導入)をすべて実装しており、要件を満たしています。
Out of Scope Changes check ✅ Passed 全変更が columnWrapThreshold 導入と mainTitle 削除(体裁修正)に関連する適切なスコープ内の修正であり、無関係な変更は含まれていません。
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 #3649

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.

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 7915be4 into staging Jun 13, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3649 branch June 13, 2026 09:32
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.

[ui/ux] テーブル ICPC・国内予選のタイトルやテーブルの体裁を修正しましょう

1 participant