feat: add Share My Result button with pre-filled URL (#411)#508
feat: add Share My Result button with pre-filled URL (#411)#508Lost-glitched wants to merge 5 commits into
Conversation
|
@Lost-glitched 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. |
komalharshita
left a comment
There was a problem hiding this comment.
Thanks for the feature contribution — the shareable URL functionality is a nice UX improvement and the clipboard fallback handling is thoughtfully implemented.
However, I’m requesting a few changes before this can be merged:
- There is duplicated conditional logic inside
renderResults():
if (!projects || projects.length === 0)appears multiple times consecutively in the modified section. This introduces unnecessary repetition and makes the flow harder to maintain. Please consolidate the empty-state handling into a single block.
- Query parameters are inserted directly into the UI without validation/sanitization. Since values come from the URL, please validate or sanitize:
skillslevelinteresttime
before using them in form autofill or rendering logic.
- The shared URL can become excessively long when many skills are selected because all skills are appended directly into query params:
params.set("skills", skillsHidden.value.trim());Please add a reasonable limit or encoding strategy to avoid oversized URLs.
- Auto-triggering form submission on page load:
form.dispatchEvent(new Event("submit", { cancelable: true }));can create unexpected API calls immediately after opening a shared link. Consider requiring explicit user interaction or adding a loading guard/debounce.
- The added test only checks for status code
200and does not validate the actual share/autofill behavior. Please add stronger coverage for:
- query param parsing,
- skill autofill,
- and auto-submit behavior.
Once these are addressed, the feature will be much more robust and maintainable. 🚀
|
@resolve the merge conflicts |
…cap URL, replace auto-submit with banner
|
All 5 review points addressed. 37/37 tests pass. Ready for re-review |
|
Looks safe to merge...but merge conflicts still exist @Lost-glitched |
Summary
Added a "Share My Result" button to the results page that builds a
pre-filled URL from the user's current form selections and copies it
to the clipboard. When someone opens a shared URL, the form auto-fills
and results render automatically. Purely frontend — no backend changes.
All new JS is ES5-compatible per CONTRIBUTING.md.
Related Issue
Closes #411
Type of Change
What Was Changed
static/script.jstemplates/index.htmlstatic/style.csstests/test_basic.pyCHANGELOG.mdHow to Test This PR
Expected test output:
Test Results
31 passed, 0 failed out of 31 tests
Screenshots
Self-Review Checklist
Notes for Reviewer
The existing script.js already uses ES6+ (const, let, arrow functions)
despite CONTRIBUTING.md requiring ES5. All new code in this PR strictly
follows ES5 — var declarations, function expressions only. The existing
violations were not touched as they are out of scope.