This commit is contained in:
Timothy Jaeryang Baek 2025-02-23 14:12:41 -08:00
parent e90e254575
commit 737b1723c7

View File

@ -129,6 +129,7 @@
export let isLastMessage = true;
export let readOnly = false;
let buttonsContainerElement: HTMLDivElement;
let showDeleteConfirm = false;
let model = null;
@ -518,6 +519,18 @@
// console.log('ResponseMessage mounted');
await tick();
if (buttonsContainerElement) {
console.log(buttonsContainerElement);
buttonsContainerElement.addEventListener('wheel', function (event) {
// console.log(event.deltaY);
event.preventDefault();
if (event.deltaY !== 0) {
// Adjust horizontal scroll position based on vertical scroll
buttonsContainerElement.scrollLeft += event.deltaY;
}
});
}
});
</script>
@ -802,10 +815,11 @@
</div>
{#if !edit}
{#if message.done || siblings.length > 1}
<div
class=" flex justify-start overflow-x-auto buttons text-gray-600 dark:text-gray-500 mt-0.5"
>
<div
bind:this={buttonsContainerElement}
class="flex justify-start overflow-x-auto buttons text-gray-600 dark:text-gray-500 mt-0.5"
>
{#if message.done || siblings.length > 1}
{#if siblings.length > 1}
<div class="flex self-center min-w-fit" dir="ltr">
<button
@ -1313,20 +1327,20 @@
{/if}
{/if}
{/if}
</div>
{/if}
{/if}
{#if message.done && showRateComment}
<RateComment
bind:message
bind:show={showRateComment}
on:save={async (e) => {
await feedbackHandler(null, {
...e.detail
});
}}
/>
{/if}
{#if message.done && showRateComment}
<RateComment
bind:message
bind:show={showRateComment}
on:save={async (e) => {
await feedbackHandler(null, {
...e.detail
});
}}
/>
{/if}
</div>
{/if}
</div>
</div>