Skip to content

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.

Merge branch 'main' into view/mbp-seat

Corey Olsonb0d9212ff405
diff --cc src/cockpit.js
index fc81d672,0a8743b8..ab4234d1
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@@ -3576,42 -3538,23 +3576,53 @@@ if (snapshot)
if (snapshotReplay.playing) { clearTimeout(snapshotReplay.timer); snapshotReplay.timer = setTimeout(advanceReplay, 1000 / Number($('replay-speed').value)); }
});
}
-if (hosted.local) $('local-note-retry').addEventListener('click', () => {
- localProblem = null;
- tabValue(LOCAL_TRIPS, null);
- // Reload both source-scoped connections together when relay streams are already active.
- if (transport) { location.reload(); return; }
- connectLocal().then((local) => local === 'local' ? refresh() : null).catch((error) => localNote('problem', { detail: error.message }));
+/** Copy a screen's command or sentence; a browser without the clipboard API copies from a selected field. */
+async function copyWords(text) {
+ try { await navigator.clipboard.writeText(text); return true; }
+ catch { /* Older and embedded browsers refuse the clipboard API: copy from a selected field below. */ }
+ const field = document.createElement('textarea');
+ field.value = text;
+ field.setAttribute('readonly', '');
+ field.style.position = 'fixed';
+ field.style.opacity = '0';
+ document.body.append(field);
+ field.select();
+ const copied = document.execCommand('copy');
+ field.remove();
+ return copied;
+}
+$('local-note').addEventListener('click', async (event) => {
+ const button = event.target instanceof Element ? event.target.closest('button[data-copy]') : null;
+ if (!button || !button.dataset.copy) return;
+ button.textContent = await copyWords(button.dataset.copy) ? 'Copied' : 'Select and copy';
});
+/**
+ * Look for this machine's view again, by itself, while a screen waits on it or a signed-in person waits for a board:
+ * the moment the view answers, the page opens the board, with no Try again (#764). Over a relay stream, a reload
+ * starts both sources together.
+ */
+function lookAgain() {
+ if (!hosted.local || relayPairing || localReached || localProblem || document.hidden) return;
+ if (![...LOCAL_STATES, 'no-linked', 'unpaired'].includes($('local-note').dataset.state || '') || $('local-note').dataset.state === 'looking') return;
+ connectLocal(true).then((local) => {
+ if (local !== 'local') return;
+ if (transport) { location.reload(); return; }
+ transportModule = null;
+ return refresh();
+ }).catch((error) => localNote('problem', { detail: error.message }));
+}
+if (hosted.local && !snapshot) setInterval(lookAgain, 2000);
++
+ /** Open a newly approved board's Items view after its real list entry arrives. */
+ async function openApprovedBoard(boardId) {
+ await refresh();
+ const board = data?.projects.find(entry => entry.id === boardId && entry.ok);
+ if (!board) throw new Error('The approved board did not load. Refresh the board list and try again.');
+ view.tab = 'items';
+ keep('pb.tab', view.tab);
+ return switchTo(board.root);
+ }
+
/** Load the configured decrypting transport once, only when relay reads or pairing need it. */
let transportLoading = null;
async function loadTransport() {