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 tagline overflow #1261

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Apr 1, 2024

Pull Request Description

This PR fixes an issue with taglines. Currently there is some logic to condense the tagline if it's very long. However, this logic performs a very simple string truncation, which can break the tagline if it truncates in the middle of markdown.

I fixed this issue by using a similar technique to the post body expander, so that the it is done by height, rather than characters. I also introduced a measurement, so the truncation only happens if the tagline is taller than a specified height. We might consider introducing this mechanism back into the post body (because I've seen cases where the body is short and the expander does almost nothing).

Review without whitespace.

Issue Being Fixed

Before

tagline_before.mp4

After

tagline_after.mp4

After -- short tagline still has no expander

tagline_short

Issue Number: N/A

Screenshots / Recordings

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

LGTM!

@hjiangsu hjiangsu merged commit b3353cb into thunder-app:develop Apr 3, 2024
1 check passed
@micahmo micahmo deleted the fix/tagline-overflow branch April 3, 2024 14:05
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.

2 participants