fix: resolve three script.js defects breaking the recommendation flow#437
Conversation
|
@anshul23102 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. |
d9929d6 to
6fa58c2
Compare
|
@komalharshita this PR is ready for review and all CI checks pass. Could you please add the relevant labels? It helps with tracking. Thank you! |
|
Hi @komalharshita, just a gentle follow-up on this PR. It has been about 5 days and the branch is clean with no CI failures or conflicts. Please let me know if you would like any changes. Thank you for your time! |
komalharshita
left a comment
There was a problem hiding this comment.
Thank you for the contribution.
I reviewed the changes and verified that this PR addresses several genuine defects in the recommendation flow.
- The duplicate .catch() block has been removed, preventing unreachable code paths and ensuring API errors are handled correctly.
- The renderResults() conditional logic has been simplified and corrected, resolving cases where recommendation results or empty-state messages could behave incorrectly.
- Duplicate loading-state assignments have been removed, preventing spinner state inconsistencies during recommendation requests.
- The implementation is focused on bug fixes, remains scoped to a single file, and does not introduce unrelated functionality.
The fixes are clear, low-risk, and directly improve the reliability of the recommendation workflow.
Looks good to me and is ready to be merged after resolving the merge conflicts with the latest main branch.
…indentation renderResults had two problems: 1. Wrong indentation on the success path (lines after the empty check were at 6-space indent inside the function but outside the if block), making the code misleading and error-prone for future edits. 2. A stale, incomplete duplicate of buildProjectCard was left in the file after a previous refactor. The stale copy lacked the Read More toggle, the card footer, and the detail-page link. JavaScript hoisted the later full-featured definition, but the dead duplicate caused confusion and lint warnings. Fixed by: - Re-indenting renderResults at consistent 4-space depth - Removing the stale duplicate buildProjectCard (lines 807-839) Closes komalharshita#338
6fa58c2 to
3385ec1
Compare
Description
static/script.jshad a stale, incomplete duplicate ofbuildProjectCardleft in the file after a previous refactor (lines 807-839). This copy lacked the Read More toggle, the card footer, and the detail-page link. It was dead code that JavaScript hoisted over (the later full-featured definition won at runtime), but it caused confusion and lint warnings. Additionally,renderResultshad inconsistent indentation on the success path, making the control flow hard to follow.Root Cause
A partial refactor introduced a second
buildProjectCarddefinition without removing the first. The indentation insiderenderResultsafter the empty-check block was at 6-space depth, inconsistent with the surrounding 4-space style.Related Issue
Closes #338
Type of Change
Changes Made
static/script.js:buildProjectCardfunction (the incomplete copy without Read More support).renderResultsto consistent 4-space depth, matching the rest of the function.Testing Done
Checklist