Skip to content
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(app): increase size of robot version mismatch tooltip #16064

Merged

Conversation

shlokamin
Copy link
Member

Overview

closes RQA-2857

Changelog

  • increase size of robot version mismatch tooltip

Review requests

  • Go to "Recent Protocol Runs" table in robot details page
  • Make sure robot and app are on mismatched versions of software OR trick the app by going to line 191 in app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx and replace isRobotOnWrongVersionOfSoftware with true
  • Verify the tooltip text does not get cut off when hovering on "rerun protocol"

Risk assessment

Low

@shlokamin shlokamin requested review from koji and ncdiehl11 August 20, 2024 14:48
@shlokamin shlokamin changed the base branch from edge to chore_release-8.0.0 August 20, 2024 14:48
@shlokamin shlokamin marked this pull request as ready for review August 20, 2024 14:48
@shlokamin shlokamin requested a review from a team as a code owner August 20, 2024 14:48
@@ -189,7 +189,7 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element {
{t('rerun_now')}
</MenuItem>
{isRobotOnWrongVersionOfSoftware && (
<Tooltip tooltipProps={tooltipProps}>
<Tooltip tooltipProps={tooltipProps} maxWidth={'max-content'}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the issue here is that the Tooltip was inheriting whiteSpace='nowrap' from its parent. This is maybe a question for design, but we can either:

  1. Keep maxWidth=FLEX_MAX_CONTENT
  2. Give an explicit whiteSpace=WRAP prop to Tooltip to override parent style one-off on this component
<Tooltip tooltipProps={tooltipProps} whiteSpace={WRAP}>
  1. default wrap behavior on app/src/atomsTooltip/index.tsx @ Tooltip
export function Tooltip(props: TooltipProps): JSX.Element {
  const {
    children,
    tooltipProps,
    width = FLEX_MAX_CONTENT,
    maxWidth = '8.75rem',
    whiteSpace = WRAP,
    ...styleProps
  } = props

  return (
    <SharedTooltip
      {...tooltipProps}
      backgroundColor={COLORS.black90}
      fontSize={TYPOGRAPHY.fontSizeCaption}
      width={width}
      maxWidth={maxWidth}
      whiteSpace={whiteSpace}
      {...styleProps}
    >
      {children}
    </SharedTooltip>
  )
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call — got rid of the white space and added a max-content with so each of the overflow items stretch horizontally to fit the container

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whiteSpace, we would need to use normal.
https://developer.mozilla.org/en-US/docs/Web/CSS/white-space

Copy link
Collaborator

@ncdiehl11 ncdiehl11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@shlokamin shlokamin merged commit cd1a05b into chore_release-8.0.0 Aug 28, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants