-
Notifications
You must be signed in to change notification settings - Fork 0
Code Review Bench PR #25858 - 🐛 Fixed reply form showing parent comment author's details #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_25858_20260125_5844
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -241,7 +241,7 @@ const Form: React.FC<FormProps> = ({ | |||||
| const [progress, setProgress] = useState<Progress>('default'); | ||||||
| const formEl = useRef(null); | ||||||
|
|
||||||
| const memberName = member?.name ?? comment?.member?.name; | ||||||
| const memberName = member?.name; | ||||||
|
|
||||||
| if (progress === 'sending' || (memberName && isAskingDetails)) { | ||||||
| // Force open | ||||||
|
|
@@ -261,8 +261,8 @@ const Form: React.FC<FormProps> = ({ | |||||
| } | ||||||
|
|
||||||
| // 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]); | ||||||
|
|
||||||
| return ( | ||||||
| <form | ||||||
|
|
@@ -289,7 +289,6 @@ const Form: React.FC<FormProps> = ({ | |||||
| }; | ||||||
|
|
||||||
| type FormWrapperProps = { | ||||||
| comment?: Comment; | ||||||
| editor: Editor | null; | ||||||
| isOpen: boolean; | ||||||
| reduced: boolean; | ||||||
|
|
@@ -298,7 +297,6 @@ type FormWrapperProps = { | |||||
| }; | ||||||
|
|
||||||
| const FormWrapper: React.FC<FormWrapperProps> = ({ | ||||||
| comment, | ||||||
| editor, | ||||||
| isOpen, | ||||||
| reduced, | ||||||
|
|
@@ -307,12 +305,12 @@ const FormWrapper: React.FC<FormWrapperProps> = ({ | |||||
| }) => { | ||||||
| const {member, dispatchAction} = useAppContext(); | ||||||
|
|
||||||
| const memberName = member?.name ?? comment?.member?.name; | ||||||
| const memberExpertise = member?.expertise ?? comment?.member?.expertise; | ||||||
| const memberName = member?.name; | ||||||
| const memberExpertise = member?.expertise; | ||||||
|
|
||||||
| let openStyles = ''; | ||||||
| if (isOpen) { | ||||||
| const isReplyToReply = !!openForm?.in_reply_to_snippet; | ||||||
| const isReplyToReply = !!openForm.in_reply_to_snippet; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 Bug: Removing optional chaining on
|
||||||
| const isReplyToReply = !!openForm.in_reply_to_snippet; | |
| const isReplyToReply = !!openForm?.in_reply_to_snippet; |
- Apply suggested fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 Bug: setEditable checks expertise instead of name — breaks editing
The
setEditablecondition was changed from!!memberNameto!!member?.expertise, but the intent (as stated in the comment on line 263) is to "disable editing if the member doesn't have a name". This introduces two bugs:Members with a name but no expertise cannot type: The editor will be non-editable for any member who has a name set but has not filled in their expertise. This is a very common case and effectively breaks the comment form for most users.
Members with expertise but no name can bypass the name check: The editor will be editable even without a name, bypassing the "force name input first" UX flow.
This appears to be an accidental change during the refactor. The line should still check the member's name.
Was this helpful? React with 👍 / 👎