@galda/cli 0.10.100 → 0.10.101
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/app/index.html +34 -3
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -4520,7 +4520,7 @@ function renderQueue(){
|
|
|
4520
4520
|
// mirror connectionBannerState({online}) from engine/lib.mjs (a browser static file
|
|
4521
4521
|
// can't import the module) — offline ⇒ red inline line + Reconnect atop the tray.
|
|
4522
4522
|
const connHtml = offline
|
|
4523
|
-
?
|
|
4523
|
+
? `<div class="connline"><span class="cdot"></span><span class="cw">Galda is offline</span><span class="cmsg">${esc(connMsg ?? '— reconnecting…')}</span><button class="errbtn creconn" data-reconnect>Reconnect</button></div>`
|
|
4524
4524
|
: '';
|
|
4525
4525
|
// Optimistic outbox items (saved to localStorage BEFORE the network call) render
|
|
4526
4526
|
// first — instant, offline-safe, never lost. 'unsent' rows are tap-to-resend.
|
|
@@ -4568,7 +4568,7 @@ function renderQueue(){
|
|
|
4568
4568
|
<button class="qico del qd" data-id="${g.id}" title="Delete">${ICONS.trash}</button></div>`;
|
|
4569
4569
|
}).join('');
|
|
4570
4570
|
for (const el of q.querySelectorAll('[data-oresend]')) el.onclick = () => { const item = outbox.load().find((x) => x.oid === el.dataset.oresend); if (item) postOutboxItem(item); };
|
|
4571
|
-
for (const el of q.querySelectorAll('[data-reconnect]')) el.onclick = () =>
|
|
4571
|
+
for (const el of q.querySelectorAll('[data-reconnect]')) el.onclick = () => reconnectTapped(el);
|
|
4572
4572
|
const qrows = [...q.querySelectorAll('.qrow[data-goal]')];
|
|
4573
4573
|
for (const el of qrows) {
|
|
4574
4574
|
el.addEventListener('dragstart', (e) => { state.dragGoal = Number(el.dataset.goal); el.classList.add('dragging'); e.dataTransfer.effectAllowed = 'move'; });
|
|
@@ -8631,8 +8631,39 @@ let sseUp = false; // live engine link — the honest signal behind the MCP tab'
|
|
|
8631
8631
|
// sub-second SSE blips don't flash a red line. connOffline is the debounced flag
|
|
8632
8632
|
// renderQueue() reads; connSetOnline/Offline flip it around real sseUp changes.
|
|
8633
8633
|
let connOffline = false, _connGraceT = null, _sseReconnectT = null, _es = null, _healthT = null, _healthFailStreak = 0;
|
|
8634
|
-
function connSetOnline(){ if (_connGraceT) { clearTimeout(_connGraceT); _connGraceT = null; } if (connOffline) { connOffline = false; renderQueue(); } }
|
|
8634
|
+
function connSetOnline(){ if (_connGraceT) { clearTimeout(_connGraceT); _connGraceT = null; } connMsg = null; if (connOffline) { connOffline = false; renderQueue(); } }
|
|
8635
8635
|
function connSetOffline(){ if (_connGraceT || connOffline) return; _connGraceT = setTimeout(() => { _connGraceT = null; connOffline = true; renderQueue(); }, 800); }
|
|
8636
|
+
// What the offline line says under "Galda is offline". Null = the default
|
|
8637
|
+
// "— reconnecting…"; a failed manual attempt leaves its own standing reason here
|
|
8638
|
+
// so the button can reset without the explanation disappearing with it.
|
|
8639
|
+
let connMsg = null;
|
|
8640
|
+
let _reconnectTapT = null, _reconnectTapArmed = false;
|
|
8641
|
+
// Reconnect must answer the tap (goal-837: 「reconnectをタップしてもフィードバックがない」).
|
|
8642
|
+
// The button used to call forceReconnect() straight, which changes nothing visible:
|
|
8643
|
+
// a retry that failed looked exactly like a tap that never registered. So: relabel and
|
|
8644
|
+
// disable at once, then — if we are still offline a few seconds later — probe health
|
|
8645
|
+
// once, say so in a toast, and put the reason on the line before resetting the button.
|
|
8646
|
+
function reconnectTapped(btn){
|
|
8647
|
+
if (btn) { btn.disabled = true; btn.textContent = 'Reconnecting…'; }
|
|
8648
|
+
_reconnectTapArmed = true;
|
|
8649
|
+
connMsg = null;
|
|
8650
|
+
forceReconnect();
|
|
8651
|
+
if (_reconnectTapT) clearTimeout(_reconnectTapT);
|
|
8652
|
+
_reconnectTapT = setTimeout(async () => {
|
|
8653
|
+
_reconnectTapT = null;
|
|
8654
|
+
if (!connOffline) { _reconnectTapArmed = false; return; } // recovered — renderQueue already reset the button
|
|
8655
|
+
await checkHealth();
|
|
8656
|
+
if (!connOffline) { _reconnectTapArmed = false; return; }
|
|
8657
|
+
_reconnectTapArmed = false;
|
|
8658
|
+
const ja = failureLang() === 'ja';
|
|
8659
|
+
// The line already says "Galda is offline"; this half says what the TAP did.
|
|
8660
|
+
connMsg = ja ? '— 再接続できませんでした' : '— reconnect failed';
|
|
8661
|
+
// showErr, not showToast: a failed reconnect is not a success, and showToast
|
|
8662
|
+
// paints the bar green (§5.5 — state colours are not decoration).
|
|
8663
|
+
showErr(ja ? '再接続できませんでした。ネットワークかGaldaサーバを確認してください。' : 'Reconnect failed. Check the network or the Galda server.');
|
|
8664
|
+
renderQueue();
|
|
8665
|
+
}, 3000);
|
|
8666
|
+
}
|
|
8636
8667
|
// Reconnect button: drop any pending backoff timer and reopen the EventSource now.
|
|
8637
8668
|
function forceReconnect(){ if (_sseReconnectT) { clearTimeout(_sseReconnectT); _sseReconnectT = null; } try { _es && _es.close(); } catch { /* already closed */ } esRetryMs = 1000; connectSSE(); }
|
|
8638
8669
|
// Robust liveness backstop that does NOT depend on EventSource onerror firing.
|
package/package.json
CHANGED