Skip to content

perf(workbooks): skip heavy fetches for anonymous users#3665

Merged
KATO-Hiro merged 3 commits into
stagingfrom
#3664
Jun 14, 2026
Merged

perf(workbooks): skip heavy fetches for anonymous users#3665
KATO-Hiro merged 3 commits into
stagingfrom
#3664

Conversation

@KATO-Hiro

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

Copy link
Copy Markdown
Collaborator

close #3664

Summary by CodeRabbit

リリースノート

  • Performance

    • ワークブックページの読み込み性能を最適化しました。
  • その他

    • ページの動作要件に関する内部コメントを追加しました。

KATO-Hiro and others added 3 commits June 14, 2026 08:43
docs(workbooks): add Phase 2 plan for anonymous early return

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

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 14, 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: acb5af29-a437-4913-878c-90d9b94855d8

📥 Commits

Reviewing files that changed from the base of the PR and between 17efa94 and e63197f.

📒 Files selected for processing (2)
  • src/routes/workbooks/+page.server.ts
  • src/routes/workbooks/+page.svelte

📝 Walkthrough

Walkthrough

workbooks/+page.server.tsload 関数に匿名ユーザー向け早期 return ガードを追加。loggedInUser が存在しない場合は DB/CRUD 取得を一切行わず空の形を即返却する。ログイン済み前提の処理を整理し、TaskGrade/TaskResult の型 import も追加。+page.svelte には説明コメントのみ追加。

Changes

匿名ユーザー向けロード最適化

Layer / File(s) Summary
早期 return ガードとタスク結果取得の整理
src/routes/workbooks/+page.server.ts
TaskGrade/TaskResult の型 import 追加。loggedInUser が null の場合に空の workbooksavailableCategories・各 Map・loggedInUser: null を即返す早期 return ブロックを追加。Promise.all 内のタスク結果取得をログイン済み前提で無条件化し、referencedTaskIds の条件を tab === CURRICULUM のみに簡略化。
Svelte 側への説明コメント
src/routes/workbooks/+page.svelte
タブ UI 周辺に、サーバー側フェッチスキップ仕様とガード境界に関する説明コメントを追加(実行挙動変更なし)。

推定コードレビュー工数

🎯 2 (Simple) | ⏱️ ~10 minutes

関連 PR

  • AtCoder-NoviSteps/AtCoderNoviSteps#3663: 同じ +page.server.tsreferencedTaskIdsCURRICULUM タブに限定する最適化を扱っており、本 PR と同一のフェッチ最適化の流れにある。

Poem

🤖 Bot が来ても空ぶりで
ログインなければ即リターン
Map も配列もからっぽで
無駄な DB アクセス ゼロへ
匿名さん、お帰りなさい 👋

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRタイトルは変更の主要な目的である「匿名ユーザーの重いデータ取得スキップによるパフォーマンス改善」を簡潔かつ明確に説明しており、実装内容と完全に一致しています。
Linked Issues check ✅ Passed 実装は#3664の要件「匿名ユーザに対する不要なデータ取得の省略」を完全に満たしており、loggedInUserが存在しない場合に重い取得処理をスキップする仕様変更が行われています。
Out of Scope Changes check ✅ Passed 全ての変更が#3664で指摘されたパフォーマンス最適化の範囲内であり、公開シグネチャの変更や無関連な実装は含まれていません。

✏️ 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 #3664

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 8fe32e5 into staging Jun 14, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3664 branch June 14, 2026 09:46
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.

[perf] 問題集一覧で匿名ユーザの場合は load 処理のうち不要なものは省略しましょう

1 participant