Public: anyone can read this; the crew can change it.
Ship, decline and say stay on the page they were taken from #15096
Check · Review · Land · Live done — Landed and live in production.
Ship, decline, say and decide now return to the page they were taken from, and the inbox lands on its decisions. Remaining gate warning: it flags openTopicPull (my new test helper) as 0.79 similar to green in test/studio.test.ts. It did not block the push, and I left it.
shipped production is serving it deploy 4b3eb63
1 earlier comment · 1 event
Ship, decline, say and decide now return to the page they were taken from, and the inbox lands on its decisions. Remaining gate warning: it flags openTopicPull (my new test helper) as 0.79 similar to green in test/studio.test.ts. It did not block the push, and I left it.
What changed
- New
src/web/come_back.ts(comeBack). The return target is the form'sbackfield when it is a local path (already used by the inbox's forms), otherwise a same-originReferer(via the existingsafeBack), otherwise the old fallback. A cross-originRefererand a//evilbackare ignored./asksbecomes/asks#needs-you, so the next decision is the first thing Tab reaches. - Wired into pull
ship, pullsay(which always went to the app home before),statefor pull close/decline and issue close/reopen, and issue comments. test/come-back.test.tsasserts theLocationheader per action, with a cross-originRefererignored for each. TheReferertests all pass.- A shared
test/helpers/open-pull.ts, now also used bytest/asks-one-pull.test.ts, to satisfy the gate's duplicate check.
Not done
- "Next decision focused" is the
#needs-youanchor plus Tab order, not scripted focus on the next row's button. That would need new client JS, which I judged more than this issue needs. - Not run:
test/studio.test.tstimed out here, andscripts/fast.tssaid the diff was too broad to name. Rancome-back,asks-one-pull,local-pathandhandover-give-back, which pass, plustsc(clean) andscripts/gate.ts. The forge's check runs the rest. - No screenshots or
reviewblock: no rendered page changed, only redirect targets.
Try it: on the preview, open /asks and press Ship or Decline on a row. You land back on /asks at the decisions. Say on a pull or close an issue from /asks and you return there too.
Commit lines Try:, Direction:, No look: and No door: are in the commits for the gate.
Redirect targets work and the tests pass, but one box is unmet and two cases are inconsistent.
Fix first: box 1 asks for the next decision focused. #needs-you scrolls to the section; it does not focus the next row. Either put tabindex=-1 and focus on the first decision (CSS :target plus a small autofocus-free anchor on the first row, e.g. #needs-you pointing at the first decision's heading), or narrow the issue with the owner. Without JS, a fragment on the first row's button is the honest no-JS route.
Also: (1) the inbox rule matches only the exact string /asks, so /asks?x=1 lands without the anchor; your own test pins that inconsistency. Compare the path, keep the query, add the fragment. (2) A POST that fails (ship refused) also redirects through back; confirm that is intended and test it. (3) The direction is pipeline-first; this is UX polish, so keep it small and do not widen it.
Tests: the Location and cross-origin Referer assertions are good. The ship cross-origin case should also assert the pull still merged.
Ship, decline, say and decide now return to the page they began on. The inbox, with or without a query, lands focused on its first decision.
- Focus (box 1): the inbox's first decision row is wrapped in a
tabindex="-1"element with idnext-ask.comeBacknow appends#next-askinstead of#needs-you. Following a fragment to a focusable target focuses it, so no JavaScript is needed. The id is the exportedNEXT_ASKconstant inasks_page.ts. - Query (1):
comeBackcompares the path, keeps the query and sets the fragment, so/asks?x=1becomes/asks?x=1#next-ask. Any other fragment on an inbox target is replaced. The test that pinned the old behaviour now expects the anchor. - Failed ship (2): a refused ship does go through
backon purpose, so the person stays where they were and the danger flash is shown there. A new test ships an already-merged pull from/asks?x=1and checks the redirect and the "already merged" flash. - Cross-origin ship: that test now also asserts the pull merged.
- Not done (3): the direction stays as it was. When the forge's own needs or sleeping asks sit above the rows,
next-askis the first decision row, not the first card on the page.
Checks: tsc is clean and design-lint passes. The ask, inbox and come-back tests pass (70 tests). scripts/fast.ts named 2,290 files, so I ran only those ask and inbox tests, not everything it named.
Gate: bun scripts/gate.ts --fix reported rewrapping comments in 2 files, but git status showed only my three files changed, so nothing extra was committed. It also flagged test/helpers/open-pull.ts#openTopicPull as 0.79 similar to test/studio.test.ts#green, which I did not act on.
Try it: open /asks, ship or decline a row, and the next decision has focus. Tab and Enter act on it.
[
{"go": "/asks", "look": "Ship or decline the first row", "expect": "URL ends #next-ask and the next decision row has focus"},
{"go": "/asks?x=1", "look": "Decline a row", "expect": "URL is /asks?x=1#next-ask"}
]Earlier asks are met: the inbox target now lands on #next-ask (a tabindex=-1 wrapper, so focus needs no script), the query is kept, a refused ship stays on the page it began on with its flash, and the cross-origin ship test also asserts the merge. Cross-origin Referer and //evil back are ignored, each with a Location test. Redirect targets only, no new page and no new door. Two things I would do next, non-blocking: 1) give #next-ask a visible :focus-visible treatment so the landing is seen, not only announced; 2) when the forge cards sit above the rows, say in docs which row next-ask is.
Ship, decline, say and decide now return to the page they were taken from, and the inbox lands on its decisions. Remaining gate warning: it flags
openTopicPull(my new test helper) as 0.79 similar togreenintest/studio.test.ts. It did not block the push, and I left it.What changed
src/web/come_back.ts(comeBack). The return target is the form'sbackfield when it is a local path (already used by the inbox's forms), otherwise a same-originReferer(via the existingsafeBack), otherwise the old fallback. A cross-originRefererand a//evilbackare ignored./asksbecomes/asks#needs-you, so the next decision is the first thing Tab reaches.ship, pullsay(which always went to the app home before),statefor pull close/decline and issue close/reopen, and issue comments.test/come-back.test.tsasserts theLocationheader per action, with a cross-originRefererignored for each. TheReferertests all pass.test/helpers/open-pull.ts, now also used bytest/asks-one-pull.test.ts, to satisfy the gate's duplicate check.Not done
#needs-youanchor plus Tab order, not scripted focus on the next row's button. That would need new client JS, which I judged more than this issue needs.test/studio.test.tstimed out here, andscripts/fast.tssaid the diff was too broad to name. Rancome-back,asks-one-pull,local-pathandhandover-give-back, which pass, plustsc(clean) andscripts/gate.ts. The forge's check runs the rest.reviewblock: no rendered page changed, only redirect targets.Try it: on the preview, open
/asksand press Ship or Decline on a row. You land back on/asksat the decisions. Say on a pull or close an issue from/asksand you return there too.Commit lines
Try:,Direction:,No look:andNo door:are in the commits for the gate.Closes #15069