openvibers/openvibe.codes Commits

Share: one Share sheet on a project's Improve page (#280)

OP OpenVibers committed 7 days ago · 8b46c49dd5 · 2 files, +4 −0

* Share: the one Share sheet on a project's Improve page

Put the network's Share button (data-ov-share-sheet) under the repository
head on /improve/:owner/:name, with the page's canonical address and its
line.

* Share: the shared kit button, one look everywhere

Render the one Share button with openvibe-shared 4.114.0's kit.share
(or its exact markup where the page is built in the browser), so every
site shows the same quiet button with the share icon. Remove the
site-specific Share styles.

Changes

ddiff --git a/server/http/pages.js b/server/http/pages.js
iindex 276b97e..c18b17b 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -387,6 +387,7 @@ ${forgejoError ? html`<p class="run-notice run-notice-error" role="alert">OpenVi
crumbs: [{ label: 'Improve OpenVibe', href: '/improve' }, { label: meta.name }],
styles: ['kit.css', 'kit-data.css'], sharedScripts: ['kit-web.js'],
body: html`${raw(kit.head({ title: meta.name, sub: tagline(meta), sticky: false }))}
++<p>${raw(kit.share({ title: `Improve ${meta.name}`, url: `${config.baseUrl}/improve/${owner}/${name}`, text: `Contribute to ${meta.name}: describe a change and run it on your machine through OpenVibe.Codes.` }))}</p>
${raw(improveSteps(1))}
${form}
${raw(kit.fold({ title: 'How the run works', body: '<ol class="steps"><li>The harness clones the repository onto <strong>your machine</strong> and checks out the default branch.</li><li>The agent makes the change you described and runs the tests.</li><li>If you asked it to push, it commits to a new branch and opens a pull request on OpenVibe Git.</li><li>You review the result, then the maintainers review the pull request.</li></ol>' }))}
ddiff --git a/test/improve.test.js b/test/improve.test.js
iindex 21de3ec..dfa6005 100644
---- a/test/improve.test.js
++++ b/test/improve.test.js
@@@ -47,6 +47,9 @@ const { boot, check, done } = require('./helpers/boot');
assert.ok(r.text.includes('Step 2 of 4') && r.text.includes('href="/improve"'), 'step 2, with step 1 linking back');
assert.ok(r.text.includes('Clone it yourself') && r.text.includes('git clone '), 'the clone command, folded');
assert.ok(r.text.indexOf('name="prompt"') < r.text.indexOf('How the run works'), 'the form comes before the explanation');
++ assert.strictEqual((r.text.match(/data-ov-share-sheet/g) || []).length, 1, 'one Share button');
++ assert.ok(r.text.includes('data-url="https://openvibe.codes/improve/OpenVibers/OpenVibe.Codes"'), 'the repository page address');
++ assert.ok(r.text.includes('data-title="Improve OpenVibe.Codes"'), 'its title');
});
await check('a repository page shows the guided path and asks guests to sign in', async () => {