Hide post actions menu for logged-out users - #1468
Open
drusepth wants to merge 1 commit into
Open
Conversation
The three-dot menu on forum posts rendered for everyone, including signed-out visitors, who then got an empty dropdown with no actions in it. The existing `actions_html.present?` guard never caught this because the primary-actions `<div class="py-1">` wrapper was emitted unconditionally, so the captured markup was always "present" even when every action inside it was filtered out. Every action in the menu (quote, edit, delete, mark as unread, report, moderate) requires an account, so skip the capture entirely unless the viewer is signed in. The action checks are also hoisted into explicit booleans so each section wrapper only renders when it has content, which keeps signed-in users with no available actions from getting an empty menu too. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FQ6QtXdy1MTUUjZm1p5Pgt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Changes proposed:
This change improves the UX for anonymous visitors by not displaying an empty/non-functional actions menu, and reduces unnecessary DOM elements when no actions are available.
@indentlabs/contributors
https://claude.ai/code/session_01FQ6QtXdy1MTUUjZm1p5Pgt