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
F19940737: D19477.id46588.diff
Wed, Apr 15, 4:47 AM
F19814562: D19477.id.diff
Mar 4 2026, 2:33 PM
F19804097: D19477.diff
Mar 2 2026, 5:04 AM
F19075622: D19477.id.diff
Dec 1 2025, 10:35 AM
F19071084: D19477.diff
Nov 30 2025, 6:25 PM
F19053532: D19477.id.diff
Nov 28 2025, 9:21 AM
F19025479: D19477.id46581.diff
Nov 24 2025, 7:30 AM
F18991602: D19477.diff
Nov 18 2025, 11:02 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