Skip to content

Commit e8d5238

Browse files
Fix sidebar button functionality and search focus
1 parent d69e632 commit e8d5238

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

components/code-editor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Editor, { Monaco } from '@monaco-editor/react'
22
import { useRef } from 'react'
33
import * as monacoEditor from 'monaco-editor'
44
import { useTheme } from 'next-themes'
5+
// @ts-ignore
56
import './code-theme.css'
67

78
export function CodeEditor({

components/sidebar.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,16 @@ export const Sidebar: React.FC<SidebarProps> = ({
193193
<Button
194194
variant="ghost"
195195
size="icon"
196-
onClick={() => handleOpenSidebar()}
196+
onClick={() => {
197+
handleOpenSidebar()
198+
// Focus search input after opening sidebar
199+
setTimeout(() => {
200+
const searchInput = document.querySelector('input[placeholder="Search"]') as HTMLInputElement
201+
if (searchInput) {
202+
searchInput.focus()
203+
}
204+
}, 100)
205+
}}
197206
className="h-8 w-8 text-muted-foreground hover:text-foreground transition-colors"
198207
aria-label="Search"
199208
>
@@ -248,13 +257,11 @@ export const Sidebar: React.FC<SidebarProps> = ({
248257
<Button
249258
variant="ghost"
250259
size="icon"
251-
asChild
260+
onClick={onSelectAccount}
252261
className="h-8 w-8 text-muted-foreground hover:text-foreground transition-colors"
253-
aria-label="Join Waitlist"
262+
aria-label="Account"
254263
>
255-
<a href="https://waitlist.codinit.dev" target="_blank" rel="noopener noreferrer">
256-
<User className="h-5 w-5" />
257-
</a>
264+
<User className="h-5 w-5" />
258265
</Button>
259266
<Button
260267
variant="ghost"
@@ -405,7 +412,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
405412
className="w-full justify-start gap-3 text-muted-foreground hover:text-foreground transition-colors"
406413
>
407414
<User className="h-4 w-4" />
408-
Select Account
415+
Account Settings
409416
</Button>
410417

411418
<Button

0 commit comments

Comments
 (0)