Skip to content

Commit 630fab4

Browse files
Apply PR #19426: fix(app): default file tree to closed with minimum width
2 parents ed1850b + e8abd84 commit 630fab4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/app/src/context/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { createScrollPersistence, type SessionScroll } from "./layout-scroll"
1313
import { createPathHelpers } from "./file/path"
1414

1515
const AVATAR_COLOR_KEYS = ["pink", "mint", "orange", "purple", "cyan", "lime"] as const
16-
const DEFAULT_PANEL_WIDTH = 344
16+
const DEFAULT_PANEL_WIDTH = 200
1717
const DEFAULT_SESSION_WIDTH = 600
1818
const DEFAULT_TERMINAL_HEIGHT = 280
1919
export type AvatarColorKey = (typeof AVATAR_COLOR_KEYS)[number]
@@ -243,7 +243,7 @@ export const { use: useLayout, provider: LayoutProvider } = createSimpleContext(
243243
panelOpened: true,
244244
},
245245
fileTree: {
246-
opened: true,
246+
opened: false,
247247
width: DEFAULT_PANEL_WIDTH,
248248
tab: "changes" as "changes" | "all",
249249
},

packages/app/src/pages/session.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,15 @@ export default function Page() {
16401640
consumePendingMessage: layout.pendingMessage.consume,
16411641
})
16421642

1643+
createEffect(
1644+
on(
1645+
() => params.id,
1646+
(id) => {
1647+
if (!id) requestAnimationFrame(() => inputRef?.focus())
1648+
},
1649+
),
1650+
)
1651+
16431652
onMount(() => {
16441653
document.addEventListener("keydown", handleKeyDown)
16451654
})

0 commit comments

Comments
 (0)