From b98a8d190ecdff275b645aeb71a33c01c81f3253 Mon Sep 17 00:00:00 2001 From: Helmut Januschka Date: Fri, 27 Jun 2025 21:32:06 +0200 Subject: [PATCH] Add Shift+Tab key to mobile QuickKeyboard (#111) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Shift+Tab key to mobile QuickKeyboard per PR #105 feedback Implements Peter's suggestion to add Shift+Tab key to mobile quick keyboard for enhanced Claude Code planning mode support on mobile devices. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude * Fix Monaco Editor keyboard input cancellation Enhanced isKeyboardShortcut detection to properly handle Monaco Editor elements, preventing keyboard event interference while maintaining terminal functionality. - Added contentEditable detection - Added .monaco-editor container detection - Added data-keybinding-context detection - Added .editor-container detection This resolves the 'Canceled: Canceled' errors when typing in Monaco Editor while preserving Shift+Tab functionality for Claude Code planning mode. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --------- Co-authored-by: Claude --- .../client/components/session-view/input-manager.ts | 10 +++++++--- web/src/client/components/terminal-quick-keys.ts | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/web/src/client/components/session-view/input-manager.ts b/web/src/client/components/session-view/input-manager.ts index 648aec24..e951106f 100644 --- a/web/src/client/components/session-view/input-manager.ts +++ b/web/src/client/components/session-view/input-manager.ts @@ -257,14 +257,18 @@ export class InputManager { } isKeyboardShortcut(e: KeyboardEvent): boolean { - // Check if we're typing in an input field + // Check if we're typing in an input field or editor const target = e.target as HTMLElement; if ( target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || - target.tagName === 'SELECT' + target.tagName === 'SELECT' || + target.contentEditable === 'true' || + target.closest('.monaco-editor') || + target.closest('[data-keybinding-context]') || + target.closest('.editor-container') ) { - // Allow normal input in form fields + // Allow normal input in form fields and editors return false; } diff --git a/web/src/client/components/terminal-quick-keys.ts b/web/src/client/components/terminal-quick-keys.ts index da39f005..eafa54a5 100644 --- a/web/src/client/components/terminal-quick-keys.ts +++ b/web/src/client/components/terminal-quick-keys.ts @@ -9,6 +9,7 @@ const TERMINAL_QUICK_KEYS = [ { key: 'CtrlExpand', label: '⌃', toggle: true, row: 1 }, { key: 'F', label: 'F', toggle: true, row: 1 }, { key: 'Tab', label: 'Tab', row: 1 }, + { key: 'shift_tab', label: '⇤', row: 1 }, { key: 'ArrowUp', label: '↑', arrow: true, row: 1 }, { key: 'ArrowDown', label: '↓', arrow: true, row: 1 }, { key: 'ArrowLeft', label: '←', arrow: true, row: 1 },