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
fix(view): open Safari local boards directly [H5,N26]
Corey Olsonb813c10b63e6
diff --git a/src/view/hosted.js b/src/view/hosted.jsindex ddc48d6a..7a98eaac 100644--- a/src/view/hosted.js+++ b/src/view/hosted.js@@ -64,6 +64,8 @@ export function hostedMarkup(localView, { looking = false, signIn = null } = {})<div class="ob-act" data-part="github" hidden>${github.replace('<a ', '<a id="local-note-go" ')}</div><div class="ob-act" data-part="command" hidden>${commandBoxes('', OPEN_ASK, 'local-note')}</div><div class="ob-act" data-part="open" hidden><a class="ob-big ob-go" id="local-note-view" href="${localView}/local/view">Open your board</a></div>+ <p class="ob-small" data-part="local-open" hidden><a id="local-note-direct" href="${localView}/local/view">Open your board on this computer</a></p>+ <p class="ob-small" data-part="local-command" hidden>On this computer, run <code>pullboard view</code> to open your board in its own page.</p><p class="ob-small" id="local-note-small" hidden></p><p class="ob-live" id="local-note-live" hidden><i aria-hidden="true"></i><span></span></p><div class="ob-help" id="local-note-help" hidden>${SPEECH}<span><span id="local-note-lead"></span><small id="local-note-said"></small></span><button type="button" id="local-note-help-copy" data-copy="">Copy</button></div>@@ -85,7 +87,7 @@ export function hostedBrowser(agent) {if (/Opera|OPR\//.test(said)) return 'Opera';if (/Chrom/.test(said)) return 'Chrome';if (/Firefox\//.test(said)) return 'Firefox';- if (/Safari\//.test(said)) return 'Safari';+ if (/Safari\/|AppleWebKit\//.test(said)) return 'Safari';return 'This browser';}@@ -95,8 +97,8 @@ export function hostedBrowser(agent) {* Your browser said no and Where are your projects? on a computer, and #757's two screens, Your boards, on your phone* and One step on your computer, for a phone and for a person signed in with nothing shared.*- * @param {string|null} state - looking, asking, blocked, not-running, mismatch, problem, signed-out, no-linked, unpaired, linked-failed or local-failed.- * @param {{phone?: boolean, detail?: string, linked?: string[]}} [facts] - Whether the page runs on a phone, a refusal's own words, and the boards the account shares that this browser cannot open yet.+ * @param {string|null} state - looking, local-open, asking, blocked, not-running, mismatch, problem, signed-out, no-linked, unpaired, linked-failed or local-failed.+ * @param {{phone?: boolean, detail?: string, linked?: string[], localNavigationOnly?: boolean, listed?: boolean, signedIn?: boolean, localOriginKnown?: boolean}} [facts] - The device, refusal, linked boards and whether local boards need their own page beside a listed relay board.* @returns {null|{state: string, kind: string, heading: string, text?: string, parts: string[], command?: string, ask?: string, small?: string, live?: string, lead?: string, help?: string, detail?: string}}*/export function hostedState(state, facts = {}) {@@ -108,6 +110,10 @@ export function hostedState(state, facts = {}) {small: 'It shares every project with your account. Your boards show up here by themselves.', live: 'Waiting for your boards' };const models = {'looking': { kind: 'state', heading: 'Finding your boards…', parts: ['spin'] },+ 'local-open': { kind: facts.listed ? 'note' : 'state', heading: 'Open this computer’s board',+ text: !facts.listed && !facts.localOriginKnown ? 'This command opens your board in its own page.' : undefined,+ parts: [facts.listed ? (facts.localOriginKnown ? 'local-open' : 'local-command') : (facts.localOriginKnown ? 'open' : 'command'),+ ...(facts.signedIn ? [] : ['github'])], command: 'pullboard view', ask: opening },'asking': { kind: 'state', heading: 'Click Allow', text: 'Your browser is asking if this page may open the boards on this computer. Your boards stay on this computer.', parts: ['ask'],live: 'Waiting for you to click Allow', lead: agent, help: 'Help me allow Pullboard in my browser.' },'blocked': { kind: 'state', heading: 'Your browser said no', text: 'That\'s fine. Turn it back on in three clicks:', parts: ['steps'],@@ -131,7 +137,8 @@ export function hostedState(state, facts = {}) {'local-failed': { kind: 'note', heading: 'This computer\'s boards did not load', text: 'They show here by themselves once Pullboard answers.', parts: [], detail: facts.detail },};const model = state ? models[state] : null;- return model ? { state, ...model } : null;+ return model ? { state, ...model, parts: [...model.parts,+ ...(facts.localNavigationOnly && state !== 'local-open' ? [facts.localOriginKnown ? 'local-open' : 'local-command'] : [])] } : null;}/**@@ -171,6 +178,7 @@ export function drawHosted(doc, model, place) {$('local-note-help-copy').dataset.copy = model?.help || '';for (const button of note.querySelectorAll('button[data-copy]')) button.textContent = 'Copy';$('local-note-view').href = place.view + '/local/view';+ $('local-note-direct').href = place.view + '/local/view';for (const link of note.querySelectorAll('.ob-gh')) if (place.signIn) link.href = place.signIn;// A person already signed in is never asked to sign in: Where are your projects? keeps only this computer's card.note.querySelector('.ob-two').classList.toggle('signed-in', Boolean(place.session));diff --git a/src/view/page-script-2.js b/src/view/page-script-2.jsindex d864d0c7..bab0000f 100644--- a/src/view/page-script-2.js+++ b/src/view/page-script-2.js@@ -30,7 +30,7 @@ const drawHosted = (${drawHosted.toString()});* page names before first paint (#757), and it hears nothing about this computer.*/function localNote(state, facts = {}) {- drawHosted(document, hostedState(state, { browser: hostedBrowser(navigator), phone: document.documentElement.dataset.relayDevice === 'phone', ...facts }), { view: localSession?.origin || LOCAL_VIEW, signIn: hosted.signIn, session: hosted.relaySession });+ drawHosted(document, hostedState(state, { browser: hostedBrowser(navigator), phone: document.documentElement.dataset.relayDevice === 'phone', localNavigationOnly, localOriginKnown: Boolean(localSession), signedIn: hosted.relaySession, ...facts }), { view: localSession?.origin || LOCAL_VIEW, signIn: hosted.signIn, session: hosted.relaySession });revealNote(state);}@@ -118,6 +118,7 @@ function localExpired() {const LOCAL_STATES = ['looking', 'asking', 'blocked', 'not-running', 'mismatch'];let localChecking = false;let localReached = false;+let localNavigationOnly = false;/*** Reach this machine's view: read the view's public protocol, which holds no secret and no board, and take the session@@ -130,6 +131,13 @@ let localReached = false;async function connectLocal(again = false) {// A phone never runs Pullboard: it is unreachable at once, before a permission query or a fetch can wait (#900).if (pageStartup(document.documentElement).phone) return 'unreachable';+ // WebKit refuses HTTPS-to-HTTP loopback reads even after a secret handoff. A top-level link opens the view itself,+ // where its normal session key and same-origin requests work; keep relay boards and their pairing screens independent.+ if (location.protocol === 'https:' && hostedBrowser(navigator) === 'Safari') {+ localNavigationOnly = true;+ if (!again) localNote('local-open', { listed: hosted.relaySession });+ return 'unreachable';+ }if (localChecking) return 'busy';localChecking = true;try { return await lookLocal(again); }@@ -980,11 +988,15 @@ async function hostedListed(boards) {// A list that arrives after a failed read, once this computer's view answered, means the page recovered: the problem// it showed is over, and this list decides what shows now.if (shown === 'problem' && localReached) { localNote(null); shown = ''; }- if (boards.length) { if (['looking', 'not-running', 'no-linked', 'unpaired', 'signed-out'].includes(shown)) localNote(null); return; }+ if (boards.length) {+ if (localNavigationOnly) localNote('local-open', { listed: true });+ else if (['looking', 'not-running', 'no-linked', 'unpaired', 'signed-out'].includes(shown)) localNote(null);+ return;+ }// Nobody signed in and no board on this computer yet: the page says how to make one, as the local view does.if (!hosted.relaySession) { if (shown === 'looking') localNote(null); return; }// An empty local view can still leave linked boards on another computer waiting for this browser to pair.- if (!['', 'looking', 'not-running', 'no-linked', 'unpaired'].includes(shown)) return;+ if (!['', 'looking', 'not-running', 'no-linked', 'unpaired', 'local-open'].includes(shown)) return;let linked;try { linked = await linkedList(); } catch { return; /* the relay's banner says why */ }const names = (linked.boards || []).filter((board) => typeof board.repository === 'string').map((board) => board.repository);