openvibers/openvibe.chat Commits

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

OP OpenVibers committed 16 h ago · 4668b44eec · 7 files, +20 −23

* 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.

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

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

Changes

ddiff --git a/README.md b/README.md
iindex c952871..23b4fc8 100644
---- a/README.md
++++ b/README.md
@@@ -1020,5 +1020,5 @@ Part of the [OpenVibe network](https://openvibe.network). Built in the open by [
<!-- 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 ff1a9cf..9a4f3cf 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -9,7 +9,7 @@
"domain": "openvibe.chat (Chat's own site: global chat, messages, rooms, settings; the service manifest records it live since 2026-09-24) and openvibe.live (/ws/chat, /api/chat/, /api/dm/, /api/tts/, /api/sounds via an nginx include in openvibe.live's vhost)",
"contracts": "openvibe-contracts v0.417.0",
"sdk": "openvibe-sdk v0.161.0",
-- "shared": "openvibe-shared v4.225.0",
++ "shared": "openvibe-shared v4.228.0",
"capabilities": [
"chat.message.send",
"chat.event.publish",
ddiff --git a/package-lock.json b/package-lock.json
iindex 576feb0..93ae0a5 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -19,7 +19,7 @@
"multer": "^2.0.2",
"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",
"ws": "^8.18.0"
},
@@@ -1957,9 +1957,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 27c437a..cf9a24f 100644
---- a/package.json
++++ b/package.json
@@@ -31,7 +31,7 @@
"multer": "^2.0.2",
"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",
"ws": "^8.18.0"
},
ddiff --git a/server/web/short.js b/server/web/short.js
iindex 2b671cf..6da2cd0 100644
---- a/server/web/short.js
++++ b/server/web/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.
*
@@@ -20,15 +21,11 @@ const { esc } = require('./layout');
*
* 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('');
-- // The pane carries its own id, so a link that points into it (a heading the page links to) still opens it on a
-- // phone: the CSS shows the pane a link points at.
-- 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/asset-cache.test.js b/test/asset-cache.test.js
iindex 3e68d31..169c9f3 100644
---- a/test/asset-cache.test.js
++++ b/test/asset-cache.test.js
@@@ -20,8 +20,8 @@ t('/web asset: immutable only at its own ?v=, the module window otherwise', asyn
const v = assetVersion('chat.css');
assert.strictEqual(v, assetVersion('chat.css'), 'the version is the same every time');
assert.strictEqual(await cacheOf(`/web/chat.css?v=${v}`), 'public, max-age=31536000, immutable', 'the current hash is immutable');
-- assert.strictEqual(await cacheOf('/web/chat.css?v=deadbeefdeadbeef'), 'public, max-age=300, stale-while-revalidate=86400', 'a hex but wrong ?v= is not immutable');
-- assert.strictEqual(await cacheOf('/web/chat.css'), 'public, max-age=300, stale-while-revalidate=86400', 'no ?v= is not immutable');
++ assert.strictEqual(await cacheOf('/web/chat.css?v=deadbeefdeadbeef'), 'public, max-age=300, stale-while-revalidate=300', 'a hex but wrong ?v= is not immutable');
++ assert.strictEqual(await cacheOf('/web/chat.css'), 'public, max-age=300, stale-while-revalidate=300', 'no ?v= is not immutable');
});
t('robots.txt and a public page carry the module\'s HTML policy', async () => {
ddiff --git a/test/home-short.test.js b/test/home-short.test.js
iindex e1fa5a0..2f5a71a 100644
---- a/test/home-short.test.js
++++ b/test/home-short.test.js
@@@ -30,13 +30,13 @@ t('the home is one pick block: a chip per section, the first picked, every secti
const start = page.indexOf('<div class="pick" id="pick-explore">');
assert.ok(start > 0, 'the pick block is on the home');
const block = page.slice(start, page.indexOf('<div class="pick" id="pick-', start + 10) > 0 ? page.indexOf('<div class="pick" id="pick-', start + 10) : start + 60000);
-- assert.match(block, /<nav class="pick-row" aria-label="Explore OpenVibe.Chat">/);
-- const chips = [...block.matchAll(/<a class="pick-chip" href="#(?:pp-explore-)?([a-z-]+)">()([^<]+)<\/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-explore-)?([a-z-]+)">()([^<]+)(?: <span class="ov-parts-n">[^<]*<\/span>)?<\/label>/g)];
assert.ok(chips.length >= 3, `a chip per section (${chips.length})`);
-- assert.ok(!/type="radio"/.test(block), 'no chip is a radio: nothing is picked, every pane shows');
-- // Every section stays in the page, with the id its chip picks.
++ 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)');
++ // Every section stays in the page, with the id its tab opens.
const panes = [...block.matchAll(/<div class="pick-pane" id="([a-z-]+)">/g)].map((m) => m[1]);
-- assert.deepStrictEqual(panes, chips.map((m) => m[1]), 'every section is in the page, one per chip');
++ assert.deepStrictEqual(panes, chips.map((m) => m[1]), 'every section is in the page, one per tab');
// Nothing was removed: the sections of the front page are all there.
for (const title of ['Stream chats on OpenVibe.Live', 'Public servers', 'Public rooms', 'What OpenVibe.Chat does', 'How it works']) {
assert.ok(page.includes(title), `${title} is on the page`);