mirror of
https://github.com/penpot/penpot.git
synced 2025-06-02 05:21:38 +02:00
🐛 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:
parent
cd731c3ad2
commit
480c224250
7 changed files with 16 additions and 3 deletions
|
@ -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 [_]
|
||||
|
|
|
@ -304,6 +304,7 @@
|
|||
}
|
||||
.file-name-label {
|
||||
@include bodyLargeTypography;
|
||||
@include textEllipsis;
|
||||
}
|
||||
}
|
||||
&.loading {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)}
|
||||
|
|
|
@ -54,6 +54,10 @@
|
|||
flex-direction: row;
|
||||
}
|
||||
|
||||
.file-name-label {
|
||||
@include textEllipsis;
|
||||
}
|
||||
|
||||
.file-name-input {
|
||||
@include flexCenter;
|
||||
width: 100%;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue