Add and remove itinerary days from the hotspot modal - #60
Open
nleiby wants to merge 3 commits into
Open
Conversation
Locations could only be scheduled from the itinerary page. The hotspot modal now has a day picker, with a checkbox per day so the same control schedules and unschedules. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
Frees room in the action row, which no longer fits once the itinerary control is present, and puts the source link with the numbers it sourced. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A day count says nothing useful; the date the hotspot is scheduled for is the thing worth seeing without opening the menu. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Locations can currently only be scheduled from the itinerary page, and it can be hard to remember which hotspots are geographically close when you're on the itinerary page and can't see the map.
This PR adds a day picker to the hotspot modal, so when you find a hotspot on the map you can put it on a day without navigating away.
The trigger sits with Save / Directions / eBird, and reads "Itinerary" or "On 2 days" depending on state. Inside is a
DropdownMenuCheckboxItemper day, labelledDay 2 · Tue, Sep 8. Checking schedules the hotspot, unchecking removes it — one control for both, which also means the menu doubles as an at-a-glance view of where the hotspot already sits, and the menu stays open so you can set several days in one go.The control only appears for a saved hotspot on a trip that has dates. Unsaved hotspots are excluded because the itinerary references
trip.hotspotsby id, so scheduling one would render as "Unknown Location"; a trip with no date range has no days to offer.Notes:
pages/[tripId]/itinerary.tsxintogetTripDays()inlib/itinerary.tsand used it in both places. The modal needs it to build the virtual day ids, to senddayIdsso the server can densify, and to apply the optimistic cache update against a day that may not be persisted yet.itineraryarray — the case where every day id is virtual. Adding to<tripId>-d1correctly densifies all three days server-side and lands the location on day 2; removing clears it.useTripMutationwith optimisticupdateCacheplusreconcileon the server's returned itinerary. Because the URL contains the day id, each day renders a small component with its own mutations rather than one mutation with a computed URL — happy to restructure if you'd rather see that done differently.