-
Notifications
You must be signed in to change notification settings - Fork 11
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
chore: Fix bugs - external CSS leaks, sending empty queries, CSSStylesheet constructor error on mobile #21
Conversation
|
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.
Code looks good! Had one minor non-blocking suggestion. Didn't test locally.
src/components/ChatView.tsx
Outdated
@@ -112,7 +112,7 @@ export const ChatView = ({ | |||
const hasContent = isLoading || messageHistory.length > 0; | |||
|
|||
const onSendQuery = useCallback(() => { | |||
if (isLoading) return; | |||
if (isLoading || query.trim().length === 0) return; |
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.
We can extract out a variable to indicate the coupling between the disabled appearance and the disabled behavior:
const isRequestDisabled = isLoading || query.trim().length === 0;
Is the useCallback
saving any render cycles here?
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.
Good callout! onSendQuery
used to be a bit more complex, justifying the useCallback
- but it doesn't need it anymore.
Addressed these comments here: a66a7f6
CONTEXT
We have a number of bugs that need to be addressed:
CHANGES
:host
selector styling to reset all styles in the web component's shadow hostisDisabled
prop toisButtonDisabled
since only the button uses it iisButtonDisabled
prop to true if waiting for a chat response or trimmed query is of length 0