-
Notifications
You must be signed in to change notification settings - Fork 4k
support file size limit error for chat input #10530
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
Conversation
lukasmasuch
left a comment
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.
A couple of comments, but LGTM overall 👍
| content={(fileInfo.status as ErrorStatus).errorMessage} | ||
| > | ||
| <Icon content={ErrorOutline} size="lg" /> | ||
| <Icon color={themeColors.red90} content={ErrorOutline} size="lg" /> |
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.
I think we should use the theme.colors.red via the useTheme hook here instead in case it also looks fine? We try to keep the usage of non-semantic static colors as low as possible so that it doesn't create any issues with custom themes.
And can you verify that it works on a dark and light background?
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.
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.
How does it look with theme.colors.red? If it's not too far off and works in light & dark, it might be better to just use theme.colors.red for now and look at it again when we add advanced theming for text, alert, metric colors. E.g. we also need a red color for negative delta on metrics, and one for danger color on alerts, and one for red text color, and a couple more places... I think these should eventually be combined into one red color.
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.
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.
Oh, we also have theme.colors.danger which we use for the file uploader error text. Can we use this color for the icon?
| color: theme.colors.danger, |
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.
@sfc-gh-pchiu what does it look like with theme.colors.danger?
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.
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.
The danger colors don't pop as much for me. Are they usually used with a red background color?
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.
| .filter(err => !!err) | ||
| .join(", "), | ||
| errorMessage: getErrorMessage( | ||
| rejected.errors[0].code, |
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.
Is it guaranteed that there is at least one error?
Is it possible that there are multiple errors? If so, maybe add a comment that it is intended to only show info about the first error.
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.
I think we carried this over from file uploader and there's a check here that implies some assumption about only 1 error?
I'm not sure if there won't be multiple errors (we get this from Axios I believe.)
But I think it wouldn't hurt to show all the errors? In the latest commit, I consolidated both chat input and file uploader's this handlers and concatenated all the human readable errors together. wdyt?
|
btw. is there a way to add an e2e test for this error? E.g. we could change the max setting to a low value in the text, upload a small file above the configured value and then do some snapshots. Do we have tests for this for file uploader? |
No, we currently don't have that in file uploader. I wonder how we could change the max setting in playwright? since it's consuming the config value on the backend |
|
you can do it programmatically in the app (this might not work for all settings): You can also change settings before server start, but thats where it gets a bit more advanced. e.g.: streamlit/e2e_playwright/theming/snowflake_dark_theme_test.py Lines 26 to 32 in 219e567
but both options will change this setting globally in the server, affecting the other e2e tests in the same script. |
e64cc43 to
fb1901f
Compare






Describe your changes
GitHub Issue Link (if applicable)
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.