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): fix csv filename wrapping #16156

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export function NumericalKeyboard({
<Keyboard
keyboardRef={r => (keyboardRef.current = r)}
theme={'hg-theme-default oddTheme1 numerical-keyboard'}
onInit={keyboard => {keyboard.setInput(initialValue)}}
onInit={keyboard => {
ncdiehl11 marked this conversation as resolved.
Show resolved Hide resolved
keyboard.setInput(initialValue)
}}
onChange={onChange}
display={numericalCustom}
useButtonTag={true}
Expand Down
1 change: 1 addition & 0 deletions app/src/atoms/buttons/RadioButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export function RadioButton(props: RadioButtonProps): JSX.Element {
display: ${maxLines != null ? '-webkit-box' : undefined};
-webkit-line-clamp: ${maxLines ?? undefined};
-webkit-box-orient: ${maxLines != null ? 'vertical' : undefined};
word-wrap: break-word;
}
}
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import type {
import type { CsvFileData } from '@opentrons/api-client'

const MAX_CHARS = 52
const CSV_FILENAME_BREAK_POINT = 46
const CSV_FILENAME_BREAK_POINT = 42
interface ChooseCsvFileProps {
protocolId: string
handleGoBack: () => void
Expand Down
10 changes: 10 additions & 0 deletions app/src/pages/ProtocolSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ interface ProtocolSetupStepProps {
title: string
// first line of detail text
detail?: string | null
// clip detail text overflow with ellipsis
clipDetail?: boolean
// second line of detail text
subDetail?: string | null
// disallow click handler, disabled styling
Expand All @@ -140,6 +142,7 @@ export function ProtocolSetupStep({
detail,
subDetail,
disabled = false,
clipDetail = false,
interactionDisabled = false,
disabledReason,
description,
Expand Down Expand Up @@ -250,6 +253,7 @@ export function ProtocolSetupStep({
textAlign={TEXT_ALIGN_RIGHT}
color={interactionDisabled ? COLORS.grey50 : COLORS.black90}
maxWidth="20rem"
css={clipDetail ? CLIPPED_TEXT_STYLE : undefined}
>
{detail}
{subDetail != null && detail != null ? <br /> : null}
Expand Down Expand Up @@ -1075,3 +1079,9 @@ export function ProtocolSetup(): JSX.Element {
</>
)
}

const CLIPPED_TEXT_STYLE = css`
white-space: nowrap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
white-space: nowrap;
white-space: ${NO_WRAP};

overflow: hidden;
text-overflow: ellipsis;
`
Loading