kingkont 0.7.36 → 0.7.38

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/index.html CHANGED
@@ -141,8 +141,20 @@
141
141
  scroll-snap-type: x proximity;
142
142
  }
143
143
  .welcome-recent-grid::-webkit-scrollbar { height: 8px; }
144
- .welcome-recent-grid::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
145
- .welcome-recent-grid::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
144
+
145
+ /* === Глобальные dark-scrollbars === */
146
+ /* Firefox */
147
+ * { scrollbar-color: #3a3a3a #1a1a1a; scrollbar-width: thin; }
148
+ /* WebKit (Electron/Chrome) — все scroll-области в приложении. */
149
+ ::-webkit-scrollbar { width: 10px; height: 10px; background: #1a1a1a; }
150
+ ::-webkit-scrollbar-track { background: #1a1a1a; }
151
+ ::-webkit-scrollbar-thumb {
152
+ background: #3a3a3a;
153
+ border-radius: 4px;
154
+ border: 2px solid #1a1a1a; /* gap, чтобы thumb «не прилипал» к краям */
155
+ }
156
+ ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
157
+ ::-webkit-scrollbar-corner { background: #1a1a1a; }
146
158
  .welcome-card {
147
159
  background: #232323; border: 1px solid #333; border-radius: 8px;
148
160
  overflow: hidden; cursor: pointer; transition: border-color 0.12s, transform 0.12s;
package/main.js CHANGED
@@ -100,6 +100,30 @@ ipcMain.handle('native-player:stop', async () => {
100
100
  let isQuitting = false;
101
101
  app.on('before-quit', () => { isQuitting = true; stopNativePlayer(); });
102
102
 
103
+ // Single-instance — спасает от двух копий после relaunch (особенно на Win,
104
+ // где старый процесс не успевает погаснуть до spawn нового). Если копия уже
105
+ // работает — этот процесс выходит, а первая копия просто фокусирует окно.
106
+ const singleLock = app.requestSingleInstanceLock();
107
+ if (!singleLock) {
108
+ app.quit();
109
+ } else {
110
+ app.on('second-instance', () => {
111
+ if (win && !win.isDestroyed()) {
112
+ if (win.isMinimized()) win.restore();
113
+ win.show();
114
+ win.focus();
115
+ }
116
+ });
117
+ }
118
+
119
+ // Windows console encoding fix: console default cp866/cp1252, наш log с
120
+ // UTF-8 (✓ ✗ ▶) превращается в кракозябры. Просим консоль UTF-8.
121
+ if (process.platform === 'win32') {
122
+ try {
123
+ require('node:child_process').execSync('chcp 65001', { stdio: 'ignore' });
124
+ } catch {}
125
+ }
126
+
103
127
  // ===== Settings persisted в userData/settings.json =====
104
128
  // Хранит API-ключи (KIE, ElevenLabs) и прочие конфиги. При старте main.js
105
129
  // прокидывает ключи в process.env, чтобы server.js подхватил без переписки.
@@ -464,15 +488,21 @@ ipcMain.handle('app:relaunch', () => {
464
488
  ? ''
465
489
  : ':/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin';
466
490
  const env = { ...process.env, PATH: (process.env.PATH || '') + extraPath };
491
+ // Задержка ДО запуска новой копии, чтобы старый процесс успел отпустить
492
+ // single-instance lock и file-based caches (на Windows иначе ловится
493
+ // 0x5 «Unable to move the cache» — два экземпляра одновременно).
494
+ const relaunchCmd = process.platform === 'win32'
495
+ ? 'timeout /t 2 /nobreak > nul && kingkont'
496
+ : 'sleep 2 && kingkont';
467
497
  try {
468
- const child = spawn('kingkont', { shell: true, env, detached: true, stdio: 'ignore' });
498
+ const child = spawn(relaunchCmd, { shell: true, env, detached: true, stdio: 'ignore' });
469
499
  child.unref();
470
500
  } catch (e) {
471
501
  console.warn('spawn kingkont failed, fallback на app.relaunch():', e?.message);
472
502
  app.relaunch();
473
503
  }
474
- // Дать ребёнку секунду чтобы успеть стартовать, потом выходим.
475
- setTimeout(() => app.exit(0), 800);
504
+ // Гасим текущий процесс быстро следующий стартует через 2 сек.
505
+ setTimeout(() => app.exit(0), 300);
476
506
  });
477
507
 
478
508
  // Фоновая проверка при старте: если есть свежая — открываем окно автоматом.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kingkont",
3
- "version": "0.7.36",
3
+ "version": "0.7.38",
4
4
  "description": "KingKont \u00b7 Chatium \u2014 \u043d\u043e\u0434-\u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0441\u0446\u0435\u043d \u0441 AI-\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 (\u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438/\u0432\u0438\u0434\u0435\u043e/\u0433\u043e\u043b\u043e\u0441/SFX/\u043c\u0443\u0437\u044b\u043a\u0430/\u0442\u0435\u043a\u0441\u0442)",
5
5
  "main": "main.js",
6
6
  "bin": {
package/settings.html CHANGED
@@ -105,6 +105,11 @@
105
105
 
106
106
  .saved { color: var(--ok); font-size: 12px; opacity: 0; transition: opacity 0.3s; }
107
107
  .saved.show { opacity: 1; }
108
+ /* Dark scrollbars — same palette как в основном окне. */
109
+ * { scrollbar-color: #3a3a3a var(--bg); scrollbar-width: thin; }
110
+ ::-webkit-scrollbar { width: 10px; height: 10px; background: var(--bg); }
111
+ ::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; border: 2px solid var(--bg); }
112
+ ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
108
113
  </style>
109
114
  </head>
110
115
  <body>
package/updates.html CHANGED
@@ -74,6 +74,11 @@
74
74
  0%, 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0.55); }
75
75
  50% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
76
76
  }
77
+ /* Dark scrollbars — same palette как в основном окне. */
78
+ * { scrollbar-color: #3a3a3a var(--bg); scrollbar-width: thin; }
79
+ ::-webkit-scrollbar { width: 10px; height: 10px; background: var(--bg); }
80
+ ::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; border: 2px solid var(--bg); }
81
+ ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
77
82
  </style>
78
83
  </head>
79
84
  <body>