Skip to content

Refine Manage Trips parser and enhance OpenAI configuration#75

Merged
GlenConway merged 2 commits into
devfrom
feature/itinerary-parser-manage-trips
Feb 28, 2026
Merged

Refine Manage Trips parser and enhance OpenAI configuration#75
GlenConway merged 2 commits into
devfrom
feature/itinerary-parser-manage-trips

Conversation

@GlenConway

Copy link
Copy Markdown
Owner

Improve the Manage Trips parser and user experience for import/export functionality. Add configuration options for OpenAI integration, including endpoint, model, and API key.

Copilot AI review requested due to automatic review settings February 28, 2026 08:41
@GlenConway GlenConway merged commit 6155ba5 into dev Feb 28, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copilot AI Feb 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
private int parsedTripsCount;
private int parsedTripsCount;
private int ParsedTripsCount
{
get => parsedTripsCount;
set => parsedTripsCount = value;
}

Copilot uses AI. Check for mistakes.
Comment on lines +135 to +141
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,

Copilot AI Feb 28, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants