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 isLastMessage = true;
export let readOnly = false; export let readOnly = false;
let buttonsContainerElement: HTMLDivElement;
let showDeleteConfirm = false; let showDeleteConfirm = false;
let model = null; let model = null;
@ -518,6 +519,18 @@
// console.log('ResponseMessage mounted'); // console.log('ResponseMessage mounted');
await tick(); 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> </script>
@ -802,10 +815,11 @@
</div> </div>
{#if !edit} {#if !edit}
{#if message.done || siblings.length > 1}
<div <div
bind:this={buttonsContainerElement}
class="flex justify-start overflow-x-auto buttons text-gray-600 dark:text-gray-500 mt-0.5" 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} {#if siblings.length > 1}
<div class="flex self-center min-w-fit" dir="ltr"> <div class="flex self-center min-w-fit" dir="ltr">
<button <button
@ -1313,7 +1327,6 @@
{/if} {/if}
{/if} {/if}
{/if} {/if}
</div>
{/if} {/if}
{#if message.done && showRateComment} {#if message.done && showRateComment}
@ -1327,6 +1340,7 @@
}} }}
/> />
{/if} {/if}
</div>
{/if} {/if}
</div> </div>
</div> </div>