shadok-ai 0.19.80 → 0.19.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/README.md +3 -0
- package/package.json +1 -1
- package/public/index.html +76 -17
- package/public/tour-steps.js +31 -0
package/README.md
CHANGED
|
@@ -597,6 +597,9 @@ Enter to skip; you can add it later from the web UI).
|
|
|
597
597
|
isn't on screen is **dropped rather than faked** — an empty cockpit has no
|
|
598
598
|
agent menu, a cockpit with no group has no groups column, a member has no
|
|
599
599
|
Reports button — so it gets a shorter tour instead of a spotlight on nothing.
|
|
600
|
+
Which steps exist is **re-read from the page at every step**, and the first
|
|
601
|
+
count waits (4s at most) for the agents and the account to load — a tour that
|
|
602
|
+
filtered its list once, at start, played five stops on a cockpit that has eleven.
|
|
600
603
|
The bubble sits below its target, above it, or **beside** it when the target
|
|
601
604
|
is a full-height column, so it never covers what it describes. The
|
|
602
605
|
**phone gets the whole tour**, because a step can name the landmark on either
|
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -2124,6 +2124,9 @@
|
|
|
2124
2124
|
and it costs a good third of the conversation still visible; it comes back
|
|
2125
2125
|
the moment the keyboard closes. */
|
|
2126
2126
|
body.kb-up header { display: none; }
|
|
2127
|
+
/* The keyboard covers the home indicator: the safe-area padding that keeps
|
|
2128
|
+
the field clear of it would only leave a dead band above the keyboard. */
|
|
2129
|
+
body.kb-up #composer { padding-bottom: 8px; }
|
|
2127
2130
|
}
|
|
2128
2131
|
/* iOS Safari ZOOMS INTO any focused field whose font is under 16px. That zoom is
|
|
2129
2132
|
the single cause of two symptoms that look unrelated: the layout viewport
|
|
@@ -4750,7 +4753,7 @@
|
|
|
4750
4753
|
import { shrinkToFit, nameReads, chanOverflowIds, chanOverflowItems } from "/bar-overflow.js?v=__ASSET_V__";
|
|
4751
4754
|
import { echoAuthor, isOwnPrompt } from "/echo-author.js?v=__ASSET_V__";
|
|
4752
4755
|
import { dialPos, dialColor, dialTitle } from "/gauge-dial.js?v=__ASSET_V__";
|
|
4753
|
-
import { TOUR_STEPS, bubblePlacement, unionRect, visibleSteps } from "/tour-steps.js?v=__ASSET_V__";
|
|
4756
|
+
import { TOUR_STEPS, bubblePlacement, tourStanding, unionRect, visibleSteps } from "/tour-steps.js?v=__ASSET_V__";
|
|
4754
4757
|
import { pickChannelSource, dirKey, serverSwapped } from "/channel-store.js?v=__ASSET_V__";
|
|
4755
4758
|
import { MODEL_CHOICES, composeModel } from "/model-choice.js?v=__ASSET_V__";
|
|
4756
4759
|
import { EFFORT_CHOICES, effortLabel } from "/effort-choice.js?v=__ASSET_V__";
|
|
@@ -4843,6 +4846,7 @@
|
|
|
4843
4846
|
window.bubblePlacement = bubblePlacement;
|
|
4844
4847
|
window.unionRect = unionRect;
|
|
4845
4848
|
window.visibleSteps = visibleSteps;
|
|
4849
|
+
window.tourStanding = tourStanding;
|
|
4846
4850
|
window.extractLiveText = extractLiveText;
|
|
4847
4851
|
window.livePreviewDecision = livePreviewDecision;
|
|
4848
4852
|
window.profileBlurb = profileBlurb;
|
|
@@ -5050,6 +5054,7 @@
|
|
|
5050
5054
|
bubblePlacement: () => null,
|
|
5051
5055
|
unionRect: () => null,
|
|
5052
5056
|
visibleSteps: (steps) => steps ?? [],
|
|
5057
|
+
tourStanding: () => ({ step: null, index: 0, total: 0 }),
|
|
5053
5058
|
// The viewer is opened by a click, so the module is long since loaded —
|
|
5054
5059
|
// but a stub is still the rule (invariant 10), and the honest one here
|
|
5055
5060
|
// shows the table UNFILTERED rather than an empty panel that reads as
|
|
@@ -6642,6 +6647,10 @@
|
|
|
6642
6647
|
// directory), so it survives a wiped browser, another device or a reboot.
|
|
6643
6648
|
let channelPushTimer = null;
|
|
6644
6649
|
let restoring = true; // suppress pushes until the initial restore is done
|
|
6650
|
+
// Resolved once the boot restore has painted its tabs (or found none) — what
|
|
6651
|
+
// the guided tour waits for before counting its steps.
|
|
6652
|
+
let markBootSettled = () => {};
|
|
6653
|
+
const bootSettled = new Promise((r) => { markBootSettled = r; });
|
|
6645
6654
|
// Set once the server on this origin turns out to be a DIFFERENT instance than
|
|
6646
6655
|
// the one this page was loaded from (its port was taken over after a stop).
|
|
6647
6656
|
// From then on the tab must not write — it would only poison the new
|
|
@@ -12862,14 +12871,20 @@
|
|
|
12862
12871
|
if (window.visualViewport && matchMedia("(pointer: coarse)").matches) {
|
|
12863
12872
|
const vv = window.visualViewport;
|
|
12864
12873
|
let pending = 0;
|
|
12874
|
+
// The keyboard-free height: the tallest the visible viewport has been since
|
|
12875
|
+
// the last rotation. The keyboard used to be read as `innerHeight - vv.height`,
|
|
12876
|
+
// but that assumes the LAYOUT viewport keeps its height when the keyboard
|
|
12877
|
+
// opens — and an installed (Home Screen) cockpit on a recent iOS shrinks both,
|
|
12878
|
+
// so the gap stayed 0: no `kb-up`, the header never folded away and the
|
|
12879
|
+
// composer kept its home-indicator padding above the keyboard (a dead band).
|
|
12880
|
+
let fullH = Math.max(window.innerHeight, vv.height);
|
|
12881
|
+
const kbOpen = () => fullH - vv.height > 120; // a retracting URL bar is not a keyboard
|
|
12865
12882
|
const syncViewport = () => {
|
|
12866
12883
|
pending = 0;
|
|
12884
|
+
fullH = Math.max(fullH, vv.height);
|
|
12867
12885
|
document.documentElement.style.setProperty("--app-h", vv.height + "px");
|
|
12868
12886
|
document.body.classList.add("vv-sized");
|
|
12869
|
-
|
|
12870
|
-
// opens, so the gap between the two IS the keyboard. The threshold keeps a
|
|
12871
|
-
// retracting URL bar from being read as one.
|
|
12872
|
-
document.body.classList.toggle("kb-up", window.innerHeight - vv.height > 120);
|
|
12887
|
+
document.body.classList.toggle("kb-up", kbOpen());
|
|
12873
12888
|
// The chassis now fits above the keyboard: if the browser already dragged
|
|
12874
12889
|
// the document, that offset hides nothing but the header.
|
|
12875
12890
|
if (window.scrollY || window.scrollX) window.scrollTo(0, 0);
|
|
@@ -12880,6 +12895,27 @@
|
|
|
12880
12895
|
const schedule = () => { if (!pending) pending = requestAnimationFrame(syncViewport); };
|
|
12881
12896
|
vv.addEventListener("resize", schedule);
|
|
12882
12897
|
vv.addEventListener("scroll", schedule);
|
|
12898
|
+
// A rotation changes what "full height" means: start over from what is seen.
|
|
12899
|
+
matchMedia("(orientation: portrait)").addEventListener("change", () => {
|
|
12900
|
+
fullH = 0;
|
|
12901
|
+
setTimeout(() => { fullH = Math.max(window.innerHeight, vv.height); schedule(); }, 300);
|
|
12902
|
+
});
|
|
12903
|
+
// Closing: iOS reports the new height only once the keyboard has finished
|
|
12904
|
+
// sliding away, so for that whole animation the chassis stayed keyboard-sized
|
|
12905
|
+
// and the composer floated mid-screen above an empty band, then snapped down.
|
|
12906
|
+
// Leaving the field IS the keyboard closing (unless focus moves to another
|
|
12907
|
+
// text field), so give the chassis its full height at once: the keyboard then
|
|
12908
|
+
// slides off a page already in place. The real resize lands later and agrees.
|
|
12909
|
+
const typesText = (el) => !!el && (el.isContentEditable || el.tagName === "TEXTAREA"
|
|
12910
|
+
|| (el.tagName === "INPUT" && !/^(button|submit|reset|checkbox|radio|file|range|color|image)$/i.test(el.type)));
|
|
12911
|
+
document.addEventListener("focusout", (e) => {
|
|
12912
|
+
if (!document.body.classList.contains("kb-up") || typesText(e.relatedTarget)) return;
|
|
12913
|
+
if (pending) { cancelAnimationFrame(pending); pending = 0; }
|
|
12914
|
+
document.documentElement.style.setProperty("--app-h", fullH + "px");
|
|
12915
|
+
document.body.classList.remove("kb-up");
|
|
12916
|
+
if (window.scrollY || window.scrollX) window.scrollTo(0, 0);
|
|
12917
|
+
if (active) pinBottom(active);
|
|
12918
|
+
});
|
|
12883
12919
|
syncViewport();
|
|
12884
12920
|
}
|
|
12885
12921
|
|
|
@@ -17110,7 +17146,7 @@
|
|
|
17110
17146
|
$("peerName").value = ""; $("peerBrief").value = "";
|
|
17111
17147
|
renderPeers();
|
|
17112
17148
|
});
|
|
17113
|
-
loadMe();
|
|
17149
|
+
const meReady = loadMe(); // the guided tour waits for it: the role decides its people step
|
|
17114
17150
|
|
|
17115
17151
|
$("profilesBtn").addEventListener("click", () => openProfilesPanel());
|
|
17116
17152
|
$("editProfilesLink").addEventListener("click", () => openProfilesPanel());
|
|
@@ -17279,8 +17315,11 @@
|
|
|
17279
17315
|
else alert((await r.json()).error || "update failed");
|
|
17280
17316
|
}
|
|
17281
17317
|
// --- Guided tour --------------------------------------------------------
|
|
17282
|
-
|
|
17283
|
-
|
|
17318
|
+
// The id of the step on screen, null before the first one. NOT an index into
|
|
17319
|
+
// a list filtered at start: which steps exist is re-read from the page at
|
|
17320
|
+
// every step (window.tourStanding), because the tour can start before the
|
|
17321
|
+
// agents and the account have landed.
|
|
17322
|
+
let tourId = null;
|
|
17284
17323
|
let tourOnEnd = null;
|
|
17285
17324
|
|
|
17286
17325
|
/** Every element a step points at, in DOM order. */
|
|
@@ -17297,14 +17336,15 @@
|
|
|
17297
17336
|
});
|
|
17298
17337
|
}
|
|
17299
17338
|
|
|
17300
|
-
function paintTourStep() {
|
|
17301
|
-
const step =
|
|
17339
|
+
function paintTourStep(advance = false) {
|
|
17340
|
+
const { step, index, total } = window.tourStanding(window.TOUR_STEPS, tourId, tourVisible, advance);
|
|
17302
17341
|
if (!step) return endTour();
|
|
17342
|
+
tourId = step.id;
|
|
17303
17343
|
const overlay = $("tourOverlay");
|
|
17304
17344
|
$("tourTitle").textContent = step.title;
|
|
17305
17345
|
$("tourBody").textContent = step.body;
|
|
17306
|
-
$("tourCount").textContent = `${
|
|
17307
|
-
$("tourNext").textContent =
|
|
17346
|
+
$("tourCount").textContent = `${index}/${total}`;
|
|
17347
|
+
$("tourNext").textContent = index === total ? "Done" : "Next ›";
|
|
17308
17348
|
|
|
17309
17349
|
if (step.target === null) {
|
|
17310
17350
|
overlay.classList.remove("spotlight");
|
|
@@ -17318,7 +17358,7 @@
|
|
|
17318
17358
|
const box = window.unionRect(rects);
|
|
17319
17359
|
// The step was filtered in because it was visible; if it vanished since
|
|
17320
17360
|
// (a closed tab), skip forward rather than frame nothing.
|
|
17321
|
-
if (!box)
|
|
17361
|
+
if (!box) return paintTourStep(true);
|
|
17322
17362
|
overlay.classList.add("spotlight");
|
|
17323
17363
|
const pad = 6;
|
|
17324
17364
|
Object.assign($("tourHole").style, {
|
|
@@ -17341,12 +17381,17 @@
|
|
|
17341
17381
|
function startTour(onEnd) {
|
|
17342
17382
|
// window.visibleSteps comes from the ESM bridge, which runs AFTER this
|
|
17343
17383
|
// classic script — so this must never be called at parse time (invariant 10).
|
|
17344
|
-
|
|
17345
|
-
|
|
17384
|
+
tourId = null;
|
|
17385
|
+
// Nothing to show (or the bridge never landed): hand over WITHOUT marking
|
|
17386
|
+
// the tour as seen — endTour would, and the person never saw it.
|
|
17387
|
+
if (!window.tourStanding(window.TOUR_STEPS, null, tourVisible).step) { onEnd?.(); return; }
|
|
17346
17388
|
tourOnEnd = onEnd ?? null;
|
|
17347
|
-
tourAt = 0;
|
|
17348
17389
|
$("tourOverlay").hidden = false;
|
|
17349
17390
|
paintTourStep();
|
|
17391
|
+
// One repaint a moment later: something that lands just after the first
|
|
17392
|
+
// paint (the groups column is drawn a frame behind the tabs) should not
|
|
17393
|
+
// leave the welcome card on a count the next step contradicts.
|
|
17394
|
+
setTimeout(() => { if (!$("tourOverlay").hidden) paintTourStep(); }, 1200);
|
|
17350
17395
|
}
|
|
17351
17396
|
|
|
17352
17397
|
function endTour() {
|
|
@@ -17358,7 +17403,7 @@
|
|
|
17358
17403
|
done?.();
|
|
17359
17404
|
}
|
|
17360
17405
|
|
|
17361
|
-
$("tourNext").addEventListener("click", () =>
|
|
17406
|
+
$("tourNext").addEventListener("click", () => paintTourStep(true));
|
|
17362
17407
|
$("tourSkip").addEventListener("click", endTour);
|
|
17363
17408
|
// A click on the overlay itself — including through the hole, which has
|
|
17364
17409
|
// pointer-events: none — ends it. Nobody is trapped in a tutorial.
|
|
@@ -17387,6 +17432,16 @@
|
|
|
17387
17432
|
// gives up after 3s and leaves the cache in charge).
|
|
17388
17433
|
await prefsReady;
|
|
17389
17434
|
if (cachedPref("tourSeen") === true) { checkAuth(); return; }
|
|
17435
|
+
// And for the page itself: the agents (boot restore) and the account
|
|
17436
|
+
// (loadMe) decide which steps have a target. Started before them, the
|
|
17437
|
+
// welcome card read "1/5" on a cockpit whose tour has eleven stops. Each
|
|
17438
|
+
// step re-reads the page anyway, so this only makes the FIRST count right
|
|
17439
|
+
// — hence bounded: a slow server delays the tour by 4s at most, never
|
|
17440
|
+
// holds it.
|
|
17441
|
+
await Promise.race([
|
|
17442
|
+
Promise.all([bootSettled, meReady]).catch(() => {}),
|
|
17443
|
+
new Promise((r) => setTimeout(r, 4000)),
|
|
17444
|
+
]);
|
|
17390
17445
|
startTour(() => checkAuth());
|
|
17391
17446
|
}
|
|
17392
17447
|
|
|
@@ -18460,6 +18515,10 @@
|
|
|
18460
18515
|
// Only now: `syncChannels` is a no-op while `restoring`, so kicking the loop
|
|
18461
18516
|
// off any earlier would leave the first EFFECTIVE pass a full period away —
|
|
18462
18517
|
// which is the four-second blank this whole change is about.
|
|
18518
|
+
// The tabs are painted (or there are none): the guided tour may count its
|
|
18519
|
+
// steps. A restore that threw never gets here — the tour's own 4s bound is
|
|
18520
|
+
// what releases it then.
|
|
18521
|
+
markBootSettled();
|
|
18463
18522
|
if (!followAgentHash()) followDeepLink();
|
|
18464
18523
|
syncLoop();
|
|
18465
18524
|
})();
|
package/public/tour-steps.js
CHANGED
|
@@ -223,6 +223,37 @@ export function visibleSteps(steps, isVisible) {
|
|
|
223
223
|
return steps.filter((s) => s.target === null || isVisible(s.target));
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Pure: where the tour stands, re-read against the page as it is NOW.
|
|
228
|
+
*
|
|
229
|
+
* `currentId` null means "not started": the answer is the first visible step.
|
|
230
|
+
* Otherwise it is the next visible step AFTER the current one in the tour's own
|
|
231
|
+
* order (`advance`), or the current one again (a repaint).
|
|
232
|
+
*
|
|
233
|
+
* The list used to be filtered ONCE, when the tour started — and on a first
|
|
234
|
+
* visit it starts with the page still loading: no agent restored yet, the
|
|
235
|
+
* account not yet known. Every step about an agent, the composer and the
|
|
236
|
+
* people buttons was dropped for good before its target had a chance to
|
|
237
|
+
* exist, and an eleven-step tour played five. Visibility is a fact about a
|
|
238
|
+
* moment, so it is asked again at every step; the counter is therefore over
|
|
239
|
+
* the steps visible NOW, and may grow while the welcome card is being read.
|
|
240
|
+
*
|
|
241
|
+
* The current step always counts as present, even if its target just went
|
|
242
|
+
* away: a counter reading "4/3" is worse than one step framing nothing, which
|
|
243
|
+
* the caller already skips.
|
|
244
|
+
*/
|
|
245
|
+
export function tourStanding(steps, currentId, isVisible, advance = false) {
|
|
246
|
+
const here = currentId == null ? -1 : steps.findIndex((s) => s.id === currentId);
|
|
247
|
+
const shown = (s, i) => i === here || s.target === null || isVisible(s.target);
|
|
248
|
+
let at = here;
|
|
249
|
+
if (here < 0 || advance) {
|
|
250
|
+
at = steps.findIndex((s, i) => i > here && shown(s, i));
|
|
251
|
+
if (at < 0) return { step: null, index: 0, total: 0 };
|
|
252
|
+
}
|
|
253
|
+
const visible = steps.filter((s, i) => i === at || shown(s, i));
|
|
254
|
+
return { step: steps[at], index: visible.indexOf(steps[at]) + 1, total: visible.length };
|
|
255
|
+
}
|
|
256
|
+
|
|
226
257
|
/**
|
|
227
258
|
* Pure: the rectangle enclosing them all, or null when there are none.
|
|
228
259
|
*
|