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
F18087320: D19477.id46588.diff
Wed, Aug 6, 3:33 AM
F18044638: D19477.id46581.diff
Sun, Aug 3, 7:34 AM
F17948352: D19477.id.diff
Thu, Jul 31, 8:50 PM
F17940583: D19477.id46581.diff
Thu, Jul 31, 4:35 AM
F17940530: D19477.diff
Thu, Jul 31, 4:30 AM
F17869544: D19477.id.diff
Jul 28 2025, 11:34 AM
F17858314: D19477.diff
Jul 27 2025, 7:27 PM
F17799899: D19477.id.diff
Jul 25 2025, 5:39 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable