Repository navigation
fix(Text): retain the final fitting truncation prefix - #8153
Conversation
|
No actionable comments were generated in the recent review. WalkthroughThe ChangesText truncation
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8153 +/- ##
==========================================
- Coverage 89.36% 89.36% -0.01%
==========================================
Files 690 690
Lines 17721 17715 -6
Branches 4793 4787 -6
==========================================
- Hits 15837 15831 -6
Misses 1678 1678
Partials 206 206 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will decrease total bundle size by 1.69kB (-0.02%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-treeshaking-cartesianAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-treeshaking-polarAssets Changed:
|
Test Results SummaryThis comment shows the latest test results for this pull request.
ℹ️ About Flakiness.io in GitHubYour team has set up Flakiness.io pull request comments. This comment is updated when
Flakiness.io rewrites the comment in place, so it always reflects the most recently tested commit. |
Description
When
Textoverflows withmaxLines, the truncation search can return the original overflowing content even though a shorter prefix with an ellipsis fits. The search only saved a result when it found an adjacent fitting/overflowing pair, so a fitting final candidate was lost. For example, with a 30px width and measured widths of 10px fora/b, 80px forW, and 5px for the ellipsis,abWshould render asab….Keep the last fitting prefix while the binary search advances. This retains the existing search range, already-fitting and
scaleToFitguards, grapheme handling, and code-point fallback. It does not change behavior when even the ellipsis cannot fit.Related Issue
Fixes #8152. This is separate from the broader font/style measurement problem in #4735.
How Has This Been Tested?
The actual
Text/Surfacecomponent regressions cover the final fitting prefix, a single overflowing glyph or grapheme, word/character wrapping, and the runtime fallback. Seven regressions fail on unchanged production code, with four controls passing; all 110 Text tests pass with this change afternpm cion the current lockfile. Measurement is deterministic in these component tests; this is not browser-font visual evidence.The normal pre-push gate passes on Node 24.22.2: build, 13 build-output tests, lint (no errors), all 407 unit-test files (18,218 passed, six expected failures, 16 skips, one todo), and all five type-check projects. The successful run used
VITEST_MAX_WORKERS=2to limit contention. Two earlier default-concurrency runs exceeded the unchanged Bar sparsity test's five-second timeout; its isolated nine-test file also passes. No tests or timeouts were changed.Types of changes
Checklist
No API change; coverage uses the existing actual-component test setup with controlled measurements.
Summary by CodeRabbit
Intl.Segmenteris unavailable.