shell-mirror 1.5.81 → 1.5.82

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": "shell-mirror",
3
- "version": "1.5.81",
3
+ "version": "1.5.82",
4
4
  "description": "Access your Mac shell from any device securely. Perfect for mobile coding with Claude Code CLI, Gemini CLI, and any shell tool.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -109,7 +109,26 @@
109
109
  gap: 8px;
110
110
  }
111
111
 
112
- /* Session Info Button */
112
+ /* Connection Status Indicator */
113
+ .connection-status {
114
+ width: 12px;
115
+ height: 12px;
116
+ border-radius: 50%;
117
+ background: #ff4444;
118
+ margin-right: 12px;
119
+ flex-shrink: 0;
120
+ }
121
+
122
+ .connection-status.connecting {
123
+ background: #ffaa44;
124
+ animation: pulse 1.5s ease-in-out infinite;
125
+ }
126
+
127
+ .connection-status.connected {
128
+ background: #44ff44;
129
+ box-shadow: 0 0 6px rgba(68, 255, 68, 0.5);
130
+ }
131
+
113
132
  /* Session Tab Bar */
114
133
  .session-tab-bar {
115
134
  display: flex;
@@ -381,6 +400,9 @@
381
400
  </div>
382
401
  <div id="terminal-container">
383
402
  <div class="session-header" id="session-header" style="display: none;">
403
+ <!-- Connection Status Indicator -->
404
+ <div class="connection-status" id="connection-status"></div>
405
+
384
406
  <!-- Session Tab Bar -->
385
407
  <div class="session-tab-bar" id="session-tab-bar">
386
408
  <!-- Tabs will be rendered here by JavaScript -->
@@ -393,7 +415,7 @@
393
415
  <span class="btn-text">Help</span>
394
416
  </button>
395
417
  <a href="/app/dashboard.html" class="header-btn dashboard-btn">
396
- <span>📊</span>
418
+ <span class="btn-text">Dashboard</span>
397
419
  </a>
398
420
  </div>
399
421
  </div>
@@ -564,6 +564,11 @@ async function initializeWebRTCSignaling() {
564
564
  if (nextData.availableSessions) {
565
565
  availableSessions = nextData.availableSessions;
566
566
  console.log('[CLIENT] 📚 Available sessions:', availableSessions);
567
+
568
+ // Re-render tabs with updated session list
569
+ if (currentSession) {
570
+ renderTabs();
571
+ }
567
572
  }
568
573
 
569
574
  console.log('[CLIENT] Received WebRTC offer from agent.');
@@ -923,11 +928,16 @@ function sendMessage(message) {
923
928
  // Session Management Functions
924
929
  function updateSessionDisplay() {
925
930
  const sessionHeader = document.getElementById('session-header');
931
+ if (!sessionHeader) {
932
+ console.warn('[CLIENT] ⚠️ session-header element not found');
933
+ return;
934
+ }
926
935
 
927
936
  if (currentSession) {
928
937
  sessionHeader.style.display = 'flex';
929
938
 
930
939
  // Update tabs
940
+ console.log('[CLIENT] 📋 Rendering tabs, availableSessions:', availableSessions);
931
941
  renderTabs();
932
942
 
933
943
  console.log('[CLIENT] 📋 Session display updated:', currentSession);
@@ -936,32 +946,57 @@ function updateSessionDisplay() {
936
946
 
937
947
  function renderTabs() {
938
948
  const tabBar = document.getElementById('session-tab-bar');
939
- if (!tabBar) return;
949
+ if (!tabBar) {
950
+ console.warn('[CLIENT] ⚠️ session-tab-bar element not found');
951
+ return;
952
+ }
940
953
 
941
954
  // Get connection status
942
955
  const connectionStatus = getConnectionStatus();
943
956
 
957
+ // Ensure we have sessions to display
958
+ let sessionsToRender = [];
959
+
960
+ if (availableSessions && availableSessions.length > 0) {
961
+ // Use availableSessions from agent
962
+ sessionsToRender = availableSessions;
963
+ } else if (currentSession) {
964
+ // Fallback: show at least the current session
965
+ sessionsToRender = [currentSession];
966
+ }
967
+
968
+ console.log('[CLIENT] 🎨 Rendering tabs:', {
969
+ sessionCount: sessionsToRender.length,
970
+ currentSession: currentSession?.id,
971
+ connectionStatus,
972
+ source: availableSessions?.length > 0 ? 'agent' : 'fallback'
973
+ });
974
+
944
975
  // Build tabs HTML
945
976
  let tabsHTML = '';
946
977
 
947
- if (availableSessions && availableSessions.length > 0) {
948
- tabsHTML = availableSessions.map(session => {
978
+ if (sessionsToRender.length > 0) {
979
+ tabsHTML = sessionsToRender.map(session => {
949
980
  const isActive = currentSession && session.id === currentSession.id;
981
+ const displayName = session.name || 'Terminal Session';
982
+
950
983
  return `
951
984
  <button class="session-tab ${isActive ? 'active' : ''}"
952
985
  onclick="switchToSession('${session.id}')"
953
- ${isActive ? 'disabled' : ''}>
986
+ ${isActive ? 'disabled' : ''}
987
+ title="${displayName}">
954
988
  <span class="session-tab-status ${connectionStatus}"></span>
955
- <span class="session-tab-name">${session.name}</span>
989
+ <span class="session-tab-name">${displayName}</span>
956
990
  </button>
957
991
  `;
958
992
  }).join('');
959
993
  }
960
994
 
961
995
  // Add new session button
962
- tabsHTML += '<button class="session-tab-new" onclick="createNewSession()">+</button>';
996
+ tabsHTML += '<button class="session-tab-new" onclick="createNewSession()" title="New Session">+</button>';
963
997
 
964
998
  tabBar.innerHTML = tabsHTML;
999
+ console.log('[CLIENT] ✅ Tabs rendered:', sessionsToRender.length, 'tabs');
965
1000
  }
966
1001
 
967
1002
  function getConnectionStatus() {