cheeaun / phanpy

A minimalistic opinionated Mastodon web client
https://phanpy.social
MIT License
1.08k stars 107 forks source link

Boosts carousel renders 'hide completely' filtered posts as empty elements #350

Open MaddyUnderStars opened 11 months ago

MaddyUnderStars commented 11 months ago

Describe the bug

In the boosts carousel, posts with content warnings are rendered as 1px tall with no content. Clicking the 1px tall element does bring up the correct post and is properly rendered.

To Reproduce

  1. View a post with a content warning in the boost carousel

Expected behavior For the standard "show content warning", blurred text, cw description, and username to be displayed.

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

MaddyUnderStars commented 11 months ago

I've realised that not all CW'd posts experience this bug.

For example: https://transmom.love/@elilla/111524776145758292 renders properly: image

For my original example, the rendered html for this element is just empty: image

oh and here's the post that experiences this bug. it's a request for mutual aid, so if you can chip in, it would help them a lot. https://comms.thedigitallancabin.net/objects/3675c771-d013-4ad8-a69f-4f3fd34f88e3

cheeaun commented 11 months ago

@MaddyUnderStars may I know what's the version of Phanpy you're using? On Phanpy, go to Settings and scroll to bottom to see the version in About section.

MaddyUnderStars commented 11 months ago

dev.phanpy.social is running 2023.12.05.8009a8d, and phanpy.social is running 2023.12.06.efca016. it occurs on both.

MaddyUnderStars commented 10 months ago

I've found another example of this behaviour. image This time, it's not the last element of the carousel. More importantly, this post doesn't even have a content warning. It's another aid request, so any and all support is welcome. https://heckin.how/notes/9ni8lkusb9qu8q1e

Here's a copy of the /home response for this boost

{
    "id": "111616402264784483",
    "created_at": "2023-12-21T03:58:56.783Z",
    "in_reply_to_id": null,
    "in_reply_to_account_id": null,
    "sensitive": false,
    "spoiler_text": "",
    "visibility": "public",
    "language": null,
    "uri": "https://bungle.online/notes/9ni8m8zzax/activity",
    "url": null,
    "replies_count": 0,
    "reblogs_count": 0,
    "favourites_count": 0,
    "edited_at": null,
    "favourited": false,
    "reblogged": false,
    "muted": false,
    "bookmarked": false,
    "content": "",
    "filtered": [
        {
            "filter": {
                "id": "3296",
                "title": "#mutualaid",
                "context": [
                    "home"
                ],
                "expires_at": null,
                "filter_action": "hide"
            },
            "keyword_matches": [
                "MutualAid"
            ],
            "status_matches": null
        }
    ],
    "reblog": {
        "id": "111616400134269650",
        "created_at": "2023-12-21T03:58:25.492Z",
        "in_reply_to_id": null,
        "in_reply_to_account_id": null,
        "sensitive": false,
        "spoiler_text": "",
        "visibility": "public",
        "language": "en",
        "uri": "https://heckin.how/notes/9ni8lkusb9qu8q1e",
        "url": "https://heckin.how/notes/9ni8lkusb9qu8q1e",
        "replies_count": 0,
        "reblogs_count": 4,
        "favourites_count": 0,
        "edited_at": null,
        "favourited": false,
        "reblogged": false,
        "muted": false,
        "bookmarked": false,
        "content": "removed by me to remove the scroll bar",
        "filtered": [
            {
                "filter": {
                    "id": "3296",
                    "title": "#mutualaid",
                    "context": [
                        "home"
                    ],
                    "expires_at": null,
                    "filter_action": "hide"
                },
                "keyword_matches": [
                    "MutualAid"
                ],
                "status_matches": null
            }
        ],
        "reblog": null,
        "account": {
            // not going to archive this
        }
    },
    "account": {
        // not going to archive this
    },
    "media_attachments": [],
    "mentions": [],
    "tags": [],
    "emojis": [],
    "card": null,
    "poll": null
}

After looking through this, I believe it might be due to my filter for "#mutualaid" set to hide completely (they just make me sad and I'm poor). So I guess the post renderer or whatever is returning null to not render the filtered post, but the boost carousel is wrapping the null in an li, without respecting the filter.

MaddyUnderStars commented 10 months ago

I can confirm that setting the filter to hide with a warning instead renders correctly.