Refine Manage Trips parser and enhance OpenAI configuration#75
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the Manage Trips UX around import/export and adds a “Quick Itinerary Parser” flow that can pre-fill trip legs from free-form itinerary text, alongside wiring new OpenAI configuration options through Docker/.env.
Changes:
- Adds itinerary parsing state + dialog integration to the Manage Trips trip editor (including multi-leg review and save).
- Refactors the Trip List header to add an “Import / Export” toggle panel and a prominent “Add Trip” action.
- Adds OpenAI endpoint/model/key environment variable plumbing in compose files and documents them in
.env.example.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ResidencyRoll.Web/wwwroot/carbon-theme.css | Updates Radzen secondary button styling and removes TabView panel padding. |
| src/ResidencyRoll.Web/Components/Pages/ManageTrips.razor.cs | Implements itinerary parsing availability check, dialog flow, draft-leg navigation, and batch-save behavior. |
| src/ResidencyRoll.Web/Components/Pages/ManageTrips.razor | Updates Manage Trips UI to support import/export toggle and the itinerary parser + multi-leg save controls. |
| docker-compose.yml | Adds OpenAI configuration env vars passed into the service container. |
| docker-compose.build.yml | Adds OpenAI configuration env vars with empty defaults for build/dev flows. |
| .env.example | Documents new OPENAI_ENDPOINT / OPENAI_MODEL / OPENAI_API_KEY variables. |
| private string validationMessage = string.Empty; | ||
| private string itineraryParsingError = string.Empty; | ||
| private bool itineraryParsingSuccess; | ||
| private int parsedTripsCount; |
There was a problem hiding this comment.
parsedTripsCount is assigned/reset but never read anywhere in this component, which will trigger an unused-field warning and adds dead state to maintain. Either remove the field/assignments, or use it in the UI (e.g., display the parsed count).
| private int parsedTripsCount; | |
| private int parsedTripsCount; | |
| private int ParsedTripsCount | |
| { | |
| get => parsedTripsCount; | |
| set => parsedTripsCount = value; | |
| } |
| DepartureCountry = departureAirport?.Country ?? parsedLeg.DepartureAirport, | ||
| DepartureCity = departureAirport?.City ?? parsedLeg.DepartureAirport, | ||
| DepartureTimezone = departureAirport?.IanaTimezone ?? "UTC", | ||
| DepartureIataCode = parsedLeg.DepartureAirport, | ||
| DepartureDateTime = departureDateTime, | ||
| ArrivalCountry = arrivalAirport?.Country ?? parsedLeg.ArrivalAirport, | ||
| ArrivalCity = arrivalAirport?.City ?? parsedLeg.ArrivalAirport, |
There was a problem hiding this comment.
When an airport IATA code isn't found in AirportDatabase, the fallback currently sets DepartureCountry/DepartureCity (and arrival equivalents) to the IATA code. This will persist incorrect country/city values (e.g., "JFK") and can break residency aggregation which keys off country names. Prefer leaving these fields empty (or another explicit sentinel) so the user must correct them before saving, consistent with how the Forecast itinerary parser populates missing airport info.
| DepartureCountry = departureAirport?.Country ?? parsedLeg.DepartureAirport, | |
| DepartureCity = departureAirport?.City ?? parsedLeg.DepartureAirport, | |
| DepartureTimezone = departureAirport?.IanaTimezone ?? "UTC", | |
| DepartureIataCode = parsedLeg.DepartureAirport, | |
| DepartureDateTime = departureDateTime, | |
| ArrivalCountry = arrivalAirport?.Country ?? parsedLeg.ArrivalAirport, | |
| ArrivalCity = arrivalAirport?.City ?? parsedLeg.ArrivalAirport, | |
| DepartureCountry = departureAirport?.Country ?? string.Empty, | |
| DepartureCity = departureAirport?.City ?? string.Empty, | |
| DepartureTimezone = departureAirport?.IanaTimezone ?? "UTC", | |
| DepartureIataCode = parsedLeg.DepartureAirport, | |
| DepartureDateTime = departureDateTime, | |
| ArrivalCountry = arrivalAirport?.Country ?? string.Empty, | |
| ArrivalCity = arrivalAirport?.City ?? string.Empty, |
Improve the Manage Trips parser and user experience for import/export functionality. Add configuration options for OpenAI integration, including endpoint, model, and API key.