Skip to content

Commit fca4915

Browse files
authored
chore(fix): ui glitches on feature blocks (#32)
1 parent 1f544d2 commit fca4915

6 files changed

Lines changed: 23 additions & 10 deletions

File tree

src/components/FeatureSelector.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ const manualFeatures = computed(() => {
170170
<div
171171
v-for="feature in filteredFeatures"
172172
:key="feature.id"
173-
class="flex flex-col border rounded-lg transition-all group overflow-hidden"
173+
class="flex flex-col border rounded-lg transition-all group relative focus-within:z-20"
174174
:class="
175175
selectedFeatures[feature.id]
176-
? 'bg-ide-accent/5 border-ide-accent/40 ring-1 ring-ide-accent/20'
177-
: 'bg-ide-activity/30 border-ide-border hover:border-ide-accent/30'
176+
? 'bg-ide-accent/5 border-ide-accent/40 ring-1 ring-ide-accent/20 z-10'
177+
: 'bg-ide-activity/30 border-ide-border hover:border-ide-accent/30 z-0'
178178
"
179179
>
180180
<div
@@ -396,7 +396,7 @@ const manualFeatures = computed(() => {
396396
<div
397397
v-for="id in manualFeatures"
398398
:key="id"
399-
class="flex flex-col border rounded-lg bg-ide-accent/5 border-ide-accent/40 ring-1 ring-ide-accent/20 overflow-hidden"
399+
class="flex flex-col border rounded-lg bg-ide-accent/5 border-ide-accent/40 ring-1 ring-ide-accent/20 relative focus-within:z-20"
400400
>
401401
<div class="flex items-center justify-between p-3">
402402
<div class="flex flex-col flex-1 min-w-0">

src/components/SearchableSelect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const isLoading = computed(() => props.loading);
145145
</div>
146146
<div
147147
v-if="showDropdown"
148-
class="absolute top-full left-0 right-0 mt-1 bg-ide-activity border border-ide-border rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto custom-scrollbar"
148+
class="absolute top-full left-0 right-0 mt-1 bg-ide-sidebar/95 backdrop-blur-md border border-ide-border rounded-lg shadow-2xl z-50 max-h-60 overflow-y-auto custom-scrollbar"
149149
>
150150
<div v-if="searchable" class="p-2 border-b border-ide-border/50">
151151
<input

src/components/config/sections/General/ImageSourceField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ dropdownRef;
5656
<div
5757
v-if="showImageSuggestions && filteredImages.length > 0"
5858
ref="dropdownRef"
59-
class="absolute top-full left-0 right-0 mt-1 bg-ide-activity border border-ide-border rounded-lg shadow-xl z-50 max-h-60 overflow-y-auto custom-scrollbar transition-all"
59+
class="absolute top-full left-0 right-0 mt-1 bg-ide-sidebar/95 backdrop-blur-md border border-ide-border rounded-lg shadow-2xl z-50 max-h-60 overflow-y-auto custom-scrollbar transition-all"
6060
>
6161
<div
6262
v-for="(img, i) in filteredImages"

src/composables/useFeatures.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ref, onMounted } from "vue";
2+
import { DATA_URLS } from "../constants/urls";
23

34
export interface FeatureOption {
45
type: "string" | "boolean";
@@ -27,7 +28,7 @@ export function useFeatures() {
2728
error.value = null;
2829

2930
try {
30-
const res = await fetch("/data/features.json");
31+
const res = await fetch(DATA_URLS.FEATURES);
3132
if (!res.ok) throw new Error("No data found");
3233

3334
features.value = await res.json();

src/composables/useImageAutocomplete.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import { ref, computed, reactive, watch, nextTick } from "vue";
2-
import { MCR_PREFIX } from "../constants/urls";
2+
import { MCR_PREFIX, DATA_URLS } from "../constants/urls";
33

44
export const sharedTagsCache = reactive<Record<string, string[]>>({});
55
let fetchPromise: Promise<void> | null = null;
66

77
export function ensureSharedTags() {
88
if (fetchPromise) return fetchPromise;
99

10-
fetchPromise = fetch("/data/imageTags.json")
10+
fetchPromise = fetch(DATA_URLS.IMAGE_TAGS)
1111
.then((res) => {
1212
if (!res.ok) throw new Error();
1313
return res.json();
1414
})
1515
.then((data) => {
16+
for (const key in sharedTagsCache) {
17+
if (Object.prototype.hasOwnProperty.call(sharedTagsCache, key)) {
18+
delete sharedTagsCache[key];
19+
}
20+
}
1621
Object.assign(sharedTagsCache, data);
1722
})
1823
.catch(() => {
19-
console.warn("imageTags.json not found. Using fallback behavior.");
24+
console.warn("imageTags.json not found.");
2025
fetchPromise = null;
2126
});
2227

src/constants/urls.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ export const URLS = {
2222
// External
2323
SIMPLE_ICONS_BASE: "https://cdn.simpleicons.org",
2424
};
25+
26+
export const BASE_URL = import.meta.env.BASE_URL;
27+
28+
export const DATA_URLS = {
29+
FEATURES: `${BASE_URL}data/features.json`,
30+
IMAGE_TAGS: `${BASE_URL}data/imageTags.json`,
31+
};

0 commit comments

Comments
 (0)