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.

fix(view): open-board screens show again behind the mark [N26,H5]

Corey Olson5bf9f08e4587
diff --git a/src/view/page-script-2.js b/src/view/page-script-2.js
index 7deef3df..9ad6565d 100644
--- a/src/view/page-script-2.js
+++ b/src/view/page-script-2.js
@@ -31,6 +31,23 @@ const drawHosted = (${drawHosted.toString()});
*/
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 });
+ revealNote(state);
+}
+
+let revealTimer = null;
+/**
+ * Leave the hosted page's neutral mark for the screen just drawn (#948). A screen the page settles on shows at once.
+ * Finding your boards and Click Allow are on the way to another screen, so they show only once they last past the
+ * page's slow threshold, and a fast look never flashes them (#932). For a signed-in person the other local screens
+ * are on the way too, since the account's list decides next, and startPage leaves the mark once it has.
+ */
+function revealNote(state) {
+ clearTimeout(revealTimer);
+ if (!state || !document.body.classList.contains('loading')) return;
+ const passing = state === 'looking' || state === 'asking';
+ if (!passing && hosted.relaySession && LOCAL_STATES.includes(state)) return;
+ if (!passing) { document.body.classList.remove('loading'); return; }
+ revealTimer = setTimeout(() => { if ($('local-note').dataset.state === state) document.body.classList.remove('loading'); }, 800);
}
let starLinked = { at: 0, linked: false, reading: false };
diff --git a/src/view/page-script-4.js b/src/view/page-script-4.js
index 159ad9b4..b4e254a3 100644
--- a/src/view/page-script-4.js
+++ b/src/view/page-script-4.js
@@ -1097,6 +1097,8 @@ async function loadTransport() {
/** Read local boards first; relay-only pages and pairing still load their configured client directly. */
async function startPage() {
let local = 'unreachable';
+ // The page opens on Finding your boards; it shows only if the look is slow (#948).
+ if (hosted.local) revealNote($('local-note').dataset.state);
if (hosted.local && !relayPairing) {
if (localProblem) localNote('problem', { detail: localProblem });
else local = await connectLocal();
diff --git a/test/cockpit/open-board.test.js b/test/cockpit/open-board.test.js
index 63bc4809..19b20bc0 100644
--- a/test/cockpit/open-board.test.js
+++ b/test/cockpit/open-board.test.js
@@ -184,7 +184,7 @@ async function pressCopy(chrome, button, words) {
/** Open the stand-in page at this address, wait for the open-board state it should settle in, and read it. */
async function openState(chrome, address, state, shot) {
await chrome.send('Page.navigate', { url: HOSTED + '/' + address });
- await chrome.waitFor(`location.search === ${JSON.stringify(address.split('#')[0])} && document.querySelector('#local-note')?.dataset.state === ${JSON.stringify(state)} && !document.querySelector('#local-note').hidden`, 20_000); // budget: hang ceiling for one page load and one refused or held loopback request.
+ await chrome.waitFor(`location.search === ${JSON.stringify(address.split('#')[0])} && document.querySelector('#local-note')?.dataset.state === ${JSON.stringify(state)} && !document.querySelector('#local-note').hidden && document.querySelector('#local-note').getClientRects().length > 0`, 20_000); // budget: hang ceiling for one page load and one refused or held loopback request.
const seen = JSON.parse(await chrome.stable(SHOWN));
if (shot) {
await proofShot(chrome, shot + '-phone', 390);