Skip to content

Fix missing partial when editing comments with @mentions#2828

Merged
flavorjones merged 1 commit intomainfrom
flavorjones/fix-user-partial
Apr 9, 2026
Merged

Fix missing partial when editing comments with @mentions#2828
flavorjones merged 1 commit intomainfrom
flavorjones/fix-user-partial

Conversation

@flavorjones
Copy link
Copy Markdown
Member

@flavorjones flavorjones commented Apr 9, 2026

Summary

  • Edge Rails introduced ActionText::Attachable#to_editor_content_attachment_partial_path which defaults to to_partial_path ("users/user"). When editing a comment containing @mentions, the new editor adapter system calls this method to render mention content inside the rich text editor. Since users/_user.html.erb doesn't exist, this raises ActionView::Template::Error.
  • Override to_editor_content_attachment_partial_path in User::Mentionable to delegate to to_attachable_partial_path ("users/attachable"), matching the existing display rendering path.

The Rails change was introduced as part of the edge Rails bump in #2820 (Lexxy 0.9.5.beta), which incidentally upgraded Rails from 12e24eaf to 75f9e28379ac. The new to_editor_content_attachment_partial_path method was added as part of the editor adapter system. See the upgrade analysis for full details on changes in this Rails bump.

Test plan

  • Regression test: edit a comment containing an @mention, assert the editor renders the mention attachment with the correct SGID and user name
  • Verified test fails without the fix (Missing partial users/_user)
  • Verified test passes with the fix
  • All existing comment controller tests pass

Edge Rails introduced ActionText::Attachable#to_editor_content_attachment_partial_path
which defaults to to_partial_path ("users/user"). Override it in User::Mentionable to
delegate to to_attachable_partial_path ("users/attachable"), matching the existing
display rendering path.
Copilot AI review requested due to automatic review settings April 9, 2026 21:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression introduced by the Edge Rails editor adapter system when rendering @mention attachments inside the comment editor: Rails now calls to_editor_content_attachment_partial_path, which previously defaulted to a non-existent users/_user partial for User mentions.

Changes:

  • Override User#to_editor_content_attachment_partial_path (via User::Mentionable) to use the existing users/attachable rendering path.
  • Add a controller regression test covering editing a comment that contains an @mention attachment.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/models/user/mentionable.rb Adds an explicit editor-attachment partial path override to prevent missing-partial errors during comment editing.
test/controllers/cards/comments_controller_test.rb Adds regression coverage asserting mention attachments render correctly in the editor’s initial value.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@flavorjones flavorjones merged commit f3f9aec into main Apr 9, 2026
17 checks passed
@flavorjones flavorjones deleted the flavorjones/fix-user-partial branch April 9, 2026 21:29
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