Skip to content

🧹 [code health improvement] Extract page loading logic in curriculum viewer#7

Draft
dynamikdev wants to merge 1 commit intomasterfrom
fix-code-health-curriculum-11833162593342191724
Draft

🧹 [code health improvement] Extract page loading logic in curriculum viewer#7
dynamikdev wants to merge 1 commit intomasterfrom
fix-code-health-curriculum-11833162593342191724

Conversation

@dynamikdev
Copy link
Copy Markdown
Owner

This PR addresses the code health task in src/ui/curriculum.rs by extracting the page loading logic into a smaller, cleaner helper function. It improves code readability while maintaining the exact same functional behavior.


PR created automatically by Jules for task 11833162593342191724 started by @dynamikdev

*   🎯 **What:** Extracted the document page loading logic inside `load_curriculum_pages` into a new helper function `load_pages_for_document`.
*   💡 **Why:** `load_curriculum_pages` was lengthy and slightly unreadable due to inline data manipulations and variable bindings for accessing the global manifest. This new abstraction neatly scopes that complexity into a separate functional unit.
*   ✅ **Verification:** Validated that existing unit tests pass using `cargo test --bin HEMA-training-tool -- --test-threads=1 ui::curriculum_test` and verified compilation with `cargo check`. Code review confirmed it to be entirely safe and correct.
*   ✨ **Result:** A more readable `load_curriculum_pages` system without behavior changes.

Co-authored-by: dynamikdev <717692+dynamikdev@users.noreply.github.com>
@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.

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.

1 participant