Add clear input button to reset text form - #674
Conversation
Added a clear button in the text input section to allow users to quickly remove entered content.
📝 WalkthroughWalkthrough
ChangesText input workflow
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (3)
eduaid_web/src/pages/Text_Input.jsx (3)
219-228: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winGeneration failures are silent for the user.
If
apiClient.postthrows, the code logs to the console, clearsloading, 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
errorMessagenear 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 winGive the textarea a label and a placeholder.
The textarea has no
aria-label, no associated<label>, and noplaceholder. 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 valueBit of leftover code to tidy up.
With the controls removed, these are all unreachable now:
Switchimport fromreact-switch(line 7)fileContent/setFileContent(line 22), never read or writtentoggleSwitch(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
📒 Files selected for processing (1)
eduaid_web/src/pages/Text_Input.jsx
| 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"); | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
| }; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
File upload has two small gotchas.
- The input value is never cleared. If a user picks the same file twice,
onChangedoes not fire the second time and nothing happens. - If the response has neither
contentnorerror,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.
| 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) => { | ||
| }; |
There was a problem hiding this comment.
🩺 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.
| 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.
| 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"); |
There was a problem hiding this comment.
🗄️ 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.
| {/* 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> |
There was a problem hiding this comment.
🎯 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.
Link your account with GitcordThanks for opening this PR, @devmaster1987! To receive Discord notifications and contributor tracking for this organization:
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.
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
eduaid_web/src/pages/Text_Input.jsx
| <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)} | ||
|
|
||
| /> |
There was a problem hiding this comment.
🎯 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.
| <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.
| <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> |
There was a problem hiding this comment.
🎯 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.
| <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.
Added a clear button in the text input section to allow users to quickly remove entered content.
Summary by CodeRabbit
New Features
Bug Fixes
UI Changes