Skip to content

Commit 1b1f84e

Browse files
authored
fix(app): Address Choose a robot to run slideout design feedback (#11065)
This PR will address choose a robot to run slideout design feedback fix #11029 and fix #11057
1 parent 9de3dca commit 1b1f84e

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

app/src/molecules/MiniCard/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const unselectedOptionStyles = css`
2020
cursor: pointer;
2121
2222
&:hover {
23-
background-color: ${COLORS.background};
2423
border: 1px solid ${COLORS.medGreyHover};
2524
}
2625
`

app/src/organisms/ChooseRobotSlideout/AvailableRobotOption.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,23 @@ export function AvailableRobotOption(
5050
<img
5151
src={OT2_PNG}
5252
css={css`
53-
width: 6rem;
53+
width: 4rem;
54+
height: 3.5625rem;
5455
`}
5556
/>
5657
<Flex
5758
flexDirection={DIRECTION_COLUMN}
5859
marginLeft={SPACING.spacing4}
5960
marginTop={SPACING.spacing3}
61+
marginBottom={SPACING.spacing4}
6062
>
6163
<StyledText as="h6">{robotModel}</StyledText>
6264
<Box maxWidth="9.5rem">
6365
<StyledText
6466
as="p"
65-
css={{ 'overflow-wrap': 'break-word' }}
67+
css={css`
68+
overflow-wrap: break-word;
69+
`}
6670
fontWeight={TYPOGRAPHY.fontWeightSemiBold}
6771
>
6872
{robotName}

app/src/organisms/ChooseRobotSlideout/__tests__/ChooseRobotSlideout.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('ChooseRobotSlideout', () => {
181181
onCloseClick: jest.fn(),
182182
showSlideout: true,
183183
})
184-
const refreshButton = getByRole('button', { name: 'Refresh list' })
184+
const refreshButton = getByRole('button', { name: 'refresh' })
185185
fireEvent.click(refreshButton)
186186
expect(mockStartDiscovery).toHaveBeenCalled()
187187
expect(dispatch).toHaveBeenCalledWith({ type: 'mockStartDiscovery' })
@@ -200,7 +200,7 @@ describe('ChooseRobotSlideout', () => {
200200
expect(proceedButton).not.toBeDisabled()
201201
const otherRobot = getByText('otherRobot')
202202
otherRobot.click() // unselect default robot
203-
expect(proceedButton).toBeDisabled()
203+
expect(proceedButton).not.toBeDisabled()
204204
const mockRobot = getByText('opentrons-robot-name')
205205
mockRobot.click()
206206
expect(proceedButton).not.toBeDisabled()

app/src/organisms/ChooseRobotSlideout/index.tsx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
JUSTIFY_CENTER,
2525
SIZE_4,
2626
TEXT_ALIGN_CENTER,
27+
DIRECTION_ROW,
2728
} from '@opentrons/components'
2829

2930
import {
@@ -54,7 +55,7 @@ interface ChooseRobotSlideoutProps extends StyleProps {
5455
export function ChooseRobotSlideout(
5556
props: ChooseRobotSlideoutProps
5657
): JSX.Element | null {
57-
const { t } = useTranslation(['protocol_details', 'shared'])
58+
const { t } = useTranslation(['protocol_details', 'shared', 'app_settings'])
5859
const { storedProtocolData, showSlideout, onCloseClick, ...restProps } = props
5960
const dispatch = useDispatch<Dispatch>()
6061
const history = useHistory()
@@ -177,20 +178,33 @@ export function ChooseRobotSlideout(
177178
<Flex flexDirection={DIRECTION_COLUMN}>
178179
<Flex
179180
alignSelf={ALIGN_FLEX_END}
180-
marginY={SPACING.spacing3}
181+
marginBottom={SPACING.spacing3}
181182
height={SIZE_2}
182183
>
183184
{isScanning ? (
184-
<Icon name="ot-spinner" spin size={SIZE_1} />
185+
<Flex flexDirection={DIRECTION_ROW} alignItems={ALIGN_CENTER}>
186+
<StyledText
187+
as="p"
188+
color={COLORS.darkGreyEnabled}
189+
marginRight={SPACING.spacingSM}
190+
>
191+
{t('app_settings:searching')}
192+
</StyledText>
193+
<Icon
194+
name="ot-spinner"
195+
spin
196+
size="1.25rem"
197+
color={COLORS.darkGreyEnabled}
198+
/>
199+
</Flex>
185200
) : (
186201
<Link
187-
color={COLORS.blue}
188202
onClick={() => dispatch(startDiscovery())}
189203
textTransform={TEXT_TRANSFORM_CAPITALIZE}
190204
role="button"
191-
css={TYPOGRAPHY.pSemiBold}
205+
css={TYPOGRAPHY.linkPSemiBold}
192206
>
193-
{t('shared:refresh_list')}
207+
{t('shared:refresh')}
194208
</Link>
195209
)}
196210
</Flex>
@@ -221,7 +235,7 @@ export function ChooseRobotSlideout(
221235
onClick={() => {
222236
if (!isCreatingRun) {
223237
resetCreateRun()
224-
setSelectedRobot(isSelected ? null : robot)
238+
setSelectedRobot(robot)
225239
}
226240
}}
227241
isError={runCreationError != null}
@@ -279,7 +293,9 @@ export function ChooseRobotSlideout(
279293
t={t}
280294
i18nKey="view_unavailable_robots"
281295
components={{
282-
devicesLink: <NavLink to="/devices" />,
296+
devicesLink: (
297+
<NavLink to="/devices" css={TYPOGRAPHY.linkPSemiBold} />
298+
),
283299
}}
284300
/>
285301
</StyledText>

0 commit comments

Comments
 (0)