-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 experimental map #1912
add experimental map #1912
Conversation
3c168f7
to
51d95df
Compare
2c483ac
to
109c4f2
Compare
131f350
to
c497414
Compare
back to draft as the core part is close to being ready and we can remove all the update-hacks here soon. so, it makes sense to wait for review until that's done. |
9d65c29
to
bcb2117
Compare
5180468
to
7b6e037
Compare
although maps for iOS will stay experimental for 1.46, we aim to get this in to move forward, to get bug reports etc. the UX improvement is huge - there is just no map before (we aimed to get that in even with the much more hacky swift-but-rust implementation :) EDIT: deltachat/deltachat-core-rust#5461 is merged, i rebase this pr, so we can move forward :) btw, this PR adds less than 40 LOC really needed to handle the map - the rest are buttons etc. without the help of core, we added 220 LOC - with fewer features |
as discussed in several chats, this PR starts making it possible to use Webxdc as integrations to the main app. In other word: selected parts of the main app can be integrated as Webxdc, eg. Maps [^1] this PR contains two parts: - draft an Webxdc Integration API - use the Webxdc Integration API to create a Maps Integration to be clear: a Webxdc is not part of this PR. the PR is about marking a Webxdc being used as a Map - and core then feeds the Webxdc with location data. from the view of the Webxdc, the normal `sendUpdate()`/`setUpdateListener()` is used. things are still marked as "experimental", idea is to get that in to allow @adbenitez and @nicodh to move forward on the integrations into android and desktop, as well as improving the maps.xdc itself. good news is that we currently can change the protocol between Webxdc and core at any point :) # Webxdc Integration API see `dc_init_webxdc_integration()` in `deltachat.h` for overview and documentation. rust code is mostly in `webxdc/integration.rs` that is called by other places as needed. current [user of the API is deltachat-ios](deltachat/deltachat-ios#1912), android/desktop will probably follow. the jsonrpc part is missing and can come in another PR when things are settled and desktop is really starting [^2] (so we won't need to do all iterations twice :) makes also sense, when this is done by someone actually trying that out on desktop while the API is prepared to allow other types of integrations (photo editor, compose tools ...) internally, we currently ignore the type. if that gets more crazy, we probably also need a dedicated table for the integrations and not just a single param. # Maps Integration rust code is mostly in `webxdc/maps_integration.rs` that is called by `webxdc/integration.rs` as needed. EDIT: the idea of having a split here, is that `webxdc/maps_integration.rs` really can focus on the json part, on the communication with the .xdc, including tests this PR is basic implementation, enabling to move forward on integrations on iOS, but also on desktop and android. the current implementation allows already the following: - global and per-chat maps - add and display POIs - show positions and tracks of the last 24 hours the current maps.xdc uses leaflet, and is in some regards better than the current android/desktop implementations (much faster, show age of positions, fade out positions, always show names of POIs, clearer UI). however, we are also not bound to leaflet, it can be anything > [**screenshots of the current state**](deltachat/deltachat-ios#1912) > 👆 to move forward faster and to keep this PR small, the following will go to a subsequent PR: - consider allowing webxdc to use a different timewindow for the location - delete POIs - jsonrpc [^1]: maps are a good example as anyways barely native (see android app), did cause a lot of pain on many levels in the past (technically, bureaucratically), and have a comparable simple api [^2]: only going for jsonrpc would only make sense if large parts of android/ios would use jsonrpc, we're not there --------- Co-authored-by: link2xt <[email protected]>
…oes not clutter UI
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 and does what it says! I added some questions here and there, but nothing blocking. Thanks again!
this PR adds a map to show locations to iOS.
the PR makes use of the new "Webxdc Integration" feature of deltachat/deltachat-core-rust#5461 (which need to be merged first).
therefore, review should concentrate on the buttons etc. added to iOS - the map itself is totally independent and can then be improved independently of iOS.
still, some map impressions
(the third image is a result from a location-streaming-bug some years ago (iirc, all ppl-locations became POIs :), however, how we have nice test-data by that :)
the current mapx.xdc uses leaflet, and the API defined at
webxdc/maps_integration.rs
in core. some random thoughts:main open point is that the xdc is currently visible in the saved-messages chat, we should consider if it is better to hide it somehow. EDIT: this will be done subsequently, for now, @nicodh and me decided that a message describing what is going on will doEDIT: default maps.xdc is no longer visible due to help of core