mirror of
https://github.com/penpot/penpot.git
synced 2025-06-04 01:31: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
|
@ -16,6 +16,7 @@
|
||||||
- Fix SVG `stroke-linecap` property when importing SVGs [Taiga #9489](https://tree.taiga.io/project/penpot/issue/9489)
|
- Fix SVG `stroke-linecap` property when importing SVGs [Taiga #9489](https://tree.taiga.io/project/penpot/issue/9489)
|
||||||
- Fix position problems cutting-pasting a component [Taiga #10677](https://tree.taiga.io/project/penpot/issue/10677)
|
- Fix position problems cutting-pasting a component [Taiga #10677](https://tree.taiga.io/project/penpot/issue/10677)
|
||||||
- Fix design tab has a horizontal scroll [Taiga #10660](https://tree.taiga.io/project/penpot/issue/10660)
|
- Fix design tab has a horizontal scroll [Taiga #10660](https://tree.taiga.io/project/penpot/issue/10660)
|
||||||
|
- Fix long file names being clipped when longer than allowed length [Taiga #10662](https://tree.taiga.io/project/penpot/issue/10662)
|
||||||
|
|
||||||
## 2.6.0 (Unreleased)
|
## 2.6.0 (Unreleased)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
(ns app.common.data.macros
|
(ns app.common.data.macros
|
||||||
"Data retrieval & manipulation specific macros."
|
"Data retrieval & manipulation specific macros."
|
||||||
(:refer-clojure :exclude [get-in select-keys str with-open min max])
|
(:refer-clojure :exclude [get-in select-keys str with-open max])
|
||||||
#?(:cljs (:require-macros [app.common.data.macros]))
|
#?(:cljs (:require-macros [app.common.data.macros]))
|
||||||
(:require
|
(:require
|
||||||
#?(:clj [clojure.core :as c]
|
#?(:clj [clojure.core :as c]
|
||||||
|
@ -144,3 +144,8 @@
|
||||||
(str "expr assert: " (pr-str expr)))]
|
(str "expr assert: " (pr-str expr)))]
|
||||||
(when *assert*
|
(when *assert*
|
||||||
`(runtime-assert ~hint (fn [] ~expr))))))
|
`(runtime-assert ~hint (fn [] ~expr))))))
|
||||||
|
|
||||||
|
(defn truncate
|
||||||
|
"Truncates a string to a certain length"
|
||||||
|
[s max-length]
|
||||||
|
(subs s 0 (min max-length (count s))))
|
||||||
|
|
|
@ -698,7 +698,7 @@
|
||||||
(defn rename-file
|
(defn rename-file
|
||||||
[id name]
|
[id name]
|
||||||
{:pre [(uuid? id) (string? name)]}
|
{:pre [(uuid? id) (string? name)]}
|
||||||
(let [name (str/prune name 200)]
|
(let [name (dm/truncate name 200)]
|
||||||
(ptk/reify ::rename-file
|
(ptk/reify ::rename-file
|
||||||
IDeref
|
IDeref
|
||||||
(-deref [_]
|
(-deref [_]
|
||||||
|
|
|
@ -304,6 +304,7 @@
|
||||||
}
|
}
|
||||||
.file-name-label {
|
.file-name-label {
|
||||||
@include bodyLargeTypography;
|
@include bodyLargeTypography;
|
||||||
|
@include textEllipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.loading {
|
&.loading {
|
||||||
|
|
|
@ -199,6 +199,7 @@
|
||||||
.file-entry {
|
.file-entry {
|
||||||
.file-name {
|
.file-name {
|
||||||
@include flexRow;
|
@include flexRow;
|
||||||
|
|
||||||
.file-icon {
|
.file-icon {
|
||||||
@include flexCenter;
|
@include flexCenter;
|
||||||
height: $s-16;
|
height: $s-16;
|
||||||
|
@ -211,6 +212,7 @@
|
||||||
}
|
}
|
||||||
.file-name-label {
|
.file-name-label {
|
||||||
@include bodyLargeTypography;
|
@include bodyLargeTypography;
|
||||||
|
@include textEllipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.loading {
|
&.loading {
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
:saved i/status-tick
|
:saved i/status-tick
|
||||||
:error i/status-wrong
|
:error i/status-wrong
|
||||||
nil)]
|
nil)]
|
||||||
file-name])]
|
[:div {:class (stl/css :file-name-label)} file-name]])]
|
||||||
(when ^boolean shared?
|
(when ^boolean shared?
|
||||||
[:span {:class (stl/css :shared-badge)} i/library])
|
[:span {:class (stl/css :shared-badge)} i/library])
|
||||||
[:div {:class (stl/css :menu-section)}
|
[:div {:class (stl/css :menu-section)}
|
||||||
|
|
|
@ -54,6 +54,10 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.file-name-label {
|
||||||
|
@include textEllipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.file-name-input {
|
.file-name-input {
|
||||||
@include flexCenter;
|
@include flexCenter;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue