diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx index 193b2ded6a33f..b8189e04b856b 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/AppTopNav/AppTopNav.tsx @@ -42,8 +42,7 @@ export const AppTopNav = ({children, allowGlobalReload = false}: Props) => { } }} shortcutLabel={`⌥R - ${reloading ? 'Reloading' : 'Reload all code locations'}`} - // On OSX Alt + R creates ®, not sure about windows, so checking 'r' for windows - shortcutFilter={(e) => e.altKey && (e.key === '®' || e.key === 'r')} + shortcutFilter={(e) => e.altKey && e.code === 'KeyR'} >
diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/HelpMenu.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/HelpMenu.tsx index 0b97e07e8e793..f2fa952f83c03 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/HelpMenu.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/HelpMenu.tsx @@ -12,7 +12,7 @@ import { import {useCallback, useState} from 'react'; import {ShortcutHandler} from './ShortcutHandler'; -import {TopNavButton} from './TopNavButton'; +import {TooltipShortcutInfo, TopNavButton} from './TopNavButton'; import DagsterUniversityImage from './dagster_university.svg'; import {useStateWithStorage} from '../hooks/useStateWithStorage'; @@ -100,7 +100,11 @@ export const HelpMenu = ({showContactSales = true}: {showContactSales?: boolean} } > - + } + placement="bottom" + canShow={!isOpen} + > diff --git a/js_modules/dagster-ui/packages/ui-core/src/app/TopNavButton.tsx b/js_modules/dagster-ui/packages/ui-core/src/app/TopNavButton.tsx index 604efb416d02c..4b11f5e7b876f 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/app/TopNavButton.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/app/TopNavButton.tsx @@ -1,4 +1,5 @@ -import {Colors, IconWrapper, UnstyledButton} from '@dagster-io/ui-components'; +import {Box, Colors, FontFamily, IconWrapper, UnstyledButton} from '@dagster-io/ui-components'; +import {ReactNode} from 'react'; import styled from 'styled-components'; export const TopNavButton = styled(UnstyledButton)` @@ -28,3 +29,25 @@ export const TopNavButton = styled(UnstyledButton)` background-color: ${Colors.navTextHover()}; } `; + +interface TooltipWithShortcutInfoProps { + label: ReactNode; + shortcutKey: string; +} + +export const TooltipShortcutInfo = ({label, shortcutKey}: TooltipWithShortcutInfoProps) => { + return ( + +
{label}
+ {shortcutKey} +
+ ); +}; + +export const TooltipShortcutKey = styled.div` + background-color: ${Colors.navButton()}; + border-radius: 3px; + font-family: ${FontFamily.monospace}; + padding: 1px 6px; + box-shadow: inset 0 0 0 1px ${Colors.borderHover()}; +`; diff --git a/js_modules/dagster-ui/packages/ui-core/src/search/SearchDialog.tsx b/js_modules/dagster-ui/packages/ui-core/src/search/SearchDialog.tsx index 75bad57bb0921..8f017e8df3adb 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/search/SearchDialog.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/search/SearchDialog.tsx @@ -1,6 +1,6 @@ // eslint-disable-next-line no-restricted-imports import {Overlay} from '@blueprintjs/core'; -import {Colors, FontFamily, Icon, Spinner} from '@dagster-io/ui-components'; +import {Colors, FontFamily, Icon, Spinner, Tooltip} from '@dagster-io/ui-components'; import Fuse from 'fuse.js'; import debounce from 'lodash/debounce'; import * as React from 'react'; @@ -12,7 +12,7 @@ import {SearchResult} from './types'; import {useGlobalSearch} from './useGlobalSearch'; import {__updateSearchVisibility} from './useSearchVisibility'; import {ShortcutHandler} from '../app/ShortcutHandler'; -import {TopNavButton} from '../app/TopNavButton'; +import {TooltipShortcutInfo, TopNavButton} from '../app/TopNavButton'; import {useTrackEvent} from '../app/analytics'; import {Trace, createTrace} from '../performance'; @@ -212,9 +212,14 @@ export const SearchDialog = () => { return ( <> - - - + } + placement="bottom" + > + + + +