Skip to content

Commit cedf482

Browse files
staredclaude
andcommitted
Improve libraries dropdown UI and z-index layering
- Remove "Available Libraries" header for more compact design - Allow dropdown to expand to full screen height (no max-height restriction) - Fix checkbox and package title alignment issues - Add "v" prefix to version numbers for consistency - Remove disabled state during loading - dropdown stays interactive - Increase z-index to 2000 on mobile to appear above CHART label - Reduce padding and font sizes for more compact appearance - Better visual hierarchy with adjusted spacing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 73ceb63 commit cedf482

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "webr-ggplot2-demo",
33
"private": true,
4-
"version": "0.2.10",
4+
"version": "0.2.11",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src/components/LibrarySelector.vue

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ const handleToggle = (library: string, event: Event): void => {
3636
const dropdownRef = ref<HTMLElement>()
3737
3838
const toggleDropdown = (): void => {
39-
if (!props.isLoading) {
40-
isOpen.value = !isOpen.value
41-
}
39+
isOpen.value = !isOpen.value
4240
}
4341
4442
const handleClickOutside = (event: MouseEvent): void => {
@@ -62,10 +60,8 @@ onUnmounted(() => {
6260
class="library-selector"
6361
>
6462
<button
65-
:disabled="isLoading"
6663
class="libraries-button"
6764
:class="{
68-
'disabled': isLoading && !showStatus,
6965
'status-loading': showStatus && isLoading,
7066
'status-ready': showStatus && isReady && !isLoading
7167
}"
@@ -91,9 +87,6 @@ onUnmounted(() => {
9187
v-if="isOpen"
9288
class="libraries-dropdown"
9389
>
94-
<div class="libraries-header">
95-
<span class="header-text">Available Libraries</span>
96-
</div>
9790
<div class="libraries-list">
9891
<label
9992
v-for="library in availableLibraries"
@@ -114,7 +107,7 @@ onUnmounted(() => {
114107
<span
115108
v-if="installedLibraries.has(library.name) && packageVersions[library.name]"
116109
class="library-version"
117-
>{{ packageVersions[library.name] }}</span>
110+
>v{{ packageVersions[library.name] }}</span>
118111
</div>
119112
<span class="library-desc">{{ library.description }}</span>
120113
</div>
@@ -146,16 +139,11 @@ onUnmounted(() => {
146139
min-height: 32px;
147140
}
148141
149-
.libraries-button:hover:not(.disabled) {
142+
.libraries-button:hover {
150143
background: #e5e7eb;
151144
border-color: #3b82f6;
152145
}
153146
154-
.libraries-button.disabled {
155-
opacity: 0.6;
156-
cursor: not-allowed;
157-
}
158-
159147
.libraries-button.status-loading {
160148
background: #fef3c7;
161149
border-color: #f59e0b;
@@ -202,9 +190,10 @@ onUnmounted(() => {
202190
background: white;
203191
border: 1px solid #e5e7eb;
204192
border-radius: 6px;
205-
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
206-
z-index: 50;
207-
min-width: 240px;
193+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
194+
z-index: 1000;
195+
min-width: 220px;
196+
overflow-y: auto;
208197
}
209198
210199
.libraries-header {
@@ -220,14 +209,14 @@ onUnmounted(() => {
220209
}
221210
222211
.libraries-list {
223-
padding: 0.5rem;
212+
padding: 0.375rem;
224213
}
225214
226215
.library-item {
227216
display: flex;
228217
align-items: center;
229-
gap: 0.75rem;
230-
padding: 0.5rem;
218+
gap: 0.5rem;
219+
padding: 0.375rem;
231220
border-radius: 4px;
232221
cursor: pointer;
233222
transition: background-color 0.2s ease;
@@ -244,7 +233,9 @@ onUnmounted(() => {
244233
245234
.library-checkbox {
246235
margin: 0;
236+
margin-top: 2px;
247237
cursor: pointer;
238+
flex-shrink: 0;
248239
}
249240
250241
.library-checkbox:disabled {
@@ -254,14 +245,16 @@ onUnmounted(() => {
254245
.library-info {
255246
display: flex;
256247
flex-direction: column;
257-
gap: 0.25rem;
248+
gap: 0.125rem;
249+
flex: 1;
258250
}
259251
260252
.library-name-row {
261253
display: flex;
262254
align-items: center;
263255
justify-content: space-between;
264256
gap: 0.5rem;
257+
min-height: 1.2em;
265258
}
266259
267260
.library-name {
@@ -271,15 +264,17 @@ onUnmounted(() => {
271264
}
272265
273266
.library-version {
274-
font-size: 0.75rem;
267+
font-size: 0.6875rem;
275268
color: #059669;
276-
font-family: monospace;
269+
font-family: 'SF Mono', Monaco, 'Courier New', monospace;
277270
font-weight: 500;
271+
white-space: nowrap;
278272
}
279273
280274
.library-desc {
281-
font-size: 0.75rem;
275+
font-size: 0.6875rem;
282276
color: #6b7280;
277+
line-height: 1.3;
283278
}
284279
285280
/* Mobile styles */
@@ -312,8 +307,8 @@ onUnmounted(() => {
312307
}
313308
314309
.libraries-dropdown {
315-
max-height: 60vh;
316310
overflow-y: auto;
311+
z-index: 2000;
317312
}
318313
}
319314
</style>

0 commit comments

Comments
 (0)