…
.role b{font:700 14px var(--display);text-transform:capitalize}.role small{color:var(--soft);font-size:12px;line-height:1.4}
/* MOCK: Home laid out by a topic */
+#dmain.hwait{visibility:hidden}
.home{display:grid;gap:18px}
.hrow.hp{display:grid;gap:18px;align-items:start}.hrow.hp.n2{grid-template-columns:repeat(2,minmax(0,1fr))}.hrow.hp.n3{grid-template-columns:repeat(3,minmax(0,1fr))}
…
const br=document.querySelector(".brain");if(br){const s=document.createElement("section");s.className="panel";s.innerHTML='<h2>The brain <small>your project\'s classes and features, as a map</small></h2>';s.append(br);P.brain=s}
return P}
+// the layout is asked for at once, beside the dashboard's own reads, so it's there when the dashboard is ready
+const LT=api("GET","/api/v2/topics/"+encodeURIComponent(LAYOUT)).then(r=>typeof r==="string"?r:(r&&r.text)||"",()=>"");
-async function layout(){let text="";try{const r=await api("GET","/api/v2/topics/"+encodeURIComponent(LAYOUT));text=typeof r==="string"?r:(r&&r.text)||""}catch(e){}
+function layout(text){
const from=text?LAYOUT:"the default layout";text=(text||DEF).replace(/^---\n[\s\S]*?\n---\n/,"");
// the topic's # title is the page's title (the header), not a second heading
…
const bar=document.createElement("p");bar.className="hmock";bar.innerHTML='<b>MOCK</b> This Home is laid out by the topic <a href="/topics/'+esc(LAYOUT)+'" target="_top">'+esc(LAYOUT)+'</a>'+(from===LAYOUT?"":" (not found here, so the default)")+': edit it to move, drop or add panels and write between them. Unused panels are left out.';
main.append(bar,home);setTimeout(()=>window.dispatchEvent(new Event("resize")),50)}
+// no moving: #dmain stays invisible until it is laid out; the observer runs before the browser paints the reveal
+const M=$("dmain");let TXT=null,done=false;M.classList.add("hwait");
+const go=()=>{if(done||M.hidden||TXT===null)return;done=true;try{layout(TXT)}catch(e){console.error(e)}M.classList.remove("hwait")};
-const wait=()=>{const m=$("dmain");if(m&&!m.hidden)layout();else setTimeout(wait,150)};wait();
+LT.then(t=>{TXT=t;go()});new MutationObserver(go).observe(M,{attributes:true,attributeFilter:["hidden"]});go();
})();
</script>
…