Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facet colouring not matching text correctly under some circumstances #31

Closed
orual opened this issue Aug 30, 2024 · 2 comments · Fixed by #35
Closed

Facet colouring not matching text correctly under some circumstances #31

orual opened this issue Aug 30, 2024 · 2 comments · Fixed by #35
Assignees
Labels
bug Something isn't working frontend

Comments

@orual
Copy link
Member

orual commented Aug 30, 2024

See below. Assuming the utf8 code point to glyph calculation is a bit off, since Skyfeed renders it correctly.
image

JSON for problematic posts:

{
  "$type": "app.bsky.feed.defs#postView",
  "record": {
    "$type": "app.bsky.feed.post",
    "text": "já dá, o padrão é 2 mas se quiser mais tem que ser assinante no patreon.com/deckblue",
    "reply": {
      "root": {
        "$type": "com.atproto.repo.strongRef",
        "cid": "bafyreianr5xb5zad2mw2wmjstfontvnpuas2cpficadcbg4n3rfjaqpzbq",
        "uri": "at://did:plc:y6xed5noeivqfdtar4yetvz4/app.bsky.feed.post/3l2xliv7tym2r"
      },
      "parent": {
        "$type": "com.atproto.repo.strongRef",
        "cid": "bafyreianr5xb5zad2mw2wmjstfontvnpuas2cpficadcbg4n3rfjaqpzbq",
        "uri": "at://did:plc:y6xed5noeivqfdtar4yetvz4/app.bsky.feed.post/3l2xliv7tym2r"
      }
    },
    "embed": {
      "$type": "app.bsky.embed.external",
      "external": {
        "uri": "https://patreon.com/deckblue",
        "title": "Get more from deck.blue on Patreon",
        "description": "Get the most out of Bluesky.",
        "thumb": {
          "$type": "blob",
          "mimeType": "image/png",
          "size": 243267,
          "ref": {
            "$link": "bafkreihzylmuca64wg7kh5eg25h6uekgtwr2h2osmbitiu7keyhcaqdj5y"
          }
        }
      }
    },
    "langs": ["en", "pt"],
    "facets": [
      {
        "$type": "app.bsky.richtext.facet",
        "index": { "byteStart": 68, "byteEnd": 88 },
        "features": [
          {
            "$type": "app.bsky.richtext.facet#link",
            "uri": "https://patreon.com/deckblue"
          }
        ]
      }
    ],
    "tags": [],
    "createdAt": "2024-08-30T20:34:04.326Z"
  },
  "author": {
    "did": "did:plc:w342borqxtyo2pul67ec2pwt",
    "handle": "deck.blue",
    "displayName": "deck.blue",
    "avatar": "https://cdn.bsky.app/img/avatar/plain/did:plc:w342borqxtyo2pul67ec2pwt/bafkreiec6yihxyfgua7myrxcfx75opofiu6l5wm4jzjrn3irlklynmagmy@jpeg",
    "viewer": {
      "muted": false,
      "blockedBy": false,
      "following": "at://did:plc:bsnnxdb2se2cdwsbav3ffhe5/app.bsky.graph.follow/3kcgfkk6gci2w"
    },
    "labels": []
  },
  "uri": "at://did:plc:w342borqxtyo2pul67ec2pwt/app.bsky.feed.post/3l2xm3m2lvm2f",
  "cid": "bafyreicnhzkvrhzepcn7nmahul3aq6fs2wdmal3mskftlcyz7oagci6sqe",
  "embed": {
    "$type": "app.bsky.embed.external#view",
    "external": {
      "$type": "app.bsky.embed.external#viewExternal",
      "uri": "https://patreon.com/deckblue",
      "title": "Get more from deck.blue on Patreon",
      "description": "Get the most out of Bluesky.",
      "thumb": "https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:w342borqxtyo2pul67ec2pwt/bafkreihzylmuca64wg7kh5eg25h6uekgtwr2h2osmbitiu7keyhcaqdj5y@jpeg"
    }
  },
  "replyCount": 1,
  "repostCount": 2,
  "likeCount": 1,
  "viewer": { "replyDisabled": false },
  "labels": [],
  "indexedAt": "2024-08-30T20:34:04.326Z"
}
{
  "$type": "app.bsky.feed.defs#postView",
  "record": {
    "$type": "app.bsky.feed.post",
    "text": "isso é com o @bsky.app! o deck.blue não é oficial",
    "reply": {
      "root": {
        "$type": "com.atproto.repo.strongRef",
        "cid": "bafyreie5rdgtef6giqu2dnxlacyb7ste5rp6p65pokxeriejq726gylkaa",
        "uri": "at://did:plc:sn7b23h46p4l3hkhm6mwpwzm/app.bsky.feed.post/3l2xpfyk3f72v"
      },
      "parent": {
        "$type": "com.atproto.repo.strongRef",
        "cid": "bafyreie5rdgtef6giqu2dnxlacyb7ste5rp6p65pokxeriejq726gylkaa",
        "uri": "at://did:plc:sn7b23h46p4l3hkhm6mwpwzm/app.bsky.feed.post/3l2xpfyk3f72v"
      }
    },
    "langs": ["en", "pt"],
    "facets": [
      {
        "$type": "app.bsky.richtext.facet",
        "index": { "byteStart": 14, "byteEnd": 23 },
        "features": [
          {
            "$type": "app.bsky.richtext.facet#mention",
            "did": "did:plc:z72i7hdynmk6r22z27h6tvur"
          }
        ]
      },
      {
        "$type": "app.bsky.richtext.facet",
        "index": { "byteStart": 27, "byteEnd": 36 },
        "features": [
          {
            "$type": "app.bsky.richtext.facet#link",
            "uri": "https://deck.blue"
          }
        ]
      }
    ],
    "tags": [],
    "createdAt": "2024-08-30T22:39:19.254Z"
  },
  "author": {
    "did": "did:plc:w342borqxtyo2pul67ec2pwt",
    "handle": "deck.blue",
    "displayName": "deck.blue",
    "avatar": "https://cdn.bsky.app/img/avatar/plain/did:plc:w342borqxtyo2pul67ec2pwt/bafkreiec6yihxyfgua7myrxcfx75opofiu6l5wm4jzjrn3irlklynmagmy@jpeg",
    "viewer": {
      "muted": false,
      "blockedBy": false,
      "following": "at://did:plc:bsnnxdb2se2cdwsbav3ffhe5/app.bsky.graph.follow/3kcgfkk6gci2w"
    },
    "labels": []
  },
  "uri": "at://did:plc:w342borqxtyo2pul67ec2pwt/app.bsky.feed.post/3l2xt3kpefu2l",
  "cid": "bafyreibd7mdultuln3rqvj4lnhxvyvb5yiufczx7vk2lvdzx62trauomjy",
  "replyCount": 0,
  "repostCount": 0,
  "likeCount": 0,
  "viewer": { "replyDisabled": false },
  "labels": [],
  "indexedAt": "2024-08-30T22:39:19.254Z"
}
@orual orual self-assigned this Aug 30, 2024
@orual orual added bug Something isn't working frontend labels Aug 30, 2024
@orual
Copy link
Member Author

orual commented Aug 31, 2024

Added the Skyfeed feature to copy out JSON of posts to Morpho to help debug this and other things more easily. Copies out the Morpho-specific version rather than AT Protocol lexicon-compatible, but that's more useful for debug anyway.

@orual orual mentioned this issue Sep 1, 2024
orual added a commit that referenced this issue Sep 2, 2024
@orual orual closed this as completed in #35 Sep 2, 2024
@orual
Copy link
Member Author

orual commented Sep 2, 2024

I hate utf16 encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants