Disable fields when submitting and fix trash icon for non-terminal jobs#1629
Disable fields when submitting and fix trash icon for non-terminal jobs#1629
Conversation
Paragon SummaryThis pull request review identified 2 issues across 1 category in 8 files. The review analyzed code changes, potential bugs, security vulnerabilities, performance issues, and code quality concerns using automated analysis tools. This PR improves form UX by disabling input fields during submission to prevent duplicate actions, and fixes a bug where the trash icon was incorrectly displayed or enabled for jobs that haven't reached a terminal state (still running or queued). Key changes:
Confidence score: 5/5
8 files reviewed, 2 comments Severity breakdown: Low: 2 Tip: |
| onClick={() => onDeleteJob?.(job.id)} | ||
| style={{ cursor: 'pointer' }} | ||
| /> | ||
| <IconButton |
There was a problem hiding this comment.
Bug: Trash icon shows pointer cursor even when button is disabled
Trash icon shows pointer cursor even when button is disabled. Misleads users into thinking they can click a non-interactive element. Remove the inline cursor style from the icon child.
View Details
Location: src/renderer/components/Experiment/Tasks/JobsList.tsx (lines 506)
Analysis
Trash icon shows pointer cursor even when button is disabled
| What fails | cursor: 'pointer' on Trash2Icon child overrides the parent IconButton's disabled cursor style, showing a pointer even when the button cannot be clicked. |
| Result | Cursor appears as pointer on a disabled button, giving false affordance for interaction. |
| Expected | Cursor should reflect the disabled state (not-allowed or default) when the IconButton is disabled. |
| Impact | UX confusion — users may repeatedly try to click a disabled delete button thinking it is interactive. |
How to reproduce
Navigate to Tasks list with a non-terminal job. Hover over the trash icon — cursor shows pointer despite button being disabled.Patch Details
- <Trash2Icon style={{ cursor: 'pointer' }} />
+ <Trash2Icon />AI Fix Prompt
Fix this issue: Trash icon shows pointer cursor even when button is disabled. Misleads users into thinking they can click a non-interactive element. Remove the inline cursor style from the icon child.
Location: src/renderer/components/Experiment/Tasks/JobsList.tsx (lines 506)
Problem: cursor: 'pointer' on Trash2Icon child overrides the parent IconButton's disabled cursor style, showing a pointer even when the button cannot be clicked.
Current behavior: Cursor appears as pointer on a disabled button, giving false affordance for interaction.
Expected: Cursor should reflect the disabled state (not-allowed or default) when the IconButton is disabled.
Steps to reproduce: Navigate to Tasks list with a non-terminal job. Hover over the trash icon — cursor shows pointer despite button being disabled.
Provide a code fix.
Tip: Reply with @paragon-run to automatically fix this issue
| const handleDeleteJob = async (jobId: string) => { | ||
| if (!experimentInfo?.id) return; | ||
|
|
||
| const target = jobs.find((j) => String(j.id) === String(jobId)); |
There was a problem hiding this comment.
Bug: handleDeleteJob shows misleading warning when job is not found in the list
handleDeleteJob shows misleading warning when job is not found in the list. The message says stop the job first, which is wrong when the job simply does not exist. Split the guard into separate branches with accurate messages.
View Details
Location: src/renderer/components/Experiment/Tasks/Tasks.tsx (lines 514)
Analysis
handleDeleteJob shows misleading warning when job is not found in the list
| What fails | When the job ID is not found in the local jobs array, the same notification is shown as when a job is in a non-terminal state, incorrectly telling the user to 'stop the job first'. |
| Result | User sees 'Stop the job first if it is still running' even though the job simply cannot be found. |
| Expected | A separate, accurate message like 'Job not found' should be shown when !target, distinct from the non-terminal status message. |
| Impact | Confusing UX — users are given incorrect instructions when a job lookup fails. |
How to reproduce
Trigger handleDeleteJob with a jobId that does not exist in the current jobs list.AI Fix Prompt
Fix this issue: handleDeleteJob shows misleading warning when job is not found in the list. The message says stop the job first, which is wrong when the job simply does not exist. Split the guard into separate branches with accurate messages.
Location: src/renderer/components/Experiment/Tasks/Tasks.tsx (lines 514)
Problem: When the job ID is not found in the local jobs array, the same notification is shown as when a job is in a non-terminal state, incorrectly telling the user to 'stop the job first'.
Current behavior: User sees 'Stop the job first if it is still running' even though the job simply cannot be found.
Expected: A separate, accurate message like 'Job not found' should be shown when !target, distinct from the non-terminal status message.
Steps to reproduce: Trigger handleDeleteJob with a jobId that does not exist in the current jobs list.
Provide a code fix.
Tip: Reply with @paragon-run to automatically fix this issue
No description provided.