Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions ARCHITECTURE.md

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,38 @@ expired recovery UX" work occupies that slot).

---

## feat(review): the review bar in the bid, and the Ready lane oldest waiting first (REVIEW-BAR, 2026-10-13)

BOARD-QUIET step 1, Will's two calls of 2026-10-13: the Ready lane sorts oldest waiting first,
and the decision moves to where the evidence is. A reviewer judged a bid from a card she had
not opened; now the board is for triage and the bid carries its own decision.

- **The bar.** While a bid that is ready for review is open by someone who can oversee it
(admin, overseer, lead), a slim bar sits under the header in the app's flex column, so the
sheet gives up its height rather than being covered: "Reviewing · waiting 11 days ·
twin-estimator-1 · 70 counts", then Request changes… (the confirm dialog's one-line note, the
server still refusing a blank one), one filled Mark reviewed, and Next ready, which opens the
next bid in the board's lane. After a decision the bar says what happened and how many are
left ("Reviewed ✓ · 40 more ready"), and Next ready walks on, so a morning of reviews is one
loop instead of forty trips to the board. It hides when the open project is no longer the one
it was shown for.
- **How it knows.** features/load-project.js ends a cloud load by calling
`App.onCloudProjectRowLoaded(proj)` with the RPC row, which carries `review_status`; the
board hands its Ready lane as rendered to `App.setReviewQueue` on every render, so Next
ready walks the lane the reviewer sees, filters included. A decision writes the status onto
the row the board holds, so its lane agrees without a refetch.
- **Oldest waiting first.** The lane sorts on `review_requested_at`, a row without a stamp
last; the lane title says so in a dim hint.
- The board's per-card Mark reviewed and Request changes… stay beside the bar for a bid the
reviewer does not need to open; whether they go is still Will's call (BOARD-QUIET).
- features/review-flow.js (the bar), features/bid-board.js (the sort, the queue),
features/load-project.js (the hook), app.js (`updateUI` calls `App.refreshReviewBar`),
app/index.html, styles.css, the Overseer guide's handoff section (rebuilt), sw.js restamped.
bid-board.spec.js gains the review-bar test (the bar on the oldest ready card, Mark reviewed,
Next ready walking to the twin's bid, Request changes through the dialog, the board agreeing,
the bar gone with the project, no bar for a reviewed bid or a non-reviewer) and pins the
lane's order.

## feat(bid-board): People · Twins · All, and an intro that says what the board does (PEOPLE-TWINS, 2026-10-13)

Wendi, a lead, opened All Bids on 41 cards, every one a digital twin's backtest, each wearing a
Expand Down
2 changes: 1 addition & 1 deletion PUNCHLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ How agents add to this list: AGENTS.md, "Recording a to-do".
| TRADE-DEFAULT | A project that never named a trade: does the device's default trade count as the project's? The app answers three ways today, so Bid Check on such a project shows water rows and the IPC edition but no hanger, fitting or plumbing rows. Decide, then one resolver | decision | ⚑ call | — | [DECOMPOSITION_MAP.md](DECOMPOSITION_MAP.md#t06-one-trade-resolver) |
| ICON-STORE | Opening a project REPLACES the user's own icon store with its `customIconPaths` (annotation-model.js:509 and 444 into app.js:209, wholesale; a project with an empty list empties the store), and they ride the user's later saves. Since #268 they are inert, but should a project be able to add icons to a user's store at all? Decide, then build | decision | ⚑ call | — | |
| DEMO-TRACK | The demo track behind the test drive's "Try it" is built for all three trades (phases 1 to 3 landed 2026-10-02). Left: a tester's real tablet and phone walk with a stopwatch against the 60 s target | test | tester | — | [DEMO-TRACK.md](journeys/plans/DEMO-TRACK.md#open-after-phase-2) |
| BOARD-QUIET | All Bids for a lead: the review moves into the opened bid (a review bar with Next ready) and the board becomes a quiet list, actions on the hovered row, exceptions only, oldest waiting first; PEOPLE-TWINS shipped the first step, the twin fleet off by default | build | agent | — | [BID-BOARD-QUIET.md](journeys/plans/BID-BOARD-QUIET.md#what-is-left) |
| BOARD-QUIET | All Bids for a lead: the board becomes a quiet list, actions on the hovered row, exceptions only, grouped by estimator once there are enough; PEOPLE-TWINS and REVIEW-BAR shipped the first two steps (the twin fleet off by default, the decision in the opened bid, oldest waiting first); whether the per-card buttons go is Will's call | build | agent | — | [BID-BOARD-QUIET.md](journeys/plans/BID-BOARD-QUIET.md#what-is-left) |
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,7 @@
// Same seam: the Notes ledger (features/notes-ledger.js) re-syncs its
// header badge and, when open, its drawer rows.
App.onNotesLedgerSync && App.onNotesLedgerSync();
App.refreshReviewBar && App.refreshReviewBar(); // REVIEW-BAR (features/review-flow.js): hides once the project it was shown for is gone
notePerfSample('updateUIMs', performance.now() - t0);
}
// N3: rapid mark placement must never rebuild the sidebar per click — the
Expand Down
11 changes: 11 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@
<span>Drag Counters and Lines by their left colors to re-order.</span>
<button type="button" id="sidebarReorderFinish" class="sidebar-btn-inline sidebar-reorder-finish-btn">Finish reordering</button>
</div>
<!-- REVIEW-BAR (features/review-flow.js): under the header while a bid that is ready for
review is open by someone who can oversee it. The board's Ready lane feeds Next ready. -->
<div class="review-bar" id="reviewBar" style="display:none;">
<span class="review-bar-kicker">Reviewing</span>
<span class="review-bar-text" id="reviewBarText"></span>
<span class="review-bar-actions">
<button type="button" class="review-bar-changes" id="reviewBarChanges">Request changes…</button>
<button type="button" class="review-bar-reviewed" id="reviewBarReviewed">Mark reviewed</button>
<button type="button" class="review-bar-next" id="reviewBarNext">Next ready ▸</button>
</span>
</div>
<div class="main">
<div class="sidebar-backdrop" id="sidebarBackdrop"></div>
<div class="right-menu-backdrop" id="rightMenuBackdrop"></div>
Expand Down
72 changes: 69 additions & 3 deletions bid-board.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ test.describe('Bid Board - overseer all-bids browser', () => {

// The ready bid gets its own pinned lane; the rest fall under "All bids".
const laneTitles = await page.locator('.bid-board-lane-title').allTextContents();
expect(laneTitles).toEqual(['Ready for review (1)', 'All bids']);
expect(laneTitles).toEqual(['Ready for review (1) · oldest waiting first', 'All bids']);
await expect(page.locator('#bidBoardList .bid-card-badge-ready')).toHaveText('Ready for review');
await expect(page.locator('#bidBoardList .bid-card-badge-reviewed')).toHaveText('Reviewed ✓');

Expand Down Expand Up @@ -171,7 +171,7 @@ test.describe('Bid Board - overseer all-bids browser', () => {
await expect(page.locator('#bidBoardList .bid-card')).toHaveCount(3);
await expect(page.locator('#bidBoardList')).not.toContainText('ZZ Twin');
await expect(page.locator('.bid-board-hidden-note')).toHaveText('1 twin bid is off · show twins');
expect(await page.locator('.bid-board-lane-title').allTextContents()).toEqual(['Ready for review (1)', 'All bids']);
expect(await page.locator('.bid-board-lane-title').allTextContents()).toEqual(['Ready for review (1) · oldest waiting first', 'All bids']);

// "show twins" flips the segment: only the fleet, and only its owner in the estimator list.
await page.click('.bid-board-show-twins');
Expand All @@ -184,7 +184,9 @@ test.describe('Bid Board - overseer all-bids browser', () => {
// All: everyone, both ready bids in the lane, every owner in the list.
await page.locator('#bidBoardKind label', { hasText: 'All' }).click();
await expect(page.locator('#bidBoardList .bid-card')).toHaveCount(4);
expect(await page.locator('.bid-board-lane-title').allTextContents()).toEqual(['Ready for review (2)', 'All bids']);
expect(await page.locator('.bid-board-lane-title').allTextContents()).toEqual(['Ready for review (2) · oldest waiting first', 'All bids']);
// Oldest waiting first: p1 asked on the 27th, the twin on the 28th.
expect(await page.locator('#bidBoardList .bid-card-name').allTextContents()).toEqual(['Riverside Apartments', 'ZZ Twin Oak Hill (backtest)', 'Oak Hill Elementary', 'Lakeway Medical Office']);
expect(await page.locator('#bidBoardOwnerFilter option').allTextContents()).toEqual(['All estimators', 'jake', 'twin-estimator-1', 'wendi']);

// An admin opens on All, the view they always had.
Expand All @@ -206,6 +208,70 @@ test.describe('Bid Board - overseer all-bids browser', () => {
expect(errors).toEqual([]);
});

test('review bar: shows on an open ready bid, takes the decision, walks Next ready', async ({ page }) => {
const errors = await bootApp(page);
await stubOverseerSession(page, STUB_ROWS);
// A cloud load needs the real backend; stand in for it the way the real one ends: the
// project is open and the hook fires with the row.
await page.evaluate(() => {
window.__loaded = [];
window.App.loadCloudProjectRow = async (proj, ui) => {
window.__loaded.push(proj.id);
window.state.currentProjectId = proj.id;
if (ui && ui.hostModalId) window.App.hideModal(ui.hostModalId);
window.App.onCloudProjectRowLoaded(proj);
};
});
await page.evaluate(() => window.App.openBidBoard());
await expect(page.locator('#bidBoardModal')).toBeVisible();
await expect(page.locator('#reviewBar')).toBeHidden();
await page.locator('#bidBoardKind label', { hasText: 'All' }).click();

// Open the first ready card (the oldest waiting): the bar shows under the header.
await page.locator('#bidBoardList .bid-card').first().click();
await expect(page.locator('#reviewBar')).toBeVisible();
await expect(page.locator('#reviewBarText')).toHaveText(/^waiting \d+ days · wendi · 214 counts · 38 lines$/);
await expect(page.locator('#reviewBarReviewed')).toBeVisible();
await expect(page.locator('#reviewBarChanges')).toBeVisible();
await expect(page.locator('#reviewBarNext')).toBeVisible();

// Mark reviewed: the decision buttons go, the text says what happened and what is left.
await page.click('#reviewBarReviewed');
await expect(page.locator('#reviewBarText')).toHaveText('Reviewed ✓ · 1 more ready');
await expect(page.locator('#reviewBarReviewed')).toBeHidden();
await expect(page.locator('#reviewBarChanges')).toBeHidden();

// Next ready opens the next bid in the lane; nothing is left after it, so Next goes.
await page.click('#reviewBarNext');
await expect(page.locator('#reviewBarText')).toHaveText(/^waiting \d+ days · twin-estimator-1 · 90 counts · 10 lines$/);
expect(await page.evaluate(() => window.__loaded)).toEqual(['p1', 'p5']);
await expect(page.locator('#reviewBarNext')).toBeHidden();

// Request changes goes through the confirm dialog; a note is required; the text quotes it.
await page.click('#reviewBarChanges');
await expect(page.locator('#confirmInput')).toBeVisible();
await page.fill('#confirmInput', 'tighten the vent sizes');
await page.click('#confirmOk');
await expect(page.locator('#reviewBarText')).toHaveText('Sent back: “tighten the vent sizes” · none left ready');

// Reopening the board shows the lane as the decisions left it; closing the project hides the bar.
await page.evaluate(() => window.App.openBidBoard());
await expect(page.locator('#bidBoardModal')).toBeVisible();
await page.locator('#bidBoardKind label', { hasText: 'All' }).click();
await expect(page.locator('.bid-board-lane-title')).toHaveCount(0);
await expect(page.locator('#bidBoardList .bid-card-badge-warn', { hasText: 'Changes requested' })).toHaveCount(1);
await page.click('#bidBoardClose');
await page.evaluate(() => { window.state.currentProjectId = null; window.App.updateUI(); });
await expect(page.locator('#reviewBar')).toBeHidden();

// A bid that is not ready, or a user who cannot oversee, gets no bar.
await page.evaluate(() => { window.state.currentProjectId = 'p2'; window.App.showReviewBar(Object.assign({}, window.__p2 || { id: 'p2', review_status: 'reviewed' })); });
await expect(page.locator('#reviewBar')).toBeHidden();
await page.evaluate(() => { window.state.isOverseer = false; window.state.currentProjectId = 'p9'; window.App.showReviewBar({ id: 'p9', review_status: 'ready', owner_email: 'x@example.com' }); });
await expect(page.locator('#reviewBar')).toBeHidden();
expect(errors).toEqual([]);
});

test('auto-open: opens once for a pure overseer, never for admins', async ({ page }) => {
await bootApp(page);
await stubOverseerSession(page, STUB_ROWS);
Expand Down
9 changes: 6 additions & 3 deletions content/guides/reviewing-all-bids.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ sign in, CountTooling brings you back to the bid you last had open; the board is

- On the overseer's board, that bid jumps into a pinned **Ready for review** lane at the top,
wearing a gold badge, no searching, no asking who finished what.
- After looking it over, the overseer clicks **Mark reviewed** right on the card. The bid
drops out of the lane and keeps a quiet **Reviewed ✓** badge, so both sides can see it's
been seen.
- The lane runs oldest waiting first, so the bid that has waited longest is the first card.
- Open a ready bid and a **Reviewing** bar sits under the header: how long it has waited, who
made it, its counts, then **Request changes…**, **Mark reviewed** and **Next ready**, which
opens the next bid in the lane, so a morning of reviews is one loop. The same two decisions
are on the card for a bid you do not need to open. Either way the bid drops out of the lane
and keeps a quiet **Reviewed ✓** badge, so both sides can see it's been seen.
- If the estimator changes the bid afterward, they can **Mark ready again** from the same
Project Settings row (or **Withdraw** a request that went up too early).

Expand Down
15 changes: 13 additions & 2 deletions features/bid-board.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@
return rows;
}

// Oldest waiting first (Will, 2026-10-13): the Ready lane runs oldest request first, so the
// bid that has waited longest is the first card and the review bar's first Next ready. A
// row with no stamp sorts last.
function byOldestWaiting(a, b) {
const ta = a.review_requested_at ? new Date(a.review_requested_at).getTime() : Infinity;
const tb = b.review_requested_at ? new Date(b.review_requested_at).getTime() : Infinity;
return ta - tb;
}

function renderBidBoardList() {
const listEl = document.getElementById('bidBoardList');
if (!listEl) return;
Expand All @@ -159,10 +168,12 @@
}
// "Ready for review" bids get their own lane pinned above the rest — the
// estimator's handoff signal is the first thing an overseer sees.
const ready = rows.filter(function (p) { return p.review_status === 'ready'; });
const ready = rows.filter(function (p) { return p.review_status === 'ready'; }).sort(byOldestWaiting);
const rest = rows.filter(function (p) { return p.review_status !== 'ready'; });
// REVIEW-BAR: the lane as shown is the bar's Next ready queue (features/review-flow.js).
App.setReviewQueue && App.setReviewQueue(ready);
listEl.innerHTML = ready.length
? '<div class="bid-board-lane-title">Ready for review (' + ready.length + ')</div>' +
? '<div class="bid-board-lane-title">Ready for review (' + ready.length + ')<span class="bid-board-lane-hint"> · oldest waiting first</span></div>' +
ready.map(bidCardHtml).join('') +
(rest.length ? '<div class="bid-board-lane-title">All bids</div>' + rest.map(bidCardHtml).join('') : '')
: rows.map(bidCardHtml).join('');
Expand Down
3 changes: 3 additions & 0 deletions features/load-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@
// dedicated modal so the user has a clear next action.
openCanvasOnlyNeedsPdfModal({ reason: 'no_pdf_stored' });
}
// REVIEW-BAR (features/review-flow.js): the row carries review_status, so the bar
// can show for a ready bid opened by a reviewer, from the board or Load Project.
App.onCloudProjectRowLoaded && App.onCloudProjectRowLoaded(proj);
fitZoom();
updateUI();
}
Expand Down
Loading
Loading