-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline code + effect clarity #2715
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances the CodeBlock component's functionality and appearance while modifying EmbeddingContext and FormContext to potentially improve performance.
- Added inline code block support in
web/src/app/chat/message/CodeBlock.tsx
with improved styling and flexibility - Removed
formStep
dependency from useEffect hooks in bothweb/src/components/context/EmbeddingContext.tsx
andweb/src/components/context/FormContext.tsx
- Potential issue: Removing
formStep
dependency may lead to inconsistencies between URL and actual form step ifformStep
changes outside the effect - CodeBlock changes improve functionality but may introduce complexity; careful testing is recommended
- Consider adding safeguards or additional checks to ensure form step and URL remain synchronized in both context components
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings
if (stepFromUrl !== formStep) { | ||
setFormStep(stepFromUrl); | ||
} | ||
}, [searchParams, formStep]); | ||
}, [searchParams]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Removing formStep from dependencies may cause missed updates if formStep changes independently of searchParams
if (stepFromUrl !== formStep) { | ||
setFormStep(stepFromUrl); | ||
} | ||
}, [searchParams, formStep]); | ||
}, [searchParams]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Removing formStep from the dependency array may cause the form step to become out of sync with the URL. Consider keeping formStep in the dependency array and implementing a more robust synchronization mechanism if needed.
Description
[Provide a brief description of the changes in this PR]
How Has This Been Tested?
[Describe the tests you ran to verify your changes]
Accepted Risk
[Any know risks or failure modes to point out to reviewers]
Related Issue(s)
[If applicable, link to the issue(s) this PR addresses]
Checklist: