Skip to content

Commit 6621e7f

Browse files
committed
style(ChatBubbleRegenerate): render the popup below the chatbubble when at top of screen
1 parent f851a46 commit 6621e7f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

app/components/Chat/Bubble/ChatBubbleRegenerate.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,20 @@ watch(
4848
}
4949
},
5050
);
51+
52+
const iconRef = ref<HTMLElement | null>(null);
53+
const renderBelow = computed(() => {
54+
if (!iconRef.value) return false;
55+
const iconRect = iconRef.value.getBoundingClientRect();
56+
57+
return iconRect.y < 240;
58+
});
5159
</script>
5260

5361
<template>
5462
<div class="relative chat-input-model">
5563
<div
64+
ref="iconRef"
5665
class="flex items-center gap-2 cursor-pointer chat-input-model-button"
5766
@mousedown.stop.prevent="popupVisible = !popupVisible"
5867
>
@@ -63,7 +72,8 @@ watch(
6372
<div
6473
v-if="popupVisible && availableModels.length"
6574
ref="popupRef"
66-
class="absolute bottom-full mb-2 left-0 bg-(--bg-color) border border-(--sub-color) rounded-lg shadow-lg w-60 max-h-60 z-10 chat-input-model-popup overflow-y-auto"
75+
class="absolute my-2 left-0 bg-(--bg-color) border border-(--sub-color) rounded-lg shadow-lg w-60 max-h-60 z-10 chat-input-model-popup overflow-y-auto"
76+
:class="renderBelow ? 'top-full' : 'bottom-full'"
6777
>
6878
<div
6979
v-for="model in availableModels.sort((a, b) =>

0 commit comments

Comments
 (0)