Skip to content

fix(ui-truncate-text): remove lineHeight theme input, default v2 truncation to 1.2#2635

Merged
HerrTopi merged 1 commit into
masterfrom
truncatetext
Jul 17, 2026
Merged

fix(ui-truncate-text): remove lineHeight theme input, default v2 truncation to 1.2#2635
HerrTopi merged 1 commit into
masterfrom
truncatetext

Conversation

@HerrTopi

@HerrTopi HerrTopi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove lineHeight as a theme/style input for v2 TruncateText: it's dropped from the TruncateTextStyle ComponentStyle union (props.ts), no longer emitted by styles.ts, and no longer threaded from index.tsx into the truncator options.
  • Replace it with a module-level DEFAULT_LINE_HEIGHT = 1.2 constant in utils/truncate.ts. When the inherited computed line-height resolves to normal, truncation height is calculated as 1.2 * fontSize; a concrete line-height is still parsed from the computed style and used as-is.

Test Plan

  • Render a v2 TruncateText in a container whose line-height is normal and confirm truncation lands on the right line (now driven by the 1.2 default).
  • Render one with a concrete numeric/px line-height and confirm truncation is unchanged (no regression).

🤖 Generated with Claude Code

@HerrTopi HerrTopi self-assigned this Jul 13, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-17 12:10 UTC

@github-actions

Copy link
Copy Markdown

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

github-actions Bot pushed a commit that referenced this pull request Jul 15, 2026
@HerrTopi HerrTopi changed the title fix(ui-truncate-text): parse percentage and non-numeric lineHeight in v2 truncation calc fix(ui-truncate-text): remove lineHeight theme input, default v2 truncation to 1.2 Jul 16, 2026
@HerrTopi
HerrTopi requested a review from matyasf July 16, 2026 10:45
github-actions Bot pushed a commit that referenced this pull request Jul 16, 2026

@matyasf matyasf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good! Lets make sure that design removed the unused token

@HerrTopi
HerrTopi requested a review from git-nandor July 16, 2026 22:36
@HerrTopi
HerrTopi merged commit d4f938f into master Jul 17, 2026
12 checks passed
@HerrTopi
HerrTopi deleted the truncatetext branch July 17, 2026 12:10
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.

3 participants