Comments 0.1.5: GIFs from Giphy in comments, and a mobile-friendly thread
Comments 0.1.5 adds an optional Giphy picker to the comment form, so people can post a GIF on its own or with text.
An admin turns it on under Giphy Integration in the comments settings: Enable Giphy Picker, a Giphy API Key stored in the database, and a Content Rating (G, PG, PG-13 or R) that caps what search returns. The chosen GIF shows inline with the comment.
The comment form also gets a character counter and a Cancel button, and the whole thread works down to about 320 pixels wide, with the picker as a bottom sheet on phones.
For developers, the component has a :form_extras slot: inputs named metadata[<key>] are saved into the comment’s metadata (giphy is reserved).
Upgrading
Comment.changeset/2 no longer requires :content, since a GIF alone is a valid comment. Code that relied on the “can’t be blank” error should check the new rule. The package adds giphy_api.
Comments 0.1.5. Install or update: {:phoenix_kit_comments, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.