AI Tutor - Refactor PR #68567 to align with AiTutorContextHelper class intentions#68589
Merged
edcodedotorg merged 1 commit intoSep 26, 2025
Conversation
8 tasks
molly-moen
approved these changes
Sep 26, 2025
molly-moen
left a comment
Contributor
There was a problem hiding this comment.
Thanks! Feel free to merge into my branch
0415c37
into
molly/files-context-weblab2
2 of 3 checks passed
molly-moen
added a commit
that referenced
this pull request
Sep 26, 2025
* some initial plumbing * more plumbing * wip * getting files to show up * create context in redux * start plumbing through redux * use new context * clear context after sending * clean up and add file path * add context to chat history * small updates * clean up * undo csp change * refactor to align with AiTutorContextHelper class intentions (#68589) * add key * fix close icon and clear context on level switch --------- Co-authored-by: Ed Baafi <edward.baafi@code.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a small refactor to align PR #68567 with the intentions of
AiTutorContextHelper. A secondary nit that was addressed was to changeUserAddedContexttoUserAddedSelectionContextto further describe the additional context (code that the user "selects") that the user is adding.Re: intentions of AiTutorContextHelper
The
AiTutorContextHelperclass is designed to be aware of a uniform set of context items that can be opted into by each lab / use-case. How the context item is formatted / added to the final context string is handled bygetHiddenContextString, so the idea is that if something is only opted-into by a given lab that is fine, but if opted-in, it should be handled uniformly without having to provide any new lab-specific methods in the derived class.The class is already pretty flexible in that it is a templated class and each use-case can provide its own internal data structure as a generic type parameter (
T). Rather than defining a use-case specificgetHiddenContextCallbackWebLab2, the additional context has been added to the WebLab2 specific type and itssetAiTutorContextturns this specific context into a genericuserSelectionthat is now an optional property ofAiTutorContextand can be handled in the base class:I will cut the explanation short in the interest of time (the original PR is somewhat urgent), but if anyone has any questions or concerns, just let me know.
PR Creation Checklist: