Skip to content

feat: allow deselecting selected skill chips by clicking again#69

Merged
komalharshita merged 3 commits into
komalharshita:mainfrom
peeyoush:feat/skill-chip-toggle
May 17, 2026
Merged

feat: allow deselecting selected skill chips by clicking again#69
komalharshita merged 3 commits into
komalharshita:mainfrom
peeyoush:feat/skill-chip-toggle

Conversation

@peeyoush
Copy link
Copy Markdown
Contributor

Summary [required]

This PR improves the skill selection interaction on the homepage by allowing already-selected popular skill chips to be deselected when clicked again.

Previously, users could only remove a selected skill by clicking the small “×” button inside the selected tag. This change makes the interaction more intuitive and touch-friendly, especially on smaller screens or during quick interactions.

The existing UI and remove button behavior remain unchanged — this update only improves the interaction logic and keeps the selected chip state synchronized properly.

Related Issue [required]

Closes #28

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Feature — adds new functionality
  • Data — adds new projects to data/projects.json
  • Documentation — updates docs, README, or code comments only
  • Style — CSS or visual changes only, no logic change
  • Refactor — restructures code without changing behaviour
  • Test — adds or updates tests

What Was Changed [required]

File Change made
static/script.js Added toggle-based select/deselect behavior for popular skill chips
static/script.js Synchronized active chip state with selected skills
static/script.js Added case-insensitive matching for skill selection/removal consistency

How to Test This PR [required]

  1. Clone this branch:
    git checkout feat/skill-chip-toggle

  2. Install dependencies:
    pip install -r requirements.txt

  3. Run the app:
    python app.py

  4. Open:
    http://127.0.0.1:5000

  5. Verify the following:

    • Clicking a popular skill chip selects it
    • Clicking the same selected chip again deselects it
    • Deselected chips return to their inactive/default styling
    • Removing a skill using the “×” button still works correctly
    • Typing a skill manually still synchronizes the chip active state correctly
    • Duplicate skills are not added
  6. Run the tests:
    python tests/test_basic.py

Expected test output:

27 passed, 0 failed out of 27 tests

Test Results [required]

Screenshot 2026-05-15 105620
paste output here

Screenshots (if UI change)

Before After

|
previous
|
updated
|

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

Ran flake8 . locally and observed several existing linting issues in unrelated repository files. No new linting issues were introduced by this PR.

This PR is scoped only to the skill chip interaction enhancement in static/script.js.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

@peeyoush 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.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

@peeyoush
Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict issues after syncing with the latest main branch and re-verified the skill chip toggle behavior locally.

Verified flows:

  • chip select/deselect
  • active state synchronization
  • Enter key handling
  • duplicate prevention
  • × button removal flow

Copy link
Copy Markdown
Owner

@komalharshita komalharshita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the thoughtful implementation and for keeping the changes cleanly scoped to the skill chip interaction logic.

I reviewed the behavior carefully, including the toggle handling, duplicate prevention, and synchronization flow. The updated interaction feels much more intuitive, especially for touch/mobile usage, while preserving the existing remove-button functionality.

The implementation is well-contained, avoids unnecessary file changes, and the conflict resolution/update verification was handled properly.

Approved for merge.

@komalharshita komalharshita merged commit 175560b into komalharshita:main May 17, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Allow deselecting selected skill chips by clicking them again

2 participants