@lethevimlet/sshift 1.7.4 → 1.7.6

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": "@lethevimlet/sshift",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "Web-based SSH + SFTP terminal client with tabs and bookmarks",
5
5
  "main": "src/server/index.js",
6
6
  "bin": {
@@ -1,7 +1,11 @@
1
1
  /**
2
2
  * Layout management WebSocket handlers
3
+ *
4
+ * The layout-change broadcast handler was removed: the preferred layout
5
+ * is a per-device preference stored in each browser's localStorage (it
6
+ * survives server restarts and can differ between devices). Only the
7
+ * per-tab panel ASSIGNMENTS are still synced (see tabs.js tabs-save).
3
8
  */
4
-
5
9
  let currentLayout = 'default';
6
10
 
7
11
  /**
@@ -26,14 +30,7 @@ function setCurrentLayout(layoutId) {
26
30
  * @param {Object} io - Socket.IO instance
27
31
  */
28
32
  function registerLayoutHandlers(socket, io) {
29
- // Layout change - sync across all sessions
30
- socket.on('layout-change', (data) => {
31
- console.log('[LAYOUT] Layout change:', data.layoutId);
32
- currentLayout = data.layoutId;
33
-
34
- // Broadcast to all other clients
35
- socket.broadcast.emit('layout-changed', { layoutId: data.layoutId });
36
- });
33
+ // No handlers: layout preference is per-device (client localStorage).
37
34
  }
38
35
 
39
36
  module.exports = {
@@ -15,11 +15,7 @@ const {
15
15
  updateTabName,
16
16
  updateTabPanel,
17
17
  setActiveTab,
18
- getOpenTabs,
19
- getCurrentTheme,
20
- setCurrentTheme,
21
- getCurrentAccent,
22
- setCurrentAccent
18
+ getOpenTabs
23
19
  } = require('../../utils/tab-manager');
24
20
  const { sshManager, sftpManager } = require('../../services');
25
21
 
@@ -169,31 +165,9 @@ function registerTabHandlers(socket, io) {
169
165
  });
170
166
  });
171
167
 
172
- // Theme change - sync across all clients
173
- socket.on('theme-change', (data) => {
174
- console.log('[TAB] Theme change:', data.theme);
175
-
176
- // Update server-side theme
177
- setCurrentTheme(data.theme);
178
-
179
- // Broadcast to all other clients
180
- socket.broadcast.emit('theme-changed', {
181
- theme: data.theme
182
- });
183
- });
184
-
185
- // Accent change - sync across all clients
186
- socket.on('accent-change', (data) => {
187
- console.log('[TAB] Accent change:', data.accent);
188
-
189
- // Update server-side accent
190
- setCurrentAccent(data.accent);
191
-
192
- // Broadcast to all other clients
193
- socket.broadcast.emit('accent-changed', {
194
- accent: data.accent
195
- });
196
- });
168
+ // theme-change / accent-change handlers removed: theme and accent are
169
+ // per-device preferences kept in each browser's localStorage and are
170
+ // no longer synced through the server.
197
171
  }
198
172
 
199
173
  /**
@@ -385,15 +385,16 @@ async function initializeServer() {
385
385
  io.on('connection', (socket) => {
386
386
  console.log('Client connected:', socket.id);
387
387
 
388
- // Send current open tabs to new client
389
- const { getOpenTabs, getTabOrder, getCurrentTheme, getCurrentAccent, getActiveTabsByPanel } = require('./utils/tab-manager');
390
- const { getCurrentLayout } = require('./endpoints/ws/layout');
388
+ // Send current open tabs to new client.
389
+ // NOTE: theme, accent and layout are deliberately NOT included —
390
+ // they are per-device preferences stored in each browser's
391
+ // localStorage (they survive server restarts and can differ per
392
+ // device). Broadcasting them here used to clobber every new client's
393
+ // own preference with the server's in-memory copy.
394
+ const { getOpenTabs, getTabOrder, getActiveTabsByPanel } = require('./utils/tab-manager');
391
395
 
392
396
  const openTabs = getOpenTabs();
393
397
  const tabOrder = getTabOrder();
394
- const currentLayout = getCurrentLayout();
395
- const currentTheme = getCurrentTheme();
396
- const currentAccent = getCurrentAccent();
397
398
  const activeTabsByPanelMap = getActiveTabsByPanel();
398
399
  const activeTabsByPanel = Object.fromEntries(activeTabsByPanelMap);
399
400
 
@@ -438,10 +439,7 @@ async function initializeServer() {
438
439
 
439
440
  socket.emit('open-tabs', {
440
441
  tabs: orderedTabs,
441
- layout: currentLayout,
442
- activeTabsByPanel,
443
- theme: currentTheme,
444
- accent: currentAccent
442
+ activeTabsByPanel
445
443
  });
446
444
 
447
445
  // Sync flash state for tabs that need attention
@@ -18,7 +18,10 @@
18
18
  <link rel="stylesheet" href="/libs/xterm/xterm.css?v=__VERSION__">
19
19
  <link rel="stylesheet" href="/libs/font-awesome/css/all.min.css?v=__VERSION__">
20
20
  <link rel="stylesheet" href="/css/style.css?v=__VERSION__">
21
- <script src="/libs/lucide/lucide.min.js?v=__VERSION__"></script>
21
+ <!-- defer: 397KB icon library must not block first paint on slow mobile
22
+ connections. lucide.createIcons() only runs at DOMContentLoaded
23
+ (app.js), which fires after deferred scripts execute. -->
24
+ <script defer src="/libs/lucide/lucide.min.js?v=__VERSION__"></script>
22
25
  </head>
23
26
  <body>
24
27
  <!-- Lock Screen Overlay (shown by default, hidden by JS if no password) -->