Skip to content

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

Open
tomerqodo wants to merge 2 commits intoqodo_claude_vs_qodo_base__fixed_reply_form_showing_parent_comment_authors_details_pr2from
qodo_claude_vs_qodo_head__fixed_reply_form_showing_parent_comment_authors_details_pr2
Open

🐛 Fixed reply form showing parent comment author's details#57
tomerqodo wants to merge 2 commits intoqodo_claude_vs_qodo_base__fixed_reply_form_showing_parent_comment_authors_details_pr2from
qodo_claude_vs_qodo_head__fixed_reply_form_showing_parent_comment_authors_details_pr2

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#2

rob-ghost and others added 2 commits January 25, 2026 11:56
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.
@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Fix reply form inheriting parent comment author details

🐞 Bug fix 🧪 Tests

Grey Divider

Walkthroughs

Description
• Removed fallback pattern that inherited parent comment author's details
• Fixed reply form to display current user's name and expertise only
• Added comprehensive test coverage for reply form data isolation
• Corrected reply submission to use parent comment ID directly
Diagram
flowchart LR
  A["Reply Form Opened"] --> B["Check Current Member Data"]
  B --> C["Remove Fallback to Parent Comment"]
  C --> D["Display Current User Info Only"]
  D --> E["Submit Reply with Correct Parent ID"]
Loading

Grey Divider

File Changes

1. apps/comments-ui/test/e2e/actions.test.ts 🧪 Tests +68/-0

Add tests for reply form data isolation

• Added test verifying reply form doesn't inherit expertise from parent comment author
• Added test verifying reply form doesn't inherit name from parent comment author
• Both tests validate that logged-in member's data is displayed, not parent's

apps/comments-ui/test/e2e/actions.test.ts


2. apps/comments-ui/src/components/content/forms/form.tsx 🐞 Bug fix +6/-8

Remove parent comment data fallback patterns

• Removed fallback pattern from memberName that used parent comment author's name
• Changed editor editability check from memberName to member?.expertise
• Removed comment prop from FormWrapperProps type definition
• Updated FormWrapper to not accept or use comment parameter
• Removed fallback patterns for both memberName and memberExpertise in FormWrapper

apps/comments-ui/src/components/content/forms/form.tsx


3. apps/comments-ui/src/components/content/forms/reply-form.tsx 🐞 Bug fix +4/-4

Fix reply submission and remove parent data passing

• Changed in_reply_to_id to use parent.id instead of openForm.in_reply_to_id
• Removed openForm from submit callback dependencies, keeping only necessary deps
• Removed comment={parent} prop when passing to FormWrapper
• Reordered CSS classes for consistency

apps/comments-ui/src/components/content/forms/reply-form.tsx


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented Mar 10, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. openForm deref crash 🐞 Bug ✓ Correctness
Description
FormWrapper dereferences openForm.in_reply_to_snippet when isOpen is true, but openForm is optional
and MainForm renders FormWrapper without it. Focusing/typing in the main comment form will throw a
TypeError and break the UI.
Code

apps/comments-ui/src/components/content/forms/form.tsx[R313-314]

+        const isReplyToReply = !!openForm.in_reply_to_snippet;
        openStyles = isReplyToReply ? 'pl-[1px] pt-[68px] sm:pl-[44px] sm:pt-[56px]' : 'pl-[1px] pt-[48px] sm:pl-[44px] sm:pt-[40px]';
Evidence
FormWrapperProps declares openForm as optional, yet the code accesses openForm.in_reply_to_snippet
without a guard; MainForm calls FormWrapper without providing openForm and can set isOpen=true when
the editor is focused or has content, triggering the crash path.

apps/comments-ui/src/components/content/forms/form.tsx[291-315]
apps/comments-ui/src/components/content/forms/main-form.tsx[94-105]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`FormWrapper` can crash at runtime because it dereferences `openForm.in_reply_to_snippet` even though `openForm` is optional and some call sites don’t pass it.

### Issue Context
`MainForm` renders `<FormWrapper ...>` without `openForm`, but `isOpen` can become `true` when the editor is focused or has content.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/form.tsx[311-315]
- apps/comments-ui/src/components/content/forms/main-form.tsx[94-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Expertise blocks editor typing 🐞 Bug ✓ Correctness
Description
Form disables editor editing based on member.expertise instead of member.name, blocking typing for
members who have a name but no expertise and allowing typing for members missing a required name.
This contradicts the AddDetailsPopup validation that requires a non-empty name but treats expertise
as optional.
Code

apps/comments-ui/src/components/content/forms/form.tsx[R263-265]

        // Disable editing if the member doesn't have a name or when we are submitting the form
-        editor.setEditable(!!memberName && progress !== 'sending');
-    }, [editor, memberName, progress]);
+        editor.setEditable(!!member?.expertise && progress !== 'sending');
+    }, [editor, member, progress]);
Evidence
The form’s own comment and click-to-focus flow enforce name entry first, and AddDetailsPopup only
validates name; switching the editable gate to expertise makes expertise required for typing and no
longer enforces the required name in the editor’s editable state.

apps/comments-ui/src/components/content/forms/form.tsx[258-265]
apps/comments-ui/src/components/popups/add-details-popup.tsx[38-49]
apps/comments-ui/src/components/content/forms/form.tsx[355-358]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The editor’s editable state is incorrectly gated by `member.expertise`, making expertise effectively required to type and failing to enforce the required `name`.

### Issue Context
- The UI flow and popup validation require a non-empty name.
- Expertise is optional.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/form.tsx[258-265]
- apps/comments-ui/src/components/popups/add-details-popup.tsx[38-49]
- apps/comments-ui/src/components/content/forms/form.tsx[355-358]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Reply-to-reply misthreaded 🐞 Bug ✓ Correctness
Description
ReplyForm always submits in_reply_to_id as parent.id, ignoring openForm.in_reply_to_id which is set
when replying to a reply. This records reply-to-reply posts as replies to the top-level comment and
loses the correct in-reply-to linkage/snippet behavior.
Code

apps/comments-ui/src/components/content/forms/reply-form.tsx[R29-32]

                post_id: postId,
-                in_reply_to_id: openForm.in_reply_to_id,
+                in_reply_to_id: parent.id,
                status: 'published',
                html
Evidence
When the user replies to a reply, openReplyForm stores the clicked reply id in
openForm.in_reply_to_id, while ReplyForm still receives parent as the top-level thread comment;
forcing in_reply_to_id=parent.id discards the nested target and breaks reply-to-reply semantics.

apps/comments-ui/src/components/content/forms/reply-form.tsx[24-35]
apps/comments-ui/src/components/content/comment.tsx[109-120]
apps/comments-ui/src/components/content/comment.tsx[248-252]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Replies to replies are mis-threaded because `ReplyForm` always submits `in_reply_to_id` as the top-level `parent.id`.

### Issue Context
`openForm.in_reply_to_id` is intentionally populated when replying to a reply; `parent` is used for the thread root placement/state update.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/reply-form.tsx[24-35]
- apps/comments-ui/src/components/content/comment.tsx[103-120]
- apps/comments-ui/src/components/content/comment.tsx[248-252]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +313 to 314
const isReplyToReply = !!openForm.in_reply_to_snippet;
openStyles = isReplyToReply ? 'pl-[1px] pt-[68px] sm:pl-[44px] sm:pt-[56px]' : 'pl-[1px] pt-[48px] sm:pl-[44px] sm:pt-[40px]';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Openform deref crash 🐞 Bug ✓ Correctness

FormWrapper dereferences openForm.in_reply_to_snippet when isOpen is true, but openForm is optional
and MainForm renders FormWrapper without it. Focusing/typing in the main comment form will throw a
TypeError and break the UI.
Agent Prompt
### Issue description
`FormWrapper` can crash at runtime because it dereferences `openForm.in_reply_to_snippet` even though `openForm` is optional and some call sites don’t pass it.

### Issue Context
`MainForm` renders `<FormWrapper ...>` without `openForm`, but `isOpen` can become `true` when the editor is focused or has content.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/form.tsx[311-315]
- apps/comments-ui/src/components/content/forms/main-form.tsx[94-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 263 to +265
// Disable editing if the member doesn't have a name or when we are submitting the form
editor.setEditable(!!memberName && progress !== 'sending');
}, [editor, memberName, progress]);
editor.setEditable(!!member?.expertise && progress !== 'sending');
}, [editor, member, progress]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Expertise blocks editor typing 🐞 Bug ✓ Correctness

Form disables editor editing based on member.expertise instead of member.name, blocking typing for
members who have a name but no expertise and allowing typing for members missing a required name.
This contradicts the AddDetailsPopup validation that requires a non-empty name but treats expertise
as optional.
Agent Prompt
### Issue description
The editor’s editable state is incorrectly gated by `member.expertise`, making expertise effectively required to type and failing to enforce the required `name`.

### Issue Context
- The UI flow and popup validation require a non-empty name.
- Expertise is optional.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/form.tsx[258-265]
- apps/comments-ui/src/components/popups/add-details-popup.tsx[38-49]
- apps/comments-ui/src/components/content/forms/form.tsx[355-358]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 29 to 32
post_id: postId,
in_reply_to_id: openForm.in_reply_to_id,
in_reply_to_id: parent.id,
status: 'published',
html
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Reply-to-reply misthreaded 🐞 Bug ✓ Correctness

ReplyForm always submits in_reply_to_id as parent.id, ignoring openForm.in_reply_to_id which is set
when replying to a reply. This records reply-to-reply posts as replies to the top-level comment and
loses the correct in-reply-to linkage/snippet behavior.
Agent Prompt
### Issue description
Replies to replies are mis-threaded because `ReplyForm` always submits `in_reply_to_id` as the top-level `parent.id`.

### Issue Context
`openForm.in_reply_to_id` is intentionally populated when replying to a reply; `parent` is used for the thread root placement/state update.

### Fix Focus Areas
- apps/comments-ui/src/components/content/forms/reply-form.tsx[24-35]
- apps/comments-ui/src/components/content/comment.tsx[103-120]
- apps/comments-ui/src/components/content/comment.tsx[248-252]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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