As a user, I want to see the history of the cities that I have searched for.

As a user, I want to click on the history search item to fetch the weather data for that city.

As a user, I want to be able to remove history search item(s).

Technical Requirements

  1. Design storage for selected cities
  2. Search History
  3. (Optional) UNDO button for delete
    1. don’t save untill UNDO timer elapsed
      • advantages:
        • simplest solution
      • downsides:
        1. if page closed - undo doesn’t apply
          • alert on page closing if UNDO is timer up? Notion and Gmail use this approach
        2. what if state changed while undo timer was active
          • record to delete not exist anymore - history list overflow (10max)
            • and then this record was again added (we don’t want to UNDO it now)
              • we need ID for it
                • maybe use react useId
    2. ✅ instant delete, UNDO as re-create action
      • advantages:
        • works for page close/reload
        • works for state changed while timer was active
      • downsides:
        • how to revert order in history?
          • its okayish to ignore order if state changed and push as new element