Skip to content

Hide post actions menu for logged-out users - #1468

Open
drusepth wants to merge 1 commit into
tailwind-redesignfrom
claude/forum-message-menu-auth-yazvri
Open

Hide post actions menu for logged-out users#1468
drusepth wants to merge 1 commit into
tailwind-redesignfrom
claude/forum-message-menu-auth-yazvri

Conversation

@drusepth

Copy link
Copy Markdown
Member

Fixes #

Changes proposed:

  • Only render the post actions menu when a user is signed in, since all available actions require authentication
  • Pre-calculate whether primary and danger action sections have content to avoid rendering empty divs
  • Conditionally apply the border-top styling only when both primary and danger sections are present
  • Improve code organization by moving permission checks to the top level before the capture block
  • Fix trailing whitespace on the x-show attribute

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants