Skip to content

feat: fix waypoint duplication on panel reopen & improve delete button enablement#376

Closed
ritgit24 wants to merge 2 commits intovalhalla:masterfrom
ritgit24:waypoint-fixes
Closed

feat: fix waypoint duplication on panel reopen & improve delete button enablement#376
ritgit24 wants to merge 2 commits intovalhalla:masterfrom
ritgit24:waypoint-fixes

Conversation

@ritgit24
Copy link

Closes #270 & #365

🛠️ Fixes Issue

  • Waypoints piling up on sidebar upon closing and reopening : Opening/closing left panel repeatedly appended empty waypoints, causing duplicates.
  • Wrong Delete Waypoint enablement : Delete button on a waypoint was clickable even when that waypoint had no selected geolocation , if atleast one other waypoint was selected with a location.

Both the issues were potentially causing bad UX.

👨‍💻 Changes proposed

  • use-directions-queries.ts : Ensuring waypoint slots exist before writing placeholders (prevents duplicated waypoints on sidebar reopen) by making permalink reverse‑geocode idempotent.

  • waypoint-item.tsx : Only enable per‑waypoint Delete when that waypoint’s geocodeResults contains a selected result.

Test Updates

  • waypoint-item.spec.tsx , waypoints.spec.tsx , directions.spec.tsx : Tp align mocks/expectations with new behavior.

📷 Screenshots

Screenshot 2026-03-15 153835

@ritgit24 ritgit24 closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make the waypoint experience better by improving enabled/disabled logic

1 participant