Skip to content

⚡ Bolt: optimize lesson progress database queries#78

Open
projectamazonph wants to merge 1 commit into
mainfrom
bolt/optimize-progress-queries-493630936714093197
Open

⚡ Bolt: optimize lesson progress database queries#78
projectamazonph wants to merge 1 commit into
mainfrom
bolt/optimize-progress-queries-493630936714093197

Conversation

@projectamazonph

@projectamazonph projectamazonph commented Jul 23, 2026

Copy link
Copy Markdown
Owner

💡 What: Scoped progress queries in the Dashboard (src/app/(dashboard)/dashboard/page.tsx) and Courses page (src/app/(dashboard)/courses/page.tsx) using { lessonId: { in: allLessonIds } }.
🎯 Why: Querying user's entire historical lesson progress on multi-course overview pages scales poorly and causes bloated database payloads and memory allocations.
📊 Impact: Decreases database payload size and API memory allocation, ensuring O(N) database reads scoped strictly to active lesson IDs.
🔬 Measurement: Verified with pnpm lint, pnpm typecheck, and standard test runs.


PR created automatically by Jules for task 493630936714093197 started by @projectamazonph

Summary by CodeRabbit

  • Performance Improvements
    • Improved course and dashboard loading by retrieving lesson progress only for lessons in currently published courses.
    • Avoided unnecessary progress queries when no relevant lessons are available.
    • Preserved course completion percentages and dashboard statistics while reducing excess data processing.

… courses

Scope lesson progress database queries on multi-course overview and dashboard pages to only retrieve progress rows matching active lesson IDs instead of fetching the student's entire historical database table context. This prevents bloated payloads and high memory consumption on PostgreSQL database and API levels.

Co-authored-by: projectamazonph <286085559+projectamazonph@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 23, 2026 13:53
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bea0e3b0-fe30-469a-8bdb-b943b3f2156a

📥 Commits

Reviewing files that changed from the base of the PR and between dabee94 and fb8adaf.

📒 Files selected for processing (3)
  • .jules/bolt.md
  • src/app/(dashboard)/courses/page.tsx
  • src/app/(dashboard)/dashboard/page.tsx

📝 Walkthrough

Walkthrough

Dashboard and courses pages now collect lesson IDs from published course hierarchies and restrict lessonProgress queries to those IDs, with empty results when no lessons are available. A journal entry documents the scoped-query approach.

Changes

Lesson progress query scoping

Layer / File(s) Summary
Scope progress retrieval to published lessons
.jules/bolt.md, src/app/(dashboard)/courses/page.tsx, src/app/(dashboard)/dashboard/page.tsx
Both pages derive lesson IDs from published courses, query progress for the current user and those IDs, and preserve existing progress-map and completion calculations. The journal documents the scoped query pattern.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 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 The title accurately summarizes the main change: optimizing lesson progress database queries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 bolt/optimize-progress-queries-493630936714093197

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

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.

2 participants