Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/view/12-gl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/view/20-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
}
// A topic's name over its group (a well, column, settlement or bay): fitted to maxW, left out where a label already is
// A topic's health in a few words (Neural's lobes and the scenes' topic labels): notes, active this week, share stale
const topicReadout = c => { const g = lobeStats[c]; return g && g.notes ? `${plural(g.notes, "note")} · ${g.fresh} active · ${Math.round(100 * g.stale / g.notes)}% stale` : ""; };
const topicReadout = c => { const g = lobeStats[c]; return g && g.notes ? `${plural(g.notes, "note")} · ${g.fresh} edited this week · ${Math.round(100 * g.stale / g.notes)}% stale (${Q.stale_days}d+)` : ""; };
// o.readout: a second, quieter line with topicReadout under the name (big group labels: settlements, yards)
function topicLabel(c, text, x, y, maxW, fill, halo, size, o = {}) {
const px = size || Math.max(8, Math.min(11, 10 * Math.sqrt(cam.k))), font = css("--vg-font") || "system-ui, sans-serif", f = `700 ${px}px ${font}`;
Expand Down
2 changes: 1 addition & 1 deletion src/view/70-shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@
setView, openLens,
hasView: v => canvasView(v), // a scene from a note exists once its block is in the state
async snapshot() { const blob = await new Promise(res => cv.toBlob(res, "image/png")); return blob.arrayBuffer(); }, // the canvas as PNG (State of the vault)
_debug: { select: id => select(id), focusClusters: ids => focusClusters(ids), gl: {
_debug: { topicReadouts: () => DATA.clusters.map(c => topicReadout(c.id)).filter(Boolean), select: id => select(id), focusClusters: ids => focusClusters(ids), gl: {
info: () => GL.info(),
// two spheres at one spot, in both drawing orders: the depth buffer decides, so the near (red) one must show either way. Pixels are read in the same task, before the page composites.
depthCheck() { if (!GL.ok()) return null; const put = (a, b) => { GL.begin([0, 0, 0], 1); glSn = 0; for (const [d, c] of [a, b]) putSprite(W / 2, H / 2, d, 60, c, 1, 0, 0); GL.sprites("lit", glS, glSn, { light: [0, 0, -1], dark: true }); glSn = 0; return GL.pixel(W / 2, H / 2); }, near = [0.3, [1, 0, 0]], far = [0.35, [0, 0, 1]], out = { nearLast: put(far, near), nearFirst: put(near, far) }; dirty = true; kick(); return out; },
Expand Down
20 changes: 20 additions & 0 deletions tests/test_lobe_caption_plain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node
// Neural lobe captions say what "active" and "stale" mean: edited in the last 7 days, and not edited in N days
// (explainer persona, 0.6.249: "12 active · 40% stale" with no day limit). The How to read this entry gives the day limit too.
// node tests/test_lobe_caption_plain.js exit 0 = pass
const { sleep, checks, finish, openPage } = require("./kit"), env = require("./env");
const { fails, ok: check } = checks();
const D = "window.vaultGraph._debug";
(async () => {
const data = env.data(), days = (data.quality || {}).stale_days || 180;
const tab = await openPage({ html: env.pageWith("", data), mobile: false });
try {
if (!await tab.waitFor(`window.vaultGraph && ${D} ? 1 : 0`, 30000)) throw new Error("the graph didn't mount");
await sleep(1500);
await tab.ev(`${D}.openView("neural")`); await sleep(1500);
const lines = await tab.ev(`window.vaultGraph._debug.topicReadouts ? window.vaultGraph._debug.topicReadouts() : null`);
check(Array.isArray(lines) && lines.length > 0, "the debug hook lists the lobe captions (the test can't fail without them)");
(lines || []).forEach(t => { check(/this week/.test(t) && !/\bactive\b/.test(t), "a caption says 'this week', not a bare 'active': " + t); check(t.includes(`stale (${days}d+)`), `a caption carries the ${days}-day limit: ` + t); });
} finally { await tab.close(); }
finish(fails, "lobe captions say what active and stale mean");
})().catch(e => { console.error(e); process.exit(1); });