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
F18785920: D19477.id46588.diff
Tue, Oct 14, 3:09 PM
F18720465: D19477.diff
Mon, Sep 29, 6:56 PM
F18620477: D19477.id46581.diff
Sep 15 2025, 5:21 AM
F18509659: D19477.id.diff
Sep 5 2025, 3:31 AM
F18502927: D19477.diff
Sep 4 2025, 10:44 PM
F18419683: D19477.id46588.diff
Aug 30 2025, 2:52 PM
F18416365: D19477.id.diff
Aug 30 2025, 10:38 AM
F18402028: D19477.diff
Aug 29 2025, 7:48 PM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable