Skip to content

Commit 32003ba

Browse files
committed
handle few edge cases on plugins page
1 parent f5a6d34 commit 32003ba

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

src/lib/installPlugin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export default async function installPlugin(
3030
isDependency,
3131
) {
3232
if (!isDependency) {
33-
loaderDialog = loader.create(name || "Plugin", strings.installing);
33+
loaderDialog = loader.create(name || "Plugin", strings.installing, {
34+
timeout: 6000,
35+
});
3436
depsLoaders = [];
3537
}
3638

src/pages/plugins/item.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ export default function Item({
2323
downloads,
2424
installed,
2525
}) {
26+
const authorName = (() => {
27+
const displayName =
28+
typeof author === "object" ? author.name : author || "Unknown";
29+
// Check if it's likely an email or too long
30+
if (displayName.includes("@") || displayName.length > 20) {
31+
return displayName.substring(0, 20) + "...";
32+
}
33+
return displayName;
34+
})();
35+
2636
return (
2737
<div
2838
data-id={id}
@@ -43,9 +53,14 @@ export default function Item({
4353
<span className="plugin-version">v{version}</span>
4454
</div>
4555
<div className="plugin-meta">
46-
<div className="plugin-stats">
56+
<div
57+
className="plugin-stats plugin-author"
58+
title={
59+
typeof author === "object" ? author.name : author || "Unknown"
60+
}
61+
>
4762
<span className="icon person"></span>
48-
{typeof author === "object" ? author.name : author || "Unknown"}
63+
{authorName}
4964
{author_verified ? (
5065
<i
5166
className="licons verified"

src/pages/plugins/plugins.scss

+34-5
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
transition: background-color 0.15s ease;
3737
display: flex;
3838
align-items: center;
39+
overflow-x: hidden;
3940
&:hover {
4041
background: color-mix(in srgb, var(--primary-color) 20%, transparent);
4142
}
@@ -88,6 +89,7 @@
8889
text-overflow: ellipsis;
8990
white-space: nowrap;
9091
min-width: 0;
92+
max-width: calc(100% - 50px);
9193
}
9294
.plugin-version {
9395
color: color-mix(in srgb, var(--secondary-text-color) 80%, black);
@@ -103,6 +105,7 @@
103105
font-size: 0.81rem;
104106
color: color-mix(in srgb, var(--secondary-text-color) 80%, black);
105107
display: flex;
108+
flex-wrap: wrap;
106109
gap: 0.375rem;
107110
align-items: center;
108111
.plugin-meta-dot {
@@ -114,12 +117,21 @@
114117
black
115118
);
116119
border-radius: 50%;
120+
display: inline-block;
117121
}
118122
.plugin-stats {
119123
display: flex;
120124
align-items: center;
121125
gap: 0.25rem;
122126
font-size: 0.81rem;
127+
128+
&.plugin-author {
129+
max-width: 150px;
130+
white-space: nowrap;
131+
overflow: hidden;
132+
text-overflow: ellipsis;
133+
}
134+
123135
.icon {
124136
display: inline-flex;
125137
align-items: center;
@@ -128,6 +140,7 @@
128140
height: 12px;
129141
font-size: 12px;
130142
line-height: 1;
143+
flex-shrink: 0;
131144
}
132145
}
133146
}
@@ -148,13 +161,29 @@
148161
}
149162
}
150163

151-
@media (max-width: 480px) {
152-
.plugin-title {
153-
flex-wrap: wrap;
164+
@media (max-width: 380px) {
165+
.plugin-header {
166+
.plugin-info {
167+
flex-direction: column;
168+
align-items: flex-start;
169+
170+
.plugin-price {
171+
margin-top: 4px;
172+
align-self: flex-start;
173+
}
174+
}
154175
}
155176

156-
.plugin-name {
157-
max-width: calc(100% - 1rem);
177+
.plugin-meta {
178+
margin-top: 2px;
179+
180+
.plugin-meta-dot {
181+
display: none;
182+
}
183+
184+
.plugin-stats {
185+
margin-right: 8px;
186+
}
158187
}
159188
}
160189
}

0 commit comments

Comments
 (0)