Skip to content

fix(ui): fix the disable-report-problem to submit#3002

Open
sham-jadhav03 wants to merge 4 commits into
AgentWrapper:mainfrom
sham-jadhav03:fix/disable-report-problem-submit
Open

fix(ui): fix the disable-report-problem to submit#3002
sham-jadhav03 wants to merge 4 commits into
AgentWrapper:mainfrom
sham-jadhav03:fix/disable-report-problem-submit

Conversation

@sham-jadhav03

@sham-jadhav03 sham-jadhav03 commented Jul 23, 2026

Copy link
Copy Markdown

What

Fixed the disable-report-problem to submit dialog submit button behavior in the settings UI so that users cannot submit empty problem reports.

Why

Fixes #2938

How

  • Added validation check summary.trim().length > 0 && details.trim().length > 0 to determine canSubmit.
  • Updated the primary action button to be disabled (disabled={!canSubmit}) when required fields are empty.
  • Added a guard clause in the submit handler (if (!canSubmit) return;) to prevent accidental or forced form submission.

Testing

  • Verified locally in the renderer settings dialog that the Submit button remains disabled until both summary and details inputs contain text.
  • Ran npx tsc -p frontend/tsconfig.json --noEmit and confirmed zero TypeScript errors.

Checklist

@somewherelostt

Copy link
Copy Markdown
Collaborator

Thanks for contributing to Agent Orchestrator.

This PR is being picked up by the current external contributor on-call pair:

If someone is already working on this, please continue as usual.
The on-call pair is added for visibility, tracking, and support, not to take over the work.
If you need help with review, direction, reproduction, or next steps, please tag @illegalcall and @Pulkit7070 here.

For faster context or live questions, you can also join the AO Discord.

Join the session here:
https://discord.gg/H6ZDcUXmq

Come by if you want to see what is being built, ask questions, or just hang around with the community.

@sham-jadhav03
sham-jadhav03 force-pushed the fix/disable-report-problem-submit branch from 88a8e44 to c6dbf5a Compare July 24, 2026 03:28
@sham-jadhav03

Copy link
Copy Markdown
Author

Hi @illegalcall @Pulkit7070,

I have resolved the merge conflicts with main and pushed the updated commits (c6dbf5a and c1570f4).

  • Verified all TypeScript typechecks pass cleanly (npx tsc -p frontend/tsconfig.json --noEmit).
  • Confirmed that the "Report Problem" submit button validation logic functions as expected.

Could you please take a look and re-review when you get a chance? Thanks!

Comment thread frontend/src/renderer/components/settings/ReportProblemDialog.tsx
@sham-jadhav03

Copy link
Copy Markdown
Author

Hi @Pulkit7070,

I have added the regression unit test in ReportProblemDialog.test.tsx (831c87f).

It asserts that:

  • Primary action (Copy & Create GitHub Issue) is disabled when both summary & details fields are empty.
  • Primary action remains disabled when only one of the fields is filled.
  • Primary action becomes enabled once both fields contain non-empty text.

All unit tests pass cleanly locally. Could you please re-review when free? Thanks!

@sham-jadhav03 sham-jadhav03 left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi team/reviewers,

I have updated the PR to ensure proper submit button state handling in ReportProblemDialog.tsx.

Summary of Changes:

  • Button State Logic: The submit button in ReportProblemDialog is now correctly disabled when required fields (like problem description/details) are empty or invalid, preventing premature submission.
  • Unit Tests Added: Added/updated unit tests in ReportProblemDialog.test.tsx to cover edge cases, verifying that the submit button properly toggles its disabled state based on input validation.
  • Verification: Ran npx tsc --noEmit and component tests locally; all tests pass cleanly with 0 errors.

Please take a look and re-review when you get a chance. Thanks!

@sham-jadhav03
sham-jadhav03 marked this pull request as draft July 25, 2026 04:37
@sham-jadhav03
sham-jadhav03 marked this pull request as ready for review July 25, 2026 04:38
@sham-jadhav03

Copy link
Copy Markdown
Author

Hi @Pulkit7070 @illegalcall,

I have updated the PR to ensure proper submit button state handling in ReportProblemDialog.tsx.

Summary of Updates:

  • Button Validation Logic: Fixed canSubmit logic (summary.trim() && details.trim()) so the primary action is properly disabled until both fields contain text.
  • Unit Tests Added: Added regression tests in ReportProblemDialog.test.tsx using jest.fn(); all unit tests pass cleanly.
  • Verification: Ran typecheck (npx tsc) and prettier formatting; everything is passing with 0 errors.

Please take a look and re-review when you get a chance. Thanks!

@illegalcall

Copy link
Copy Markdown
Collaborator

The new canSubmit condition correctly requires both Title and What happened, but the existing destination-flow test still uses the old title-only behavior.

For example, in GlobalSettingsForm.test.tsx the Discord path currently:

  1. Enters only Title.
  2. Leaves What happened? empty.
  3. Selects Discord and clicks the primary action.
  4. Expects writeText to have been called.

With this change, canSubmit remains false, so the button is disabled and the clipboard/navigation side effects correctly do not run. This is why the Frontend test fails at the writeText assertion.

The production validation does not need to be weakened. The test should instead:

  • Fill both Title and What happened? before the Discord submission.
  • After the successful Discord submission clears both fields, keep the assertion that the Email action is disabled.
  • Fill both fields again before testing the Email submission and its side effects.

It would also be useful for the focused dialog test to include whitespace-only values, since the intended boundary is based on trim().

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.

Report a problem: disable primary action until both Summary and Details are filled

4 participants