Skip to content

Disable fields when submitting and fix trash icon for non-terminal jobs#1629

Merged
deep1401 merged 3 commits intomainfrom
fix/disable-fields
Mar 25, 2026
Merged

Disable fields when submitting and fix trash icon for non-terminal jobs#1629
deep1401 merged 3 commits intomainfrom
fix/disable-fields

Conversation

@deep1401
Copy link
Copy Markdown
Member

No description provided.

@paragon-review
Copy link
Copy Markdown

Paragon Summary

This 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:

  • Disables form fields during submission to prevent duplicate actions
  • Fixes trash icon visibility for non-terminal job states
  • Updates Interactive and Tasks components with submission state handling
  • Modifies utils.ts with supporting helper functions

Confidence score: 5/5

  • This PR has low risk with no critical or high-priority issues identified
  • Score reflects clean code review with only minor suggestions or no issues found
  • Code quality checks passed - safe to proceed with merge

8 files reviewed, 2 comments

Severity breakdown: Low: 2


Tip: @paragon-run <instructions> to chat with our agent or push fixes!

Dashboard

onClick={() => onDeleteJob?.(job.id)}
style={{ cursor: 'pointer' }}
/>
<IconButton
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@deep1401 deep1401 merged commit 456e2c2 into main Mar 25, 2026
5 checks passed
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