Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add walking legs to the trip plan details #2246

Merged
merged 10 commits into from
Dec 6, 2024
Merged

Conversation

anthonyshull
Copy link
Contributor

@anthonyshull anthonyshull commented Dec 5, 2024

Screenshot Capture - 2024-12-05 - 11-13-13

@anthonyshull anthonyshull marked this pull request as ready for review December 5, 2024 17:26
@anthonyshull anthonyshull requested a review from a team as a code owner December 5, 2024 17:26
Comment on lines +84 to +92
<.leg
start_time={leg.start}
end_time={leg.stop}
from={leg.from}
to={leg.to}
mode={leg.mode}
realtime={leg.realtime}
realtime_state={leg.realtime_state}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📓 We should probably rename this to TransitLeg and not destructure the leg.

Copy link
Collaborator

Choose a reason for hiding this comment

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

did you look inside DotcomWeb.Components.TripPlanner.Leg.leg/1? it's basically a wrapper that shows a transit leg or walking leg. Might want to either (a) move this to there or (b) simplify leg/1 internal logic to remove handling of the walking directions, then rename that to transit_leg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what I meant by this comment. I don't think it is in the scope of this ticket to refactor the previous work. But, we should do it because the two different legs have completely different rendering methods. And, they should both take a leg instead of that destructuring.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, I agree. I just think since this change makes part of the existing leg/1 logic unreachable already, it feels a little odd not to make that refactor here. Just my 2c.

@thecristen thecristen self-assigned this Dec 5, 2024
lib/dotcom_web/components/trip_planner/walking_leg.ex Outdated Show resolved Hide resolved
@@ -129,11 +129,6 @@ defmodule DotcomWeb.Components.LiveComponents.TripPlannerForm do
</.inputs_for>
</div>
</:content>
<:extra :if={used_input?(f[:modes])}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we undo this removal? This removes the "please select a mode" message if all modes are left unchecked, and this change doesn't seem to have anything to do with the rest of this PR anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed that attribute from the accordion because you said we didn't need it anymore. It was giving a warning once I removed it. So, I removed it here. Are you using it for the errors? I assumed not so removed it here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, gotcha.

image

As I just described: "Please select at least one mode of transit". But this could just as easily be included as a <div> after the accordion instead of using the prior extra attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, that way they all work the same.

Comment on lines +84 to +92
<.leg
start_time={leg.start}
end_time={leg.stop}
from={leg.from}
to={leg.to}
mode={leg.mode}
realtime={leg.realtime}
realtime_state={leg.realtime_state}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

did you look inside DotcomWeb.Components.TripPlanner.Leg.leg/1? it's basically a wrapper that shows a transit leg or walking leg. Might want to either (a) move this to there or (b) simplify leg/1 internal logic to remove handling of the walking directions, then rename that to transit_leg.

@anthonyshull anthonyshull force-pushed the ags/walking-leg-component branch from 3ad3199 to 4b11b9b Compare December 5, 2024 18:28
Copy link
Collaborator

@thecristen thecristen left a comment

Choose a reason for hiding this comment

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

Can you fix the formatting? I'm fine with it otherwise.

@anthonyshull anthonyshull enabled auto-merge (squash) December 5, 2024 20:24
@anthonyshull anthonyshull force-pushed the ags/walking-leg-component branch from 1abadff to 130846c Compare December 6, 2024 14:15
@anthonyshull anthonyshull merged commit ad2a7f2 into main Dec 6, 2024
17 checks passed
@anthonyshull anthonyshull deleted the ags/walking-leg-component branch December 6, 2024 14:30
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