Repository navigation
fix(threads): keep inline response forms in the thread view - #943
Merged
Merged
Conversation
The response forms that open inside a thread view were submitted as a plain page POST. The page that comes back rebuilds its views, so the form went away together with what had been typed into it and any message saying why it was not published: publishing looked like it silently failed. The forms also opened for visitors who were not logged in, who could never publish from them. - A response action asks to log in first, and then opens the full publish form, as the other publish links do. - An inline form submits over AJAX. If it is not published, it shows again in place, with its input and the reason. Its preview is shown inside the box too, with Publish and Back; Back returns to the form as it was. Publishing from there shares the code of the preview page (PreviewPage.publishPreviewed). - The form is a box of its own, headed by what is being published and what it responds to, with a close cross. - At most one form is open on a page: opening one closes the others. Once something has been typed into a form, or it was previewed, closing it, opening another, folding its branch or loading more responses around it asks first, and so does leaving the page. Views that refresh in the background leave a view with an open form alone. On the publish page, a preview that could not be made no longer goes on to publish, which failed again on the same check and showed its message twice. Closes #937 Closes #938 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
🎉 This PR is included in version 5.23.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #937, closes #938.
Why
The response forms that open inside a thread view were submitted as a plain page POST. The page that comes back rebuilds its views, so the form disappeared together with what had been typed into it and any message saying why it was not published. To the user, publishing silently failed (#937). The forms also opened for visitors who were not logged in.
What changes
In the thread view
Login first: a response action (reply, support, …) asks a logged-out visitor to log in, then opens the full publish form, as other publish links do.
Submitted in place: the inline form submits over AJAX. If the nanopub is not published, the form shows again in place, with its input and the reason.
Inline preview: Preview shows the nanopub inside the box, with consent, Publish and Back. Back returns to the form as it was. Publishing from there uses the preview page's code, now
PreviewPage.publishPreviewed.A box of its own (Nicer inline forms #938): headed by the action and what it responds to ("reply in response to “…”"), with a × to close it.
One form at a time: opening a form closes any other open one. Only the cards involved are redrawn.
Asks before discarding: once something has been typed into a form, or it was previewed, these ask "Discard the response you started writing?" first:
Leaving the page triggers the browser's own prompt, except while publishing.
Background refreshes: a view with an open form is not replaced while it refreshes.
On the publish page
/publishand/previewwork as before: a normal page submit, the same checks in the same order.PublishForm's existing 4-argument constructor keeps this behaviour; the inline mode is a new 5-argument one.Testing
Run locally in headless Chrome against the thread view of the nanoarguments pilot space, logged in, using only Preview:
Logged out, a response action goes to the login with no form opened. On
/publish, Preview →/preview→ Back still keeps the text.Not tried: clicking Publish itself, from the inline form or from the inline preview. To try: Publish with consent unticked should leave the message in the box, and a real reply should land on the space page.
ThreadNodePanelTestpasses, including "load more".PublishFormTemplate*TestandPreviewPageProtectedTestintermittently fail to fetch templates from the registries. Each passed in at least one of three runs.🤖 Generated with Claude Code