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): a repo with one board shows once [N33,N26]
Corey Olson4180094cfbd1
diff --git a/src/cockpit.js b/src/cockpit.jsindex b05f9ed0..c0f23040 100644--- a/src/cockpit.js+++ b/src/cockpit.js@@ -618,7 +618,9 @@ async function boardState(root, mark) {if (!grouped.has(project.project)) grouped.set(project.project, []);grouped.get(project.project).push(project);}- const groups = [...grouped].map(([name, repos]) => ({ name, key: 'group:' + name, repos }));+ // A project groups repos only when two or more share its name. One repo alone, as every board the relay+ // lists is, shows as itself: a heading above the same board would only say it twice.+ const groups = [...grouped].filter(([, repos]) => repos.length > 1).map(([name, repos]) => ({ name, key: 'group:' + name, repos }));const group = groups.find((entry) => entry.key === root);return {projects, groups, project: states.get(root) || null,@@ -788,7 +790,7 @@ function renderSide() {const count = group.repos.length;return '<section class="repo-group"><button class="proj project-pick' + (on ? ' on' : '') + '"' + (on ? ' aria-current="true"' : '') + ' data-root="' + esc(group.key) + '" type="button"><span class="pname">' + esc(group.name) + '</span>' + (needs ? '<b class="need" title="needs you">' + needs + '</b>' : '') + '<small>' + count + ' ' + (count === 1 ? 'repo' : 'repos') + '</small></button><div class="repos">' + group.repos.map(repoButton).join('') + '</div></section>';}).join('');- const loose = data.projects.filter((repo) => !repo.project && !groupedRoots.has(repo.root)).map(repoButton).join('');+ const loose = data.projects.filter((repo) => !groupedRoots.has(repo.root)).map(repoButton).join('');$('proj-list').innerHTML = grouped || loose ? grouped + loose : '<div class="empty">None yet.</div>';const currentGroup = data.groups.find((group) => group.key === view.root);const currentRoots = new Set(currentGroup ? currentGroup.repos.map((repo) => repo.root) : [view.root]);diff --git a/test/cockpit.test.js b/test/cockpit.test.jsindex f84b71cc..cbecfbf5 100644--- a/test/cockpit.test.js+++ b/test/cockpit.test.js@@ -608,6 +608,32 @@ test('projects group repos with combined needs and activity, while ungrouped and}});+test('a project with one repo shows once in the project list [N33, N26]', async () => {+ const box = machine();+ const solo = project(box, 'solo', SPEC, { name: 'Solo board', project: 'Solo' });+ box.run(solo.repo, 'shout', 'person', 'Ship it today?', '--decision');+ // The relay lists every board this way: its project is its own repository's name.+ const mirrored = project(box, 'mirrored', SPEC, { name: 'acme/site', project: 'acme/site' });+ project(box, 'core', SPEC, { name: 'Core API', project: 'Atlas' });+ project(box, 'web', SPEC, { name: 'Web UI', project: 'Atlas' });+ const view = await startView(box);+ try {+ const page = await openPage(view);+ const side = page.show('proj-list');+ const once = (name) => side.split('<span class="pname">' + name + '</span>').length - 1;+ assert.doesNotMatch(side, /data-root="group:Solo"|data-root="group:acme\/site"/, 'a project with one repo has no group heading');+ assert.deepEqual([once('Solo board'), once('acme/site'), once('Solo')], [1, 1, 0], 'each one-repo project shows as its repo, once');+ assert.ok(side.includes(`data-root="${solo.repo}"`) && side.includes(`data-root="${mirrored.repo}"`), 'as a repo button of its own');+ assert.equal((side.match(/title="needs you">1<\/b>/g) || []).length, 1, "the lone repo's decision is counted once, not again on a heading");+ assert.match(side, /data-root="group:Atlas"/, 'two repos sharing a project still group');+ assert.deepEqual([once('Core API'), once('Web UI'), once('Atlas')], [1, 1, 1], 'under one heading');+ await page.click({ root: solo.repo });+ assert.deepEqual([page.element('group-view').hidden, page.element('tabs').hidden], [true, false], 'the lone repo opens on its own board');+ } finally {+ await view.stop();+ }+});+test('the tabs fit one row on a phone [N26]', async () => {const view = await startView(machine());try {