@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.

Support size=thumb parameter for embedded video files in Remarkup

Summary:
When embedding a video in a task description via Remarkup's `{F1}` it takes up to 95% of the width which is often unwanted.
Should support the same `{F1,size=thumb}` parameter which embedded image files already support.

In case of image files the resulting width for `TRANSFORM_PREVIEW` is hardcoded to 220px in `PhabricatorFileThumbnailTransform.php::generateTransforms()`.
That feels subjectively small for video thumbs so arbitrarily bikeshed to hardcoded 400px instead.

Closes T16042

Test Plan: Upload a video file; put `{F1,size=thumb}` and `{F1}` into a task comment; resize viewport width.

Reviewers: O1 Blessed Committers, mainframe98

Reviewed By: O1 Blessed Committers, mainframe98

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16042

Differential Revision: https://we.phorge.it/D26080

+15 -4
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '384ce2d9', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '727e128a', 12 + 'core.pkg.css' => '1161c9ea', 13 13 'core.pkg.js' => '63f896ec', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '4c951b31', ··· 104 104 'rsrc/css/application/tokens/tokens.css' => 'ce5a50bd', 105 105 'rsrc/css/application/uiexample/example.css' => '549e220b', 106 106 'rsrc/css/core/core.css' => '83d97073', 107 - 'rsrc/css/core/remarkup.css' => 'e2edb23d', 107 + 'rsrc/css/core/remarkup.css' => '6ab3c4aa', 108 108 'rsrc/css/core/syntax.css' => '548567f6', 109 109 'rsrc/css/core/z-index.css' => '56fbe5ba', 110 110 'rsrc/css/diviner/diviner-shared.css' => '4bd263b0', ··· 773 773 'phabricator-object-selector-css' => 'ee77366f', 774 774 'phabricator-phtize' => '2f1db1ed', 775 775 'phabricator-prefab' => '5793d835', 776 - 'phabricator-remarkup-css' => 'e2edb23d', 776 + 'phabricator-remarkup-css' => '6ab3c4aa', 777 777 'phabricator-remarkup-metadata' => 'e40c4991', 778 778 'phabricator-search-results-css' => '9ea70ace', 779 779 'phabricator-shaped-request' => '995f5102',
+6 -1
src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
··· 311 311 $mime_type = $file->getMimeType(); 312 312 } 313 313 314 + $thumb_class = null; 315 + if (isset($options['size']) && $options['size'] == 'thumb') { 316 + $thumb_class = ' video-thumb'; 317 + } 318 + 314 319 return $this->newTag( 315 320 $tag, 316 321 array( ··· 319 324 'autoplay' => $autoplay, 320 325 'loop' => idx($options, 'loop') ? 'loop' : null, 321 326 'alt' => $options['alt'], 322 - 'class' => 'phabricator-media', 327 + 'class' => 'phabricator-media'.$thumb_class, 323 328 ), 324 329 $this->newTag( 325 330 'source',
+6
webroot/rsrc/css/core/remarkup.css
··· 258 258 max-width: 95%; 259 259 } 260 260 261 + .phabricator-remarkup video.video-thumb { 262 + display: inline-block; 263 + margin: 0 auto; 264 + max-width: 400px; 265 + } 266 + 261 267 .phui-remarkup-preview .phabricator-remarkup-mention-unknown { 262 268 font-weight: bold; 263 269 background: #ffaaaa;