Public: anyone can read this; the crew can change it.

Tell from any forge page: the palette's "Tell the crew" opens a composer in place, and the tell carries the page it was told from #1228

Closed opened this
Closed without merging

From any page of an app, the palette's "Tell the crew" now opens a composer in place, and the tell it sends records the page it came from. I couldn't run the server-backed tests here.

Notes

stopped closed without shipping

opened this

From any page of an app, the palette's "Tell the crew" now opens a composer in place, and the tell it sends records the page it came from. I couldn't run the server-backed tests here. The sandbox refuses to listen on the unix socket they need (EPERM), so test/studio.test.ts, test/mcp.test.ts and test/studio-words.test.ts are unrun. There is also no node_modules, so I didn't run tsc. What ran: the new toldFrom unit test, which passes. Every client script string parses, and studio/app.ts, http/mcp.ts and scope.ts load. The forge's check is the first real run of the rest, and I didn't look at the diff-page "Look" on a phone and a desk either.

What changed

  • Composer: the palette row opens a textarea and Send inside the palette dialog, so nothing on the page shifts. It posts to the existing POST /:owner/:name/tell, same-origin checked.
  • Receipt: after Send, one line under the textarea links to the tell, e.g. #12. It is reserved up front, so sending moves nothing.
  • Without JavaScript: the row is a link to the app page's tell form, ?from=<path>#tell. The form carries a hidden from and shows "Told from: …".
  • from on the tell: toldFrom() in src/actions/tell.ts keeps only a path that starts with /. Anything else is dropped without repair: a scheme, //host, a backslash, whitespace, control characters, or more than 300 characters. tell() then appends Told from: <path> to the body.
  • MCP: the tell tool takes the same optional from.
  • Where the entry appears: src/web/tell-row.ts builds the row. It appears only on pages of an app, and only for someone who may direct the crew (mayDirectCrew, the check the tell action already uses). Readers and visitors don't get it.
  • Pages covered: the row now also shows on file, diff and run pages, which didn't have it before. It is added in scope.ts as well as chrome.ts.
  • Tests: new test/told-from.test.ts, plus cases in studio.test.ts (the tell carries from, a foreign from is dropped, a cross-origin post gets 403, the composer row renders, a reader gets no entry) and mcp.test.ts. I updated the old #tell expectation in studio-words.test.ts because the row's href now carries ?from=.

Left out

  • Plain repositories that aren't apps get no entry, since only apps have a crew and a tell form.
  • The pull-time redirect still lands on the app page rather than back on the originating page.
  • I deleted no other tell entry point, because none became redundant: the app-page form is the no-JavaScript path.

Try it Open any app's file or diff page, press Cmd/Ctrl+K, choose "Tell the crew", type, and press Send or Cmd/Ctrl+Enter. The resulting issue ends with Told from: /….

Closes #1059

commented

I fixed the type error that failed the check and pushed it. I couldn't run test/studio.test.ts here, so its tests are unverified.

  • Fix: in test/studio.test.ts line 407, the palette-row lookup now reads i.t?.endsWith(...). The row type is a string-to-string record, so i.t can be undefined under the strict index check. The ! after .find(...) still stops the test if the row is missing, so the test is no weaker.
  • Type check: tsc --noEmit is clean after the change.
  • Tests: every studio test hits the same EPERM when the test server tries to listen on its unix socket, because my sandbox blocks that. The forge's own check will be the first real run of that file. The app code is unchanged from the last push.

Earlier work on this pull is unchanged: the palette's "Tell the crew" opens a composer in place, and the tell carries the page it was sent from.

commented

Parked by the crew: the check failed ("the studio > ship lands a change; say tells the crew") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs