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

feat: update.href api #6248

Merged
merged 4 commits into from
Nov 23, 2024
Merged

feat: update.href api #6248

merged 4 commits into from
Nov 23, 2024

Conversation

r10s
Copy link
Member

@r10s r10s commented Nov 22, 2024

add update.href property option to update objects send via Context::send_webxdc_status_update().

when set together with update.info,
UI can implement the info message as a link that is passed to the webxdc via window.location.href.
for that purpose, UI will read the link back from Message::get_webxdc_href().

Practically,
this allows e.g. an calendar.xdc
to emits clickable update messages
opening the calendar at the correct date.

closes #6219

documentation at webxdc/website#90

add `update.href` property option to update objects
send via `Context::send_webxdc_status_update()`.

when set together with `update.info`,
UI can implement the info message as a link that is passed to the webxdc
via `window.location.href`.
for that purpose, UI will read the link back from `Message::get_webxdc_href()`.

Practically,
this allows e.g. an calendar.xdc
to emits clickable update messages
opening the calendar at the correct date.
deltachat-ffi/src/lib.rs Outdated Show resolved Hide resolved
src/webxdc.rs Outdated
/// Get link attached to an info message.
///
/// The info message needs to be of type SystemMessage::WebxdcInfoMessage.
/// Typically, this is used to start the corresponding
Copy link
Collaborator

Choose a reason for hiding this comment

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

Start the corresponding what? :o)

Copy link
Member Author

Choose a reason for hiding this comment

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

the corresponding excursion of rocket scientists 🚀


/**
* Get link attached to an webxdc info message.
* The info message needs to be of type DC_INFO_WEBXDC_INFO_MESSAGE.
Copy link
Member

Choose a reason for hiding this comment

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

so this will not work for notifications using update.notify setting a summary but no info message 🤔 when showing such a notification (which potentially will have info-message sometimes) I guess we will add an "open" to the notification to jump to the app, for notifications with info-messages it would work for not for summary, it is a limitation but probably not a big deal for the first iterations and could be improved at a later point I guess

Copy link
Member Author

Choose a reason for hiding this comment

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

indeed, that is not possible currently. but that is no conceptual flaw, we could probably easily add the hash to the event as well, if we consider that an important usecase as well (or just to make documentation easier :)

however, i suggest to do that after this PR and after all UI have adapted to href approach - that way we can see if things work out as we exepect. if so, adpating UI for event-href is easy :)

@r10s r10s merged commit 22b9308 into main Nov 23, 2024
38 checks passed
@r10s r10s deleted the webxdc-deeplink2 branch November 23, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

webxdc deeplinks (M3)
3 participants