From d28a66627d71221f58869e08487d461b35973638 Mon Sep 17 00:00:00 2001
From: Yash Maheshwari
+ May be read truncated +
+ ) : null}{file.name} @@ -134,18 +140,31 @@ export function AttachmentStrip({ {file.loading ? (
Uploading…
) : file.size === undefined ? null : ( -- {formatBytes(file.size)} -
- )} - {file.mayTruncate === true ? ( + /* + * ON THE SIZE LINE, NOT UNDER IT, AND THAT IS A LAYOUT CONSTRAINT RATHER THAN A + * PREFERENCE. The tile's height is fixed so that a file and a thumbnail read as + * one row. A third line does not fit: measured in Chromium at this repository's + * 15px root, the two in-flow children need 63.75px inside a 58px box. Something + * has to give, and the only choices are the icon shrinking to 13px or the text + * spilling past the border. Folding the warning onto this line keeps two. + * + * `truncate` is the guarantee, not the wording: `formatBytes` is unbounded, so a + * large enough file would wrap this line and put the third one back. The short + * phrasing is what keeps it from ellipsizing at any realistic size; `title` + * carries the sentence that actually explains it. + */- May be read truncated + {formatBytes(file.size)} + {file.mayTruncate === true ? " · may be cut" : null}
- ) : null} + )}