openvibers/openvibe.community Commits

openvibe-shared v4.39.0: code pastes show their first lines on the home, Pulse rows take rel from the kit (#181)

OP OpenVibers committed 15 days ago · a616448ece · 6 files, +13 −15

* openvibe-shared v4.39.0 (was v4.38.0)

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

* Home on openvibe-shared 4.39.0: a code paste's card shows its first lines (kit.card preview), Pulse rows take rel from kit.row, the local 44 px rule goes

Changes

ddiff --git a/README.md b/README.md
iindex 01420b8..9bb28dc 100644
---- a/README.md
++++ b/README.md
@@@ -42,7 +42,7 @@ little progressive JavaScript for pagination, copy buttons and the upload path.
(a space's room), OpenVibe.Events (the outbox relay and the Pulse and account subscriptions)
- OpenVibe.Live only for old VOD/clip comment imports (it reads and writes no pastes here any more)
- `openvibe-contracts` v0.112.0, `openvibe-sdk` v0.67.0 (events outbox, per-actor limits, no-looks),
-- `openvibe-shared` v4.38.0, pinned by release tarball
++ `openvibe-shared` v4.39.0, pinned by release tarball
## How it fits the network
@@@ -846,5 +846,5 @@ release after paste comments moved onto the typed comment threads. [Submissions]
<!-- versions:start -->
- openvibe-contracts: v0.222.0
- openvibe-sdk: v0.67.0
--- openvibe-shared: v4.38.0
++- openvibe-shared: v4.39.0
<!-- versions:end -->
ddiff --git a/STATUS.json b/STATUS.json
iindex 2e7ebe6..7b9b137 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -9,7 +9,7 @@
"domain": "openvibe.community",
"contracts": "openvibe-contracts v0.222.0",
"sdk": "openvibe-sdk v0.67.0",
-- "shared": "openvibe-shared v4.38.0",
++ "shared": "openvibe-shared v4.39.0",
"capabilities": [
"community.paste.create",
"community.paste.write",
ddiff --git a/package-lock.json b/package-lock.json
iindex d0a190f..8a18264 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -19,7 +19,7 @@
"multer": "^2.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.67.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.38.0",
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.39.0",
"pg": "^8.23.0"
},
"devDependencies": {
@@@ -1236,9 +1236,9 @@
}
},
"node_modules/openvibe-shared": {
-- "version": "4.38.0",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.38.0",
-- "integrity": "sha512-4sEQ78EQaw+cWWJs+AlPRhxObzHT1nwTMz6yHVBL20Mr+raAhhP10DtL1OTnbuMCDVsYhVwpd3QGgmyC6391EA==",
++ "version": "4.39.0",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.39.0",
++ "integrity": "sha512-xmEqLmhC+njwb2icgzOX4HibrgpXjHI7m4cI9I7sdYseKWH0xEFpaqlhxAsdKm2ZEbzaKkVo+F5rYn5HUPdwZA==",
"license": "MIT",
"dependencies": {
"jsonwebtoken": "^9.0.0",
ddiff --git a/package.json b/package.json
iindex c5ce3b4..5d17229 100644
---- a/package.json
++++ b/package.json
@@@ -30,7 +30,7 @@
"multer": "^2.4.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.222.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.67.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.38.0",
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.39.0",
"pg": "^8.23.0"
},
"engines": {
ddiff --git a/public/css/community.css b/public/css/community.css
iindex 4f282cb..31a4f60 100644
---- a/public/css/community.css
++++ b/public/css/community.css
@@@ -372,7 +372,6 @@ button.rx:hover { border-color: var(--accent); }
.cm-home .page > .sc-sec > h2, .cm-h { margin: 0 0 12px; font-family: inherit; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.cm-sec { min-width: 0; margin-top: 28px; }
.cm-sec > .ovk-rail { margin-top: 0; }
--.cm-home .ovk-rail-more, .cm-home .sc-apps-more a { display: inline-flex; align-items: center; min-height: 44px; }
.cm-note { margin: 0; color: var(--text-secondary); font-size: .88rem; }
/* The kinds as quick filters: one strip that scrolls sideways on a phone (like the numbers), wrapping from 600 px. */
.cm-kinds { display: flex; gap: 8px; margin: 2px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
ddiff --git a/server/render/pages.js b/server/render/pages.js
iindex f90685a..fc8130b 100644
---- a/server/render/pages.js
++++ b/server/render/pages.js
@@@ -161,7 +161,8 @@ function homeStats(c = {}) {
/**
* A paste as the kit's card: its picture when it is a screenshot (never an NSFW one: that card shows the paste icon and
-- * says NSFW), else the paste icon with its language in the corner; who, views and when under the title.
++ * says NSFW), else its first lines in the media (kit.card preview; the lists carry 300 characters) with its language in
++ * the corner; who, views and when under the title.
*/
function pasteKitCard(p) {
const isShot = p.type === 'screenshot';
@@@ -170,6 +171,7 @@ function pasteKitCard(p) {
href: `/p/${p.slug}`, title: p.title || 'Untitled', type: 'post', ratio: '16/9', image: image || '',
badge: p.is_nsfw ? 'NSFW' : p.origin === 'ai' ? 'AI' : p.pinned ? 'Pinned' : '',
corner: isShot ? '' : languageLabel(p.language || 'text'),
++ preview: !isShot && !p.is_nsfw ? String(p.content || '') : '',
who: authorName(p), avatar: avatarUrl(p, 68) || '',
count: [Number(p.views) || 0, 'views'], when: p.created_at || null,
});
@@@ -222,11 +224,8 @@ ${kit.list(items.slice(0, 5).map((t) => kit.row({ href: `/s/roadmap/t/${t.slug}`
function pulseShelf(items) {
if (!items || !items.length) return '';
-- const rows = items.slice(0, 4).map((it) => {
-- const row = kit.row({ href: it.url, title: it.title, badge: it.origin === 'ai' ? kit.badge('AI', 'accent') : '', sub: SERVICE_WORDS[it.source.service] || it.source.service, meta: whenOf(it.occurred_at).text, metaIso: whenOf(it.occurred_at).iso });
-- // Links to the network's other sites keep the nofollow they have on /pulse (kit.row has no rel of its own).
-- return it.source.service === 'community' ? row : row.replace('<a href=', '<a rel="nofollow ugc noopener" href=');
-- });
++ // Links to the network's other sites keep the nofollow they have on /pulse.
++ const rows = items.slice(0, 4).map((it) => kit.row({ href: it.url, rel: it.source.service === 'community' ? '' : 'nofollow ugc noopener', title: it.title, badge: it.origin === 'ai' ? kit.badge('AI', 'accent') : '', sub: SERVICE_WORDS[it.source.service] || it.source.service, meta: whenOf(it.occurred_at).text, metaIso: whenOf(it.occurred_at).iso }));
return `<section class="cm-sec" id="pulse" aria-labelledby="h-pulse">${shelfHead('h-pulse', 'Across OpenVibe', { href: '/pulse', label: 'All of Pulse' })}
${kit.list(rows)}</section>`;
}