Hide bookmark from post menu on hidden posts

AI-generated summary

The discussion revolves around the user experience of bookmarking posts on a forum, specifically when posts are hidden due to flags. Moin points out that the bookmark button remains visible on hidden posts, which is confusing since bookmarking doesn’t work in such cases. They suggest hiding the bookmark button on hidden posts to improve the experience. rokejulianlockhart provides a technical analysis, showing that the bookmark button (with `id=

Bookmarking does not work on posts that have been hidden because of flags. I think the experience would improve if the bookmark button were hidden from the post menu in this case, similar to how the ‘like’ button is.

8 Likes

When I select //*[@id="ember38"] at discussion.fedoraproject.org/t/173585/35:

<button class="btn no-text btn-icon fk-d-menu__trigger bookmark-menu-trigger post-action-menu__bookmark btn-flat bookmark widget-button bookmark-menu__trigger btn-icon no-text" aria-expanded="false" title="bookmark this post" data-identifier="bookmark-menu" data-trigger="" type="button" id="ember38">
<svg class="fa d-icon d-icon-bookmark svg-icon svg-string" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><use href="#bookmark"></use></svg>      <span aria-hidden="true">
          ​
        </span>
<!---->    
    </button>

…I see:

An error occurred: You are not permitted to view the requested resource.

The ECMAScript console returns:

12:24:12.798 XHRPOST
https://discussion.fedoraproject.org/bookmarks.json
[HTTP/2 403  160ms]

12:24:04.683 Uncaught (in promise) TypeError: can't access property "saveData", e is undefined
    create bookmark-api.js:20
    create post-bookmark-manager.js:36
    onBookmark bookmark-menu.gjs:124
    onShowMenu bookmark-menu.gjs:147
    show float-kit-instance.js:28
    show d-menu-instance.js:101
    onTrigger d-menu-instance.js:136
    onClick d-menu-instance.js:120
bookmark-api.js:20:7

Instead, it should be hidden, or (perhaps, better yet), disabled.