Skip to content

Comments 0.4.2: Server-created threads without a comment text

Comments 0.4.2 adds an option for module and app developers. No change in the admin or for readers.

create_comment/4 now accepts :allow_empty_content. It is meant for an anchor comment that server code creates to start a thread, where the visible label lives elsewhere, such as an annotation’s own title shown above the thread. Such a comment no longer needs text, a GIF or an attachment just to pass validation, so the label is not copied into the comment body.

The option is read straight from the attributes passed by server code. It is not part of the form data a browser can send, so a visitor cannot use it to post an empty comment.

Full release notes: Comments 0.4.2

0.4.2 · 17 August 2026

Empty-content anchor comments for server-created threads (#37).

Added

  • create_comment/4 accepts :allow_empty_content — a server-created anchor/topic comment whose visible text lives elsewhere (e.g. an annotation’s own label rendered as the thread’s decoration) can now skip the content-or-media requirement instead of duplicating that label into the comment body just to pass validation. Read directly off attrs before the changeset, the same pattern as :inserted_at — server-side callers only. Documented in create_comment/4’s doc and added integration coverage — the PR that introduced this shipped with neither.

Comments 0.4.2. Install or update: {:phoenix_kit_comments, "~> 0.4"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.