Skip to content

Conversation

@elliotwutingfeng
Copy link
Contributor

demo_exit_mrt.webm

I used the oldURL param of HashChangeEvent to store the previous hash, to prevent stationView.mount from re-rendering the wikipedia sidebar when switching to a different exit marker of the same station.

@cheeaun cheeaun added the triage label Aug 21, 2025
@cheeaun
Copy link
Owner

cheeaun commented Aug 21, 2025

Sorry, I've looked at this but got sidetracked.

To be honest, the code does get kinda hacky. Wondering how come your screen recording doesn't show any zoom/pan animations?

@elliotwutingfeng
Copy link
Contributor Author

elliotwutingfeng commented Aug 21, 2025

Sorry, I've looked at this but got sidetracked.

To be honest, the code does get kinda hacky. Wondering how come your screen recording doesn't show any zoom/pan animations?

Yes, the code is hacky. 😅 It would require some refactoring to make it fit better.

I've found the cause of the lack of animations. I had ui.prefersReducedMotion set to 1 in Firefox on Ubuntu. Pan/Zoom animations would also be disabled if Animation effects is turned off in Windows 11 settings.

@cheeaun
Copy link
Owner

cheeaun commented Aug 21, 2025

The blame is on me too. Current code is not very well-thought and hastily written due to me not knowing how people are using this and if anyone would use this at all 😂

Are you adding this because you need this feature?

If I were to revisit this, I'll probably look at the URL part first. Now it points to '/#stations/Chinatown' which is not quite a "nice" URL. '/#stations/NE4-DT19" probably make more sense but it could change in the future if suddenly it handles another new line 😂, so technically the name of station would "last longer" than its codes. Good for people linking to it as "permalink", and useful when pressing back in browsers.

As for exits, probably '/#stations/Chinatown/A' for exit A would make sense? Would be less hacky if every exit has their own URL path, works for back button too, and don't need to track the previous clicked station. One possible problem is that MRT folks are now slowly migrating from A-Z to numbers for the exit labels, so the these exit links will not be permanent enough 🤣

@elliotwutingfeng
Copy link
Contributor Author

Nope. I have no urgent need for this feature.

Station codes can also completely change in the future. Example would be the Changi Airport Branch stations CG, CG1 and CG2 -> TEx in year 2040. Station codes have also been transferred to other stations before, although this is very rare; EW29 once belonged to Changi Airport, now it refers to Joo Koon. For permalink, I think the station name only format is safest.

Exits may be temporarily closed off too, like at Choa Chu Kang right now due to the JRL construction. Maybe we can use the station-view as a fallback? (e.g. /#stations/Chinatown/A no longer exists -> fallback/redirect to station view /#stations/Chinatown, safer as there is no guarantee that it will always be Exit A => 1, B => 2, ...)

@cheeaun
Copy link
Owner

cheeaun commented Aug 22, 2025

@elliotwutingfeng exit fallback to station make sense 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants