feat: add loading spinner during recommendation generation#34
Conversation
|
@Muskankr is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @komalharshita , I re-tested the loading state flow and verified that the spinner, disabled button state, and recommendation rendering are working correctly across desktop and mobile views. All CI checks are passing successfully. Please let me know if any refinements are needed. Thank you for your review! |
komalharshita
left a comment
There was a problem hiding this comment.
Thank you for the contribution. The loading spinner feature and disabled-button UX improvements are valuable additions and the overall user experience direction is good.
However, this PR currently includes several issues that need to be resolved before it can be approved:
-
The PR contains a large number of unrelated formatting-only changes in
templates/index.htmlandstatic/script.js. Please keep the PR focused only on the loading spinner functionality to make review and maintenance easier. -
The following artificial delay should be removed:
setTimeout(function () {
res.json().then(resolve);
}, 3000);This intentionally slows down starter code loading by 3 seconds and negatively affects production UX.
-
The additional 500ms timeout around recommendation rendering should also be removed or significantly reduced unless there is a strong technical reason for it.
-
Please remove unnecessary debug logging such as:
console.error(...)Once the unrelated formatting changes and artificial delays are removed, this PR will be much closer to merge-ready.
|
Thanks for the detailed review. I’ve made the requested changes:
The PR now strictly focuses only on the loading spinner functionality and related UX improvements. All CI checks are passing locally after the fixes. Please let me know if anything else needs adjustment. Thanks again for the review! |
|
@Muskankr please resolve the conflicts before merging |
|
@komalharshita, Resolved Conflicts |
komalharshita
left a comment
There was a problem hiding this comment.
Thanks for working on this feature — the loading spinner UX improvement is a valuable addition and the accessibility improvements are appreciated.
However, this PR is not merge-ready yet because there are several unresolved duplicate/conflict artifacts remaining after the merge resolution.
Issues that still need cleanup
- Duplicate fetch/request handling logic remains in
static/script.js setLoadingState()contains duplicated display assignments- Empty-state rendering logic is duplicated
- Multiple SVG/icon blocks in
templates/index.htmlappear duplicated - Some SVG markup appears malformed due to incomplete conflict cleanup
Examples include:
- duplicated
btnLabel.style.display/btnLoading.style.display - duplicated icon SVGs in hero/features sections
- overlapping request logic around the loading spinner implementation
Please clean up the duplicated sections and verify the final rendered UI before requesting review again.
The feature direction itself looks good — this mainly needs proper conflict cleanup and final polishing before merge.
|
Hi @komalharshita, I’ve cleaned up the remaining conflict artifacts and duplicate sections mentioned in the review. Changes made:
The PR is now focused only on the loading spinner UX improvements and related accessibility behavior. Please review again when possible. Thank you! |
|
@Muskankr sync your branch with the latest main branch |
|
@komalharshita, I did as you said. |
Summary [required]
This PR improves the recommendation generation experience by adding a clear loading state while projects are being fetched from the API. Users now receive immediate visual feedback after submitting the form through a loading spinner and updated button text, while the submit button is temporarily disabled to prevent duplicate submissions. The loading state is automatically restored once recommendations are displayed or if an error occurs, making the interaction smoother and more user-friendly.
Related Issue [required]
Closes #17
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
static/script.jsstatic/style.csstemplates/index.htmlHow to Test This PR [required]
Clone this branch:
git checkout feat/loading-spinnerInstall dependencies:
pip install -r requirements.txtRun the app:
python app.pyOpen:
http://127.0.0.1:5000Fill the recommendation form with:
Click Generate My Projects
Verify that:
Test Results [required]
Screenshots (if UI change)
Before

After

Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/Notes for Reviewer
The implementation keeps the existing recommendation flow intact while improving the user experience with lightweight visual feedback during API requests.
Thanks for reviewing my PR!