openvibers/openvibe.deals Commits

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

OP OpenVibers committed 17 h ago · af801b90ca · 8 files, +28 −28

* 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 bbab3e0..c9d7a2f 100644
---- a/README.md
++++ b/README.md
@@@ -502,6 +502,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 a779fb8..e0f4b52 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -9,11 +9,11 @@
"domain": "openvibe.deals",
"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 b263b68..55d4f9e 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 8f7b54f..9233bca 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 4779c40..f022a84 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 rule, 2026-10-31: never hide content to shorten): every block is shown, stacked,
* each with its own heading. The chips are links that jump to a block.
@@@ -18,15 +19,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 panes 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 the id the page already links to (an anchor in the hero, for instance), so the chip and any
-- // link to it land on that block.
-- 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 6984830..6a6b040 100644
---- a/test/asset-cache.test.js
++++ b/test/asset-cache.test.js
@@@ -3,7 +3,7 @@
* Static-asset caching (openvibe-shared/cache-policy, used by the express.static setHeaders in
* server/app.js): a URL whose `?v=` equals the render layout's assetVersion for that file is
* content-addressed and immutable for a year; anything else — a wrong hash or no `?v=` at all —
-- * is a short public window with a day of stale-while-revalidate.
++ * is a short public window with five minutes of stale-while-revalidate.
*/
const assert = require('assert');
const { assetVersion } = require('../server/render/layout');
@@@ -11,7 +11,7 @@ const { boot, check, done } = require('./helpers/boot');
const ASSET = 'css/deals.css';
const IMMUTABLE = 'public, max-age=31536000, immutable';
--const SHORT = 'public, max-age=300, stale-while-revalidate=86400';
++const SHORT = 'public, max-age=300, stale-while-revalidate=300';
(async () => {
const t = await boot();
ddiff --git a/test/home-short.test.js b/test/home-short.test.js
iindex cad3248..59b73d0 100644
---- a/test/home-short.test.js
++++ b/test/home-short.test.js
@@@ -20,7 +20,7 @@ const { boot, check, done } = require('./helpers/boot');
await t.ctx.store.db.prepare("UPDATE deal_offers SET category = 'Kitchen', seller = 'Coffee Shop', staff_pick = true WHERE id = (SELECT id FROM deal_offers ORDER BY seq DESC LIMIT 1)").run();
await t.ctx.store.db.prepare("UPDATE deal_offers SET category = 'Kitchen', seller = 'Coffee Shop' WHERE id = (SELECT id FROM deal_offers ORDER BY seq ASC LIMIT 1)").run();
-- await check('the home is two pick blocks: a link per section, every section in the page and showing', async () => {
++ await check('the home is two pick blocks: tabs on a phone, every section in the page', async () => {
const r = await t.get('/');
assert.strictEqual(r.status, 200, r.text);
const page = r.text;
@@@ -29,13 +29,16 @@ const { boot, check, done } = require('./helpers/boot');
const next = page.indexOf('<div class="pick" id="pick-', start + 10);
const block = page.slice(start, next > 0 ? next : start + 20000);
assert.ok(block.startsWith(`<div class="pick" id="pick-${key}">`), `the ${key} block is on the home`);
-- assert.ok(!/<input type="radio"/.test(block), `no radio in the ${key} block`);
-- assert.match(block, /<nav class="pick-row" aria-label="[^"]+">/, `the ${key} chips are a nav of links`);
-- const chips = [...block.matchAll(/<a class="pick-chip" href="#([a-z-]+)">[^<]+<\/a>/g)];
-- assert.ok(chips.length >= 1, `a link per section (${chips.length})`);
-- // Every section is in the page, and every link points at one of them.
++ // Shared pick() (11-12): sections as tabs on a phone (one section alone is simply shown); every one in
++ // the page, and every tab names one of them.
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 link');
++ assert.ok(panes.length >= 1, `a pane per section (${panes.length})`);
++ if (panes.length > 1) {
++ assert.match(block, /<div class="ov-parts ov-parts--front" data-parts="\d+">/, `the ${key} sections are tabs on a phone`);
++ assert.ok(/<input type="radio" class="ov-parts-r"[^>]* checked>/.test(block), `the first ${key} section is open`);
++ const tabs = [...block.matchAll(/<label for="ovp-[a-z0-9]+-([a-z-]+)">[^<]+(?: <span class="ov-parts-n">[^<]*<\/span>)?<\/label>/g)].map((m) => m[1]);
++ assert.deepStrictEqual(panes, tabs, 'every section is in the page, one per tab');
++ } else assert.match(block, /<div class="ov-parts is-stacked">/);
}
// Nothing was removed: every section of the home is still in the page.
for (const title of ['Editors', 'Just in', 'Browse by category', 'Shop by store', 'Questions and answers']) {
ddiff --git a/test/perf-budget.test.js b/test/perf-budget.test.js
iindex 763e536..d332e45 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 353.9 KB raw / 84.4 KB brotli.
// 2026-11-08: openvibe-shared v4.149.0; CI measured JS 352.9 KB raw / 84.2 KB brotli.
const BUDGETS = {
-- htmlRawKB: 47, // 47 openvibe-shared v4.202.0 (2026-11-11: measured 46.7, raised by pin-bump from 46); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 42.4 measured 2026-11-10: the empty home's kit empty state (the measured database is fresh); 41.1 with openvibe-shared 4.66.0: the mark with depth and motion, ov-fx loaded on request (2026-10-31); 40.1 with the short home's pick blocks and folds (2026-10-30); 33.2 with the Part of OpenVibe section (Shared 4.13, 2026-10-26); 29.1 with the curated front page's search, questions (FAQ + JSON-LD) and closing call (2026-10-22); 23.5 before
++ htmlRawKB: 47.5, // 47.5 openvibe-shared v4.228.0 (2026-11-12: measured 47.2, raised by pin-bump from 47); 47 openvibe-shared v4.202.0 (2026-11-11: measured 46.7, raised by pin-bump from 46); 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 42.4 measured 2026-11-10: the empty home's kit empty state (the measured database is fresh); 41.1 with openvibe-shared 4.66.0: the mark with depth and motion, ov-fx loaded on request (2026-10-31); 40.1 with the short home's pick blocks and folds (2026-10-30); 33.2 with the Part of OpenVibe section (Shared 4.13, 2026-10-26); 29.1 with the curated front page's search, questions (FAQ + JSON-LD) and closing call (2026-10-22); 23.5 before
htmlBrotliKB: 10.5, // 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 8.3 openvibe-shared 4.15 footer: the compact footer opens into the whole one, and the pulse line; 7.1 with the curated front page (6.0 before; 4.5 before the showcase)
jsFiles: 6, // 6: the signed-out page's passkey enhancement (2026-11-11, related-origin passkeys); 5 before it, with openvibe-shared 2.10's web-runtime.js
jsRawKB: 394.5, // 394.5: measured 394.1 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); 376.4: measured 376.3 KB raw 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); 375.1: measured 367.1 with openvibe-shared 4.161.0, plus room for 4.162.0–4.163.0, 2026-11-09
jsBrotliKB: 94, // 2026-11-11: openvibe-shared 4.190.0 (the site name's dropdown, the footer's online strip, the balances pill); 89.8: measured 89.7 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); 89.5: measured 87.5 with openvibe-shared 4.163.0, plus room for 4.162.0–4.163.0, 2026-11-09
cssFiles: 3, // 3 on the empty home (deals.css, shared showcase.css and kit.css for the empty state); 2 on every other home
-- cssRawKB: 100, // 98.7 measured 2026-11-10: kit.css on the empty home; 49.9 with 2026-11-01: category and store tiles (2026-11-01); 48.2 with the pick chips and fold rules (2026-10-30); 45.1 with openvibe-shared 4.48.0 (the site switcher on the mark, the menu's Start tab and quick tools; Kit's touch hit areas and the phone navbar fix, 4.44-4.47.3); 43.3 touch targets on phones (2026-10-29); 38.2 openvibe-shared 4.26.1 (hero visual); 30.4 with Shared 4.13.0 (2026-10-26: account links); 24.2 with the front page's stats, cards, chips and questions (19.0 before)
++ cssRawKB: 103, // 103 openvibe-shared v4.228.0 (2026-11-12: measured 102.8, raised by pin-bump from 100); 98.7 measured 2026-11-10: kit.css on the empty home; 49.9 with 2026-11-01: category and store tiles (2026-11-01); 48.2 with the pick chips and fold rules (2026-10-30); 45.1 with openvibe-shared 4.48.0 (the site switcher on the mark, the menu's Start tab and quick tools; Kit's touch hit areas and the phone navbar fix, 4.44-4.47.3); 43.3 touch targets on phones (2026-10-29); 38.2 openvibe-shared 4.26.1 (hero visual); 30.4 with Shared 4.13.0 (2026-10-26: account links); 24.2 with the front page's stats, cards, chips and questions (19.0 before)
cssBrotliKB: 21, // 20.2 measured 2026-11-10: kit.css on the empty home; 10.1 with the pick chips and fold rules (2026-10-30); 8.1 openvibe-shared 4.26.1 (hero visual); 6.5 with Shared 4.13.0 (2026-10-26: account links); 5.4 with the front page (2026-10-22); 4.7 with the crowdfunding rules; 1.5 before showcase.css
externalFiles: 1, // 0
};