MishkaCmsCoreWeb.Templates.ReviewComments (Mishka CMS Core v0.0.1)

Copy Markdown View Source

A MishkaGervaz custom table template: the thread in the builder's Review sheet.

It owns the list and nothing above it — the composer is a Gervaz FORM, MishkaCmsCoreWeb.Templates.ReviewCommentForm.

What it draws and what it borrows

Structure only. Every chip, button and empty state goes through dynamic_component/1 at @static.ui_adapter, which is MishkaCmsCoreWeb.UIAdapters.Review — so the look is the adapter's and swapping the adapter reskins the thread without touching this file. Hardcoding MishkaGervaz.UIAdapters.Tailwind.badge(…) here would defeat exactly that.

features/0 returns [:filter, :paginate] and not [:select, :bulk_actions]: a review thread is read one note at a time, and a checkbox column in a 360px sidebar costs more than it gives. Dropping a feature drops its EVENTS too, so the two that stay are the two whose controls this template draws — the Open/All chips push filter, and "Show older" pushes load_more, both with phx-target={@myself}.

Which clicks go where

Deliberately both ways, the way MishkaCmsCoreWeb.Templates.StudioSnippets does it:

  • filter and load_more are Gervaz's own events and carry phx-target={@myself}.
  • Going to a note's element, resolving it, reopening it and deleting it are the EDITOR's business, so they carry no target and land in BuilderLive, which owns the selection and the Ash calls.

Getting that backwards produces a silent no-op, which is why it is written down.

Why the avatar disc is a class

Panels.avatar_tint/1 still decides WHICH of the five colours a name gets, but avatar_class/1 turns that answer into a whole class rather than a style attribute — CSP has no nonce for an attribute, so style-src-attr can only be closed by there being none. The five are written out one clause per colour because Tailwind reads source text: an interpolated class name gets no rule at all, which is what MishkaCmsWeb.InterpolatedClassTest guards.

Summary

Functions

render_bulk_actions(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_bulk_actions/1.

render_empty(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_empty/1.

render_error(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_error/1.

render_filters(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_filters/1.

render_header(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_header/1.

render_pagination(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_pagination/1.

render_template_switcher(assigns)

Callback implementation for MishkaGervaz.Table.Behaviours.Template.render_template_switcher/1.