@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Split exceptionally huge revision titles into the summary

Summary: Fixes T4034.

Test Plan: See screenshot.

Reviewers: spicyj, btrahan

Reviewed By: spicyj

CC: aran

Maniphest Tasks: T4034

Differential Revision: https://secure.phabricator.com/D7443

+32
+32
src/applications/differential/conduit/ConduitAPI_differential_parsecommitmessage_Method.php
··· 169 169 $fields[$name] = $data; 170 170 } 171 171 172 + // This is another piece of special-cased magic which allows you to 173 + // enter a ridiculously long title, or just type a big block of stream 174 + // of consciousness text, and have some sort of reasonable result conjured 175 + // from it. 176 + if (isset($fields['title'])) { 177 + $terminal = '...'; 178 + $title = $fields['title']; 179 + $short = phutil_utf8_shorten($title, 250, $terminal); 180 + if ($short != $title) { 181 + 182 + // If we shortened the title, split the rest into the summary, so 183 + // we end up with a title like: 184 + // 185 + // Title title tile title title... 186 + // 187 + // ...and a summary like: 188 + // 189 + // ...title title title. 190 + // 191 + // Summary summary summary summary. 192 + 193 + $summary = idx($fields, 'summary', ''); 194 + $offset = strlen($short) - strlen($terminal); 195 + $remainder = ltrim(substr($fields['title'], $offset)); 196 + $summary = '...'.$remainder."\n\n".$summary; 197 + $summary = rtrim($summary, "\n"); 198 + 199 + $fields['title'] = $short; 200 + $fields['summary'] = $summary; 201 + } 202 + } 203 + 172 204 return $fields; 173 205 } 174 206