Fix: add Read more toggle to expand truncated project descriptions#286
Conversation
|
Someone 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. |
|
can you please look into this pr @komalharshita, thank you |
|
@Kr1491 resolve the merge conflicts |
|
Hi @komalharshita , I have resolved the merge conflicts. Please review when you get a chance. Thank you! |
|
Hi @komalharshita can you please merge this pr, I have resolved the conflicts, thank you |
|
@komalharshita, resolved the conflicts can you please merge this pr, thank you |
komalharshita
left a comment
There was a problem hiding this comment.
Good UX improvement overall — the feature solves a real readability issue for longer project descriptions and the implementation is fairly clean/scoped.
However, a few improvements are needed before merge:
- Avoid using
desc.textContent = ...together with repeatedlyappendChild(readMoreBtn). UpdatingtextContentremoves child nodes and forces the button to be recreated in the flow each toggle. - Separate the description text and toggle button into different elements for cleaner DOM handling.
- Add accessibility support (
aria-expanded) to the button. - Verify layout/card-height behavior after expansion since the original truncation existed for visual consistency.
Once these are addressed, this should be good to merge.
|
Hi @komalharshita , I have addressed all the requested changes: |
|
Also requesting level:intermediate label as the implementation required refactoring the DOM structure, fixing a textContent/appendChild conflict, and adding accessibility support as per the review feedback. |
|
Hi @komalharshita can you please look into this, I have made all the requested changes |
|
please merge this pr, I have addressed all the requested changes, also resolved the conflicts |
|
@komalharshita please look into this pr once, |
komalharshita
left a comment
There was a problem hiding this comment.
Thanks for addressing the requested changes.
I verified the updated implementation and the previous concerns have been resolved:
• Description text and toggle button are now separated into distinct elements.
• The textContent + appendChild issue has been fixed.
• aria-expanded support has been added for accessibility.
• The Read More button is only rendered when truncation actually occurs.
• Overall DOM handling is cleaner and more maintainable.
The implementation now looks good and achieves the intended UX improvement without the structural issues noted in the previous review.
Please resolve the remaining merge conflicts with the latest main branch and this PR should be ready to merge.
|
@komalharshita conflicts resolved, |
|
Okay! Approved for merge.... |
|
@komalharshita please give appropriate tags like difficulty and quality, or else i am just going to get base points |
Summary [required]
Added a "Read More" / "Read Less" toggle button to project cards on the recommendation results page. When a project description is longer than 120 characters, it is truncated and a "Read more" button appears. Clicking it expands the full description inline without navigating away. Clicking again collapses it back.
Related Issue [required]
Closes #181
Type of Change [required]
data/projects.jsonWhat Was Changed [required]
static/script.jsstatic/style.cssHow to Test This PR [required]
git checkout fix/read-more-togglepip install -r requirements.txtpython3 app.pyTest Results [required]
No backend tests affected. This is a frontend-only change to static/script.js and static/style.css.
Screenshots (if UI change)
|


|
|
Self-Review Checklist [required]
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 27 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer