feat: implement address management components and functionality#396
feat: implement address management components and functionality#396Abhishek-Punhani wants to merge 6 commits intoshopstr-eng:mainfrom
Conversation
|
@Abhishek-Punhani is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
0ef250f to
adc4620
Compare
arnavkirti
left a comment
There was a problem hiding this comment.
Thanks for the solid work on this PR - Would like to point out some things:
- Please confirm that we validate all required fields (
name,address,city,state,zip,country) both on the client and at the boundary where these are sent to the backend. - Consider what happens if
ziporcountryare missing or malformed (especially for non‑US addresses) and add tests to cover these edge cases. isDefaultis a boolean onSavedAddress, but there is no obvious guard to ensure only one address can be default at a time.- Can you add logic (and tests) to ensure we never end up with multiple defaults, and clarify the behavior when the current default is deleted?
- Please double‑check that all interactive elements in the Address picker / management UI are keyboard accessible and have appropriate ARIA labels where needed.
- If we are showing destructive actions (like delete), a confirmation step or undo pattern would be helpful to prevent accidental loss of an address.
- it would be good to have a few focused tests on:
- Rendering of saved addresses list.
- Creating a new address and setting it as default.
- Editing/deleting an existing address.
- Ensuring only one default address after updates.
Ensuring one default address and destructive action modal is there already, could you once pull the changes and test it before suggesting |
|
Handling the pin codes and duplicate checks , ARIA, these I will handle in another PR |
There was a problem hiding this comment.
-
Can you fix the saved-address default handling. Right now updating/saving an existing default address can leave the address book with no default at all. We should always preserve exactly one default address.
-
Also, Please update the helper tests to use the real saved-address helpers with mocked
localStorageinstead of re-implementing the logic inside the test file. As written, the tests can still pass even when the actual helper behavior is wrong.
Once those are fixed, ping me again and I’ll re-review.
- Add AddressPicker component for selecting and managing saved addresses. - Enhance PreferencesPage to include address management features. - Add unit tests for saved address helper functions. - Update local storage helper functions to manage saved addresses. - Define SavedAddress type in typescript types. Signed-off-by: Abhishek-Punhani <[email protected]>
…ress Signed-off-by: Abhishek-Punhani <[email protected]>
…s in preferences Signed-off-by: Abhishek-Punhani <[email protected]>
…nd improving error handling
adc4620 to
cf597f7
Compare
Implemented address management components and functionality
Description
AddressPickercomponent for selecting and managing saved addresses.Use Saved Addressin cart view to use saved address during checkout.Resolved or fixed issue
Fixes #374
Screenshots (if applicable)
2026-04-10.23-17-11.mp4
Affirmation