Skip to content

Commit 3a74733

Browse files
mofojeddsmmcken
andauthored
fix: Resize contextual help popup for widget error messages (#995)
- Default size was limited to just 250px, which is too small for this use case - Just set width to "auto" so it resizes to the contents - Tested with a bad widget and opening the contextual help error message: ```python from deephaven import ui @ui.component def ui_boom(): raise Exception("Boom") boom = ui_boom() ``` --------- Co-authored-by: Don <[email protected]>
1 parent 103c1e7 commit 3a74733

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

plugins/ui/src/js/src/styles.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,11 @@
9090
overflow: hidden;
9191
width: 100%;
9292
}
93+
94+
.ui-widget-error-contextual-help {
95+
section[class*='spectrum-ContextualHelp-dialog'] {
96+
// Our error messages can be quite large. The default size of the contextual help is only 250px and is too small.
97+
// Just set a size automatically based on the content.
98+
width: fit-content;
99+
}
100+
}

plugins/ui/src/js/src/widget/WidgetErrorView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export function WidgetErrorView({
4242
<Flex direction="column" gap="size-150">
4343
<Text UNSAFE_className="ui-text-wrap-balance">
4444
{shortMessage}
45-
<ContextualHelp variant="info">
45+
<ContextualHelp
46+
variant="info"
47+
UNSAFE_className="ui-widget-error-contextual-help"
48+
>
4649
<Heading>
4750
{name}{' '}
4851
<CopyButton

0 commit comments

Comments
 (0)