diff --git a/frontend/src/lib/components/cards/LodgingCard.svelte b/frontend/src/lib/components/cards/LodgingCard.svelte index ec2c53f1..c643cb88 100644 --- a/frontend/src/lib/components/cards/LodgingCard.svelte +++ b/frontend/src/lib/components/cards/LodgingCard.svelte @@ -101,6 +101,7 @@ export let readOnly: boolean = false; export let itineraryItem: CollectionItineraryItem | null = null; export let showImage: boolean = true; + export let compact: boolean = false; let isWarningModalOpen: boolean = false; @@ -154,13 +155,17 @@ {/if}
{#if showImage}
- +
@@ -193,12 +198,22 @@ {/if}
{/if} -
+
{lodging.name} diff --git a/frontend/src/lib/components/collections/CollectionItineraryPlanner.svelte b/frontend/src/lib/components/collections/CollectionItineraryPlanner.svelte index 689c7733..3deefacf 100644 --- a/frontend/src/lib/components/collections/CollectionItineraryPlanner.svelte +++ b/frontend/src/lib/components/collections/CollectionItineraryPlanner.svelte @@ -576,6 +576,10 @@ return day.items.filter((item) => item.id !== day.boundaryLodgingItem?.id); } + function shouldShowOvernightSummary(day: DayGroup): boolean { + return day.overnightLodging.length > 0 && !day.boundaryLodgingItem?.resolvedObject; + } + function reinsertBoundaryLodgingItem( day: DayGroup, timelineItems: ResolvedItineraryItem[] @@ -1111,18 +1115,18 @@ targetPendingDate && !addedToItinerary.has(lodgingBeingUpdated.id) ) { - // Normalize check_in to date-only (YYYY-MM-DD) if present - const lodgingCheckInDate = lodgingBeingUpdated.check_in - ? String(lodgingBeingUpdated.check_in).split('T')[0] - : null; - const targetDate = lodgingCheckInDate || targetPendingDate; + // Normalize check_in to date-only (YYYY-MM-DD) if present + const lodgingCheckInDate = lodgingBeingUpdated.check_in + ? String(lodgingBeingUpdated.check_in).split('T')[0] + : null; + const targetDate = lodgingCheckInDate || targetPendingDate; - addItineraryItemForObject('lodging', lodgingBeingUpdated.id, targetDate); - // Mark this lodging as added to prevent duplicates - addedToItinerary.add(lodgingBeingUpdated.id); - addedToItinerary = addedToItinerary; // trigger reactivity - pendingAddDate = null; - pendingLodgingAddDate = null; + addItineraryItemForObject('lodging', lodgingBeingUpdated.id, targetDate); + // Mark this lodging as added to prevent duplicates + addedToItinerary.add(lodgingBeingUpdated.id); + addedToItinerary = addedToItinerary; // trigger reactivity + pendingAddDate = null; + pendingLodgingAddDate = null; } } @@ -2330,11 +2334,12 @@ lodging={resolvedObj} {user} {collection} - itineraryItem={item} - showImage={false} - on:delete={handleItemDelete} - on:removeFromItinerary={handleRemoveItineraryItem} - on:edit={handleEditLodging} + itineraryItem={item} + showImage={false} + compact={true} + on:delete={handleItemDelete} + on:removeFromItinerary={handleRemoveItineraryItem} + on:edit={handleEditLodging} on:moveToGlobal={(e) => moveItemToGlobal(e.detail.type, e.detail.id)} /> {:else if objectType === 'note'} @@ -2555,6 +2560,7 @@ {collection} itineraryItem={boundaryLodgingItem} showImage={false} + compact={true} on:delete={handleItemDelete} on:removeFromItinerary={handleRemoveItineraryItem} on:edit={handleEditLodging} @@ -2821,11 +2827,12 @@ lodging={resolvedObj} {user} {collection} - itineraryItem={item} - showImage={false} - on:delete={handleItemDelete} - on:removeFromItinerary={handleRemoveItineraryItem} - on:edit={handleEditLodging} + itineraryItem={item} + showImage={false} + compact={true} + on:delete={handleItemDelete} + on:removeFromItinerary={handleRemoveItineraryItem} + on:edit={handleEditLodging} on:moveToGlobal={(e) => moveItemToGlobal(e.detail.type, e.detail.id)} on:changeDay={(e) => @@ -2887,26 +2894,28 @@ {locationConnector.durationLabel} - - {#if directionsUrl} - - - {getI18nText('itinerary.directions', 'Directions')} - - {:else} - - - {getI18nText('itinerary.directions', 'Directions')} - - {/if} -
- {:else} -
+ + {#if directionsUrl} + + + {getI18nText('itinerary.directions', 'Directions')} + + {:else} + + + {getI18nText('itinerary.directions', 'Directions')} + + {/if} +
+ {:else} +
{#if locationConnector.mode === 'driving'} @@ -2917,26 +2926,28 @@ {locationConnector.distanceLabel} - - {#if directionsUrl} - - - {getI18nText('itinerary.directions', 'Directions')} - - {:else} - - - {getI18nText('itinerary.directions', 'Directions')} - - {/if} -
- {/if} -
+ + {#if directionsUrl} + + + {getI18nText('itinerary.directions', 'Directions')} + + {:else} + + + {getI18nText('itinerary.directions', 'Directions')} + + {/if} +
+ {/if} +
{/if}
@@ -3011,6 +3022,7 @@ {collection} itineraryItem={boundaryLodgingItem} showImage={false} + compact={true} on:delete={handleItemDelete} on:removeFromItinerary={handleRemoveItineraryItem} on:edit={handleEditLodging} @@ -3075,13 +3087,13 @@ @@ -3130,10 +3142,10 @@ - {#if day.overnightLodging.length > 0 || day.globalDatedItems.length > 0} + {#if shouldShowOvernightSummary(day) || day.globalDatedItems.length > 0}
- {#if day.overnightLodging.length > 0} + {#if shouldShowOvernightSummary(day)}
@@ -3352,12 +3364,13 @@ /> {:else if type === 'lodging'} {:else if type === 'note'}