Public: anyone can read this; the crew can change it.
Tell the crew from a toolbar carries the page it was sent from, proven in a test and visible on the issue #16000
Check · Review · Land · Live done — Landed and live in production.
Most of this was already on main. A tell from the toolbar already carried the page, app and pull and showed them on the issue. The 300-character trim and the API read-back test were missing.
shipped production is serving it deploy 3fede26
Most of this was already on main. A tell from the toolbar already carried the page, app and pull and showed them on the issue. The 300-character trim and the API read-back test were missing. This pull adds both.
What changed
- A tell's context lines are cut to 300 characters at the boundary. The shared helper
trimContextinsrc/actions/tell_context.tsdoes it, and it never cuts inside a%XXescape. - It covers the
- page:line and theFrom: <app> <path>line, including the preview formFrom: <app> /x (preview of #N). - A longer context is trimmed, not refused, so the tell still goes.
- The trim runs before the path is checked, so a long path still gives the preview line instead of falling back to the plain one.
- Two new tests in
test/apps-toolbar-tell.test.ts:- A tell posted from a preview's toolbar is read back through
GET /api/v1/repos/alice/notes/issues/Nand carries exactly one line,From: notes /deep/page (preview of #3). - A 900-character path on a preview and a long path on production both leave every context line at 300 characters or fewer.
- A tell posted from a preview's toolbar is read back through
- The same-origin check on the mutation is untouched. The context is still written as plain, escaped data.
What I left out
- No terminal screen change. The terminal's tell goes through the same
contextNote, so it gets the trim for free. ANo door:commit line says so. - No new page markup, so the commit says
No look:.
What I ran
- The tell and toolbar tests: 62 pass.
bun x tsc --noEmitis clean.bun scripts/gate.tsexits 0.
I ran the gate after the first push, and it flagged the missing No door: line. A second commit added it, and that one is pushed too.
Try it
On a preview, open the forge toolbar and use Tell the crew from a page with a very long path. Then read the issue's From: line, which stays within 300 characters.
Clean and small. The 300-character trim is one shared helper (trimContext) that never cuts inside a %XX escape. It covers the page line, the From line and the preview form, and it trims before the path check so a long path still gets the preview line. The same-origin check is untouched, the output stays escaped, and the terminal tell goes through the same contextNote. Both new tests would fail without the change. Nit, not blocking: trimContext sits between the SAID_MAX and RUN constants in tell_context.ts, so it would read better after the constants block. I did not exercise the preview.
Most of this was already on main. A tell from the toolbar already carried the page, app and pull and showed them on the issue. The 300-character trim and the API read-back test were missing. This pull adds both.
What changed
trimContextinsrc/actions/tell_context.tsdoes it, and it never cuts inside a%XXescape.- page:line and theFrom: <app> <path>line, including the preview formFrom: <app> /x (preview of #N).test/apps-toolbar-tell.test.ts:GET /api/v1/repos/alice/notes/issues/Nand carries exactly one line,From: notes /deep/page (preview of #3).What I left out
contextNote, so it gets the trim for free. ANo door:commit line says so.No look:.What I ran
bun x tsc --noEmitis clean.bun scripts/gate.tsexits 0.I ran the gate after the first push, and it flagged the missing
No door:line. A second commit added it, and that one is pushed too.Try it On a preview, open the forge toolbar and use Tell the crew from a page with a very long path. Then read the issue's
From:line, which stays within 300 characters.Closes #15975