openvibers/openvibe.coupons Commits

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

OP OpenVibers committed 15 h ago · fafbcadbac · 8 files, +26 −27

* 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 1628d1a..11ec414 100644
---- a/README.md
++++ b/README.md
@@@ -501,6 +501,6 @@ 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
- openvibe-publishing: v1.7.0
<!-- versions:end -->
ddiff --git a/STATUS.json b/STATUS.json
iindex 122458d..ead8f25 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -9,11 +9,11 @@
"domain": "openvibe.coupons",
"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-publishing v1.7.0",
"openvibe-contracts v0.417.0",
-- "openvibe-shared v4.225.0",
++ "openvibe-shared v4.228.0",
"openvibe-sdk v0.161.0"
],
"capabilities": [
ddiff --git a/package-lock.json b/package-lock.json
iindex d333471..5f284bc 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -18,7 +18,7 @@
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.7.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"
},
"devDependencies": {
@@@ -1291,9 +1291,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 e3f4792..129b7c0 100644
---- a/package.json
++++ b/package.json
@@@ -29,7 +29,7 @@
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v1.7.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"
},
"devDependencies": {
ddiff --git a/server/render/short.js b/server/render/short.js
iindex 0048b6b..92d15f1 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/asset-cache.test.js b/test/asset-cache.test.js
iindex 7e1149e..dd599d7 100644
---- a/test/asset-cache.test.js
++++ b/test/asset-cache.test.js
@@@ -11,10 +11,10 @@ const { boot, check, done } = require('./helpers/boot');
const ASSET = 'css/coupons.css';
const IMMUTABLE = 'public, max-age=31536000, immutable';
--const REVALIDATE = 'public, max-age=300, stale-while-revalidate=86400';
++const REVALIDATE = 'public, max-age=300, stale-while-revalidate=300';
(async () => {
-- await check('the module: hashed → immutable, otherwise a 5 min window with a day of stale-while-revalidate', async () => {
++ await check('the module: hashed → immutable, otherwise a 5 min window with five minutes of stale-while-revalidate', async () => {
assert.strictEqual(cache.IMMUTABLE, IMMUTABLE);
assert.strictEqual(cache.assetHeaders(ASSET, { hashed: true }), IMMUTABLE);
assert.strictEqual(cache.assetHeaders(ASSET, { hashed: false }), REVALIDATE);
ddiff --git a/test/home-short.test.js b/test/home-short.test.js
iindex ac8e4ad..02f0fb1 100644
---- a/test/home-short.test.js
++++ b/test/home-short.test.js
@@@ -32,14 +32,14 @@ const { boot, check, done } = require('./helpers/boot');
const start = page.indexOf('<div class="pick" id="pick-codes">');
assert.ok(start > 0, 'the pick block is on the home');
const block = page.slice(start, page.indexOf('<section class="cp-sec" id="shops"'));
-- assert.match(block, /<nav class="pick-row" aria-label="Codes">/);
-- const chips = [...block.matchAll(/<a class="pick-chip" href="#(?:pp-codes-)?([a-z-]+)">()()([^<]+)<\/a>/g)];
-- assert.ok(chips.length >= 1, `a chip per list (${chips.length})`);
-- assert.ok(!/type="radio"/.test(block), 'no chip is a radio: nothing is picked, every pane shows');
-- // The lists that have something to show stay in the page, each in its own pane.
-- for (const id of chips.map((m) => m[1])) {
-- assert.ok(block.includes(`id="${id}"`), `the pane of ${id} is in the page`);
-- }
++ // Shared pick() (11-12): two lists or more are tabs on a phone; one list with codes is simply shown (never
++ // an empty tab). Every list that has something to show is a pane in the page.
++ const panes = [...block.matchAll(/<div class="pick-pane" id="([a-z-]+)">/g)].map((m) => m[1]);
++ assert.ok(panes.length >= 1, `a pane per list with codes (${panes.length})`);
++ if (panes.length > 1) {
++ assert.match(block, /<div class="ov-parts ov-parts--front" data-parts="\d+">/, 'its lists are tabs on a phone');
++ assert.ok(/<input type="radio" class="ov-parts-r"[^>]* checked>/.test(block), 'the first list is open on a phone');
++ } else assert.match(block, /<div class="ov-parts is-stacked">/, 'one list: shown, no tabs');
assert.ok(block.includes('VEG5'), 'the code is on the page');
});
ddiff --git a/test/perf-budget.test.js b/test/perf-budget.test.js
iindex a529ceb..cddf409 100644
---- a/test/perf-budget.test.js
++++ b/test/perf-budget.test.js
@@@ -15,13 +15,13 @@ const { measure, check, format } = require('openvibe-shared/perf-budget');
// 2026-11-08: openvibe-shared v4.150.0; CI measured JS 370.1 KB raw / 88.6 KB brotli.
// 2026-11-08: openvibe-shared v4.149.0; CI measured JS 369.1 KB raw / 88.5 KB brotli.
const BUDGETS = {
-- htmlRawKB: 53, // 53 openvibe-shared v4.202.0 (2026-11-11: measured 52.8, raised by pin-bump from 52); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 49.9: measured 47.9 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
++ htmlRawKB: 53.5, // 53.5 openvibe-shared v4.228.0 (2026-11-12: measured 53.2, raised by pin-bump from 53); 53 openvibe-shared v4.202.0 (2026-11-11: measured 52.8, raised by pin-bump from 52); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 49.9: measured 47.9 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
htmlBrotliKB: 11.5, // 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 9.1 Shared 4.15.1 footer; 7.9 with the curated front page; 6.2 (4.5 before the showcase)
jsFiles: 6, // 6 with the OpenVibe Kit's kit-web.js (Shared 4.20.1, 2026-10-28); 5 (openvibe-shared 2.9 shell: web-runtime.js)
jsRawKB: 416, // 416: measured 415.8 with openvibe-shared 4.197.0 (2026-11-10: the menu's row of places, the You tab's row, the Sign in mark, the tooltip); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 398: measured 390 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
jsBrotliKB: 100, // 100: measured 99.6 with openvibe-shared 4.197.0 (2026-11-10: the menu's row of places, the You tab's row, the Sign in mark, the tooltip); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 95.4: measured 95.3 KB brotli with openvibe-shared 4.186.0 (2026-11-10: the mark's Working and Thinking states, the Dock and the menu as one sheet, bare controls styled by the loader); 95.1: measured 93.1 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
cssFiles: 3, // 3 with the OpenVibe Kit's kit.css on every page (Shared 4.20); 2 (coupons.css + showcase.css, home only)
-- cssRawKB: 100.3, // 100.3: measured 95.3 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
++ cssRawKB: 104, // 104 openvibe-shared v4.228.0 (2026-11-12: measured 103.8, raised by pin-bump from 100.3); 100.3: measured 95.3 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
cssBrotliKB: 21, // 21: measured 20.7 with openvibe-shared 4.197.0 (2026-11-10: the menu's row of places, the You tab's row, the Sign in mark, the tooltip); 20.5: measured 19.3 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
externalFiles: 1, // 0
};