From 523caa4d4264a54e6e01aea040687f9e82206559 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Mon, 26 Oct 2026 15:32:54 -0700 Subject: [PATCH] fix(app): keep the mobile tabs drawer open when a session's composer loads --- packages/app/src/session/composer/controller.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/app/src/session/composer/controller.ts b/packages/app/src/session/composer/controller.ts index 3160b8ee3a20..8b6a460a1238 100644 --- a/packages/app/src/session/composer/controller.ts +++ b/packages/app/src/session/composer/controller.ts @@ -62,8 +62,14 @@ export function createSessionComposerController(input: { if (!editor?.isConnected || !region.showComposer() || region.child() || dialog.active) return const active = document.activeElement - // A control chosen while the session was loading owns focus now. - if (active && active !== document.body && active !== editor && !active.matches("[data-titlebar-tab-link]")) + // A control chosen while the session was loading owns focus now. The tab link that opened the session + // passes focus on, unless it sits in a dialog, such as the mobile tabs drawer reopened before the composer. + if ( + active && + active !== document.body && + active !== editor && + (!active.matches("[data-titlebar-tab-link]") || active.closest('[role="dialog"]')) + ) return editor.focus({ preventScroll: true }) setCursorPosition(editor, adapter.state.cursor() ?? promptLength(adapter.state.current()))