Skip to content

Commit

Permalink
Make the response buttons visible on scroll using sticky
Browse files Browse the repository at this point in the history
  • Loading branch information
codewithcheese committed Aug 1, 2024
1 parent 43735c5 commit cf5fa40
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions src/routes/(app)/chat/[id]/revise/RevisePage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,29 @@
>
<CardContent class="overflow-y-auto p-0" action={autoScroller.action}>
{#if haveResponse}
<div class="flex flex-row items-center justify-end">
<Button
class="h-fit w-fit p-1 text-gray-500 hover:text-black"
variant="ghost"
size="icon"
onclick={() => (responseMode = responseMode === "edit" ? "view" : "edit")}
>
{#if responseMode === "view"}
<EditIcon class="h-4 w-4" />
{:else}
<EyeIcon class="h-4 w-4" />
{/if}
</Button>
<Button
class="h-fit w-fit p-1 text-gray-500 hover:text-black"
variant="ghost"
size="icon"
onclick={() => handleRemove(chatService.messages.length - 1)}
>
<Trash2Icon class="h-4 w-4" />
</Button>
<div class="sticky top-0 z-10 flex flex-row items-center justify-end">
<div class="rounded bg-background">
<Button
class="h-fit w-fit p-1 text-gray-500 hover:text-black "
variant="ghost"
size="icon"
onclick={() => (responseMode = responseMode === "edit" ? "view" : "edit")}
>
{#if responseMode === "view"}
<EditIcon class="h-4 w-4" />
{:else}
<EyeIcon class="h-4 w-4" />
{/if}
</Button>
<Button
class="h-fit w-fit p-1 text-gray-500 hover:text-black"
variant="ghost"
size="icon"
onclick={() => handleRemove(chatService.messages.length - 1)}
>
<Trash2Icon class="h-4 w-4" />
</Button>
</div>
</div>
<div class="px-4 pb-4">
{#if responseMode === "view" || chatService.isLoading}
Expand Down

0 comments on commit cf5fa40

Please sign in to comment.