DevPath icon indicating copy to clipboard operation
DevPath copied to clipboard

[Bug]: Manual comma-separated skills are preserved as one JSON-array token

Open eshaanag opened this issue 5 months ago • 6 comments

What happened?

Typed comma-separated skills are treated differently from the older plain string input path.

While checking the recommendation form, I noticed that static/script.js now sends selected skills as a JSON array:

skills: JSON.stringify(selectedSkills)

That works for normal single-skill chips, but if a user types HTML, CSS manually and presses Enter, window.addSkill() stores it as one selected skill. The backend then receives:

["HTML, CSS"]

In utils/recommender.py, parse_skills() preserves JSON array entries as-is:

raw_skills = [s.strip().lower() for s in parsed if isinstance(s, str) and s.strip()]

So the parsed skill becomes:

["html, css"]

instead of:

["html", "css"]

That lowers recommendation accuracy because projects store these as separate skills in data/projects.json.

I verified the behavior locally from the current code:

parse_skills('["HTML, CSS"]')
# ['html, css']

For a project with ["HTML", "CSS"], the score changes from 11.0 with the legacy comma-separated path to 5.0 with the JSON-array path.

Steps to reproduce

  1. Open the DevPath homepage.
  2. Type HTML, CSS into the skills input manually.
  3. Press Enter so it becomes one selected skill chip.
  4. Select Beginner, Web, and Low.
  5. Submit the form.
  6. Compare backend parsing with:
from utils.recommender import parse_skills

print(parse_skills('["HTML, CSS"]'))
print(parse_skills("HTML, CSS"))

Expected behaviour

The JSON-array input path should normalize comma-separated manual entries the same way the legacy string path does.

For example:

parse_skills('["HTML, CSS"]')

should behave like:

parse_skills("HTML, CSS")

so recommendation scoring sees html and css as separate skills.

Area of the app affected

Homepage form

Python version

3.9+

Operating system

macOS / Linux / Windows

Relevant error output or logs

parse_skills('["HTML, CSS"]') -> ['html, css']
parse_skills("HTML, CSS")    -> ['html', 'css']

Before submitting

  • [x] I searched existing issues and this has not been reported before.
  • [x] I can reproduce this bug consistently with the steps above.
  • [x] I am running the latest version of the main branch.

eshaanag avatar Jun 08 '26 03:06 eshaanag

Thank you for opening your first issue in DevPath.

Please make sure to:

  • Read CONTRIBUTING.md
  • Wait for assignment before starting work
  • Follow repository guidelines carefully

Happy contributing.

github-actions[bot] avatar Jun 08 '26 03:06 github-actions[bot]

Hi @komalharshita i would like to work on this issue under GSSOC 2026. could you please assign this issue to me ?

geetanunakani avatar Jun 08 '26 04:06 geetanunakani

/claim under GSSoC'26 contributions

srividrumavangara avatar Jun 08 '26 09:06 srividrumavangara

/assign

nensii21 avatar Jun 08 '26 10:06 nensii21

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

github-actions[bot] avatar Nov 10 '26 08:11 github-actions[bot]

This issue was closed because it has been inactive for an extended period. If this issue is still relevant, feel free to reopen it or create a new one.

github-actions[bot] avatar Nov 17 '26 08:11 github-actions[bot]