-
Couldn't load subscription status.
- Fork 590
feat(city guide): enable expanded list of cities #12286
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yesss
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is added directly to Eigen in this PR, but note that we currently have a build process that grabs this from Metaphysics.
I'm not exactly sure why — perhaps we anticipated this list would evolve more frequently, but it has been unchanged since City Guide's launch in early 2019 😅
We should decide whether to continue with that pattern, or do away with that kinda superfluous build step and leave this static data file here in Eigen.
| const insets = useSafeAreaInsets() | ||
| const enabledExpandedList = useFeatureFlag("AREnableExpandedCityGuide") | ||
|
|
||
| const cities = enabledExpandedList ? expandedCities : originalCities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place we switch between the regular and expanded list, on order to create the expanded city picker menu.
But note that there are several other mentions of this static data file, and we haven't combed through these to see if they also need to change according to this flag.
| "maxBounds": { | ||
| "sw": { "lat": 44.959, "lng": -74.338 }, | ||
| "ne": { "lat": 46.036, "lng": -72.802 } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have sworn that these maxBounds parameters were in use before, and governed the behavior of the map in Eigen.
But that does not appear to be the case now. (I'm really not sure what happened here, it's possible that it changed or that I mis-remembered the original feature.)
In any case I generated them for completeness' sake, based on this notebook which dates back to the original City Guide days.
19cbe84 to
1525c80
Compare
| <MapboxGL.Camera | ||
| ref={cameraRef} | ||
| animationMode="flyTo" | ||
| animationMode="moveTo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is meant to replace the very melodramatic current animation with a simple instant transition.
The old animation however, due to being so lengthy, was actually masking the query latency. Now we see a spinner instead, but we'll try to improve upon that too.
| Before | After |
|---|---|
animationMode="flyTo" |
animationMode="moveTo" |
fly_half.mp4 |
move_half.mp4 |
1525c80 to
1392e34
Compare
Co-authored-by: Anandaroop Roy <[email protected]>
Turns out these are not actually consulted by Eigen, we use the data coming from upstream in MP instead. I make this change just for consistency
| "slug": "tokyo-japan", | ||
| "name": "Tokyo", | ||
| "coordinates": { "lat": 35.69, "lng": 139.69 }, | ||
| "coordinates": { "lat": 35.68, "lng": 139.76 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose the updated values for Tokyo and Dubai manually by adapting this notebook from the old City Guide days https://observablehq.com/@anandaroop/city-guide-shows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impressive notebook! thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
FYI, I looked further into the scripts we currently have but are not using to understand if they are worth keeping. I believe we don't need them anymore. The goal, I assume, was to preheat the relay cache so more cities are available for quicker switching as well as sending less payload to MP (using query id instead of the entire query payload). Although it's a nice quality of life improvement, I think it could mean that one might get cached values and we would need to maintain a script that is very hard to know about its existence (which is the case now). Which is why I think it's fair to remove it |
|
One final thought I have before opening this up for QA — now that we've got a bigger list of cities in the picker UI, it's no longer easy to digest in one glance. Therefore I think the ordering of the list is important. Currently it's essentially in random order:
(Not really random, it follows this list in Gravity, but I do not know why that list is ordered the way it is, and neither will any user.) Since we have full control in Eigen thanks to that static file that lives in this repo, we can modify the ordering to make it more sensible. There's more than one way to do this. I propose keeping the "original 6" cities at the top of the list, followed by the remainder in alphabetical order:
Not perfect, but an improvement over the current list I think, a compromise between keeping the original 6 major cities where they always were vs making the other cities easy to find by skimming. @MounirDhahri if you agree, I will push that change up to this branch. |
|
@anandaroop I think that's a valid concern and I like the suggested solution. My only worry is that if you didn't see your city at first glance from the top 6 in the List ( |
|
I was going for the lazy approach that merely tweaked the data file, but yeah I'm open to any of that! Either now, or as a a follow-up. We could get design input as well. Maybe a hands-on QA session could surface ideas about the best way forward. |






Description
Co-authored-by: @MounirDhahri
To accompany the enablement of cross-platform City Guide (#12175) here we also expand the list of cities from the original six that were supported at launch.
Which cities to include? Luckily we already have a concept of "featured cities" which we make use of in various places e.g. on https://www.artsy.net/shows
So here we create an expanded list of cities based on that existing concept.
For QA purposes, this is behind a feature flag: Enable expanded city list in City Guide
expanded.out.mov
android-expanded.out.mov
PR Checklist
To the reviewers 👀
Changelog updates
Changelog updates
Cross-platform user-facing changes
iOS user-facing changes
Android user-facing changes
Dev changes
Need help with something? Have a look at our docs, or get in touch with us.