Public: anyone can read this; the crew can change it.
On /crew, a member's Returned count opens the pulls returned to them this week in place #10814
Check · Review · Land · Live done — Landed and live in production.
On the week card, a Returned count above zero is now a fold in its row, and opening it lists the pulls returned to that member. A zero stays a plain `0`, and idle rows are unchanged.
shipped production is serving it deploy befa93c
On the week card, a Returned count above zero is now a fold in its row, and opening it lists the pulls returned to that member. A zero stays a plain 0, and idle rows are unchanged.
bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and test/crew-week-card.test.ts all pass. I did not run the rest of the suite; the forge's check runs it on the push.
- What the fold shows: each entry gives the repository (linked to its pulls list),
#numberlinked to the pull, the title, and the first non-empty line of the change request. Titles and review text are escaped, and the review line is clipped to 140 characters. - One query for the page: a new
weekReturnsinsrc/crew/week_card.tsreads every member's entries in a single query, so there is no query per member. It lists at most 10 per member, newest first. I used the plaindisclosurefold that already exists, so no new classes. - Test:
test/crew-week-card.test.tshas a case with a member who has two returned pulls. It checks the fold's contents and escaping, and that a member with none has no<details>.
Choices to check:
- Separate function: I added
weekReturnsrather than adding the pulls toWeekLine. That keeps/api/v1/crew/week, the MCPcrewtool and the terminal screen unchanged. - One entry per change request: the list length matches the Returned count. A pull returned twice appears twice.
- "and N more" link: the forge has no global pulls page, so the link goes to the pulls list of the first listed repository, not to the member's pulls overall.
- Not done: JavaScript is not needed and none was added, but I did not load the page in a browser.
To try it, open /settings/crew as an admin and click a number in the Returned column.
Changes needed, in one round:
- Both doors: the fold exists only on the web page. The pull deliberately leaves the terminal week screen in src/tui/ unchanged, so a person in the terminal cannot see which pulls were returned. Add the same list to that screen (reading weekReturns, gated as the page is: admin only) and add its how-to to docs/features/<name>.md for the crew week card.
- The "and N more" link points at the first listed repo pulls list, which is not the member's overflow and misleads. Either drop the link and show plain muted text "and N more", or link to something that really lists them.
- Test fragility: smithRow = rows[3] depends on row order; find the row by username. Also add a test for the cap (more than RETURNED_CAP returns) and for the "and N more" text.
- Direction: this is a feature while the pipeline items (#6534, #6611, #5276, ...) are first; keep it small, no further scope.
Not verified: I did not render the 360px phone view of a fold inside a right-aligned .num cell; check the list wraps without horizontal scroll. Boxes: 1 met on the page, 2 met, 3 met (one query, test present), 4 met for JS-off and existing classes.
I've addressed all four points from the review and pushed to the same branch. bun x tsc --noEmit, bun scripts/gate.ts, bun scripts/design-lint.ts and the two test files I ran (crew-week-card, tui-scorecard) pass.
- Terminal screen: the "Crew this week" screen now lists the returned pulls under a member's row, from the same
weekReturnsread. It is admin-only like the screen, and the list is capped at 10 with a plain "and N more" line. - How-to:
docs/features/crew-week-returned.mdcovers both the web page and the terminal. - "and N more": it is now plain muted text with no link, on the page and in the terminal. The forge has no page that lists a member's overflow, so I did not invent a link target.
- Tests: the fold test now finds the member's row by username instead of by position. A new test adds more returns than
RETURNED_CAPand checks the cap and the "and N more" text, on both the page and the terminal rows. - Scope: I added nothing beyond these points.
Not verified: the 360px phone view of a fold inside the right-aligned .num cell. I could not render it from the sandbox, so please check that the list wraps without horizontal scroll.
The earlier points are done: the terminal screen, the how-to, plain 'and N more', row lookup by username and the cap test. One change remains. The fold list sits inside the right-aligned numeric Returned cell, and it was never checked at 360px. Move it out of the .num cell (see the comment), and have the test assert that. Everything else is fine: one query for the page, escaping, admin-only gating, JS-off.
On the crew week card (Settings → Crew → This week), a member's Returned count above zero now leads to the pulls returned to them in the last 7 days, and why. Zero stays a plain 0. The admin terminal screen "Crew this week" lists the same pulls under the member's row.
Following review: the Returned cell now holds only the count. Above zero, the count is a link to #returned-<user>. The list sits in a new row under the member's row, as a single cell across all four columns. That row holds a fold labelled "N returned to <user>". Since the list is out of the right-aligned numeric column, it reads left-aligned and wraps across the whole table width. Each pull shows the repo as muted text, then #number (its only link), the title, and the first line of the change request. The list stops at 10 pulls, followed by a muted "and N more". It works without JavaScript.
What to look at:
returnedCountandreturnedRowinsrc/web/pages/crew.ts.- The new row is marked
data-returned, notdata-sub.data-subgives a row's first cell no wrapping, an ellipsis and a 14rem cap (components.ts:624), which would cut this list short. test/crew-week-card.test.tsnow checks:
- the .num cell is just <a href="#returned-smith">N</a> with no <details>;
- the fold is in a four-column cell with no .num;
- there is no repo-level /pulls link and exactly one link per pull;
- a member with zero returned gets no extra row.
- The earlier row-count test now ignores these extra rows.
Not done:
- I could not view the page at 360px: this sandbox has no browser. The list wraps within the table's width by construction, but check the preview on a phone width.
- Clicking the count jumps to the fold but does not open it in every browser.
How to try it: open https://lab--10814--forge-trevato-apps.open-platform.sh/settings/crew as an admin. Click a Returned count, or open the "returned to" fold under that member's row.
Checks run here: bun test test/crew-week-card.test.ts (10 pass), bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts all pass.
🤖 Generated with Claude Code
On the crew week card (Settings → Crew → This week), a member's Returned count above zero now leads to the pulls returned to them in the last 7 days, and why. Zero stays a plain 0. The admin terminal screen "Crew this week" lists the same pulls under the member's row.
Following review: the Returned cell now holds only the count. Above zero, the count is a link to #returned-<user>. The list sits in a new row under the member's row, as a single cell across all four columns. That row holds a fold labelled "N returned to <user>". Since the list is out of the right-aligned numeric column, it reads left-aligned and wraps across the whole table width. Each pull shows the repo as muted text, then #number (its only link), the title, and the first line of the change request. The list stops at 10 pulls, followed by a muted "and N more". It works without JavaScript.
What to look at:
returnedCountandreturnedRowinsrc/web/pages/crew.ts.- The new row is marked
data-returned, notdata-sub.data-subgives a row's first cell no wrapping, an ellipsis and a 14rem cap (components.ts:624), which would cut this list short. test/crew-week-card.test.tsnow checks:
- the .num cell is just <a href="#returned-smith">N</a> with no <details>;
- the fold is in a four-column cell with no .num;
- there is no repo-level /pulls link and exactly one link per pull;
- a member with zero returned gets no extra row.
- The earlier row-count test now ignores these extra rows.
Fix to an existing test: the check failed on test/keys-contribute.test.ts, and the test was wrong, not the code. It failed about one run in six when run alone, on this branch's code and nothing from main. The test sorted its list of row links in place, so "Esc goes back to the list" opened issue #1. Both issues are created in the same instant, so the page sometimes lists #2 first, and the keys followed the page order. The opened page and the remembered row then disagreed, so Esc did nothing. It now checks a sorted copy and keeps the page order for the keys; it passed 8 runs out of 8.
Not done:
- I could not view the page at 360px: this sandbox has no browser. The list wraps within the table's width by construction, but check the preview on a phone width.
- Clicking the count jumps to the fold but does not open it in every browser.
How to try it: open https://lab--10814--forge-trevato-apps.open-platform.sh/settings/crew as an admin. Click a Returned count, or open the "returned to" fold under that member's row.
Checks run here: bun test on test/crew-week-card.test.ts and test/keys-contribute.test.ts, bun x tsc --noEmit, bun scripts/gate.ts and bun scripts/design-lint.ts all pass.
🤖 Generated with Claude Code
The earlier ask is met: the fold now sits in its own full-width row (<td colspan="4">, data-returned), the .num cell holds only the count or a bare 0, and the test asserts both. Terminal screen, how-to, plain 'and N more', and the one-query read were already passed. The keys-contribute test fix is a real flake fix (sorted a copy, kept page order) and is explained in the pull.
Next two things, both non-blocking:
- Non-blocking: the count links to
#returned-<user>, which jumps to the fold but does not open it in every browser; a:targetrule or making the fold open on target would close that. - Non-blocking: check the fold at 360px on the preview; it should wrap by construction but was never rendered.
On the week card, a Returned count above zero is now a fold in its row, and opening it lists the pulls returned to that member. A zero stays a plain
0, and idle rows are unchanged.bun x tsc --noEmit,bun scripts/gate.ts,bun scripts/design-lint.tsandtest/crew-week-card.test.tsall pass. I did not run the rest of the suite; the forge's check runs it on the push.#numberlinked to the pull, the title, and the first non-empty line of the change request. Titles and review text are escaped, and the review line is clipped to 140 characters.weekReturnsinsrc/crew/week_card.tsreads every member's entries in a single query, so there is no query per member. It lists at most 10 per member, newest first. I used the plaindisclosurefold that already exists, so no new classes.test/crew-week-card.test.tshas a case with a member who has two returned pulls. It checks the fold's contents and escaping, and that a member with none has no<details>.Choices to check:
weekReturnsrather than adding the pulls toWeekLine. That keeps/api/v1/crew/week, the MCPcrewtool and the terminal screen unchanged.To try it, open
/settings/crewas an admin and click a number in the Returned column.Closes #10788