Page MenuHomePhabricator

Improve string truncation behavior for strings truncated in a very long word
ClosedPublic

Authored by epriestley on Jun 7 2018, 6:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 16 2026, 3:57 AM
Unknown Object (File)
Apr 15 2026, 4:47 AM
Unknown Object (File)
Mar 4 2026, 2:33 PM
Unknown Object (File)
Mar 2 2026, 5:04 AM
Unknown Object (File)
Dec 1 2025, 10:35 AM
Unknown Object (File)
Nov 30 2025, 6:25 PM
Unknown Object (File)
Nov 28 2025, 9:21 AM
Unknown Object (File)
Nov 24 2025, 7:30 AM
Subscribers
None

Details

Summary

Ref T13151. See PHI654. When truncating strings like package names in the form "X: YYYYYYYYYYYY", we currently render "X...".

A better rendering in this case is "X: YYYYYY...", where we chop the long word in the middle.

Tweak the logic a bit to handle this case better.

This will support improving the display behavior of long package names in the table of contents view.

Test Plan

Added/modified unit tests, got a clean result.

Diff Detail

Repository
rPHU libphutil
Branch
trunc1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 20385
Build 27683: Run Core Tests
Build 27682: arc lint + arc unit