A MishkaGervaz custom form template: the composer at the FOOT of the builder's Review sheet.
It owns the box and nothing above it — the thread is a Gervaz TABLE,
MishkaCmsCoreWeb.Templates.ReviewComments, which scrolls above this.
Why it is at the bottom
It used to be the first thing in the sheet, which put the newest note below a form nobody was using yet and made reading the thread mean scrolling past the composer every time. A thread is read downwards and written at the end; the composer belongs where the writing happens.
Two fields, because the editor knows the rest
A note needs six things stored and asks for two. Which document, which element, who is writing and
what kind of author they are all come from the editor through the form's defaults, and
MishkaCmsCore.Runtime.PageComment.apply_scope/2 puts them on the params in before_save. Asking
would be a five-field form where two will do, and every one of those three answers would be a
chance to get wrong what the editor already knows for certain.
That is also what makes a PAGE-LEVEL note the same thing as an element one: nothing is selected,
so node_id is nil, and the scope chip says "the whole page" instead of naming a tag. There is no
second form and no second code path.
The scope chip reports, and offers one way out
What a note is anchored to is whatever the canvas has selected, which is the right answer nearly always — a dropdown of every element on the page would be a worse way to say "this one" than clicking it. The chip does not choose the element.
It does carry a single ✕, because there is one thing the selection cannot say: that what you want to write is about the PAGE, while you happen to have a div selected. Deselecting in the canvas to say it means losing the place you were working in. The override lasts until the selection changes, and then the composer follows it again.
Why the errors are a flash
This box has no error slot, and Gervaz reports a rejected submit by assigning errors onto the
form state for the TEMPLATE to draw. A template with nowhere to draw them swallows every failure
silently — the author presses Save and nothing happens. PageComment.refuse/1 catches the two
cases that matter before the submit and sends the editor a flash, which is the same shape
MishkaCmsCore.Runtime.Snippet uses and for the same reason.
Summary
Functions
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_field/1.
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_group/1.
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_step_indicator/1.
Functions
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_field/1.
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_group/1.
Callback implementation for MishkaGervaz.Form.Behaviours.Template.render_step_indicator/1.