@hmduc16031996/claude-mb-bridge 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ program
8
8
  .description('Bridge Claude Code CLI to mobile via WebView')
9
9
  .version('2.4.1')
10
10
  .option('--token <token>', 'Pairing token from mobile app')
11
- .option('--server <url>', 'Backend server URL', 'http://127.0.0.1:3110')
11
+ .option('--server <url>', 'Backend server URL', 'https://mobileide.kanddlabs.com')
12
12
  .option('--path <path>', 'Working directory', process.cwd())
13
13
  .option('--port <port>', 'Local port for terminal server', '38473')
14
14
  .option('--ide <type>', 'IDE type: claude_code or cursor', 'claude_code')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmduc16031996/claude-mb-bridge",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "Bridge between Claude Code CLI and your mobile app via WebView",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/public/app.js CHANGED
@@ -1688,7 +1688,6 @@ class ClaudeRemote {
1688
1688
  }
1689
1689
  }
1690
1690
 
1691
- // Mobile keys methods
1692
1691
  initMobileKeys() {
1693
1692
  // Only init on touch devices
1694
1693
  if (window.matchMedia('(pointer: fine)').matches) return;
@@ -1723,54 +1722,11 @@ class ClaudeRemote {
1723
1722
  });
1724
1723
  }, { passive: true });
1725
1724
 
1726
- // Detect keyboard visibility using visualViewport API
1727
- if (window.visualViewport) {
1728
- window.visualViewport.addEventListener('resize', () => this.onViewportChange());
1729
- window.visualViewport.addEventListener('scroll', () => this.onViewportChange());
1730
- }
1731
- }
1732
-
1733
- onViewportChange() {
1734
- const viewport = window.visualViewport;
1735
- const heightDiff = window.innerHeight - viewport.height;
1736
-
1737
- // If viewport is significantly smaller than window, keyboard is likely open
1738
- // Using 150px threshold to account for keyboard
1739
- const keyboardOpen = heightDiff > 150;
1740
-
1741
- if (keyboardOpen && this.elements.mainScreen.classList.contains('active')) {
1742
- // Position toolbar just above the keyboard
1743
- // Account for visual viewport offset when page is scrolled
1744
- const keyboardHeight = window.innerHeight - viewport.height - viewport.offsetTop;
1745
- this.elements.mobileKeys.style.bottom = `${Math.max(0, keyboardHeight)}px`;
1746
- this.showMobileKeys();
1747
- } else {
1748
- this.hideMobileKeys();
1749
- }
1750
- }
1751
-
1752
- showMobileKeys() {
1753
- this.elements.mobileKeys.classList.remove('hidden');
1754
- this.elements.mobileKeys.classList.add('visible');
1725
+ // Always show in mobile flex flow
1755
1726
  this.elements.mainScreen.classList.add('mobile-keys-visible');
1756
- this.fitTerminal();
1757
- }
1758
-
1759
- hideMobileKeys() {
1760
- this.elements.mobileKeys.classList.remove('visible');
1761
- this.elements.mainScreen.classList.remove('mobile-keys-visible');
1762
- // Reset modifier states when hiding
1763
- this.setCtrlActive(false);
1764
- this.setShiftActive(false);
1765
- this.fitTerminal();
1766
- // Hide after animation
1767
- setTimeout(() => {
1768
- if (!this.elements.mobileKeys.classList.contains('visible')) {
1769
- this.elements.mobileKeys.classList.add('hidden');
1770
- }
1771
- }, 300);
1772
1727
  }
1773
1728
 
1729
+
1774
1730
  handleMobileKey(key) {
1775
1731
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN || !this.currentSessionId) return;
1776
1732
 
@@ -1790,12 +1746,18 @@ class ClaudeRemote {
1790
1746
  case 'slash':
1791
1747
  this.ws.send('/');
1792
1748
  break;
1749
+ case 'left':
1750
+ this.ws.send('\x1b[D'); // Arrow left
1751
+ break;
1793
1752
  case 'up':
1794
1753
  this.ws.send('\x1b[A'); // Arrow up
1795
1754
  break;
1796
1755
  case 'down':
1797
1756
  this.ws.send('\x1b[B'); // Arrow down
1798
1757
  break;
1758
+ case 'right':
1759
+ this.ws.send('\x1b[C'); // Arrow right
1760
+ break;
1799
1761
  }
1800
1762
 
1801
1763
  // Clear modifiers after sending a key (except when toggling modifiers)
package/public/index.html CHANGED
@@ -130,6 +130,19 @@
130
130
  </div>
131
131
  </header>
132
132
 
133
+ <!-- Mobile Control Keys Toolbar (visible on mobile only) -->
134
+ <div id="mobile-keys" class="mobile-keys" role="toolbar" aria-label="Control keys">
135
+ <button type="button" class="mobile-key" data-key="escape" aria-label="Escape">Esc</button>
136
+ <button type="button" class="mobile-key mobile-key-modifier" data-key="ctrl" aria-label="Control modifier" aria-pressed="false">Ctrl</button>
137
+ <button type="button" class="mobile-key mobile-key-modifier" data-key="shift" aria-label="Shift modifier" aria-pressed="false">Shift</button>
138
+ <button type="button" class="mobile-key" data-key="tab" aria-label="Tab">Tab</button>
139
+ <button type="button" class="mobile-key" data-key="slash" aria-label="Slash">/</button>
140
+ <button type="button" class="mobile-key" data-key="left" aria-label="Arrow left">←</button>
141
+ <button type="button" class="mobile-key" data-key="up" aria-label="Arrow up">↑</button>
142
+ <button type="button" class="mobile-key" data-key="down" aria-label="Arrow down">↓</button>
143
+ <button type="button" class="mobile-key" data-key="right" aria-label="Arrow right">→</button>
144
+ </div>
145
+
133
146
  <!-- Terminal Container -->
134
147
  <div id="terminal-container" role="application" aria-label="Terminal"></div>
135
148
 
@@ -140,16 +153,6 @@
140
153
  </svg>
141
154
  </button>
142
155
 
143
- <!-- Mobile Control Keys Toolbar (visible when keyboard is open on mobile) -->
144
- <div id="mobile-keys" class="mobile-keys hidden" role="toolbar" aria-label="Control keys">
145
- <button type="button" class="mobile-key" data-key="escape" aria-label="Escape">Esc</button>
146
- <button type="button" class="mobile-key mobile-key-modifier" data-key="ctrl" aria-label="Control modifier" aria-pressed="false">Ctrl</button>
147
- <button type="button" class="mobile-key mobile-key-modifier" data-key="shift" aria-label="Shift modifier" aria-pressed="false">Shift</button>
148
- <button type="button" class="mobile-key" data-key="tab" aria-label="Tab">Tab</button>
149
- <button type="button" class="mobile-key" data-key="slash" aria-label="Slash">/</button>
150
- <button type="button" class="mobile-key" data-key="up" aria-label="Arrow up">↑</button>
151
- <button type="button" class="mobile-key" data-key="down" aria-label="Arrow down">↓</button>
152
- </div>
153
156
 
154
157
  <!-- Floating expand button (visible when header collapsed) -->
155
158
  <button id="expand-header-btn" class="btn-icon floating-btn hidden" title="Show header" aria-label="Show header">
package/public/styles.css CHANGED
@@ -1443,36 +1443,28 @@ kbd {
1443
1443
  /* CRITICAL: z-index must be higher than touch-scroll-overlay (9999) to receive taps.
1444
1444
  The overlay doesn't create a stacking context, so its 9999 z-index competes directly. */
1445
1445
  .mobile-keys {
1446
- position: fixed;
1447
- left: 0;
1448
- right: 0;
1449
1446
  display: flex;
1450
1447
  justify-content: center;
1451
- gap: 0.5rem;
1452
- padding: 0.5rem;
1448
+ gap: 0.25rem;
1449
+ padding: 0.375rem 0.5rem;
1453
1450
  background: var(--bg-primary);
1454
- border-top: 1px solid var(--border);
1455
- z-index: 10000;
1456
- opacity: 0;
1457
- pointer-events: none;
1451
+ border-bottom: 1px solid var(--border);
1452
+ z-index: 5;
1458
1453
  transition: opacity var(--transition);
1459
- /* bottom is set dynamically by JS */
1454
+ flex-shrink: 0;
1460
1455
  }
1461
1456
 
1462
- .mobile-keys.visible {
1463
- opacity: 1;
1464
- pointer-events: auto;
1465
- }
1466
1457
 
1467
1458
  .mobile-key {
1459
+ flex: 1;
1460
+ min-width: 0;
1468
1461
  display: inline-flex;
1469
1462
  align-items: center;
1470
1463
  justify-content: center;
1471
- min-width: 48px;
1472
1464
  height: 40px;
1473
- padding: 0 0.75rem;
1465
+ padding: 0 0.25rem;
1474
1466
  font-family: var(--font-mono);
1475
- font-size: 0.8125rem;
1467
+ font-size: 0.75rem;
1476
1468
  background: var(--bg-surface);
1477
1469
  color: var(--text-secondary);
1478
1470
  border: 1px solid var(--border);
@@ -1502,15 +1494,9 @@ kbd {
1502
1494
  }
1503
1495
  }
1504
1496
 
1505
- /* Adjust terminal container when toolbar is visible */
1506
- .mobile-keys.visible + .floating-btn,
1507
- .mobile-keys.visible ~ .floating-btn {
1508
- bottom: calc(56px + max(0.5rem, env(safe-area-inset-bottom)));
1509
- }
1510
-
1511
- /* When mobile keys are visible, add padding to terminal */
1512
- #main-screen.mobile-keys-visible #terminal-container {
1513
- padding-bottom: calc(56px + env(safe-area-inset-bottom));
1497
+ /* Layout adjustments when toolbar is visible (now part of flex flow) */
1498
+ .mobile-keys + #terminal-container {
1499
+ border-top: none; /* Already have border-bottom on keys */
1514
1500
  }
1515
1501
 
1516
1502
  /* ===== SCROLL TO BOTTOM BUTTON ===== */