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): preserve shout card layout [N26,N38]
Corey Olson84597e331641
diff --git a/src/cockpit.js b/src/cockpit.jsindex 33416b34..44a2cf93 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -1707,7 +1707,6 @@ function render() {const addressed = addressedShouts.get(JSON.stringify([view.root, view.shout]));const feedShouts = addressed?.shout && !p.shouts.some((entry) => entry.shout_id === view.shout) ? [...p.shouts, addressed.shout] : p.shouts;const heard = unread ? feedShouts.filter((x) => x.shout_id > unread.after) : view.agent ? feedShouts.filter((x) => x.shout_from === view.agent || x.shout_to === view.agent) : feedShouts;- if (view.tab === 'shouts' && view.shout !== null) openShouts.add(view.shout);const bar = !unread && !view.agent ? '' : '<div class="feed-bar">' + (unread ? '<span><b>' + heard.length + '</b> unread <button class="link" data-unread type="button">show all</button></span>': '<span>Shouts with <b>' + esc(agentName(view.agent)) + '</b> <button class="link" data-agent="" type="button">show all</button></span>') + '</div>';$('shouts-pane').classList.toggle('bare', view.agentsHidden);@@ -1726,7 +1725,7 @@ function render() {// One card for a shout, in the feed and among the asks; tail adds what the place needs, such as Answer. Only the// feed's copy carries the band and the id an answer's link lands on, so an ask shown twice never repeats an id.const card = (x, tail = '', inFeed = true) => '<article class="shout h' + hue(x.shout_from) + (lead(x.shout_from) ? ' lead' : '') + (openShouts.has(x.shout_id) ? ' open' : '') + (inFeed && x.shout_id === view.shout ? ' found' : '') + '"' + (inFeed ? ' id="shout-' + x.shout_id + '"' : '') + ' data-shout-id="' + x.shout_id + '">'- + (lead(x.shout_from) ? '<span class="avatar">' + LEAD + '</span>' : '<span class="avatar' + (initials(x.shout_from).length > 3 ? ' wide' : '') + '" aria-hidden="true">' + esc(initials(x.shout_from)) + '</span>') + '<div class="shout-main">' + (inFeed && x.shout_id === view.shout ? '<h2>Shout #' + x.shout_id + '</h2>' : '') + '<header><b class="who">' + shoutAgentName(x.shout_from) + '</b><span class="to">→ ' + shoutAgentName(x.shout_to) + '</span>'+ + (lead(x.shout_from) ? '<span class="avatar">' + LEAD + '</span>' : '<span class="avatar' + (initials(x.shout_from).length > 3 ? ' wide' : '') + '" aria-hidden="true">' + esc(initials(x.shout_from)) + '</span>') + '<div class="shout-main">' + (inFeed && x.shout_id === view.shout ? '<h2 class="visually-hidden">Shout #' + x.shout_id + '</h2>' : '') + '<header><b class="who">' + shoutAgentName(x.shout_from) + '</b><span class="to">→ ' + shoutAgentName(x.shout_to) + '</span>'+ (itemOf(x) ? '<span class="item">#' + esc(itemOf(x)) + '</span>' : '') + mark(x) + '<time class="long" data-ago="' + esc(x.shout_at) + '" title="' + esc(when(x.shout_at)) + '">' + agoLong(x.shout_at) + '</time></header>'+ '<div class="text">' + rich(x.shout_text, titles) + '</div><button class="more" data-more type="button">' + (openShouts.has(x.shout_id) ? 'less' : 'more') + '</button>' + (inFeed ? band(x) + heardBy(x) : '') + evidence(x) + tail + '</div></article>';$('feed').innerHTML = (view.shout !== null && !feedShouts.some((entry) => entry.shout_id === view.shout) ? '<p class="empty" id="shout-address-status" role="status">' + esc(addressed?.error || 'Loading shout #' + view.shout + '…') + '</p>' : '') + bar + (heard.length ? dayRules(heard, (x) => x.shout_at, card) : '<div class="empty">' + (unread ? 'No unread shouts.' : view.agent ? 'No shouts with ' + esc(agentName(view.agent)) + ' among the last forty.' : 'No shouts yet.') + '</div>');diff --git a/src/view.css b/src/view.cssindex 8b8778bc..eec90593 100644--- a/src/view.css+++ b/src/view.css@@ -22,6 +22,7 @@body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.5 var(--sans); }button, input, select, textarea { font: inherit; color: inherit; }[hidden] { display: none !important; }+.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }diff --git a/test/cockpit/addresses.test.js b/test/cockpit/addresses.test.jsindex 340c7a6d..e859f4bc 100644--- a/test/cockpit/addresses.test.js+++ b/test/cockpit/addresses.test.js@@ -422,6 +422,57 @@ test('a shout address opens an old shout [N38,N26]', { timeout: 180_000 }, async});});+/** Read stable document-space boxes and the accessible heading for one addressed shout. */+async function shoutLayout(chrome, id) {+ return JSON.parse(await chrome.stable(`JSON.stringify((() => {+ const card = document.querySelector('#shout-${id}');+ /** Convert one rendered node to stable document-space geometry. */+ const box = node => {+ if (!node) return null;+ const rect = node.getBoundingClientRect();+ return { left: rect.left + scrollX, top: rect.top + scrollY, width: rect.width, height: rect.height };+ };+ const heading = card?.querySelector('h2');+ return { card: box(card), avatar: box(card?.querySelector('.avatar')), header: box(card?.querySelector('header')),+ heading: heading ? { tag: heading.tagName, text: heading.textContent } : null,+ found: card?.classList.contains('found') ?? false };+ })())`));+}++test('an addressed shout is highlighted without changing its layout [N26,N38]', { timeout: 180_000 }, async (t) => { // budget: hang-only ceiling for four real Chrome viewport and theme checks.+ const box = machine(), alpha = addressBoard(box, 'shout-layout');+ const text = 'Shout whose address must not change its layout.';+ box.run(alpha.repo, 'shout', 'person', text);+ await withBrowser(box, async (chrome, server) => {+ const shout = (await boardOf(server, alpha.repo)).shouts.find(one => one.shout_text === text);+ assert.ok(shout?.shout_id, 'the real board contains the addressed shout');+ for (const scheme of ['light', 'dark']) {+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });+ assert.equal(await chrome.stable(`matchMedia('(prefers-color-scheme: ${scheme})').matches`), true, `${scheme} media is active`);+ for (const width of [375, 1280]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.waitFor(`innerWidth === ${width}`);+ await openAddress(chrome, server, '/shouts');+ await assertPlace(chrome, '/shouts', 'shouts', alpha.repo);+ const before = await shoutLayout(chrome, shout.shout_id);+ assert.ok(before.card && before.avatar && before.header, `${width}px ${scheme}: the unaddressed shout has its layout boxes`);+ assert.equal(before.heading, null, `${width}px ${scheme}: the unaddressed shout has no detail heading`);+ await openAddress(chrome, server, `/shouts/${shout.shout_id}`);+ await assertPlace(chrome, `/shouts/${shout.shout_id}`, 'shouts', alpha.repo);+ await assertShout(chrome, shout.shout_id, text);+ const after = await shoutLayout(chrome, shout.shout_id);+ t.diagnostic('515-layout-geometry ' + JSON.stringify({ width, scheme, before, after }));+ assert.equal(after.heading?.tag, 'H2', `${width}px ${scheme}: address keeps its semantic heading`);+ assert.equal(after.heading?.text, `Shout #${shout.shout_id}`, `${width}px ${scheme}: heading names the shout`);+ assert.equal(after.found, true, `${width}px ${scheme}: addressed card is highlighted`);+ assert.deepEqual(after.card, before.card, `${width}px ${scheme}: addressed card keeps its document-space box`);+ assert.deepEqual(after.avatar, before.avatar, `${width}px ${scheme}: avatar stays in place`);+ assert.deepEqual(after.header, before.header, `${width}px ${scheme}: header stays in place`);+ }+ }+ });+});+test('grouped repos each get their own address [N38,N26]', { timeout: 180_000 }, async () => { // budget: hang-only ceiling for grouped repo switching and a separate one-repo machine.const box = machine(), alpha = addressBoard(box, 'alpha', 'same-suite'), beta = addressBoard(box, 'beta', 'same-suite');await withBrowser(box, async (chrome, server) => {