a web component that shows the replies to a linked bsky post as comments.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix decoder edge cases and add screenshot to README

rekkice 4ac15b62 b155601f

+7 -4
+2
README.md
··· 2 2 3 3 a web component that shows the replies to a linked bsky post as comments. 4 4 5 + ![a screenchot](./screenshot.png) 6 + 5 7 [![Package Version](https://img.shields.io/hexpm/v/bsky_comments_widget)](https://hex.pm/packages/bsky_comments_widget) 6 8 [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/bsky_comments_widget/) 7 9
+1 -1
gleam.toml
··· 1 1 name = "bsky_comments_widget" 2 - version = "1.0.2" 2 + version = "1.0.3" 3 3 target = "javascript" 4 4 5 5 # Fill out these fields if you intend to generate HTML documentation or publish
+1 -1
package.json
··· 1 1 { 2 2 "name": "bsky_comments_widget", 3 - "version": "1.0.2", 3 + "version": "1.0.3", 4 4 "type": "module", 5 5 "main": "dist/bsky_comments_widget.umd.cjs", 6 6 "module": "dist/bsky_comments_widget.js",
screenshot.png

This is a binary file and will not be displayed.

+2 -2
src/bsky_comments_widget/models.gleam
··· 79 79 use did <- decode.field("did", decode.string) 80 80 use handle <- decode.field("handle", decode.string) 81 81 use display_name <- decode.field("displayName", decode.string) 82 - use avatar_url <- decode.field("avatar", decode.string) 82 + use avatar_url <- decode.optional_field("avatar", "", decode.string) 83 83 decode.success(Author(did:, handle:, display_name:, avatar_url:)) 84 84 } 85 85 ··· 95 95 "app.bsky.embed.external#view" -> { 96 96 use ext <- decode.field("external", { 97 97 use description <- decode.field("description", decode.string) 98 - use thumb <- decode.field("thumb", decode.string) 98 + use thumb <- decode.optional_field("thumb", "", decode.string) 99 99 use title <- decode.field("title", decode.string) 100 100 use uri <- decode.field("uri", decode.string) 101 101 decode.success(#(description, thumb, title, uri))
+1
src/bsky_comments_widget/widget.gleam
··· 53 53 } 54 54 55 55 fn update(_model: Model, msg: Msg) -> #(Model, Effect(Msg)) { 56 + // i usually put an echo here when i want to debug the fetch/decode logic 56 57 case msg { 57 58 ApiReturnedPost(Ok(post)) -> #(Comments(main_post: post), effect.none()) 58 59 ApiReturnedPost(Error(_)) -> #(CouldntLoad, effect.none())