Skip to content

FeaturePanel: Single public transport route #626

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

Merged
merged 11 commits into from
Oct 8, 2024

Conversation

Dlurak
Copy link
Collaborator

@Dlurak Dlurak commented Oct 3, 2024

Description

When the user clicks a single public transport route they now can see a list of stops.
If the route has more then 7 stops it will get minimized in a smaller view. It is easy to expand it back either by using the checkbox or by pressing the small arrow.

Example links

/relation/13065547

Screenshots

Minimized Expanded
image image

Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Oct 7, 2024 4:56pm

@zbycz
Copy link
Owner

zbycz commented Oct 7, 2024

Wow, good idea. This looks wonderful! 😻

One design idea though, instead of the checkbox above, we could add toggle button right after the first stop, eg like this. What do you think?
image

background: isFirst ? 'transparent' : color,
}}
/>
{hold && (
Copy link
Owner

Choose a reason for hiding this comment

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

I don't understand what does this prop mean, can you please explain and then we can perhaps find a more suitable name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At all stations a train holds so they get a circle on the left line. The show more/show less buttons should not get that circle as a train doesn't hold there.
hold shows/hides that circle:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we should just call it showCircle or something similar. This names indicates what the property is for

Copy link
Owner

Choose a reason for hiding this comment

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

see new comment below

@zbycz zbycz mentioned this pull request Oct 7, 2024
return (
<StationsList>
{stops.map((stop, i) => {
{stopsWithButton.map((stop, i) => {
Copy link
Owner

Choose a reason for hiding this comment

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

While this is better than before, I would suggest code like this - in my opinion it is more streamlined, it doesnt mix stops with buttons. Also we could get rid of the showCircle prop, or just use it statically.

stops.map((stop, i) => (
<>
  <StationItem stop={stop} showCircle />
  {i === 0 ? (<ShowMoreLessButton />) : null}
</>
))

Do you think this could work, or do I miss something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ShowMoreLessButton needs to be in a own StationItem. If it isn't in one at all the left line will suddenly stop and then start again. If it is in the same as the Link it will break the spacing and the circle would be shown in between the button and the first label. If you can think of a solution better then the one I just commited let me know :)

Copy link
Owner

Choose a reason for hiding this comment

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

Sure, that was only a pseudo-code.

The solution you commited is perfect i think. We get rid of the stopsWithButton array, and the code reads clearly now. 👍

@Dlurak
Copy link
Collaborator Author

Dlurak commented Oct 7, 2024

I noticed you recently prefixed a pr with Publictransport: so that is now preffered in comparison to FeaturePanel:?

@zbycz
Copy link
Owner

zbycz commented Oct 8, 2024

I noticed you recently prefixed a pr with Publictransport: so that is now preffered in comparison to FeaturePanel:?

I think PublicTransport is becoming so significant, we can use it as a prefix. 👍 I do it kinda intuitively - you can do the same.

@Dlurak Dlurak merged commit 2edfce7 into zbycz:master Oct 8, 2024
2 checks passed
Copy link

sentry-io bot commented Oct 8, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ QuotaExceededError: The quota has been exceeded. /[[...all]] View Issue

Did you find this useful? React with a 👍 or 👎

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