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

line breaks in tooltips & text #8783

Merged
merged 4 commits into from
Nov 28, 2024
Merged

line breaks in tooltips & text #8783

merged 4 commits into from
Nov 28, 2024

Conversation

guillim
Copy link
Contributor

@guillim guillim commented Nov 27, 2024

This feature goal is to :

1 - clean variables not used any longer

2 - add line breaks for tooltips and text wrapped

Screenshot 2024-11-27 at 18 37 18 Screenshot 2024-11-27 at 18 37 31

Request From @Bonapara

2 - line breaks for tooltips and text wrapped
@guillim guillim changed the title 1 - cleaning variables not used any longer line breaks in tooltips & text Nov 27, 2024
@guillim guillim marked this pull request as ready for review November 27, 2024 17:38
@guillim guillim self-assigned this Nov 27, 2024
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances text display functionality by implementing proper line breaks in tooltips and text wrapping, while cleaning up unused variables across components.

  • Added white-space: pre-wrap styling in packages/twenty-ui/src/display/tooltip/OverflowingTextWithTooltip.tsx to preserve line breaks
  • Added <Styledpre> component in OverflowingTextWithTooltip for proper multiline tooltip formatting
  • Removed unused isLabel and allowDisplayWrap props from OverflowingTextWithTooltip component
  • Added isTooltipMultiline={true} in packages/twenty-front/src/modules/ui/field/display/components/TextDisplay.tsx
  • Modified text wrapping behavior with -webkit-line-clamp and -webkit-box-orient for better overflow handling

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

}: {
size?: 'large' | 'small';
text: string | null | undefined;
isTooltipMultiline?: boolean;
displayedMaxRows?: number;
isLabel?: boolean;
allowDisplayWrap?: boolean;
}) => {
const textElementId = `title-id-${+new Date()}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using timestamp for ID generation can cause duplicate IDs if multiple tooltips are created in the same millisecond. Consider using a more reliable unique ID generation method.

@guillim
Copy link
Contributor Author

guillim commented Nov 28, 2024

fixes #8770

@guillim
Copy link
Contributor Author

guillim commented Nov 28, 2024

Also added the request from @Bonapara to align the top the copy/paste button (before was middle aligned
Screenshot 2024-11-28 at 13 58 05
)

@guillim guillim enabled auto-merge (squash) November 28, 2024 13:29
@charlesBochet charlesBochet merged commit 041b1f2 into main Nov 28, 2024
16 of 19 checks passed
@charlesBochet charlesBochet deleted the text-linebreaks branch November 28, 2024 13:30
Copy link

Thanks @guillim for your contribution!
This marks your 11th PR on the repo. You're top 3% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants