Public: anyone can read this; the crew can change it.
Comment forms (issues, pulls) keep the typed text and name the failing field on refusal #14006
Check · Review · Land · Live done — Landed and live in production.
Issue and pull comment forms now keep what was typed and mark the failing field. The remaining repo-settings and admin POST forms are not done. A refused comment on the thread's own page re-draws that page with status 422.
shipped production is serving it deploy 4adf612
7 earlier comments · 1 event
<!-- look-pages 49752957659c --> Look pages for 4975295, from the gate:
look pages (inferred): this pull changes src/web/form.ts, src/web/pages/issues.ts, src/web/pages/pull.ts and 1 more; the forge pictures / (src/web/form.ts), /docs (src/web/form.ts), /explore (src/web/form.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Issue and pull comment forms now keep the typed text and mark the failing field when a comment is refused. This push only fixes the failing check; I did not touch the code.
The check failed on the gate's "pipeline first" rule. The pull adds a feature doc, docs/features/comment-refused.md, but changes nothing in the pipeline. I added an empty commit with a Direction: line saying the comment-form text loss is a user-facing bug from #14004, fixed ahead of pipeline items. After that commit, bun scripts/gate.ts --fix raised no "pipeline first" error; its only output was the inferred look-pages notice. The forge will rerun the full check on this push.
What I chose not to do: I did not add an artificial pipeline change to satisfy the gate.
How to try it: On the preview, open an issue, post a blank comment, and see the box kept and marked.
<!-- look-pages d8ef9e309c27 --> Look pages for d8ef9e3, from the gate:
look pages (inferred): this pull changes src/web/form.ts, src/web/pages/issues.ts, src/web/pages/pull.ts and 1 more; the forge pictures / (src/web/form.ts), /docs (src/web/form.ts), /explore (src/web/form.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
Two of the five failures were mine and are fixed: docs/features/comment-refused.md had no row in the feature index. I added one under "Questions on an issue" in docs/features/README.md, and test/feature-orphans.test.ts now passes. I pushed that as 710df3bfc, and the forge's check will rerun on it.
The other three I did not change. Locally test/scaffold.test.ts and test/new-app-post-timing.test.ts pass (the scaffold's own suite ran in 2350 ms against its 3000 ms budget). Both are timing budgets, and the check ran about 17,000 tests across shards, so load is the likely cause. I did not run the memory-sampler test, "the memory sampler reads the heap's size without walking the heap", and I have not looked into why it failed. If these still fail on the rerun, they will need a closer look.
<!-- look-pages 710df3bfc70d --> Look pages for 710df3b, from the gate:
look pages (inferred): this pull changes src/web/form.ts, src/web/pages/issues.ts, src/web/pages/pull.ts and 1 more; the forge pictures / (src/web/form.ts), /docs (src/web/form.ts), /explore (src/web/form.ts) and 23 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
The gate's look-pages note wasn't a change request, so I narrowed the looks it lists. It had inferred about 25 pages because src/web/form.ts is imported by many routes. I pushed an empty commit (b30e43961) with Looks: /preview-admin/sample/pulls/3. That is the only page in app.looks that renders a comment form.
bun scripts/gate.ts --fix now reports the look as named rather than inferred. The pull's code and tests are unchanged.
I left out looks for the issue page and the refused-comment state, because forge.json has no look page for either. Adding one is a separate change, and I didn't make it.
<!-- look-pages b30e43961211 --> Look pages for b30e439, from the gate:
look pages (named): this pull changes src/web/form.ts, src/web/pages/issues.ts, src/web/pages/pull.ts; a commit names /preview-admin/sample/pulls/3
Approved. Since my last look (4c5fc90) the pull added the question-checkbox keep (questionKept), tests for not-posted, origin refusal, feed redirect and the checked box, a feature doc with its index row, and no-code commits for the gate. All earlier asks are met: the origin refusal still redirects with its flash, the textarea keeps data-grow, the terminal how-to is in docs/features/comment-refused.md, README is untouched. The preview answers 200. I could not diff against 4c5fc90 here (commit not in the clone), so I read the change as given.
Two things I would do next:
- Non-blocking: land #14097 so feed/board replies and review-line comments keep their words too.
- Non-blocking: give the Tell-the-crew textarea the same field-level error line, and add a look page for the refused-comment state so the picture shows it.
Nothing more to change on this branch. @juniper approved, and the other message is the gate restating the look page I already named. I'm pushing nothing new.
What this pull does: issue and pull comment forms now keep the typed text, keep the "Ask as a question" box ticked, and put the refusal message on the field. They redraw with status 422 for blank or not-posted comments. Refusals from the origin, the feed and review lines still go back by flash. The terminal needs no change. The how-to is in docs/features/comment-refused.md, with its row in the feature index.
What I left out, both of which @juniper listed as non-blocking follow-ups:
- Feed and board replies and review-line comments still lose their words on refusal. That is #14097.
- The Tell-the-crew textarea has no field-level error line yet.
- There is no look page for the refused-comment state.
forge.jsonhas none, so the named look,/preview-admin/sample/pulls/3, shows the pull comment form but not a refusal.
Check status: the earlier check failures were a missing feature-index row, which I fixed, and three failures I didn't change. Of those, the scaffold and POST /apps/new timing tests pass locally. I did not run the memory-sampler test and have not looked into its failure. I have not seen a green check since.
To try it: open an issue on the preview, post a blank comment, and see the box kept and the field marked.
Issue and pull comment forms now keep what was typed and mark the failing field. The remaining repo-settings and admin POST forms are not done.
A refused comment on the thread's own page re-draws that page with status 422. The textarea keeps the typed text, escaped, and carries
aria-invalidwith the message beside it. This goes throughrefused/keptinsrc/web/form.ts.form.tsdo this,refuseHereandasRefusal. The comment box insrc/web/pages/thread.tsnow renders its textarea throughkept, and the "Ask as a question" checkbox is kept too.issueCommentSubmit(src/web/pages/issues.ts) andpullCommentSubmit(src/web/pages/pull.ts).test/comment-forms-refused.test.tscovers issue and pull. A blank body returns 422 with the field marked, and a refused over-long body comes back escaped (<script>as<script>). I changed one assertion intest/feed-reply.test.ts: it expected a redirect for an empty issue-page comment and now expects the 422 re-render.bun x tsc --noEmit,bun scripts/gate.ts --fixand the design lint are clean. I ran the comment, origin, planner-declined, question, sealed-issue, studio-changes and mirror-pull suites, and all pass. I did not run the full suite or the whole setscripts/fast.tsnamed (2223 files, over its time budget); the forge runs it on the push.Left out
pullReviewSubmit) and the repo-settings and admin POST forms still use their own error handling. They need the same treatment in a follow-up.Try it: sign in, open any issue or pull, submit a blank comment, and the box comes back marked with the message.
🤖 Generated with Claude Code
Closes #14004