-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix: ErrorBoundary small styling changes #669
fix: ErrorBoundary small styling changes #669
Conversation
@@ -204,7 +204,9 @@ function ReactPanel({ | |||
direction={direction} | |||
justifyContent={justifyContent} | |||
alignContent={alignContent} | |||
alignItems={alignItems} | |||
alignItems={ |
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.
This seems weird, can't you just give 100% width to the ui-widget-error-view isntead?
Ready for re-review |
<IllustratedMessage UNSAFE_className="ui-widget-error-view"> | ||
<IllustratedMessage | ||
UNSAFE_className="ui-widget-error-view" | ||
UNSAFE_style={{ overflow: 'hidden', width: '100%' }} |
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.
Move the style stuff to a WidgetErrorView.scss, rather than inline.
@@ -19,6 +19,7 @@ import { | |||
getErrorShortMessage, | |||
getErrorStack, | |||
} from './WidgetUtils'; | |||
import styles from '../styles.scss?inline'; |
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.
Not like this.
- Make a file adjacent to this fill WidgetErrorView.scss
- Place your style in it.
- Do a regular import of it (vite will handle the rest) you don't need to ?inline and then put it in a style tag
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 was told by @mofojed and @mattrunyon to have it like this, they did not want me to create a separate WidgetErrorView.scss
, since it isn't really done like that anywhere else in plugins.
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't do regular css imports in plugins because they're distributed as a single JS file. Vite and other bundlers typically handle css imports by putting style tags in the index.html, but plugins can't do that
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.
That said, you shouldn't need to import the styles here. They should already be included in one of the top TS files
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.
If I do not import, the styles don't apply @mattrunyon
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.
Nvm, yeah they are included here -- had to hard refresh my page.
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't do regular css imports in plugins because they're distributed as a single JS file. Vite and other bundlers typically handle css imports by putting style tags in the index.html, but plugins can't do that.
Oh, didn't know that. Anyways, that's cleaner now thanks.
Closes #642
Clarification:
panel.py
(since we still want non-errored panel to have the items aligned withflex-start
), as noted heredeephaven-plugins/plugins/ui/src/js/src/layout/ReactPanel.tsx
Line 59 in 2dfbe0f
Image below of the icon no longer overflowing when it is made very short: