Skip to content

Add clear input button to reset text form - #674

Open
devmaster1987 wants to merge 2 commits into
AOSSIE-Org:mainfrom
devmaster1987:main
Open

Add clear input button to reset text form#674
devmaster1987 wants to merge 2 commits into
AOSSIE-Org:mainfrom
devmaster1987:main

Conversation

@devmaster1987

@devmaster1987 devmaster1987 commented Aug 6, 2026

Copy link
Copy Markdown

Added a clear button in the text input section to allow users to quickly remove entered content.

Summary by CodeRabbit

  • New Features

    • Added clipboard paste support for input text.
    • Added file upload display with the selected filename.
    • Added controls for document URLs and uploaded files.
    • Generated question pairs continue to be saved and shown on the output page.
  • Bug Fixes

    • Prevented the question count from decreasing below one.
  • UI Changes

    • Updated page layout, labels, responsive behavior, and button styling.
    • Removed textarea scrollbar-hiding behavior.

Added a clear button in the text input section to allow users to quickly remove entered content.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Text_Input adds clipboard paste and clearing, tracks uploaded filenames, and preserves document retrieval and quiz generation. It removes quiz-history persistence, keeps question settings available, and reorganizes the page layout and navigation.

Changes

Text input workflow

Layer / File(s) Summary
Input actions and state
eduaid_web/src/pages/Text_Input.jsx
Adds clipboard paste, form clearing, uploaded-file name tracking, and a minimum question count of one.
Retrieval and generation flow
eduaid_web/src/pages/Text_Input.jsx
Retains document retrieval, question generation, local input storage, loading and error handling, QA-pair storage, and /output navigation. Removes quiz-history persistence.
Page controls and presentation
eduaid_web/src/pages/Text_Input.jsx
Reorganizes the textarea, upload controls, question settings, and Back and Next navigation. Displays the selected filename and removes scrollbar-hiding styles.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a clear input button that resets the text form.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (3)
eduaid_web/src/pages/Text_Input.jsx (3)

219-228: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Generation failures are silent for the user.

If apiClient.post throws, the code logs to the console, clears loading, and stops. No navigation happens and no message appears, so the user just sees the spinner vanish and assumes the button is broken. Add an error state and surface it in the UI.

🔧 Sketch
     } catch(error){
 
       console.error("Error:", error);
 
+      setErrorMessage("Could not generate questions. Please try again.");
+
 
     } finally {

Then render errorMessage near the Next button.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 219 - 228, Update the
generation error handling around apiClient.post to store a user-facing message
in an error state when the request fails, while retaining the existing console
logging and loading cleanup. Render that error state near the Next button so
failures visibly inform the user instead of only stopping the spinner.

332-340: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Give the textarea a label and a placeholder.

The textarea has no aria-label, no associated <label>, and no placeholder. Screen reader users get no idea what the field is for, and sighted users see an empty grey box.

♿ Suggested fix
           <textarea
 
             className="absolute inset-0 p-8 pt-6 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
 
+            aria-label="Content to generate questions from"
+
+            placeholder="Paste or type your content here"
+
             value={text}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 332 - 340, Add an
accessible label and a descriptive placeholder to the textarea in the text input
component. Associate a visible or screen-reader-accessible label with the
textarea using matching identifiers, and ensure the placeholder clearly
communicates what text users should enter.

7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Bit of leftover code to tidy up.

With the controls removed, these are all unreachable now:

  • Switch import from react-switch (line 7)
  • fileContent / setFileContent (line 22), never read or written
  • toggleSwitch (lines 28-30)
  • handleDifficultyChange, incrementQuestions, decrementQuestions (lines 154-166)

Give them the flick, or wire the controls back in. Keeping them around makes the component harder to follow.

Also applies to: 22-22, 28-30, 154-166

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` at line 7, Remove the unreachable
leftover controls code from the Text_Input component: delete the unused Switch
import, fileContent/setFileContent state, and the toggleSwitch,
handleDifficultyChange, incrementQuestions, and decrementQuestions functions.
Keep the remaining component behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@eduaid_web/src/pages/Text_Input.jsx`:
- Around line 210-216: Update the quiz-generation function around the qaPairs
localStorage write to also persist the generated quiz data under the
last5Quizzes key expected by Previous.jsx, preserving the existing history
behavior and Clear button functionality.
- Around line 16-17: Restore the user-configurable controls for difficulty,
question count, and the mediawiki toggle in the Text_Input component, or
initialize difficulty, numQuestions, and isToggleOn from the values stored by
the earlier step. Ensure the selected values continue reaching getEndpoint and
the backend so hard endpoints and non-default quiz settings remain available.
- Around line 299-301: Correct the heading text in the gradient span within
Text_Input to “Questionnaires,” preserving the existing styling and surrounding
markup.
- Around line 344-356: Update handleClearInput to reset the textarea value,
docUrl, and selected file state so Clear fully resets the form before
handleSaveToLocalStorage runs. Add type="button" to the Clear button, and add
sufficient bottom padding to the textarea while preserving its existing absolute
layout.
- Around line 323-340: Remove the unused clipboard button containing
FaClipboard, or make it functional by adding an accessible name, an onClick
handler that pastes clipboard text into the textarea state, and positioning it
above the textarea with appropriate stacking order and pointer interaction.
- Around line 85-153: Update handleSaveToLocalStorage to return immediately when
both docUrl and text are empty, before calling setLoading(true). Preserve the
existing document and text handling branches, ensuring loading state is only
enabled when one of them will execute.
- Around line 41-69: Update handleFileUpload to always clear the file input
value after processing so selecting the same file again triggers onChange, set
text using a string fallback when both data.content and data.error are absent,
and manage loading state for the full upload lifecycle, including errors and
completion.

---

Nitpick comments:
In `@eduaid_web/src/pages/Text_Input.jsx`:
- Around line 219-228: Update the generation error handling around
apiClient.post to store a user-facing message in an error state when the request
fails, while retaining the existing console logging and loading cleanup. Render
that error state near the Next button so failures visibly inform the user
instead of only stopping the spinner.
- Around line 332-340: Add an accessible label and a descriptive placeholder to
the textarea in the text input component. Associate a visible or
screen-reader-accessible label with the textarea using matching identifiers, and
ensure the placeholder clearly communicates what text users should enter.
- Line 7: Remove the unreachable leftover controls code from the Text_Input
component: delete the unused Switch import, fileContent/setFileContent state,
and the toggleSwitch, handleDifficultyChange, incrementQuestions, and
decrementQuestions functions. Keep the remaining component behavior unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f5e0c2d-4ee1-4d82-aaa7-786b74a0111d

📥 Commits

Reviewing files that changed from the base of the PR and between 2038116 and 5103c83.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Text_Input.jsx

Comment thread eduaid_web/src/pages/Text_Input.jsx Outdated
Comment on lines 41 to 69
const handleFileUpload = async (event) => {

const file = event.target.files[0];
if (file) {

if(file){

const formData = new FormData();

formData.append("file", file);

try {

try{

const data = await apiClient.postFormData("/upload", formData);

setText(data.content || data.error);
} catch (error) {


}catch(error){

console.error("Error uploading file:", error);

setText("Error uploading file");

}

}

};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

File upload has two small gotchas.

  1. The input value is never cleared. If a user picks the same file twice, onChange does not fire the second time and nothing happens.
  2. If the response has neither content nor error, setText(undefined) flips the textarea from controlled to uncontrolled and React will complain.

Also worth setting loading around the upload so the user gets feedback on a big PDF or MP3.

🔧 Suggested fix
   const handleFileUpload = async (event) => {
 
     const file = event.target.files[0];
 
     if(file){
 
       const formData = new FormData();
 
       formData.append("file", file);
 
 
       try{
 
+        setLoading(true);
+
         const data = await apiClient.postFormData("/upload", formData);
 
-        setText(data.content || data.error);
+        setText(data?.content ?? data?.error ?? "");
 
 
       }catch(error){
 
         console.error("Error uploading file:", error);
 
         setText("Error uploading file");
 
       }
+      finally{
+
+        setLoading(false);
+
+        event.target.value = "";
+
+      }
 
     }
 
   };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 41 - 69, Update
handleFileUpload to always clear the file input value after processing so
selecting the same file again triggers onChange, set text using a string
fallback when both data.content and data.error are absent, and manage loading
state for the full upload lifecycle, including errors and completion.

Comment thread eduaid_web/src/pages/Text_Input.jsx Outdated
Comment on lines +85 to +153
const handleSaveToLocalStorage = async()=>{

setLoading(true);

// Check if a Google Doc URL is provided
if (docUrl) {
try {
const data = await apiClient.post("/get_content", { document_url: docUrl });

if(docUrl){

try{

const data = await apiClient.post(
"/get_content",
{
document_url:docUrl
}
);


setDocUrl("");

setText(data || "Error in retrieving");
} catch (error) {
console.error("Error:", error);


}catch(error){

console.error(error);

setText("Error retrieving Google Doc content");
} finally {


}finally{

setLoading(false);

}
} else if (text) {
// Proceed with existing functionality for local storage
localStorage.setItem("textContent", text);
localStorage.setItem("difficulty", difficulty);
localStorage.setItem("numQuestions", numQuestions);


}

else if(text){


localStorage.setItem(
"textContent",
text
);


localStorage.setItem(
"difficulty",
difficulty
);


localStorage.setItem(
"numQuestions",
numQuestions
);


await sendToBackend(
text,
difficulty,
localStorage.getItem("selectedQuestionType")
);


}
};

const handleDifficultyChange = (e) => {
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

The UI locks up if a user presses Next with nothing entered.

setLoading(true) runs before the branches. If docUrl is empty and text is empty, neither branch runs, so setLoading(false) is never called. The overlay stays up and the wrapper carries pointer-events-none (line 251), so the whole page becomes unusable until a reload.

Guard the empty case before you flip the spinner on.

🐛 Suggested fix
   const handleSaveToLocalStorage = async()=>{
 
+    if(!docUrl && !text.trim()){
+
+      return;
+
+    }
+
     setLoading(true);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleSaveToLocalStorage = async()=>{
setLoading(true);
// Check if a Google Doc URL is provided
if (docUrl) {
try {
const data = await apiClient.post("/get_content", { document_url: docUrl });
if(docUrl){
try{
const data = await apiClient.post(
"/get_content",
{
document_url:docUrl
}
);
setDocUrl("");
setText(data || "Error in retrieving");
} catch (error) {
console.error("Error:", error);
}catch(error){
console.error(error);
setText("Error retrieving Google Doc content");
} finally {
}finally{
setLoading(false);
}
} else if (text) {
// Proceed with existing functionality for local storage
localStorage.setItem("textContent", text);
localStorage.setItem("difficulty", difficulty);
localStorage.setItem("numQuestions", numQuestions);
}
else if(text){
localStorage.setItem(
"textContent",
text
);
localStorage.setItem(
"difficulty",
difficulty
);
localStorage.setItem(
"numQuestions",
numQuestions
);
await sendToBackend(
text,
difficulty,
localStorage.getItem("selectedQuestionType")
);
}
};
const handleDifficultyChange = (e) => {
};
const handleSaveToLocalStorage = async()=>{
if(!docUrl && !text.trim()){
return;
}
setLoading(true);
if(docUrl){
try{
const data = await apiClient.post(
"/get_content",
{
document_url:docUrl
}
);
setDocUrl("");
setText(data || "Error in retrieving");
}catch(error){
console.error(error);
setText("Error retrieving Google Doc content");
}finally{
setLoading(false);
}
}
else if(text){
localStorage.setItem(
"textContent",
text
);
localStorage.setItem(
"difficulty",
difficulty
);
localStorage.setItem(
"numQuestions",
numQuestions
);
await sendToBackend(
text,
difficulty,
localStorage.getItem("selectedQuestionType")
);
}
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 85 - 153, Update
handleSaveToLocalStorage to return immediately when both docUrl and text are
empty, before calling setLoading(true). Preserve the existing document and text
handling branches, ensuring loading state is only enabled when one of them will
execute.

Comment on lines +210 to 216
localStorage.setItem(
"qaPairs",
JSON.stringify(responseData)
);

let last5Quizzes =
JSON.parse(localStorage.getItem("last5Quizzes")) || [];
last5Quizzes.push(quizDetails);
if (last5Quizzes.length > 5) {
last5Quizzes.shift(); // Keep only the last 5 quizzes
}
localStorage.setItem("last5Quizzes", JSON.stringify(last5Quizzes));

navigate("/output");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Removing last5Quizzes leaves the Previous page empty.

This function now only writes qaPairs. But eduaid_web/src/pages/Previous.jsx:9-111 reads last5Quizzes from local storage to build the quiz history list, and it renders "No quizzes available" when that key is missing. With the write gone, the Previous page will stay empty for every quiz generated here, and its Clear button has nothing to clear.

If dropping quiz history is intentional, please remove or update Previous.jsx in the same PR so the two sides match. Otherwise, restore the last5Quizzes write alongside qaPairs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 210 - 216, Update the
quiz-generation function around the qaPairs localStorage write to also persist
the generated quiz data under the last5Quizzes key expected by Previous.jsx,
preserving the existing history behavior and Clear button functionality.

Comment thread eduaid_web/src/pages/Text_Input.jsx
Comment thread eduaid_web/src/pages/Text_Input.jsx Outdated
Comment thread eduaid_web/src/pages/Text_Input.jsx Outdated
Comment on lines +344 to +356
{/* Clear Button Added */}

<button

onClick={handleClearInput}

className="absolute bottom-3 right-3 bg-[#3e5063] text-white px-4 py-2 rounded-xl border border-[#cbd0dc80] hover:bg-[#526b82] transition"

>

Clear

</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear only resets the textarea, not the rest of the form.

The PR objective says the button resets the text form, but handleClearInput only calls setText(""). The Google Doc URL in docUrl and the selected file both stay put, so pressing Clear then Next still fires the Google Docs branch in handleSaveToLocalStorage. Please clear those too.

Two smaller things while you are in there:

  • Add type="button". It costs nothing and keeps the button safe if this markup is ever wrapped in a <form>.
  • The button sits on top of the textarea, which is absolute inset-0. Long text will run underneath it. A bit of bottom padding on the textarea fixes that.
🔧 Suggested fix
   // Clear Input Function
   const handleClearInput = () => {
     setText("");
+    setDocUrl("");
+    if (fileInputRef.current) {
+      fileInputRef.current.value = "";
+    }
   };
           {/* Clear Button Added */}
 
           <button
 
+            type="button"
+
             onClick={handleClearInput}
 
             className="absolute bottom-3 right-3 bg-[`#3e5063`] text-white px-4 py-2 rounded-xl border border-[`#cbd0dc80`] hover:bg-[`#526b82`] transition"
 
           >
 
             Clear
 
           </button>

And give the textarea room so the text does not slide under the button:

-            className="absolute inset-0 p-8 pt-6 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
+            className="absolute inset-0 p-8 pt-6 pb-16 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 344 - 356, Update
handleClearInput to reset the textarea value, docUrl, and selected file state so
Clear fully resets the form before handleSaveToLocalStorage runs. Add
type="button" to the Clear button, and add sufficient bottom padding to the
textarea while preserving its existing absolute layout.

@gitcordapp

gitcordapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Link your account with Gitcord

Thanks for opening this PR, @devmaster1987!

To receive Discord notifications and contributor tracking for this organization:

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

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

Posted by Gitcord

Implemented multiple improvements in the text input section:

- Restored difficulty selection, question count controls, and MediaWiki toggle functionality.
- Updated the clear button to reset the complete form state, including text, Google Doc URL, and file content.
- Added clipboard paste functionality to the clipboard button.
- Fixed clipboard button layering issue by making it clickable above the textarea.
- Added proper button types and improved textarea spacing for better usability.

These changes improve the user experience and maintain existing quiz generation functionality.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@eduaid_web/src/pages/Text_Input.jsx`:
- Around line 757-773: Update the Back navigation in Text_Input.jsx to use the
Link to="/question-type" as the sole interactive control: move the existing
button styling and text onto the Link, then remove the nested button while
preserving the navigation behavior and appearance.
- Around line 493-501: Update the textarea in the text input component so its
left padding is at least 48px, keeping the text clear of the clipboard button
while preserving the existing responsive styling and other textarea behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee7023ed-12b9-493d-a5f2-21186638b5c7

📥 Commits

Reviewing files that changed from the base of the PR and between 5103c83 and 6e66b1b.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Text_Input.jsx

Comment on lines 493 to 501
<textarea
className="absolute inset-0 p-8 pt-6 bg-[#83b6cc40] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
style={{ scrollbarWidth: "none", msOverflowStyle: "none" }}

className="absolute inset-0 p-8 pb-16 pt-6 bg-[#83b6cc40] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"

value={text}

onChange={(e) => setText(e.target.value)}

/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep textarea text clear of the clipboard button, mate.

The clipboard button occupies the top-left 48 px. The textarea starts text at 32 px from the left, so first-line text renders beneath the button. Increase the left padding or move the button outside the text area.

Proposed fix
- className="absolute inset-0 p-8 pb-16 pt-6 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
+ className="absolute inset-0 p-8 pl-16 pb-16 pt-6 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<textarea
className="absolute inset-0 p-8 pt-6 bg-[#83b6cc40] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
style={{ scrollbarWidth: "none", msOverflowStyle: "none" }}
className="absolute inset-0 p-8 pb-16 pt-6 bg-[#83b6cc40] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
value={text}
onChange={(e) => setText(e.target.value)}
/>
<textarea
className="absolute inset-0 p-8 pl-16 pb-16 pt-6 bg-[`#83b6cc40`] text-lg sm:text-xl rounded-2xl outline-none resize-none h-full overflow-y-auto text-white caret-white"
value={text}
onChange={(e) => setText(e.target.value)}
/>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 493 - 501, Update the
textarea in the text input component so its left padding is at least 48px,
keeping the text clear of the clipboard button while preserving the existing
responsive styling and other textarea behavior.

Comment on lines 757 to 773
<Link to="/question-type">
<button className="bg-black text-white text-lg sm:text-xl px-4 py-2 border-gradient rounded-xl w-full sm:w-auto">Back</button>


<button

type="button"

className="bg-black text-white text-lg px-4 py-2 border-gradient rounded-xl w-full"

>

Back

</button>


</Link>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use one interactive control for Back, mate.

Link renders an anchor. An anchor must not contain a button. The current markup creates two focusable controls for the same navigation action. Style the Link as the button instead.

Proposed fix
- <Link to="/question-type">
-   <button
-     type="button"
-     className="bg-black text-white text-lg px-4 py-2 border-gradient rounded-xl w-full"
-   >
-     Back
-   </button>
+ <Link
+   to="/question-type"
+   className="block bg-black text-white text-lg px-4 py-2 border-gradient rounded-xl w-full text-center"
+ >
+   Back
  </Link>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link to="/question-type">
<button className="bg-black text-white text-lg sm:text-xl px-4 py-2 border-gradient rounded-xl w-full sm:w-auto">Back</button>
<button
type="button"
className="bg-black text-white text-lg px-4 py-2 border-gradient rounded-xl w-full"
>
Back
</button>
</Link>
<Link
to="/question-type"
className="block bg-black text-white text-lg px-4 py-2 border-gradient rounded-xl w-full text-center"
>
Back
</Link>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@eduaid_web/src/pages/Text_Input.jsx` around lines 757 - 773, Update the Back
navigation in Text_Input.jsx to use the Link to="/question-type" as the sole
interactive control: move the existing button styling and text onto the Link,
then remove the nested button while preserving the navigation behavior and
appearance.

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.

1 participant