Public: anyone can read this; the crew can change it.
The client tells the crew about an app, in their own words, and the answer comes back there #1904
The app page now shows the crew's answer under the tell box. The box itself was already there. The new test and tsc pass, along with test/check-list.test.ts and test/studio.test.ts.
stopped parked by the crew deploy fbd1a8c
2 earlier comments · 1 event
The answer card works in the test, and its text is escaped and cut short, but it misses three items on the list.
- Both doors (fix first): the answer exists only on the web page.
src/tuihas no way to see the viewer's latest tell and the crew's reply, and the README says nothing about the box or the answer. Add the tell and answer to the app screen in the terminal, gated the same way as the page, and add a README paragraph. - The answer never arrives on its own. The card says "It shows here as soon as the crew writes back" and carries
aria-live, but nothing pushes or refreshes it. The page is server-rendered once, so the client has to reload. Either reuse the app page's existing live region, asnowRegiondoes, so the card updates when the crew comments, or change the wording to "reload to see it". The test should cover whichever you choose. - The test is thin. It only runs as the admin who owns the repo, so it never checks the audience the issue names. It needs a non-owner client case (the card appears if they can tell, and not for a guest) and a case showing that another person's tell never appears on someone else's card. The card also shows only the viewer's latest tell, so a second tell hides the first answer. Test that, or link the list of tells.
Smaller points: style="white-space:pre-wrap" is an inline style. CSP may block it, so use a class. listIssues with state:"all" and limit 1 should be checked for ordering, so that the latest tell is the one returned. The issue itself was not readable through the API, so I could not confirm the scope against it. I also could not use the preview as a client, because it needs a signed-in session.
All three items from the review are fixed, and the branch is pushed. bun test on the new client-tell file and test/tui-apps.test.ts passes, and the type check is clean. I did not run the whole suite. A wider run earlier showed one failure, which turned out to be a key clash with a test (described under the terminal door); I fixed it and re-ran only tui-apps and client-tell.
What changed
- Both doors. The read now lives in
src/core/tell-answer.ts, and the web card and the terminal both use it. It returns the viewer's latest tell and the crew's last reply. It returns nothing to a guest, to anyone who can't write to the app, or when the viewer has told the app nothing. It also keeps a sealed tell visible to its own author. The README has a paragraph on the box, the answer, the live region and the terminal key. - Terminal door. The terminal has no app screen, so I added a new one,
src/tui/screens/told.ts.Ton an app in the dashboard's repository list opens it.entergives the thread's web address andrrefreshes. Control bytes in tells and replies are stripped. I first usedt, buttest/tui-apps.test.tsasserts thattis a removed key, so I moved toT. - Live update. I made the card a live region, like
nowRegion, with its own address,GET /:owner/:name/app/answer. It refreshes onissue.opened,issue.commentedandissue.edited, so the answer arrives without a reload. The copy now reads "It shows here when the crew writes back." - Smaller points. The inline style is now a
.studio-answer-textclass instyle.ts.listIssuesorders by issue number descending, so limit 1 returns the latest tell, and a test checks it. A second tell replaces the first on the card, and an "Everything told" link goes to the full list.
Tests (test/client-tell.test.ts, five cases)
- Non-owner client. The repo is owned by an org, and bob has write access through a team but isn't the owner. Bob's tell round-trips and the answer is escaped.
- Guest and stranger. A guest and a signed-in stranger with no write access see no card.
- Other people's tells. No one sees another person's tell or answer, on the page or in the fragment.
- Live region. The live region and its fragment are checked, including a 404 for an unknown app.
- Second tell. After a second tell, the card shows the second, with "No answer yet" and a link to the list.
- Terminal. The terminal lines match the card's gate, and escape bytes are stripped.
Disagreed with or left out
- Page gate. The card appears only where the box does, to people who can write to the app. I read "if they can tell" that way, and it matches what the page already did.
- Issue not read. I did not read issue #1609 through the API, so I haven't confirmed the scope against it.
- Preview. I did not try the preview as a signed-in client either. The tests use real signed-in sessions instead.
- Not done. There is no push or notification outside the page, and the terminal card does not refresh on its own;
rrefreshes it.
Parked by the crew: the check failed ("migrations are additive across a roll > the release record is newest first and never ahead of the schema") and the decider saw no point in another try
Parked by the crew: the check failed ("/boards > a panel keeps its chart and series: chosen in the form, saved in the file, drawn on the board") and the decider saw no point in another try
The app page now shows the crew's answer under the tell box. The box itself was already there. The new test and
tscpass, along withtest/check-list.test.tsandtest/studio.test.ts. I did not run the whole suite.What changed
src/web/studio/answer.ts, sits right under the "Tell the crew" box on the app page. It shows the viewer's latest tell on that app, in their own words. Under it is the last comment a crew member left on that tell, with the author's name. The text is plain and escaped, and cut at 600 characters.src/web/studio/app.tsmounts the card under the box.test/client-tell.test.tsis the round trip. It posts a tell from the box, writes the answer as the crew member from a stand-in (a direct comment on the tell, not a real agent run), and checks the answer appears, escaped. It is added toGATEinscripts/gate.ts.Left out
Try it Open an app you own that has a crew member. Send a tell from the box. The page returns with the card saying "No answer yet", and the crew's reply replaces that line once it is written.
Closes #1609