Skip to content

fix(web): add input validation and fix infinite loading in Text_Input… - #682

Closed
yashinrush wants to merge 1 commit into
AOSSIE-Org:mainfrom
yashinrush:fix/608-text-input-validation-loading
Closed

yashinrush wants to merge 1 commit into
AOSSIE-Org:mainfrom
yashinrush:fix/608-text-input-validation-loading

Conversation

@yashinrush

@yashinrush yashinrush commented Nov 7, 2026 •

Copy link
Copy Markdown

Summary of Changes:

Fixes an issue where submitting without input triggered an infinite loading state that froze the UI, and adds proper input validation and user feedback.

  • Defensive Validation: Checks text.trim() and docUrl.trim() before triggering loading state; shows user-friendly error notification if both are missing.
  • Prevent Infinite Loading: Wraps submission handling in try ... finally blocks to ensure setLoading(false) is always reached.
  • Question Counter Limits: Prevents numQuestions from decrementing below 1.
  • Clipboard Integration: Connects the clipboard icon button in textarea to navigator.clipboard.readText().
  • Error Feedback: Added an inline dismissible error banner for validation and backend communication errors.

Addressed Issues:

Fixes #608

AI Usage Disclosure:

  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: Google Gemini (Antigravity)

Checklist:

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

…AOSSIE-Org#608)

- Validate educational content and doc URL before setting loading state
- Ensure setLoading(false) is always executed via try/finally
- Display user-friendly error notifications on validation or API failures
- Enforce question counter lower bound of 1
- Add paste handler for textarea clipboard button
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@yashinrush yashinrush closed this Nov 7, 2026
@yashinrush yashinrush reopened this Nov 7, 2026
@yashinrush yashinrush closed this Nov 7, 2026
@yashinrush
yashinrush deleted the fix/608-text-input-validation-loading branch November 7, 2026 10:20
@gitcordapp

gitcordapp Bot commented Nov 7, 2026

Copy link
Copy Markdown

Link your account with Gitcord

Thanks for opening this PR, @yashinrush!

To receive Discord notifications and contributor tracking for this organization:

  1. Join Discord: https://discord.gg/hjUhu33uAn
  2. In Discord, run /link yashinrush
  3. Paste the verification code into your GitHub bio (or a public gist)
  4. Click Verify in Discord (or run /verify-link yashinrush)

Once linked, Gitcord can notify you about reviews, merges, and more.

— Posted by Gitcord

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.

[BUG]: Fix input validation and prevent unnecessary API calls in Text_Input.jsx

1 participant