Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
feat(view): pullboard.dev shows one dismissible star line [N26]
Corey Olson98241530eea4
diff --git a/src/cockpit.js b/src/cockpit.jsindex 0a8743b8..c921b875 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -3,6 +3,10 @@ import {IN_STATE,MACHINE,} from './machine.js';+import {+ STAR_KEY,+ starMarkup,+} from './view/star.js';import { commandPhrases } from './help.js';import { personNeeds } from './needs.js';import {@@ -172,6 +176,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<div class="card-panel feed" id="activity"></div></section><section data-pane="roadmap" class="roadmap-layout" id="roadmap" aria-label="Roadmap"></section>+ ${hostedLocal && !snapshot ? starMarkup() : ''}</main></div></div>@@ -316,6 +321,15 @@ function localNote(state, facts = {}) {drawHosted(document, hostedState(state, { browser: hostedBrowser(navigator), ...facts }), { view: localSession?.origin || LOCAL_VIEW, signIn: hosted.signIn, session: hosted.relaySession });}+/** Show the hosted page's star line (src/view/star.js) to a signed-in person with a linked board, until dismissed here; pass a board list through. */+function starLine(list) {+ const linked = Boolean(list?.boards?.some((board) => board.source === 'relay'));+ if ($('star-line')) $('star-line').hidden = !(hosted.relaySession && linked && keep(${JSON.stringify(STAR_KEY)}) !== 'dismissed');+ return list;+}+$('star-dismiss')?.addEventListener('click', () => { keep(${JSON.stringify(STAR_KEY)}, 'dismissed'); starLine(null); });+starLine(null);+/** Hide the relay's own banner, which speaks for the relay, on a page the relay does not serve this time. */function hideRelayNotice() {const banner = document.getElementById('relay-notice');@@ -951,7 +965,7 @@ async function api(path, body) {if (body !== undefined && body !== null) throw new Error('This is a read-only snapshot.');return jsonRequest(path, undefined, '', {});}- if (path === '/api/v1/boards') return await listedBoards();+ if (path === '/api/v1/boards') return starLine(await listedBoards());const boardId = /^\\/api\\/v1\\/boards\\/([0-9a-f]{32})(?:\\/|$)/u.exec(path)?.[1];const source = boardId ? boardSources.get(boardId) : null;if (boardId && !source) throw new Error(transportdiff --git a/src/view.css b/src/view.cssindex ce8b298e..6fdd931e 100644--- a/src/view.css+++ b/src/view.css@@ -842,3 +842,13 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }@media (width < 480px) { .proof-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }.milestone-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }++/* The hosted page's one star line (#727): a quiet sentence under the board, with a small way to dismiss it. */+.star-line { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 18px 0 0; color: var(--ink-faint); font-size: 12.5px; }+.star-line[hidden] { display: none; }+.star-line a { color: var(--ink-muted); text-decoration: none; }+.star-line a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }+.star-dismiss { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ink-faint); font: inherit; font-size: 15px; cursor: pointer; }+.star-dismiss:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }+.star-dismiss:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }+@media (pointer: coarse) { .star-dismiss { width: 44px; height: 44px; } }diff --git a/src/view/star.js b/src/view/star.jsnew file mode 100644index 00000000..6062f509--- /dev/null+++ b/src/view/star.js@@ -0,0 +1,35 @@+/**+ * The hosted page's one star line [N26] (#727): "Like Pullboard? A GitHub star helps.", linking to the GitHub+ * repository. Why so quiet: the person asked for a star only from people who use the relay and never to be+ * annoying, so the line is one sentence under the board, shown only on pullboard.dev to a signed-in person with a+ * linked board, and gone for good on that device once dismissed. The local view, the CLI and MCP never carry it.+ */+import { readFileSync } from 'node:fs';++/** The line's words: a plain sentence, never an instruction. */+export const STAR_TEXT = 'Like Pullboard? A GitHub star helps.';++/** The page storage key that remembers a dismissal, beside the page's other pb. preferences. */+export const STAR_KEY = 'pb.star';++/**+ * The repository's web address, read from package.json's repository field so the link never goes stale.+ *+ * @returns {string}+ */+export function starRepository() {+ const manifest = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));+ const url = String(manifest.repository?.url || manifest.repository || '');+ return url.replace(/^git\+/u, '').replace(/\.git$/u, '');+}++/**+ * The line's markup, hidden until the page knows a signed-in person has a linked board.+ *+ * @returns {string}+ */+export function starMarkup() {+ const href = starRepository().replace(/[&<>"']/gu, (character) => `&#${character.charCodeAt(0)};`);+ return `<p class="star-line" id="star-line" hidden><a href="${href}" target="_blank" rel="noopener">${STAR_TEXT}</a>`+ + '<button class="star-dismiss" id="star-dismiss" type="button" aria-label="Dismiss the star line" title="Dismiss">×</button></p>';+}diff --git a/test/cockpit/relay.test.js b/test/cockpit/relay.test.jsindex 03ffa605..fb574dda 100644--- a/test/cockpit/relay.test.js+++ b/test/cockpit/relay.test.js@@ -14,7 +14,8 @@ import { createRelayBrowserHandler } from '../../relay/browser-page.js';import { relayClientFixture } from '../relay-client-fixture.js';import { runFixtureChildAsync } from '../fixture-child.js';import { findChromeExecutable, relayWorkBudgetMs, startChrome } from '../relay-browser-fixture.js';-import { BIN, scratch, SPEC, machine, project, fetchLive, startView, target, chromeExecutable, browserPause, startSnapshotChrome, openSnapshotChrome, stopOwnedChrome, closeSnapshotChrome, pickProject } from './fixture.js';+import { BIN, scratch, SPEC, machine, project, fetchLive, startView, target, chromeExecutable, browserPause, startSnapshotChrome, openSnapshotChrome, stopOwnedChrome, closeSnapshotChrome, pickProject, proofShot } from './fixture.js';+import { STAR_TEXT, starRepository } from '../../src/view/star.js';test('a paired relay reference explains that committed source is available only in the local project view [B33]', {// Its relay work is the fixture's setup moves, the browser's pairing and the reference's request: three budgets,@@ -2043,3 +2044,48 @@ test('the hosted page lists linked and local boards together [N26,H5]', {}}});++test('the star line shows once to a signed-in person and stays dismissed [N26]', { timeout: 90_000 }, async (t) => { // budget: hang-only ceiling for real Chrome startup and five page loads.+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for the star line proof.');+ const box = machine();+ project(box, 'star-line');+ const live = await startView(box);+ let linked = false, chrome;+ const page = (relaySession) => cockpitPage('', { readOnly: true, requests: relaySession, transportModule: '/star-transport.js', apiHeaders: {}, stylesheet: '/view.css', hostedLocal: true, relaySession, signIn: '/auth/github/start' });+ const server = createServer(async (request, response) => {+ const url = new URL(request.url, 'http://127.0.0.1');+ const send = (type, body, status = 200) => response.writeHead(status, { 'content-type': type, 'cache-control': 'no-store' }).end(body);+ if (url.pathname === '/in' || url.pathname === '/out') return send('text/html; charset=utf-8', page(url.pathname === '/in'));+ if (url.pathname === '/star-transport.js') return send('text/javascript', "export async function createTransport() { return { async request(path) { return (await fetch('/relay' + path)).json(); } }; }");+ if (url.pathname === '/view.css') return send('text/css', readFileSync(new URL('../../src/view.css', import.meta.url), 'utf8'));+ if (!url.pathname.startsWith('/relay/') || (!linked && url.pathname === '/relay/api/v1/boards')) return send('application/json', JSON.stringify({ version: 1, boards: [] }));+ const reply = await fetchLive(live.base + url.pathname.slice('/relay'.length) + url.search, { headers: { 'x-pullboard-key': live.key } }).catch(() => null);+ return send('application/json', reply ? await reply.text() : '{}', reply?.status ?? 502);+ });+ const origin = await new Promise((resolve) => server.listen(0, '127.0.0.1', () => resolve(`http://127.0.0.1:${server.address().port}`)));+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-star-line-chrome-'));+ const line = "(() => { const p = document.querySelector('#star-line'); return p && !p.hidden && getComputedStyle(p).display !== 'none' ? { text: p.textContent, href: p.querySelector('a').href, lines: p.querySelector('a').getClientRects().length, parts: p.children.length, count: document.querySelectorAll('.star-line').length } : null; })()";+ try {+ chrome = await openSnapshotChrome(executable, 'about:blank', profile);+ await chrome.send('Page.addScriptToEvaluateOnNewDocument', { source: "{ const f = window.fetch; window.fetch = (input, init) => String(input?.url ?? input).startsWith('http://127.0.0.1:4890') ? Promise.reject(new TypeError('no local view in this proof')) : f(input, init); }" }); // Never this machine's real view.+ await chrome.send('Page.navigate', { url: origin + '/out' }).then(() => chrome.waitFor("location.pathname === '/out' && !document.querySelector('#local-note').hidden"));+ assert.equal(await chrome.stable(line), null, 'a signed-out page shows no star line');+ await chrome.send('Page.navigate', { url: live.link.href }).then(() => chrome.waitFor('!!data?.project'));+ assert.equal(await chrome.stable("document.querySelector('#star-line') === null && !document.body.textContent.includes('GitHub star')"), true, 'the local view never carries the star line');+ for (const file of ['src/cli.js', 'src/mcp.js', 'src/help.js']) assert.ok(!readFileSync(new URL('../../' + file, import.meta.url), 'utf8').includes('GitHub star'), file + ' never prints the star line');+ await chrome.send('Page.navigate', { url: origin + '/in' }).then(() => chrome.waitFor("location.pathname === '/in' && data !== null && !document.body.classList.contains('loading')"));+ assert.equal(await chrome.stable(line), null, 'a signed-in person with no linked board sees no star line');+ linked = true; // The person links a board: the page's next read of the relay lists it.+ await chrome.waitFor(`${line} !== null`);+ assert.deepEqual(await chrome.stable(line), { text: STAR_TEXT + '×', href: starRepository(), lines: 1, parts: 2, count: 1 }, 'one line, one plain sentence, linking to the repository');+ for (const width of [1280, 390]) await proofShot(chrome, 'star-line', width);+ await press(chrome, "document.querySelector('#star-dismiss')");+ await chrome.waitFor(`${line} === null && localStorage.getItem('pb.star') === 'dismissed'`);+ await chrome.send('Page.reload', {}).then(() => chrome.waitFor("!!data?.project && document.querySelector('#star-line') !== null"));+ assert.equal(await chrome.stable(line), null, 'a dismissed star line stays dismissed across a reload, with the linked board listed');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ await Promise.all([live.stop(), new Promise((resolve) => server.close(resolve))]).finally(() => rmSync(profile, { recursive: true, force: true }));+ }+});