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

show deck card in messages #4327

Merged
merged 14 commits into from
Oct 23, 2024
Merged

show deck card in messages #4327

merged 14 commits into from
Oct 23, 2024

Conversation

sowjanyakch
Copy link
Contributor

@sowjanyakch sowjanyakch commented Oct 9, 2024

fix #1025

  • show deck card in the chat messages when user shared card via "Post to conversation".
  • Clicking on the deck card chat message will navigate to the deck card on the web.

🚧 TODO

  • ...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@sowjanyakch sowjanyakch marked this pull request as draft October 9, 2024 19:06
@sowjanyakch sowjanyakch force-pushed the deck_card_is_shown_as_object branch from 6b68499 to fb4997f Compare October 11, 2024 11:08
@sowjanyakch sowjanyakch marked this pull request as ready for review October 11, 2024 11:08
@sowjanyakch sowjanyakch self-assigned this Oct 11, 2024
@sowjanyakch sowjanyakch added the 3. to review Waiting for reviews label Oct 11, 2024
@sowjanyakch sowjanyakch force-pushed the deck_card_is_shown_as_object branch from 83771cc to 3093f0f Compare October 11, 2024 12:27
@mahibi
Copy link
Collaborator

mahibi commented Oct 18, 2024

Playing around how deck cards in more detail for the first time. It feels quite confusing...:

The handling how deck cards are viewed are quite depending on who sent it in which way, if the board is shared to the other user, and also it's different by platforms.

See numbers in the first screenshot of web...

1&2 were received when the board was not yet shared.

  1. was received from other user who sent it from deck via "Post to a conversation"
  2. was received from other user by smartpicker (however if the board is shared beforehand, it displayed via preview(OpenGraph?))
  3. was sent to other user via "Post to a conversation"
  4. was sent to other user by smartpicker (it's a link that has a preview by OpenGraph)

This is how it looks in web:
grafik

Android (with this PR):
grafik

iPhone:
grafik
grafik

Todos:

  • todo for server people?: share board when a card is posted to a chat???
  • we should decide if cards are shown by own design or by OpenGraph? But mixed it's confusing?
  • todo for android?: visualize OpenGraph link when it's a Deck Card? Is this how it's done on iOS and web?
  • todo for android: check if links are opened in Android Nextcloud Deck app / if not whats needs to be done?

pinging some people if anyone want to share opinions..
@nickvergessen @Ivansss @SystemKeeper @juliusknorr

@@ -415,6 +416,7 @@ How to translate with transifex:
<string name="nc_sent_poll_you">You sent a poll.</string>
<string name="nc_sent_location_you">You sent a location.</string>
<string name="nc_sent_voice_you">You sent a voice message.</string>
<string name="nc_sent_deck_card_you">You: %1$s</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

You sent a deck card.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mahibi - The string is modified to align with web

Copy link
Member

Choose a reason for hiding this comment

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

The web is always saying You: … but that's not the best. Use what Marcel suggested, to align with the other messages of the same type that exist atm in Android

@@ -407,6 +407,7 @@ How to translate with transifex:
<string name="nc_sent_poll" formatted="true">%1$s sent a poll.</string>
<string name="nc_sent_location" formatted="true">%1$s sent a location.</string>
<string name="nc_sent_voice" formatted="true">%1$s sent a voice message.</string>
<string name="nc_sent_deck_card" formatted="true">%1$s: %2$s</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

%1$s sent a deck card.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The string is modified to align with web

Copy link
Member

Choose a reason for hiding this comment

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

Same as above

@SystemKeeper
Copy link

1 was received from other user who sent it from deck via "Post to a conversation"

We try to use the link that included in the richObject to get additional information from the reference provider (not opengraph). If that is not possible, we render the deck card with the information we have in the richObject. Actually the last one is not correctly working, as our check is wrong, you found a bug :) nextcloud/talk-ios#1843. Without the bug, we should render the same as android.

2 was received from other user by smartpicker (however if the board is shared beforehand, it displayed via preview(OpenGraph?))

Since it's just a link, we try to get reference data. If there's one for "deck-card" we use that: https://github.com/nextcloud/talk-ios/blob/25ebf7eca1f1043ab89b7ff4791a4eac34dff075/NextcloudTalk/ReferenceView.swift#L126-L135. Otherwise we fall back to opengraph data, which most of the time is just the link.

3 was sent to other user via "Post to a conversation"

Should be the same as 1. Not totally sure, why it's rendered in this case. Maybe the reference provider behaves differently, but need to check.

4 was sent to other user by smartpicker (it's a link that has a preview by OpenGraph)

Same as 2.

@sowjanyakch sowjanyakch force-pushed the deck_card_is_shown_as_object branch from 3093f0f to 9b9f5e0 Compare October 21, 2024 11:30
@sowjanyakch
Copy link
Contributor Author

@nickvergessen - Is the current implementation of deck card on android okay for you or do you want to make any changes to the way the deck card is shown?

@nickvergessen
Copy link
Member

Regarding the questions/comments in #4327 (comment)

was received from other user by smartpicker (however if the board is shared beforehand, it displayed via preview(OpenGraph?))

When the board/card is not publicly accessible, OpenGraph will not be able to return any information, so that's expected.

todo for server people?: share board when a card is posted to a chat???

It was decided that automatic sharing should not happen, as otherwise people might expect that quickly afterwards deleting the message would also undo the share, but we wouldn't know if we just shared or not. In addition we would need to understand and interact with quite a lot 3rdparty app APIs in those cases, so that's a "No" for now.

we should decide if cards are shown by own design or by OpenGraph? But mixed it's confusing?

There is also a significant difference when you share a file to chat or when you post /f/ link or even a public share link. So yes, for now the difference is expected.

todo for android: check if links are opened in Android Nextcloud Deck app / if not whats needs to be done?

While that would be cool, we can also simply raise a follow up issue and keep this PR here scoped.

@sowjanyakch sowjanyakch force-pushed the deck_card_is_shown_as_object branch from 9b9f5e0 to 99b410f Compare October 23, 2024 09:39
@sowjanyakch sowjanyakch requested a review from mahibi October 23, 2024 09:42
Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4327-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings9497
Errors132132

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code7979
Internationalization33
Malicious code vulnerability33
Performance66
Security11
Total109109

Lint increased!

@mahibi mahibi merged commit 5bee52d into master Oct 23, 2024
16 of 18 checks passed
@mahibi mahibi deleted the deck_card_is_shown_as_object branch October 23, 2024 10:58
@mahibi
Copy link
Collaborator

mahibi commented Oct 23, 2024

/backport to stable-20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deck card link is show as {object}
5 participants