codeant-ai-for-open-source[bot] commented on code in PR #42494:
URL: https://github.com/apache/superset/pull/42494#discussion_r3694268573


##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -2597,6 +2599,22 @@ const AlertReportModal: 
FunctionComponent<AlertReportModalProps> = ({
                       </Checkbox>
                     </div>
                   )}
+                  <div className="inline-container">
+                    <Checkbox
+                      data-test="include-cta"
+                      checked={currentAlert?.include_cta !== false}
+                      onChange={(e: CheckboxChangeEvent) =>
+                        updateAlertState('include_cta', e.target.checked)
+                      }

Review Comment:
   **Suggestion:** The checkbox is interactive before the asynchronous 
existing-schedule request completes, but the `resource` effect later replaces 
`currentAlert` wholesale. If a user unchecks or checks this control while the 
form is still hydrating, that change is silently overwritten by the server 
response, so the saved schedule may not reflect the user's choice. Disable the 
control until hydration completes or merge the fetched state without 
overwriting dirty fields. [stale reference]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ CTA preference can be lost during slow schedule hydration.
   - ⚠️ Saved notifications may unexpectedly include or omit the Superset link.
   - ⚠️ Affects existing alert and report editing from the Alerts & Reports 
list.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=8a8318a4c4b74d3887a3bc5a260d4d8a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=8a8318a4c4b74d3887a3bc5a260d4d8a&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/features/alerts/AlertReportModal.tsx
   **Line:** 2603:2608
   **Comment:**
        *Stale Reference: The checkbox is interactive before the asynchronous 
existing-schedule request completes, but the `resource` effect later replaces 
`currentAlert` wholesale. If a user unchecks or checks this control while the 
form is still hydrating, that change is silently overwritten by the server 
response, so the saved schedule may not reflect the user's choice. Disable the 
control until hydration completes or merge the fetched state without 
overwriting dirty fields.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42494&comment_hash=cdd5064c44c22372e3b42cbc45e978da0750bdce438f955c9a2afd2b93e9f113&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42494&comment_hash=cdd5064c44c22372e3b42cbc45e978da0750bdce438f955c9a2afd2b93e9f113&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to