refactor(ui): audit leftovers use Alert, Item, CodeView and Tooltip
Inline error paragraphs become destructive Alerts, divided record lists become Item rows, the redirect URI box uses CodeView, and icon-button title hints use Tooltip. Native titles remain on truncated values and on disabled controls.
This commit is contained in:
35 files changed
+333
-243
No files matched your search
+15
-10
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { MessageCirclePlus } from "@lucide/vue";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -17,16 +18,20 @@ import { newChat } from "./state";
|
||||
<template>
|
||||
<div class="flex items-center gap-1 border-b px-3 py-2">
|
||||
<ChatSessionList />
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
title="New chat"
|
||||
aria-label="New chat"
|
||||
@click="newChat"
|
||||
>
|
||||
<MessageCirclePlus />
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
aria-label="New chat"
|
||||
@click="newChat"
|
||||
>
|
||||
<MessageCirclePlus />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>New chat</TooltipContent>
|
||||
</Tooltip>
|
||||
<ChatSessionActions />
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { computed, nextTick, ref, watch } from "vue";
|
||||
|
||||
import { Clock, Mic, Pencil, X } from "@lucide/vue";
|
||||
@@ -173,12 +174,22 @@ function onKeydown(event: KeyboardEvent): void {
|
||||
>
|
||||
<Clock class="size-3.5 flex-none" aria-hidden="true" />
|
||||
<span class="min-w-0 flex-1 truncate">{{ queued }}</span>
|
||||
<Button variant="ghost" size="icon" class="size-7" aria-label="Edit queued message" title="Edit" @click="editQueued(index)"
|
||||
><Pencil
|
||||
/></Button>
|
||||
<Button variant="ghost" size="icon" class="size-7" aria-label="Remove queued message" title="Remove" @click="removeQueued(index)"
|
||||
><X
|
||||
/></Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button variant="ghost" size="icon" class="size-7" aria-label="Edit queued message" @click="editQueued(index)"
|
||||
><Pencil
|
||||
/></Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Edit</TooltipContent>
|
||||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button variant="ghost" size="icon" class="size-7" aria-label="Remove queued message" @click="removeQueued(index)"
|
||||
><X
|
||||
/></Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Remove</TooltipContent>
|
||||
</Tooltip>
|
||||
</li>
|
||||
</ul>
|
||||
<div
|
||||
|
||||
+28
-19
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { ChevronDown, ChevronUp } from "@lucide/vue";
|
||||
import { onUnmounted, ref, watch } from "vue";
|
||||
|
||||
@@ -69,16 +70,20 @@ function usePrompt(text: string): void {
|
||||
"
|
||||
>
|
||||
<ChatBar v-if="expanded">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
aria-label="Hide conversation"
|
||||
title="Hide conversation"
|
||||
@click="expanded = false"
|
||||
>
|
||||
<ChevronDown />
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
aria-label="Hide conversation"
|
||||
@click="expanded = false"
|
||||
>
|
||||
<ChevronDown />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Hide conversation</TooltipContent>
|
||||
</Tooltip>
|
||||
</ChatBar>
|
||||
<div v-if="expanded" class="flex h-[min(28rem,55dvh)] min-h-0 flex-col">
|
||||
<ChatTranscript @prompt="usePrompt" />
|
||||
@@ -86,15 +91,19 @@ function usePrompt(text: string): void {
|
||||
<div @focusin="expanded = true">
|
||||
<ChatComposer ref="composer" :open="false" :bordered="expanded" :class="!expanded && 'border-t-0!'">
|
||||
<template v-if="!expanded" #actions>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
aria-label="Show conversation"
|
||||
title="Show conversation"
|
||||
@click="expanded = true"
|
||||
>
|
||||
<ChevronUp />
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
aria-label="Show conversation"
|
||||
@click="expanded = true"
|
||||
>
|
||||
<ChevronUp />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Show conversation</TooltipContent>
|
||||
</Tooltip>
|
||||
</template>
|
||||
</ChatComposer>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import {
|
||||
Ellipsis,
|
||||
GitBranch,
|
||||
@@ -52,15 +53,19 @@ function prompt(command: string, message: string): void {
|
||||
<template>
|
||||
<Popover v-model:open="open">
|
||||
<PopoverTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
aria-label="More"
|
||||
title="More"
|
||||
>
|
||||
<Ellipsis />
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as-child>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
class="flex-none"
|
||||
aria-label="More"
|
||||
>
|
||||
<Ellipsis />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>More</TooltipContent>
|
||||
</Tooltip>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent align="end" class="grid w-64 gap-0.5 p-1">
|
||||
<template v-if="currentSession">
|
||||
|
||||
Reference in new issue
Block a user