Skip to content

Comments

🐛 Fixed reply form showing parent comment author's details#25858

Merged
rob-ghost merged 1 commit intomainfrom
fix/comment-member-expertise
Jan 15, 2026
Merged

🐛 Fixed reply form showing parent comment author's details#25858
rob-ghost merged 1 commit intomainfrom
fix/comment-member-expertise

Conversation

@rob-ghost
Copy link
Contributor

@rob-ghost rob-ghost commented Jan 15, 2026

Summary

When opening a reply form on a comment, the form header was incorrectly displaying the parent comment author's name and expertise instead of the current user's data. This happened because the code used fallback patterns that pulled values from the comment being replied to when the current member had no name or expertise set.

The fix removes these fallbacks so the reply form only shows the logged-in user's own details (or the appropriate placeholder if they have none).

ref https://linear.app/ghost/issue/BER-3212

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Walkthrough

Form and FormWrapper components now derive memberName and memberExpertise only from member (member?.name, member?.expertise) and no longer fall back to comment?.member. FormWrapperProps had the comment?: Comment property removed and FormWrapper no longer accepts a comment prop. ReplyForm usage was updated to stop passing comment={parent} to FormWrapper. Two end-to-end tests were added verifying reply forms do not inherit name or expertise from parent comment authors; each test appears duplicated in the test file.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main bug fix: removing incorrect fallback logic that caused reply forms to display parent comment author details instead of the current user's details.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug (form showing parent comment author's details), the root cause (fallback patterns), and the fix (removing fallbacks to show only current user's data).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd222d7 and a1cd570.

📒 Files selected for processing (3)
  • apps/comments-ui/src/components/content/forms/form.tsx
  • apps/comments-ui/src/components/content/forms/reply-form.tsx
  • apps/comments-ui/test/e2e/actions.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/comments-ui/src/components/content/forms/form.tsx
  • apps/comments-ui/test/e2e/actions.test.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: rob-ghost
Repo: TryGhost/Ghost PR: 25791
File: ghost/core/core/server/api/endpoints/utils/serializers/output/mappers/comments.js:0-0
Timestamp: 2026-01-12T11:44:47.578Z
Learning: In Ghost's comment ban feature (PR `#25791`), the `can_comment` and `comment_ban` fields are exposed only via the authenticated `/members` API endpoint, not through the comments API serializers. This ensures members can see their own ban status without exposing ban details (reason, expires_at) to other members viewing comments.
🧬 Code graph analysis (1)
apps/comments-ui/src/components/content/forms/reply-form.tsx (2)
apps/comments-ui/src/components/content/forms/form.tsx (1)
  • FormWrapper (393-393)
apps/comments-ui/src/utils/helpers.ts (1)
  • isMobile (140-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Comments-UI tests
  • GitHub Check: Unit tests (Node 22.18.0)
  • GitHub Check: Build & Push Docker Image
🔇 Additional comments (1)
apps/comments-ui/src/components/content/forms/reply-form.tsx (1)

48-48: LGTM! Correctly removes the source of the fallback bug.

Removing comment={parent} ensures FormWrapper no longer has access to the parent comment's author data, preventing the incorrect fallback when the logged-in user lacks name or expertise.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rob-ghost rob-ghost self-assigned this Jan 15, 2026
@rob-ghost rob-ghost marked this pull request as ready for review January 15, 2026 10:48
Copy link
Member

@kevinansfield kevinansfield left a comment

Choose a reason for hiding this comment

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

Left a comment about a similar fallback issue with member name, although that's a little more of an edge-case. Otherwise looks good 👌

@rob-ghost rob-ghost force-pushed the fix/comment-member-expertise branch from 1845c45 to 88ac2cd Compare January 15, 2026 12:57
@rob-ghost rob-ghost changed the title 🐛 Fixed reply form showing parent comment author's expertise 🐛 Fixed reply form showing parent comment author's details Jan 15, 2026
@rob-ghost rob-ghost force-pushed the fix/comment-member-expertise branch from 88ac2cd to cd222d7 Compare January 15, 2026 12:59
ref https://linear.app/ghost/issue/BER-3212

When a user opened a reply form, the form header was showing the parent
comment author's name and expertise instead of the current user's data.
This happened because the code used a fallback pattern that pulled from
the comment being replied to when the current member had no value set.
@rob-ghost rob-ghost force-pushed the fix/comment-member-expertise branch from cd222d7 to a1cd570 Compare January 15, 2026 14:03
@rob-ghost rob-ghost enabled auto-merge (rebase) January 15, 2026 14:04
@rob-ghost rob-ghost merged commit 78b3268 into main Jan 15, 2026
35 checks passed
@rob-ghost rob-ghost deleted the fix/comment-member-expertise branch January 15, 2026 14:31
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