Public: anyone can read this; the crew can change it.
Ship and close from the inbox and the feed land back on the same page with a one-line flash #1766
Check · Review · Land · Live done — Landed and live in production.
Ship and close now return to the page they were taken from, with a flash like "Shipped #N · see it live" carrying one link. `test/studio.test.ts` and the asks tests pass. The type check couldn't run here: `tsc` fails with "Cannot find type definition file for 'bun'", even after `bun install`.
shipped production is serving it deploy eb43263
Ship and close from the home inbox now return to the page they were taken from, with a one-line flash. A successful ship says "Shipped #N · see it live" and carries one link. The type check and test/studio.test.ts (178 tests) pass locally; the check on the last push failed with a type error, which this push fixes.
What changed
backfield:POST …/pulls/:number/shipand…/stateread abackfield. It is used only if it is a same-origin path. Anything else, such ashttps://evil.example/, falls back to the pull page. The validator isisLocalPathinsrc/web/flash.ts, used throughbackToinsrc/web/form.ts.- Pull page: its forms send no
back, so they land on that pull's page (/changes/Nin studio mode). - Ship fallback moved: a bare ship used to redirect to the repo page. It now redirects to the pull page, which is what "stay on the pull page" asks for.
- Flash link:
Flashgets an optionallinkthat points at<repo>/app/production/open. It is checked as a local path again when the flash is read, and the toast shows it. - Inbox forms: the inbox's Ship and Close forms (
decisionForminsrc/web/studio/asks.ts) now send the current page's path asback. - Type fix: under
exactOptionalPropertyTypes,linkOfinsrc/web/flash.tsreturned a type that allowedundefinedforlink. It now returnsNonNullable<Flash["link"]>. - Tests: three, in
test/studio.test.ts. Ship from the home returns to/with the flash and link. Abackofhttps://evil.example/lands on the pull page. Close from the home returns to/and closes the pull.
Left out
- Feed: I found no ship or close form there, so it sends no
backyet. The routes honorbackas soon as it does. - Issue close:
stateSubmitis shared with issues, so an issue's close and reopen also honorback. Nothing sends it yet. - Not touched: the say, review-state and asks' decide routes, and in-place fragment re-render, as the issue says.
Try it: open the home with a green change waiting and press Ship. You land on / with the toast and the "see it live" link.
🤖 Generated with Claude Code
Ship and close from the home inbox now land back on the page they came from. The flash is one line with one "see it live" link. back is accepted only as a local path, checked again when the flash cookie is read, and the tests cover the foreign-URL fallback. I could not open the preview (the sandbox blocked the host) and did not look at the screenshots, so this is a read of the source and diff only. Next: (1) the title names the feed, but no feed form sends back yet; add it where the feed offers ship or close, or open an issue. (2) back is ctx.url.pathname, so it drops any query string such as a filter the owner set. Carry the query too, still validated by isLocalPath.
The full gate on land was red and named no test; the pull is open again.
The full gate on land was red and named no test; the pull is open again.
Ship and close now return to the page they were taken from, with a flash like "Shipped #N · see it live" carrying one link.
test/studio.test.tsand the asks tests pass. The type check couldn't run here:tscfails with "Cannot find type definition file for 'bun'", even afterbun install.What changed
backfield:POST …/pulls/:number/shipandPOST …/pulls/:number/stateread abackfield. It is accepted only if it is a same-origin path: one leading/, no//, no backslash, no control bytes, at most 512 characters. Anything else, such ashttps://evil.example/, falls back to the pull page. The check isisLocalPathinsrc/web/flash.ts, used throughbackToinsrc/web/form.ts.back, so they redirect to that pull's page,/changes/Nin studio mode. A bare ship used to redirect to the repo page, so that fallback moved to the pull page. The "stay on the pull page" line in the issue is why.<repo>/app/production/open. This needed a small addition:Flashgets an optionallink, which is re-validated as a local path when the flash is read and rendered in the toast.backas the current page's path. This isdecisionForm(d, back)inasks.ts, called fromasks_page.ts.back:stateSubmitis shared with issues, so an issue's close and reopen honorbacktoo. Nothing sends it yet.test/studio.test.ts. Ship from the home withback=/returns to/with the flash and link. Abackofhttps://evil.example/lands on the pull page. Close from the home returns to/and closes the pull.Left out
backthere. The routes acceptbackfrom the feed as soon as it sends one.Try it: open the home with a green change waiting, press Ship, and you land on
/with the toast and the "see it live" link.🤖 Generated with Claude Code
Closes #1567