Comments 0.5.0: Moderators see only the records they manage, and core 3 support
Comments 0.5.0 lets a site give someone moderation rights over the comments on their own records only, keeps the comments settings behind a separate permission, and makes the module ready for PhoenixKit 3 with its own migration chain.
Moderation by record
The comments permission is split in three. The base key opens the moderation page. Two new sub-permissions sit under it: Moderate every comment on the site (comments.moderate_all) and Change the comments settings (comments.settings).
A moderator with only the base key sees the comments on records a module says they manage, and nothing else. The page subtitle then reads Moderate comments on records you manage, with the note “This page shows comments on records you manage.” The rule applies to the list, the counts, the stats and the type filter, and to every action. Authors’ emails are shown only to holders of comments.moderate_all; others see the author’s name. The Actions tile with its Settings link appears only for holders of comments.settings.
The same rule now decides who may edit or delete someone else’s comment in an embedded thread, so the thread and the moderation page agree. Before, any owner or admin could.
For module authors, a resource handler answers which records a viewer manages with the new moderatable_resources/2 callback (:all or a list of uuids). A type whose handler does not answer is invisible to a base-key moderator. A second new callback, on_comment_published/3, fires once when a pending comment is approved.
Its own migration chain
The module now owns its four tables through PhoenixKitComments.Migrations. Its V1 adopts the tables core already created and only adds a marker, so nothing changes on an existing install. It also supplies the table manifest that mix phoenix_kit.repair and mix phoenix_kit.doctor use to check them.
Upgrading
Comments 0.5 needs PhoenixKit 2.65 or later and works with 3.x. Run mix phoenix_kit.update. On the first boot, every role that already holds comments is granted both new sub-permissions once, so existing moderators keep what they had. A role given comments after that gets the narrow meaning. The enabled attribute on the comments component can no longer turn a thread on while the module is switched off.
Full release notes: Comments 0.5.0
0.5.0 · 27 October 2026
Changed
- Core pin widened to
>= 2.65.0 and < 4.0.0: works with core 3.x (core 3.0 stops creating the module tables; this module’s own chain builds its tables). The floor is the first core with thefile_references/0andexpected_schema/0callbacks, which now carry@impl PhoenixKit.Module.
Added
- The module supplies the manifest of its 4 tables (
expected_schema/0,PhoenixKitComments.ExpectedSchema), somix phoenix_kit.repairandmix phoenix_kit.doctorcheck and repair them again, now from the module’s own chain instead of core’s manifest. Generated fromPhoenixKitComments.Migrationsby core’sdev_docs/squash/generate_module_manifest.exs, never edited by hand. Core uses it from the first release after 2.64.1; before that nothing reads it. Repair is additive (it creates what is missing and reports the rest) and checks the tables only while the database is at the chain’s current version. No migration. - The module’s own migration chain,
PhoenixKitComments.Migrations(migration_module/0). V1 adopts the four tables core’s chain creates for comments,phoenix_kit_comments,phoenix_kit_comments_likes,phoenix_kit_comments_dislikesandphoenix_kit_comment_media, exactly as a fresh core install builds them, and stamps apkcmt_schema:1marker. Nothing changes on an existing install but the marker; from now on a change to these tables ships here instead of in core. A test proves the chain builds the tables without core (core’sPhoenixKit.TestSupport.ModuleChainCheck).
Comments 0.5.0. Install or update: {:phoenix_kit_comments, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.