@hmduc16031996/claude-mb-bridge 2.5.3 → 2.5.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmduc16031996/claude-mb-bridge",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
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
@@ -1724,6 +1724,40 @@ class ClaudeRemote {
1724
1724
 
1725
1725
  // Always show in mobile flex flow
1726
1726
  this.elements.mainScreen.classList.add('mobile-keys-visible');
1727
+
1728
+ // Handle initial sizing
1729
+ if (window.visualViewport) {
1730
+ window.visualViewport.addEventListener('resize', () => this.onViewportChange());
1731
+ window.visualViewport.addEventListener('scroll', () => this.onViewportChange());
1732
+ this.onViewportChange();
1733
+ }
1734
+ }
1735
+
1736
+ onViewportChange() {
1737
+ if (!window.visualViewport) return;
1738
+
1739
+ // Adjust app height to match visual viewport (the actual visible area above the keyboard)
1740
+ const viewportHeight = window.visualViewport.height;
1741
+ const bodyHeight = window.innerHeight;
1742
+
1743
+ // On some mobile browsers, setting 100% isn't enough when keyboard is open
1744
+ // We explicitly set the app height to the visual viewport height
1745
+ const app = document.getElementById('app');
1746
+ if (app) {
1747
+ app.style.height = `${viewportHeight}px`;
1748
+ }
1749
+
1750
+ // Recalculate terminal size for the new container height
1751
+ this.fitTerminal();
1752
+
1753
+ // Ensure terminal scrolled to bottom so cursor is visible above keyboard
1754
+ // Only if the current session is terminal-based
1755
+ if (this.currentSessionId && this.terminal) {
1756
+ this.terminal.scrollToBottom();
1757
+ }
1758
+
1759
+ // Log for debugging visibility if needed
1760
+ // console.log(`Viewport height: ${viewportHeight}, Body height: ${bodyHeight}`);
1727
1761
  }
1728
1762
 
1729
1763
 
@@ -1731,8 +1765,8 @@ class ClaudeRemote {
1731
1765
  if (!this.ws || this.ws.readyState !== WebSocket.OPEN || !this.currentSessionId) return;
1732
1766
 
1733
1767
  switch (key) {
1734
- case 'escape':
1735
- this.ws.send('\x1b'); // ESC
1768
+ case 'enter':
1769
+ this.ws.send('\r'); // Enter (CR)
1736
1770
  break;
1737
1771
  case 'ctrl':
1738
1772
  this.setCtrlActive(!this.ctrlActive);
package/public/index.html CHANGED
@@ -132,7 +132,7 @@
132
132
 
133
133
  <!-- Mobile Control Keys Toolbar (visible on mobile only) -->
134
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>
135
+ <button type="button" class="mobile-key" data-key="enter" aria-label="Enter">Ent</button>
136
136
  <button type="button" class="mobile-key mobile-key-modifier" data-key="ctrl" aria-label="Control modifier" aria-pressed="false">Ctrl</button>
137
137
  <button type="button" class="mobile-key mobile-key-modifier" data-key="shift" aria-label="Shift modifier" aria-pressed="false">Shift</button>
138
138
  <button type="button" class="mobile-key" data-key="tab" aria-label="Tab">Tab</button>
package/public/styles.css CHANGED
@@ -63,11 +63,12 @@ body {
63
63
 
64
64
  #app {
65
65
  width: 100%;
66
- height: 100%;
66
+ height: 100vh; /* Primary height */
67
67
  display: flex;
68
68
  flex-direction: column;
69
69
  position: relative;
70
70
  z-index: 1;
71
+ overflow: hidden;
71
72
  }
72
73
 
73
74
  /* ===== SCREENS ===== */