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
feat(view): the switcher's arrow points the way the list goes [N26]
Corey Olson25571828d803
diff --git a/src/cockpit.js b/src/cockpit.jsindex f3973f94..1a776df4 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -65,7 +65,7 @@ export function cockpitPage(key = '', { snapshot = false, readOnly = false, requ<aside class="side" id="side" aria-label="Projects"><div class="side-top"><button class="brand" id="side-toggle" type="button" aria-pressed="false" aria-controls="side-body" aria-label="Collapse the project list" title="Collapse the project list"><svg viewBox="0 0 64 64" aria-hidden="true"><path fill="currentColor" d="M8 7h35a6 6 0 0 1 6 6v7H8a5 5 0 0 1-5-5v-3a5 5 0 0 1 5-5Z"/><rect width="56" height="14" x="3" y="25" fill="var(--accent)" rx="5"/><path fill="currentColor" d="M8 43h35a6 6 0 0 1 6 6v8H8a5 5 0 0 1-5-5v-4a5 5 0 0 1 5-5Z"/></svg><span>Pullboard</span></button>- <button class="switch-btn" id="proj-switch" type="button" aria-expanded="false" aria-controls="side-body"><span id="proj-name">Projects</span><small>▾</small></button>+ <button class="switch-btn" id="proj-switch" type="button" aria-expanded="false" aria-controls="side-body"><span id="proj-name">Projects</span><small aria-hidden="true"><svg viewBox="0 0 16 16"><path d="M4 6l4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg></small></button><button class="theme-btn" id="theme" type="button" title="Theme: system"><svg class="sys" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="6" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="currentColor" d="M8 2a6 6 0 0 1 0 12Z"/></svg><svg class="sun" viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3" fill="none" stroke="currentColor" stroke-width="1.5"/><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M8 1.5v1.2M8 13.3v1.2M1.5 8h1.2M13.3 8h1.2M3.4 3.4l.85.85M11.75 11.75l.85.85M3.4 12.6l.85-.85M11.75 4.25l.85-.85"/></svg><svg class="moon" viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" d="M13.6 9.6A6 6 0 1 1 6.4 2.4a5.2 5.2 0 0 0 7.2 7.2Z"/></svg></button></div><div class="side-body" id="side-body">diff --git a/src/view.css b/src/view.cssindex 044fb888..2ec8da62 100644--- a/src/view.css+++ b/src/view.css@@ -32,7 +32,10 @@ button, input, select, textarea { font: inherit; color: inherit; }.brand svg { width: 22px; height: 22px; flex: none; }.switch-btn { display: none; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-weight: 600; }.switch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }-.switch-btn small { color: var(--ink-faint); font-weight: 400; }+.switch-btn small { display: grid; place-items: center; color: var(--ink-faint); }+.switch-btn small svg { width: 16px; height: 16px; }+/* While the project list is open the arrow points up at once, so the switcher says it will close what it opened. */+.switch-btn[aria-expanded="true"] small { transform: rotate(180deg); }.theme-btn { flex: none; margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-faint); cursor: pointer; }.theme-btn:hover { color: var(--ink); background: var(--surface-2); }.theme-btn svg { display: none; width: 16px; height: 16px; }diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex 7aa4872f..eeb520c4 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -7299,3 +7299,65 @@ test('needs you and the asks sit in their lists [N26]', { timeout: 180_000 }, asawait view.stop();}});++test('the project switcher\'s arrow turns with the list [N26]', { timeout: 120_000 }, async (t) => {+ const executable = chromeExecutable();+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for project switcher checks.');+ const box = machine();+ project(box, 'arrow-alpha');+ project(box, 'arrow-beta');+ const view = await startView(box);+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-arrow-chrome-'));+ let chrome;+ /** The switcher's arrow as it reads: shown, its size, which way it points, and whether it animates. */+ const read = async () => JSON.parse(await chrome.evaluate(`JSON.stringify((() => {+ const arrow = document.querySelector('#proj-switch small'), svg = arrow.querySelector('svg'), s = getComputedStyle(arrow), r = svg.getBoundingClientRect();+ return {+ page: { width: document.documentElement.clientWidth, scroll: document.documentElement.scrollWidth },+ shown: s.display !== 'none' && r.width > 0, size: [Math.round(r.width), Math.round(r.height)], faint: s.color === (() => { const p = document.createElement('i'); p.style.color = 'var(--ink-faint)'; document.body.append(p); const c = getComputedStyle(p).color; p.remove(); return c; })(),+ turn: s.transform, motion: [s.transitionDuration, s.animationName], open: document.querySelector('#proj-switch').getAttribute('aria-expanded'),+ };+ })())`));+ const click = (selector) => chrome.evaluate(`document.querySelector(${JSON.stringify(selector)}).click()`);+ /** One drawn frame after a click: an arrow that animated would still be part way round. */+ const frame = () => chrome.evaluate('new Promise((done) => requestAnimationFrame(() => requestAnimationFrame(done)))');+ const DOWN = 'none', UP = 'matrix(-1, 0, 0, -1, 0, 0)';+ try {+ chrome = await openSnapshotChrome(executable, view.link.href, profile);+ await chrome.waitFor("typeof data === 'object' && data?.projects?.length === 2 && !!document.querySelector('#proj-list .proj.repo')");+ for (const scheme of ['light', 'dark']) {+ for (const width of [1280, 375]) {+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });+ await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });+ await chrome.waitFor(`innerWidth === ${width} && matchMedia('(prefers-color-scheme: ${scheme})').matches`);+ const at = `${width}px ${scheme}`;+ if (width === 1280) {+ // Docked, the name opens no list, so there is no arrow; collapsed, the list drops from the name.+ if (await chrome.evaluate("document.documentElement.dataset.side === 'collapsed'")) await click('#side-toggle');+ await chrome.waitFor("document.documentElement.dataset.side !== 'collapsed'");+ assert.equal((await read()).shown, false, `${at}: docked, with no list to drop, there is no arrow`);+ await click('#side-toggle');+ await chrome.waitFor("document.documentElement.dataset.side === 'collapsed'");+ }+ const closed = await read();+ assert.ok(closed.page.scroll <= closed.page.width, `${at}: no sideways scroll`);+ assert.deepEqual([closed.shown, closed.size, closed.faint, closed.open, closed.turn], [true, [16, 16], true, 'false', DOWN], `${at}: a 16px chevron in the faint ink, pointing down while the list is closed: ${JSON.stringify(closed)}`);+ assert.deepEqual(closed.motion, ['0s', 'none'], `${at}: the arrow never animates: ${JSON.stringify(closed.motion)}`);+ // Open, it points up at once: one frame after the click it is all the way round. Closed again, down.+ await click('#proj-switch');+ await frame();+ const opened = await read();+ assert.deepEqual([opened.open, opened.turn], ['true', UP], `${at}: open, it points up at once: ${JSON.stringify(opened)}`);+ await click('#proj-switch');+ await frame();+ const shut = await read();+ assert.deepEqual([shut.open, shut.turn], ['false', DOWN], `${at}: closed again, it points down at once: ${JSON.stringify(shut)}`);+ }+ }+ assert.deepEqual(chrome.exceptions, [], 'the page raises no uncaught exception');+ } finally {+ if (chrome) await closeSnapshotChrome(chrome);+ rmSync(profile, { recursive: true, force: true });+ await view.stop();+ }+});