Skip to content

fix(problems): place TabItem children directly inside Tabs to fix HMR context error#3697

Merged
KATO-Hiro merged 2 commits into
stagingfrom
#3696
Jun 20, 2026
Merged

fix(problems): place TabItem children directly inside Tabs to fix HMR context error#3697
KATO-Hiro merged 2 commits into
stagingfrom
#3696

Conversation

@KATO-Hiro

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

Copy link
Copy Markdown
Collaborator

close #3696

Summary by CodeRabbit

リリースノート

  • Documentation

    • スニペットのコンテキスト関連注意事項を追加しました。
  • Refactor

    • 問題ページのタブ切り替えUI構造を最適化し、安定性を向上させました。

KATO-Hiro and others added 2 commits June 20, 2026 06:35
… context error

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

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

coderabbitai Bot commented Jun 20, 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: 504e6a62-43a6-4dcc-b190-0ff90b50a981

📥 Commits

Reviewing files that changed from the base of the PR and between ee004dc and 6deacec.

📒 Files selected for processing (2)
  • .claude/rules/svelte-components.md
  • src/routes/problems/+page.svelte

📝 Walkthrough

Walkthrough

src/routes/problems/+page.svelte で、Tabs 外に定義したスニペット(problemListTab 等)経由でタブ内容を {@render} していた構成を廃止し、ProblemListTabItemTabs 内に直接配置する形へ変更。.claude/rules/svelte-components.md に Context trap 警告を追記。

Changes

Tabs コンテキストトラップ修正

Layer / File(s) Summary
スニペット削除・ProblemListTabItemをTabs内に直接配置
src/routes/problems/+page.svelte
Snippet import を削除。problemListTab / contestTable / listByGrade / gradeGuidelineTable の各スニペット定義と {@render} 呼び出しを除去し、ProblemListTabItemTabs 内に直接記述する形へ置換。
AIルール: Context trap 注意書き追加
.claude/rules/svelte-components.md
Snippets vs Components セクションに「スニペットはコンテキストプロバイダ外で定義して {@render} してはいけない」旨の Context trap 警告を追記。

🎯 Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

スニペット、コンテキストを外で捕まえた 🪤
getContext 叫ぶ、"Tabs はどこ?"と
インラインに直して、祖先の懐へ 🤝
エラーは消えて、タブが輝く ✨
Context trap、もう二度と踏まぬよう 📜

🚥 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タイトルは主な変更内容(TabItemをTabs内に直接配置してHMRコンテキストエラーを修正)を正確に説明しており、変更セットの焦点と一致しています。
Linked Issues check ✅ Passed PR変更は#3696で報告されたエラー「TabItem must be used within a Tabs component」を解決し、コンポーネント階層の再構成によるコンテキスト伝播の修正を実現しています。
Out of Scope Changes check ✅ Passed 全変更は#3696のHMRコンテキストエラー修正と関連ドキュメント更新に限定されており、スコープ外の変更は見当たりません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3696

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.

@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 6645715 into staging Jun 20, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3696 branch June 20, 2026 06:48
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.

[bug] Error: TabItem must be used within a Tabs component を修正しましょう

1 participant