From 276dad95c96fa8fc5501ef936cabcbf80656c73e Mon Sep 17 00:00:00 2001 From: Tao Xu <360470+hewigovens@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:24:03 +0900 Subject: [PATCH] Fix mobile keyboard layout and text sizing issues (#441) Co-authored-by: Claude --- CHANGELOG.md | 4 +- .../client/components/terminal-quick-keys.ts | 109 +++++++++++------- 2 files changed, 69 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f96e343..78dd1c52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -165,7 +165,7 @@ First-time contributors to VibeTunnel: - Fixed duplicate session creation with intelligent detection (#345) (via @lukeswitz) - Added keyboard navigation in session grid (arrow keys, Enter, etc.) (#322) - Fixed race conditions in network access mode (#347) -- Improved SSH key manager modal layout (#325) (via @taoxugit) +- Improved SSH key manager modal layout (#325) (via @hewigovens) - Updated all dependencies to latest stable versions - Enhanced TypeScript configuration with better type safety @@ -173,7 +173,7 @@ First-time contributors to VibeTunnel: First-time contributors to VibeTunnel: - [@davidgomesdev](https://github.com/davidgomesdev) - Transformed SessionListView to clean MVVM architecture for better maintainability (#217) - [@jeffhurray](https://github.com/jeffhurray) - Consolidated z-index management to prevent UI layer conflicts (#291) -- [@taoxugit](https://github.com/taoxugit) - Fixed SSH key manager modal layout and improved test compatibility (#325) +- [@hewigovens](https://github.com/hewigovens) - Fixed SSH key manager modal layout and improved test compatibility (#325) - [@tarasenko](https://github.com/tarasenko) - Added browser keyboard shortcut support with intelligent priority handling (#298) ## [1.0.0-beta.9] - 2025-07-11 diff --git a/web/src/client/components/terminal-quick-keys.ts b/web/src/client/components/terminal-quick-keys.ts index cb7635a1..9873215f 100644 --- a/web/src/client/components/terminal-quick-keys.ts +++ b/web/src/client/components/terminal-quick-keys.ts @@ -111,6 +111,29 @@ export class TerminalQuickKeys extends LitElement { this.isLandscape = window.innerWidth > window.innerHeight && window.innerWidth > 600; } + private getButtonSizeClass(label: string): string { + if (label.length >= 4) { + // Long text: compact with max-width constraint + return this.isLandscape ? 'px-0.5 py-1 flex-1 max-w-14' : 'px-0.5 py-1.5 flex-1 max-w-16'; + } else if (label.length === 3) { + // Medium text: slightly more padding, larger max-width + return this.isLandscape ? 'px-1 py-1 flex-1 max-w-16' : 'px-1 py-1.5 flex-1 max-w-18'; + } else { + // Short text: can grow freely + return this.isLandscape ? 'px-1 py-1 flex-1' : 'px-1 py-1.5 flex-1'; + } + } + + private getButtonFontClass(label: string): string { + if (label.length >= 4) { + return 'quick-key-btn-xs'; // 8px + } else if (label.length === 3) { + return 'quick-key-btn-small'; // 10px + } else { + return 'quick-key-btn-medium'; // 13px + } + } + updated(changedProperties: PropertyValues) { super.updated(changedProperties); if (changedProperties.has('keyboardHeight')) { @@ -255,17 +278,6 @@ export class TerminalQuickKeys extends LitElement { private renderStyles() { return html` @@ -433,13 +458,13 @@ export class TerminalQuickKeys extends LitElement { >
-
+
${TERMINAL_QUICK_KEYS.filter((k) => k.row === 1).map( ({ key, label, modifier, arrow, toggle }) => html`