fix: disable delete/reset buttons when all waypoints are empty regard…#383
fix: disable delete/reset buttons when all waypoints are empty regard…#383rohhann12 wants to merge 4 commits intovalhalla:masterfrom
Conversation
|
Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/383 |
nilsnolde
left a comment
There was a problem hiding this comment.
please make sure there's some github PR hygiene in place, like a proper non-overflowing title. and if this is for GSoC, I'd give you the benefit of the doubt, as nothing here suggests AI usage. in future PRs just do note that anyways pls, even the guidelines don't explicitly say so..
other than that, LGTM, thanks!
|
Thanks for the review! will make sure of the points mentioned. The failing test is because my disabled condition doesn't account for when extra waypoints have been added.The test adds a 3rd empty waypoint and then tries to reset back to 2 — which is a valid use case, but my condition I'll fix it by updating the condition to: Will push the fix shortly. |
|
mistake- pushed a wrong commit here , will clean it up |
This reverts commit 208fbf3.
|
fixed it @nilsnolde |
…less of order
Closes #382
🛠️ Fixes Issue
Minor ux Bug: Shuffling the waypoints enables the delete and reset waypoint buttons, though no location is added in the waypoints.
Changed the logic of how the disabling those buttons were working
👨💻 Changes proposed
instead of comparing waypoints against defaultWaypoints via JSON.stringify (which breaks on reorder), we simply check if every waypoint's userInput is empty.
In both the files-
-src/components/directions/waypoints/waypoint-item.tsx
I changed the logic of disabling the button instead comparing the waypoints against the default , now we simply check if they are empty.
📄 Note to reviewers
📷 Screenshots
1CC38228-E72E-4A99-909B-57CFEB1C823F.mov