🐛 Fix long file names (#6216)

* 🔧 Add truncate str macro

* 🐛 Use truncate instead of prune to prevent title override

* 💄 Use text-overflow ellipsis on file names

* 📎 Add #10662 to 2.7 bugfixes
This commit is contained in:
Elena Torró 2025-04-03 16:06:02 +02:00 committed by GitHub
parent cd731c3ad2
commit 480c224250
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 16 additions and 3 deletions

View file

@ -698,7 +698,7 @@
(defn rename-file
[id name]
{:pre [(uuid? id) (string? name)]}
(let [name (str/prune name 200)]
(let [name (dm/truncate name 200)]
(ptk/reify ::rename-file
IDeref
(-deref [_]

View file

@ -304,6 +304,7 @@
}
.file-name-label {
@include bodyLargeTypography;
@include textEllipsis;
}
}
&.loading {

View file

@ -199,6 +199,7 @@
.file-entry {
.file-name {
@include flexRow;
.file-icon {
@include flexCenter;
height: $s-16;
@ -211,6 +212,7 @@
}
.file-name-label {
@include bodyLargeTypography;
@include textEllipsis;
}
}
&.loading {

View file

@ -132,7 +132,7 @@
:saved i/status-tick
:error i/status-wrong
nil)]
file-name])]
[:div {:class (stl/css :file-name-label)} file-name]])]
(when ^boolean shared?
[:span {:class (stl/css :shared-badge)} i/library])
[:div {:class (stl/css :menu-section)}

View file

@ -54,6 +54,10 @@
flex-direction: row;
}
.file-name-label {
@include textEllipsis;
}
.file-name-input {
@include flexCenter;
width: 100%;