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.

feat(view): milestones show their count against the limit [N26]

Corey Olson9250e20c01d8
diff --git a/src/cockpit.js b/src/cockpit.js
index 0f9b7223..d55b111f 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -43,10 +43,8 @@ import { settingsMarkup } from './view/settings-page.js';
import { settingsPageScript } from './view/settings-page.js';
import { agentApprovalScript } from './view/agent-approval.js';
import { historyLoadingScript } from './view/history-loading.js';
-
/** The CLI's default phrases, ordered by depth for the existing prose inventory guard. */
export const PULLBOARD_COMMANDS = Object.freeze(commandPhrases().sort((left, right) => right.split(' ').length - left.split(' ').length));
-
/**
* The item lifecycle as the page draws it (M1): each state with what it means and, for a final
* state, what every way in checks; each move with who makes it, its command or the clock's
@@ -64,7 +62,6 @@ function lifecycle() {
moves: MACHINE.moves.map((move) => ({ verb: move.verb, from: move.from, to: move.to, by: move.by, how: move.command ?? `when ${move.when}`, checks: effectiveGuards(move).map((id) => rule(move, id)) })),
};
}
-
/**
* The page `pullboard view` serves (N26): one self-contained file, no assets from anywhere, that
* reads the board through the server's JSON and follows its events. The layout is the one the person
@@ -955,6 +952,9 @@ function roadmapCards(p, titles) {
const mobileHistory = '<section class="roadmap-shipping roadmap-mobile-shipping" aria-label="Last shipped release">' + lastShipped + '</section>';
/** Keep supplied landed progress beside an upcoming release without a modern summary. */
const count = (m) => m.total ? '<span class="milestone-count" aria-label="' + m.done + '/' + m.total + ' landed">' + m.done + '/' + m.total + ' landed</span>' : '';
+ /** Show the backend's capacity independently of remaining-work headers, including empty and shipped plans [N26]. */
+ const capacity = (m) => Number.isSafeInteger(m.milestone.limit) && m.milestone.limit >= 0 && Number.isSafeInteger(m.milestone.count) && m.milestone.count >= 0
+ ? '<span class="milestone-limit">' + m.milestone.count + '/' + m.milestone.limit + ' items</span>' : '';
/** Render the existing milestone items, progress and complete note when opened. */
const body = (read) => {
const { milestone, rows, done, total } = read;
@@ -972,10 +972,10 @@ function roadmapCards(p, titles) {
const header = headerFor(m);
const legacyTarget = m.milestone.target ? '<div class="milestone-targetline">Target <time datetime="' + esc(m.milestone.target) + '">' + when(m.milestone.target) + '</time>' + (m.milestone.pastTarget ? ' <span class="chip warn">past target</span>' : '') + '</div>' : '';
return wrap('section', 'card-panel milestone' + (header ? ' roadmap-has-summary' : ''), 'm:' + m.milestone.name, true,
- '<h2>' + linked(m.milestone.name, titles) + '</h2>' + (header ? header.count : count(m)), body(m), header ? header.detail + (m === next ? mobileHistory : '') : legacyTarget + (m === next ? mobileShipping : ''));
+ '<h2>' + linked(m.milestone.name, titles) + '</h2>' + (header ? header.count : count(m)) + capacity(m), body(m), header ? header.detail + (m === next ? mobileHistory : '') : legacyTarget + (m === next ? mobileShipping : ''));
};
/** Summarize one shipped milestone with its first note line and total count. */
- const line = (m) => wrap('div', 'milestone shipped-one', 'm:' + m.milestone.name, false, '<h2>' + esc(m.milestone.name) + '</h2><small>' + esc(firstLine(m.milestone.note)) + '</small>' + (m.milestone.shipped?.commit ? '<code class="roadmap-shipped-commit" title="' + esc(m.milestone.shipped.commit) + '">' + esc(m.milestone.shipped.commit.slice(0, 12)) + '</code>' : '') + '<span class="milestone-count">' + m.total + (m.total === 1 ? ' item' : ' items') + '</span>', body(m));
+ const line = (m) => wrap('div', 'milestone shipped-one', 'm:' + m.milestone.name, false, '<h2>' + esc(m.milestone.name) + '</h2><small>' + esc(firstLine(m.milestone.note)) + '</small>' + (m.milestone.shipped?.commit ? '<code class="roadmap-shipped-commit" title="' + esc(m.milestone.shipped.commit) + '">' + esc(m.milestone.shipped.commit.slice(0, 12)) + '</code>' : '') + '<span class="milestone-count">' + m.total + (m.total === 1 ? ' item' : ' items') + '</span>' + capacity(m), body(m));
const releaseButtons = coming.map((m) => {
const key = 'm:' + m.milestone.name;
return '<button class="roadmap-release" data-roadmap-jump="' + esc(key) + '" type="button"><span>' + esc(m.milestone.name) + '</span><b>' + m.done + '/' + m.total + '</b></button>';
diff --git a/test/cockpit/milestone-limit.test.js b/test/cockpit/milestone-limit.test.js
new file mode 100644
index 00000000..c230e44b
--- /dev/null
+++ b/test/cockpit/milestone-limit.test.js
@@ -0,0 +1,41 @@
+/** @pullboard-test-gui */
+/** Real roadmap capacity labels remain visible for active, empty and shipped milestones [N26]. */
+import assert from 'node:assert/strict';
+import { mkdtempSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { test } from 'node:test';
+import { machine, project, startView, chromeExecutable, openSnapshotChrome, closeSnapshotChrome, press } from './fixture.js';
+
+test('the view shows milestone count against its limit including empty and shipped plans [N26]', { timeout: 90_000 }, async () => {
+ const executable = chromeExecutable();
+ assert.ok(executable, 'Chrome is required for milestone capacity labels.');
+ const box = machine(), alpha = project(box, 'milestone-caps');
+ box.run(alpha.repo, 'add', 'web', 'Release work', '--specs', 'G1', '--criterion', 'Ready.');
+ box.run(alpha.repo, 'milestone', 'add', 'Active', '--items', '1');
+ box.run(alpha.repo, 'milestone', 'edit', 'Active', '--limit', '2');
+ for (const name of ['Empty', 'Shipped']) {
+ box.run(alpha.repo, 'milestone', 'add', name);
+ box.run(alpha.repo, 'milestone', 'edit', name, '--limit', '0');
+ }
+ box.run(alpha.repo, 'milestone', 'ship', 'Shipped');
+ box.run(alpha.repo, 'milestone', 'add', 'Unlimited');
+ const view = await startView(box), profile = mkdtempSync(join(tmpdir(), 'pullboard-capacity-chrome-'));
+ let chrome;
+ try {
+ chrome = await openSnapshotChrome(executable, view.link.href, profile);
+ await chrome.waitFor("document.querySelector('[data-tab=roadmap]')");
+ await press(chrome, "document.querySelector('[data-tab=roadmap]')");
+ await chrome.waitFor("document.querySelector('[data-key=\"m:Active\"] .milestone-limit')");
+ for (const width of [375, 1280]) {
+ await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });
+ const labels = JSON.parse(await chrome.stable(`JSON.stringify(['Active','Empty','Shipped','Unlimited'].map(name => document.querySelector('[data-key="m:'+name+'"] .milestone-limit')?.textContent ?? null))`));
+ assert.deepEqual(labels, ['1/2 items', '0/0 items', '0/0 items', null], String(width));
+ }
+ assert.deepEqual(chrome.exceptions, []);
+ } finally {
+ if (chrome) await closeSnapshotChrome(chrome);
+ await view.stop();
+ rmSync(profile, { recursive: true, force: true });
+ }
+});