feat: widen search and label the upload button

This commit is contained in:
2026-08-11 20:08:53 -04:00
parent adddcfeeed
commit 87fff20d72
3 changed files with 21 additions and 37 deletions
@@ -59,14 +59,14 @@
<svelte:document onkeydown={handleKeydown} />
<form>
<div class="flex w-full max-w-xs flex-col gap-6">
<form class="min-w-0 flex-1">
<div class="flex w-full max-w-xl flex-col">
<InputGroup.Root>
<InputGroup.Input placeholder="Search..." onclick={handleClick} />
<InputGroup.Input placeholder="Search books..." onclick={handleClick} />
<InputGroup.Addon>
<SearchIcon />
</InputGroup.Addon>
<InputGroup.Addon align="inline-end">
<InputGroup.Addon align="inline-end" class="hidden sm:flex">
<Kbd.Root>Ctrl</Kbd.Root>+
<Kbd.Root>k</Kbd.Root>
</InputGroup.Addon>
@@ -108,7 +108,7 @@
class="w-24 rounded object-cover shadow-lg"
/>
<div class="flex-top flex flex-col">
<span class="text-lg font-medium">{book.title}</span>
<span class="font-serif text-lg">{book.title}</span>
<span class=" text-md">{book.subtitle}</span>
{#if book.authors.length > 0}
<span class="line-clamp-1 w-full text-sm text-muted-foreground">
@@ -11,21 +11,18 @@
</script>
<header class="sticky top-0 z-50 flex w-full items-center border-b bg-background">
<div class="my-2 flex h-(--header-height) w-full items-center gap-2 px-4">
<div class="flex w-full justify-between">
<div class="flex gap-3">
<Button class="size-8" variant="ghost" size="icon" onclick={sidebar.toggle}>
<SidebarIcon />
</Button>
<Separator orientation="vertical" class="mr-2 h-(--header-height) border" />
</div>
<div class="my-2 flex h-(--header-height) w-full items-center gap-3 px-4">
<Button class="size-8 shrink-0" variant="ghost" size="icon" onclick={sidebar.toggle}>
<SidebarIcon />
</Button>
<Separator orientation="vertical" class="mr-1 h-6" />
<SearchForm />
<!-- Search takes the free space rather than sitting at a fixed width -->
<SearchForm />
<div class="flex w-24 items-center gap-4">
<UploadButton />
<ThemeToggle />
</div>
<div class="ml-auto flex shrink-0 items-center gap-2">
<UploadButton />
<ThemeToggle />
</div>
</div>
</header>
@@ -1,29 +1,16 @@
<script>
import Upload from '@lucide/svelte/icons/upload';
import { buttonVariants } from '$lib/components/ui/button/button.svelte';
import * as Tooltip from '$lib/components/ui/tooltip/index';
import { Button } from '$lib/components/ui/button/index.js';
import BooksUpload from '$lib/components/forms/books-upload.svelte';
import { goto } from '$app/navigation';
import { getBookOperationsState } from '$lib/state/bookOperations.svelte';
const bookOps = getBookOperationsState();
</script>
<Tooltip.Provider>
<Tooltip.Root ignoreNonKeyboardFocus>
<Tooltip.Trigger
onclick={async () => {
bookOps.uploadDialogOpen = true;
}}
class="{buttonVariants({ variant: 'ghost', size: 'icon' })} scale-110"
>
<Upload class="scale-110" />
</Tooltip.Trigger>
<Tooltip.Content>
<p>Upload Book</p>
</Tooltip.Content>
</Tooltip.Root>
</Tooltip.Provider>
<!-- Labelled, so no tooltip: the button already says what it does. -->
<Button onclick={() => (bookOps.uploadDialogOpen = true)}>
<Upload class="size-4" />
Upload
</Button>
<BooksUpload bind:open={bookOps.uploadDialogOpen} />