|
18 | 18 | () => selectedChannelId, |
19 | 19 | () => organizationId, |
20 | 20 | ); |
| 21 | +
|
| 22 | + function autofocus(node: HTMLElement) { |
| 23 | + node.focus(); |
| 24 | + } |
21 | 25 | </script> |
22 | 26 |
|
23 | 27 | <div class="flex h-full flex-col"> |
24 | 28 | <!-- Channel header --> |
25 | 29 | <header |
26 | 30 | class="border-subtle flex items-center justify-between border-b px-6 py-4" |
27 | 31 | > |
28 | | - <div class="flex items-center gap-3"> |
29 | | - <Hash class="size-5 opacity-50" /> |
| 32 | + <div class="flex items-center gap-4"> |
| 33 | + <Hash class="size-5 opacity-60" /> |
30 | 34 | <h1 class="text-base font-semibold"> |
31 | 35 | {controller.selectedChannel.data?.name ?? "..."} |
32 | 36 | </h1> |
33 | 37 | {#if controller.selectedChannel.data?.description} |
34 | | - <span class="hidden text-sm opacity-40 sm:inline"> |
| 38 | + <span class="hidden text-sm opacity-60 sm:inline"> |
35 | 39 | — {controller.selectedChannel.data.description} |
36 | 40 | </span> |
37 | 41 | {/if} |
|
44 | 48 | > |
45 | 49 | <input |
46 | 50 | type="text" |
47 | | - placeholder="メッセージを検索..." |
48 | | - class="input input-sm input-bordered bg-base-200 w-56 pr-8 text-sm transition-all duration-150 focus:w-64" |
| 51 | + placeholder="Search messages..." |
| 52 | + class="input input-sm input-bordered bg-base-200 w-56 pr-8 text-sm transition-all duration-200 focus:w-64" |
49 | 53 | bind:value={controller.searchQuery} |
50 | 54 | onkeydown={(e) => e.key === "Enter" && controller.handleSearch()} |
| 55 | + use:autofocus |
51 | 56 | /> |
52 | 57 | {#if controller.isSearching} |
53 | 58 | <span |
|
57 | 62 | </div> |
58 | 63 | {/if} |
59 | 64 | <button |
60 | | - class="btn btn-ghost btn-sm btn-square transition-all duration-150" |
61 | | - title="検索" |
| 65 | + class="btn btn-ghost btn-sm btn-square transition-all duration-200" |
| 66 | + title="Search" |
62 | 67 | onclick={() => (controller.showSearch = !controller.showSearch)} |
63 | 68 | > |
64 | 69 | <Search |
65 | | - class="size-5 opacity-50 transition-opacity duration-150 hover:opacity-80" |
| 70 | + class="size-5 opacity-60 transition-opacity duration-200 hover:opacity-80" |
66 | 71 | /> |
67 | 72 | </button> |
68 | 73 | </div> |
69 | 74 | </header> |
70 | 75 |
|
71 | 76 | <!-- Search results --> |
72 | 77 | {#if controller.searchResults.length > 0} |
73 | | - <div class="border-subtle bg-base-200/50 border-b p-2"> |
| 78 | + <div class="border-subtle bg-base-200/50 border-b p-4"> |
74 | 79 | <SearchResults |
75 | 80 | results={controller.searchResults} |
76 | 81 | onResultClick={controller.handleResultClick} |
|
0 commit comments