Skip to content

Commit 44aa779

Browse files
committed
feat: update UI components and styles for improved layout and aesthetics
1 parent a5a5c28 commit 44aa779

12 files changed

Lines changed: 40 additions & 27 deletions

File tree

‎src-tauri/tauri.conf.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"transparent": true,
2727
"trafficLightPosition": {
2828
"x": 24,
29-
"y": 26
29+
"y": 25
3030
}
3131
}
3232
],

‎src/components/ai-elements/prompt-input.tsx‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { ChatStatus, FileUIPart } from "ai"
22
import {
3+
ArrowUpIcon,
34
ImageIcon,
45
Loader2Icon,
56
MicIcon,
6-
Navigation2Icon,
77
PaperclipIcon,
88
PlusIcon,
99
SquareIcon,
@@ -912,7 +912,7 @@ export const PromptInputTextarea = forwardRef<PromptInputTextareaHandle, PromptI
912912
return (
913913
<InputGroupTextarea
914914
ref={textareaRef}
915-
rows={1}
915+
rows={2}
916916
className={cn(
917917
"field-sizing-content min-h-(--chat-input-line-height) max-h-(--chat-input-max-height)",
918918
"text-sm leading-(--chat-input-line-height)",
@@ -1033,7 +1033,7 @@ export const PromptInputSubmit = ({
10331033
children,
10341034
...props
10351035
}: PromptInputSubmitProps) => {
1036-
let Icon = <Navigation2Icon className="mb-px fixed text-white fill-current" />
1036+
let Icon = <ArrowUpIcon className="size-4 fixed" />
10371037

10381038
if (status === "submitted") {
10391039
Icon = <Loader2Icon className="fixedanimate-spin" />
@@ -1046,11 +1046,7 @@ export const PromptInputSubmit = ({
10461046
return (
10471047
<InputGroupButton
10481048
aria-label="Submit"
1049-
className={cn(
1050-
"rounded-full bg-brand-green hover:bg-brand-green",
1051-
"transition-all duration-200",
1052-
className
1053-
)}
1049+
className={cn("rounded-full bg-foreground", "transition-all duration-200", className)}
10541050
size={size}
10551051
type="submit"
10561052
variant={variant}

‎src/components/ai-elements/tool-calls-container.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const ToolCallsContainerContent = memo(
137137
({ className, maxHeight = "24rem", children, ...props }: ToolCallsContainerContentProps) => (
138138
<CollapsibleContent
139139
className={cn(
140-
"relative mt-4 text-sm leading-normal",
140+
"relative mt-2 text-sm leading-normal",
141141
"data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2",
142142
"outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
143143
className

‎src/components/app-chat.tsx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,8 @@ const AppChat = ({ activeChatId, onChatCreated }: AppChatProps) => {
301301
}, [messages])
302302

303303
const handleSubmit = (message: PromptInputMessage) => {
304-
const hasText = Boolean(message.text)
304+
const messageText = message.text?.trim() ?? ""
305+
const hasText = Boolean(messageText)
305306
const hasAttachments = Boolean(message.files?.length)
306307
if (!(hasText || hasAttachments)) {
307308
return
@@ -323,8 +324,8 @@ const AppChat = ({ activeChatId, onChatCreated }: AppChatProps) => {
323324
description: toastConstants.filesAttachedDescription(message.files.length)
324325
})
325326
}
326-
if (message.text) {
327-
sendMessage({ text: message.text })
327+
if (messageText) {
328+
sendMessage({ text: messageText })
328329
setInput("")
329330
textareaRef.current?.resetHeight()
330331
}
@@ -353,7 +354,7 @@ const AppChat = ({ activeChatId, onChatCreated }: AppChatProps) => {
353354
<div
354355
className={cn(
355356
"fixed left-10 flex z-50 items-center justify-center pointer-events-auto gap-1.25",
356-
!isCompact && open ? "left-66.75" : "left-42",
357+
!isCompact && open ? "left-66.75" : "left-43",
357358
"transition-left duration-300 ease"
358359
)}
359360
>

‎src/components/nav-top.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ function NewChatTrigger({ className, ...props }: React.ComponentProps<typeof But
1919
variant="ghost"
2020
size="icon"
2121
className={cn(
22-
"size-8 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
22+
"size-7 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
2323
className
2424
)}
2525
{...props}
2626
>
27-
<MessageSquarePlus className="cursor-pointer size-4.5" />
27+
<MessageSquarePlus className="size-4 lucide-light" />
2828
<span className="sr-only">{t("nav.newChat")}</span>
2929
</Button>
3030
</TooltipTrigger>

‎src/components/nav-user.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { useLanguage } from "@/hooks/use-language"
2828
import { useShortcutDisplay } from "@/hooks/use-shortcut-config"
2929
import { openSettingsWindow, SettingsSection } from "@/lib/window-manager"
3030
import { ShortcutAction } from "@/types/settings"
31+
import { cn } from "../lib/utils"
3132
import { useTheme } from "./theme-provider"
3233
import { Button } from "./ui/button"
3334
import { Kbd, KbdGroup } from "./ui/kbd"
@@ -43,7 +44,13 @@ export function NavUser() {
4344
<SidebarMenuItem>
4445
<DropdownMenu>
4546
<DropdownMenuTrigger asChild>
46-
<Button variant="ghost" className="size-8 transition-transform hover:rotate-12">
47+
<Button
48+
variant="ghost"
49+
className={cn(
50+
"size-8 transition-transform opacity-50",
51+
"hover:opacity-100 hover:rotate-12"
52+
)}
53+
>
4754
<GhostIcon className="size-4" />
4855
</Button>
4956
</DropdownMenuTrigger>

‎src/components/select-model.tsx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ function SelectModel({ className, value, onChange, ...props }: SelectModelProps)
5757
<TooltipTrigger asChild>
5858
<DropdownMenuTrigger asChild>
5959
<Button
60-
variant="ghost"
61-
className={cn("h-8 gap-2 data-[state=open]:bg-accent font-medium", className)}
60+
variant="outline-no-shadow"
61+
className={cn("h-7 gap-2 data-[state=open]:bg-accent font-normal text-xs", className)}
6262
{...props}
6363
>
64-
<ProviderLogo providerId={selectedModel.provider} className="size-4" />
64+
<ProviderLogo providerId={selectedModel.provider} className="size-3.5" />
6565
{selectedModel.label || t("model.selectModel")}
6666
<ChevronDown
67-
className={cn("size-3.5 transition-transform duration-300", open && "-rotate-180")}
67+
className={cn("size-3 transition-transform duration-300", open && "-rotate-180")}
6868
/>
6969
<span className="sr-only">{t("model.selectModel")}</span>
7070
</Button>
@@ -73,7 +73,7 @@ function SelectModel({ className, value, onChange, ...props }: SelectModelProps)
7373
<TooltipContent>{t("model.switchModel")}</TooltipContent>
7474
</Tooltip>
7575

76-
<DropdownMenuContent align="start" sideOffset={6}>
76+
<DropdownMenuContent align="start" sideOffset={4}>
7777
<DropdownMenuGroup>
7878
{isLoading ? (
7979
<DropdownMenuItem disabled className="text-muted-foreground">

‎src/components/ui/button.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const buttonVariants = cva(
1414
destructive: "bg-destructive text-white hover:bg-destructive/90 dark:bg-destructive/60",
1515
outline:
1616
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
17+
"outline-no-shadow":
18+
"border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1719
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
1820
ghost:
1921
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-sidebar-accent aria-expanded:bg-accent dark:aria-expanded:bg-sidebar-accent aria-expanded:text-accent-foreground",

‎src/components/ui/sidebar.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<t
256256
variant="ghost"
257257
size="icon"
258258
className={cn(
259-
"size-8 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
259+
"size-7 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
260260
className
261261
)}
262262
onClick={event => {
@@ -265,7 +265,7 @@ function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<t
265265
}}
266266
{...props}
267267
>
268-
<PanelLeftIcon className="size-4.5" />
268+
<PanelLeftIcon className="size-4 lucide-light" />
269269
<span className="sr-only">{t("sidebar.toggleSidebar")}</span>
270270
</Button>
271271
</TooltipTrigger>

‎src/pages/Home.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,13 @@ export default function Page() {
5555
/>
5656

5757
{/* Top drag region */}
58-
<div data-tauri-drag-region className="z-50 fixed top-0 left-0 right-0 h-13.5"></div>
58+
<div data-tauri-drag-region className="z-50 h-12 fixed top-0 left-0 right-0"></div>
5959

6060
{/* Top buttons */}
61-
<div className="z-50 fixed top-3 left-23 flex items-center justify-center pointer-events-auto gap-1">
61+
<div
62+
data-tauri-drag-region
63+
className="z-50 pt-1.5 h-12 fixed left-24 flex items-center justify-center pointer-events-auto gap-2"
64+
>
6265
<SidebarTrigger />
6366
<NewChatTrigger onClick={handleNewChat} />
6467
</div>

0 commit comments

Comments
 (0)