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

feat: center align action forms #37763

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -67,5 +67,10 @@
& :global(.ads-v2-select > .rc-select-selector) {
min-width: unset;
}

/* Remove this once the config in DB is updated to use Section and Zone (Twilio, Airtable) */
& :global(.ar-form-info-text) {
max-width: unset;
}
/* Removable section ends here */
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const UQIEditorForm = () => {

return (
<Flex
alignItems="center"
data-testid="t--uqi-editor-form"
flexDirection="column"
overflowY="scroll"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export const StyledFormInfo = styled.span<{ config?: ControlProps }>`
? "5px"
: "0px"};
line-height: 16px;
max-width: 270px;
overflow: hidden;
break-word: break-all;
Comment on lines +35 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve text handling properties for better readability

The current text handling approach could be improved:

-  max-width: 270px;
-  overflow: hidden;
-  break-word: break-all;
+  max-width: min(270px, 100%);
+  overflow: hidden;
+  text-overflow: ellipsis;
+  overflow-wrap: break-word;

This change:

  • Makes max-width responsive
  • Adds ellipsis for truncated text
  • Uses overflow-wrap for better word breaking
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
max-width: 270px;
overflow: hidden;
break-word: break-all;
max-width: min(270px, 100%);
overflow: hidden;
text-overflow: ellipsis;
overflow-wrap: break-word;

`;

const FormSubtitleText = styled.span<{ config?: ControlProps }>`
Expand Down Expand Up @@ -177,7 +180,9 @@ function FormLabel(props: FormLabelProps) {
//Wrapper on styled <span/>
function FormInfoText(props: FormLabelProps) {
return (
<StyledFormInfo config={props.config}>{props.children}</StyledFormInfo>
<StyledFormInfo className="ar-form-info-text" config={props.config}>
{props.children}
</StyledFormInfo>
);
}

Expand Down
Loading