kingkont 0.17.5 → 0.17.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": "kingkont",
3
- "version": "0.17.5",
3
+ "version": "0.17.6",
4
4
  "description": "KingKont · Chatium — нод-редактор сцен с AI-генерацией (картинки/видео/голос/SFX/музыка/текст)",
5
5
  "main": "main.js",
6
6
  "bin": {
@@ -2008,7 +2008,13 @@ async function pollJob(job, nodeId, bKey, boardHandle, kind) {
2008
2008
  const isCurrent = state.currentBoard?.key === bKey;
2009
2009
  if (typeof showToast === 'function') {
2010
2010
  const where = isCurrent ? '' : ` в ${bKey}`;
2011
- showToast(`✓ ${kind} «${nodeName || nodeId.slice(0,6)}» готов${where}`, isCurrent ? 'ok' : 'info');
2011
+ // target для click-навигации в notify-панели (откроется доска +
2012
+ // подсветится нода).
2013
+ showToast(
2014
+ `✓ ${kind} «${nodeName || nodeId.slice(0,6)}» готов${where}`,
2015
+ isCurrent ? 'ok' : 'info',
2016
+ { target: { projectKey: projectKeyAtCompletion, boardKey: bKey, nodeId } },
2017
+ );
2012
2018
  }
2013
2019
  // System notification — только когда генерация завершилась в фоне
2014
2020
  // (не на активной доске или когда окно скрыто). На активном UI
@@ -206,11 +206,12 @@
206
206
  // Init: ensure UI exists ASAP, hook into showToast и WS-events.
207
207
  document.addEventListener('DOMContentLoaded', () => {
208
208
  _ensureUI();
209
- // Wrap showToast чтобы дублировать в панель.
209
+ // Wrap showToast чтобы дублировать в панель + forward target для
210
+ // click-навигации (showToast(text, kind, {target: {...}})).
210
211
  if (typeof window.showToast === 'function') {
211
212
  const orig = window.showToast;
212
- window.showToast = function (text, kind) {
213
- try { addEvent({ kind: kind || 'info', text }); } catch {}
213
+ window.showToast = function (text, kind, opts) {
214
+ try { addEvent({ kind: kind || 'info', text, target: opts?.target || null }); } catch {}
214
215
  return orig.apply(this, arguments);
215
216
  };
216
217
  }
package/renderer/state.js CHANGED
@@ -201,12 +201,16 @@ window.systemNotify = systemNotify;
201
201
  // resume сработал, ...). Стек справа сверху. Auto-dismiss:
202
202
  // - ok/info — 10s (юзер должен заметить успех)
203
203
  // - error — 30s (важно, не пропустить)
204
- function showToast(text, kind) {
204
+ function showToast(text, kind, opts) {
205
+ // opts.target: {projectKey, boardKey, nodeId} — toast становится кликабельным.
205
206
  let host = document.getElementById('toastHost');
206
207
  if (!host) {
207
208
  host = document.createElement('div');
208
209
  host.id = 'toastHost';
209
- host.style.cssText = 'position:fixed; right:16px; top:64px; z-index:9999; display:flex; flex-direction:column; gap:8px; pointer-events:none; max-width:340px;';
210
+ // Bottom-left стек рядом с 🔔 кнопкой нотификаций. Новые toast'ы
211
+ // появляются СНИЗУ (flex-direction: column-reverse), так что они
212
+ // «всплывают» вверх от кнопки.
213
+ host.style.cssText = 'position:fixed; left:52px; bottom:12px; z-index:9999; display:flex; flex-direction:column-reverse; gap:8px; pointer-events:none; max-width:340px;';
210
214
  document.body.appendChild(host);
211
215
  }
212
216
  const t = document.createElement('div');
package/server.js CHANGED
@@ -356,9 +356,9 @@ async function handleChatClear(req, res) {
356
356
  async function handleJobsTrack(req, res) {
357
357
  try {
358
358
  const body = await readJson(req);
359
- const { action, projectKey, jobId, kind, name, type, taskId } = body || {};
359
+ const { action, projectKey, jobId, kind, name, type, taskId, boardKey } = body || {};
360
360
  if (!projectKey || !jobId) return send(res, 400, { error: 'projectKey + jobId обязательны' });
361
- if (action === 'start') jobsHub.start({ projectKey, jobId, kind, name, type, taskId });
361
+ if (action === 'start') jobsHub.start({ projectKey, jobId, kind, name, type, taskId, boardKey });
362
362
  else if (action === 'end') jobsHub.end({ projectKey, jobId });
363
363
  else return send(res, 400, { error: 'action: start|end' });
364
364
  send(res, 200, { ok: true });