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
F19075622: D19477.id.diff
Mon, Dec 1, 10:35 AM
F19071084: D19477.diff
Sun, Nov 30, 6:25 PM
F19053532: D19477.id.diff
Fri, Nov 28, 9:21 AM
F19025479: D19477.id46581.diff
Mon, Nov 24, 7:30 AM
F18991602: D19477.diff
Nov 18 2025, 11:02 PM
F18852617: D19477.id.diff
Oct 31 2025, 10:46 AM
F18850648: D19477.diff
Oct 30 2025, 6:27 PM
F18816773: D19477.id46588.diff
Oct 21 2025, 9:20 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