diff --git a/packages/components/src/context-actions/ContextActionUtils.ts b/packages/components/src/context-actions/ContextActionUtils.ts index 1e802bfe3b..f71671f208 100644 --- a/packages/components/src/context-actions/ContextActionUtils.ts +++ b/packages/components/src/context-actions/ContextActionUtils.ts @@ -10,7 +10,7 @@ export type ResolvableContextAction = export type MenuItem = ContextAction | Promise; export interface ContextAction { - title?: string; + title?: string | JSX.Element; description?: string; action?: (event: Event) => void; actions?: ResolvableContextAction[]; diff --git a/packages/dashboard-core-plugins/src/panels/ChartPanel.tsx b/packages/dashboard-core-plugins/src/panels/ChartPanel.tsx index fe89e881c4..e71f79c468 100644 --- a/packages/dashboard-core-plugins/src/panels/ChartPanel.tsx +++ b/packages/dashboard-core-plugins/src/panels/ChartPanel.tsx @@ -348,7 +348,12 @@ export class ChartPanel extends Component { pending: Pending; initModel(): void { - this.setState({ isLoading: true, isLoaded: false, error: undefined }); + this.setState({ + isLoading: true, + isLoaded: false, + error: undefined, + isDisconnected: false, + }); const { makeModel } = this.props; diff --git a/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx b/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx index e4efb20dda..d697f47109 100644 --- a/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx +++ b/packages/dashboard-core-plugins/src/panels/IrisGridPanel.tsx @@ -563,7 +563,12 @@ export class IrisGridPanel extends PureComponent< ); initModel(): void { - this.setState({ isModelReady: false, isLoading: true, error: null }); + this.setState({ + isModelReady: false, + isLoading: true, + error: null, + isDisconnected: false, + }); const { makeModel } = this.props; if (this.modelPromise != null) { this.modelPromise.cancel(); diff --git a/packages/dashboard-core-plugins/src/panels/Panel.tsx b/packages/dashboard-core-plugins/src/panels/Panel.tsx index beb753535a..86ec513284 100644 --- a/packages/dashboard-core-plugins/src/panels/Panel.tsx +++ b/packages/dashboard-core-plugins/src/panels/Panel.tsx @@ -13,6 +13,7 @@ import { ContextActions, createXComponent, LoadingOverlay, + type ResolvableContextAction, Tooltip, } from '@deephaven/components'; import { @@ -64,7 +65,7 @@ export type CorePanelProps = { onTabBlur?: (...args: unknown[]) => void; onTabFocus?: (...args: unknown[]) => void; renderTabTooltip?: () => ReactNode; - additionalActions?: ContextAction[]; + additionalActions?: ResolvableContextAction[]; errorMessage?: string; isLoading?: boolean; isLoaded?: boolean; @@ -297,7 +298,7 @@ class Panel extends PureComponent { getAdditionalActions = memoize( ( - actions: readonly ContextAction[], + actions: readonly ResolvableContextAction[], isClonable: boolean, isRenamable: boolean ) => { diff --git a/packages/dashboard-core-plugins/src/panels/PanelContextMenu.tsx b/packages/dashboard-core-plugins/src/panels/PanelContextMenu.tsx index 11da9d351a..97d2f4cf86 100644 --- a/packages/dashboard-core-plugins/src/panels/PanelContextMenu.tsx +++ b/packages/dashboard-core-plugins/src/panels/PanelContextMenu.tsx @@ -1,5 +1,8 @@ import React, { PureComponent, type ReactElement } from 'react'; -import { type ContextAction, ContextActions } from '@deephaven/components'; +import { + ContextActions, + type ResolvableContextAction, +} from '@deephaven/components'; import type { Container, EventEmitter, Tab } from '@deephaven/golden-layout'; import { type CustomizableWorkspace, @@ -15,7 +18,7 @@ import { } from '@deephaven/dashboard'; interface PanelContextMenuProps { - additionalActions: ContextAction[]; + additionalActions: ResolvableContextAction[]; glContainer: Container; glEventHub: EventEmitter; workspace: CustomizableWorkspace; @@ -136,9 +139,7 @@ class PanelContextMenu extends PureComponent< render(): ReactElement { const { additionalActions, glContainer } = this.props; - const contextActions: (ContextAction | (() => ContextAction))[] = [ - ...additionalActions, - ]; + const contextActions = [...additionalActions]; contextActions.push(() => ({ title: 'Re-open closed panel', diff --git a/packages/dashboard-core-plugins/src/panels/WidgetPanel.tsx b/packages/dashboard-core-plugins/src/panels/WidgetPanel.tsx index 1841b5f398..b8832b0387 100644 --- a/packages/dashboard-core-plugins/src/panels/WidgetPanel.tsx +++ b/packages/dashboard-core-plugins/src/panels/WidgetPanel.tsx @@ -2,9 +2,9 @@ import React, { PureComponent, type ReactElement } from 'react'; import classNames from 'classnames'; import memoize from 'memoize-one'; import { - type ContextAction, ContextActions, createXComponent, + type ResolvableContextAction, } from '@deephaven/components'; import type { dh } from '@deephaven/jsapi-types'; import { copyToClipboard, EMPTY_ARRAY } from '@deephaven/utils'; @@ -97,7 +97,7 @@ class WidgetPanel extends PureComponent { getCachedActions = memoize( ( descriptor: WidgetPanelDescriptor, - propsAdditionalActions: readonly ContextAction[] = EMPTY_ARRAY + propsAdditionalActions: readonly ResolvableContextAction[] = EMPTY_ARRAY ) => [ ...propsAdditionalActions, { diff --git a/packages/dashboard-core-plugins/src/panels/WidgetPanelTooltip.scss b/packages/dashboard-core-plugins/src/panels/WidgetPanelTooltip.scss index e8f3bd2913..cfbd454bf1 100644 --- a/packages/dashboard-core-plugins/src/panels/WidgetPanelTooltip.scss +++ b/packages/dashboard-core-plugins/src/panels/WidgetPanelTooltip.scss @@ -16,7 +16,7 @@ $tooltip-container-width: 300px; .tab-tooltip-name-wrapper { display: flex; flex-wrap: nowrap; - align-items: first baseline; + align-items: center; gap: $spacer-1; }