openvibers/openvibe.vision Commits

openvibe-shared v4.228.0 (was v4.225.0) (#170)

OP OpenVibers committed 16 h ago · 67568eccd1 · 7 files, +18 −19

* openvibe-shared v4.228.0 (was v4.225.0)

Opened by scripts/pin-bump.js in OpenVibers/OpenVibe.Shared after the v4.228.0 release.

* Home: the pick block is Shared's showcase.pick(), tabs on a phone; the old chips only jumped, so every pane showed

* Tests: an unversioned asset revalidates after five minutes (openvibe-shared 4.227.0 cache-policy)

Changes

ddiff --git a/README.md b/README.md
iindex 323a037..cce0e18 100644
---- a/README.md
++++ b/README.md
@@@ -327,5 +327,5 @@ Offer discovery is configured by `VISION_DEALS_SEARCH_URL` and `VISION_SHOES_SEA
<!-- versions:start -->
- openvibe-contracts: v0.417.0
- openvibe-sdk: v0.161.0
--- openvibe-shared: v4.225.0
++- openvibe-shared: v4.228.0
<!-- versions:end -->
ddiff --git a/STATUS.json b/STATUS.json
iindex 80e0240..a566625 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -10,11 +10,11 @@
"domain": "openvibe.vision",
"contracts": "openvibe-contracts v0.417.0",
"sdk": "openvibe-sdk v0.161.0",
-- "shared": "openvibe-shared v4.225.0",
++ "shared": "openvibe-shared v4.228.0",
"packages": [
"openvibe-contracts v0.417.0",
"openvibe-sdk v0.161.0",
-- "openvibe-shared v4.225.0"
++ "openvibe-shared v4.228.0"
],
"capabilities": [
"vision.image.ask",
ddiff --git a/package-lock.json b/package-lock.json
iindex d845870..c803e81 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -20,7 +20,7 @@
"onnxruntime-node": "^1.31.1",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
"pg": "^8.23.0",
"sharp": "^0.33.5"
},
@@@ -2750,9 +2750,9 @@
}
},
"node_modules/openvibe-shared": {
-- "version": "4.225.0",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
-- "integrity": "sha512-zuZIgYODwJJ7UpDBTVnT+czEI5l6YFWqt1nbfbPeEsW6/NlmDZHJWPSGpBv223jRpvhJYH7Duea6nuRr8KZ3sg==",
++ "version": "4.228.0",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
++ "integrity": "sha512-HR0Hac/K+qKmwMf2QZWCFxW+uVja36nyAtxVbNFgPGUDFdmWhmb6RMoP/CkU0+GSCPsC50k6aTS+oPx2czDgGg==",
"license": "MIT",
"dependencies": {
"clean-css": "^5.3.3",
ddiff --git a/package.json b/package.json
iindex cf967d0..8c41710 100644
---- a/package.json
++++ b/package.json
@@@ -30,7 +30,7 @@
"onnxruntime-node": "^1.31.1",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
"pg": "^8.23.0",
"sharp": "^0.33.5"
},
ddiff --git a/server/render/short.js b/server/render/short.js
iindex df4abf9..7501e94 100644
---- a/server/render/short.js
++++ b/server/render/short.js
@@@ -1,4 +1,5 @@
'use strict';
++const { pick } = require('openvibe-shared/showcase');
/**
* The home on a phone (the owner's short-pages rule, 2026-10-30): one or two screens, app-like.
*
@@@ -19,13 +20,11 @@ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&amp;').replace(/</
*
* pickBlock({ key, label, head, panes }) panes: [{ id, label, html }]
*/
--function pickBlock({ key, label, head = '', panes }) {
-- // A pane with nothing to show is left out, so the chips and the rules that show them match the page.
-- panes = (panes || []).filter((p) => p.html);
-- if (!panes.length) return '';
-- const chips = panes.map((p) => '<a class="pick-chip" href="#' + esc(p.id) + '">' + esc(p.label) + '</a>').join('');
-- const body = panes.map((p) => '<div class="pick-pane" id="' + esc(p.id) + '">' + p.html + '</div>').join('');
-- return '<div class="pick" id="pick-' + esc(key) + '"><div class="pick-bar"><div class="pick-head"><h2>' + esc(head || label) + '</h2></div><nav class="pick-row" aria-label="' + esc(label) + '">' + chips + '</nav></div><div class="pick-body">' + body + '</div></div>';
++// 4.228.0: Shared's showcase.pick() draws the block (tabs on a phone, every pane in the page, a link to a pane opens
++// it); this copy only jumped to a pane with chips, so a phone showed them all (the owner, 11-12). The ids are this
++// site's own, so its links keep working.
++function pickBlock({ key, label, head = '', headId = '', bodyClass = '', panes, checked = '' }) {
++ return pick({ key, label, head, headId, bodyClass, checked: checked ? checked : '', panes: (panes || []).map((p) => ({ id: p.id, label: p.label, html: p.html })) });
}
ddiff --git a/test/home-short.test.js b/test/home-short.test.js
iindex 794173d..731d0f1 100644
---- a/test/home-short.test.js
++++ b/test/home-short.test.js
@@@ -11,10 +11,10 @@ const { boot, check, done } = require('./helpers/boot');
const start = page.indexOf('<div class="pick" id="pick-scenes">');
assert.ok(start > 0, 'the pick block is on the home');
const block = page.slice(start, start + 8000);
-- assert.match(block, /<nav class="pick-row" aria-label="What Vision does">/);
-- const chips = [...block.matchAll(/<a class="pick-chip" href="#(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)<\/a>/g)];
++ assert.match(block, /<div class=\"ov-parts ov-parts--front\" data-parts=\"\d+\">/, 'its parts are tabs on a phone');
++ const chips = [...block.matchAll(/<label for="ovp-[a-z0-9]+-(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)(?: <span class="ov-parts-n">[^<]*<\/span>)?<\/label>/g)];
assert.strictEqual(chips.length, 4, 'a chip per scene (' + chips.length + ')');
-- assert.ok(!/type="radio"/.test(block), 'no chip is a radio: nothing is picked, every pane shows');
++ assert.ok(/<input type=\"radio\" class=\"ov-parts-r\"[^>]* checked>/.test(block), 'the first part is open on a phone (Shared pick(): tabs, 11-12)');
const scenes = [...block.matchAll(/<article class="sc-scene/g)];
assert.strictEqual(scenes.length, chips.length, 'every scene is in the page');
for (const m of chips) assert.ok(block.includes('id="' + m[1] + '"'), 'the pane of ' + m[1] + ' is in the page');
ddiff --git a/test/pages.test.js b/test/pages.test.js
iindex 9ac95f6..cbd494d 100644
---- a/test/pages.test.js
++++ b/test/pages.test.js
@@@ -121,7 +121,7 @@ const PLANTED = '<style>body{background:#fff;color:#999}.wide{width:1600px}</sty
assert.strictEqual(hashed.headers.get('cache-control'), 'public, max-age=31536000, immutable');
const wrong = await t.get('/css/vision.css?v=deadbeefdeadbeef');
assert.strictEqual(wrong.status, 200);
-- assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=86400');
++ assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=300');
const robots = await t.get('/robots.txt');
assert.match(robots.text, /Disallow: \/api\//);
assert.match(robots.text, /Disallow: \/a\//);