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(new-links): Parse url data and display #11619

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

borismelnik
Copy link
Contributor

@borismelnik borismelnik commented Jul 20, 2023

Fixes: #10852

What does the PR do

Unfurling new urls formats

Affected areas

Invitations

StatusQ checklist

  • add documentation if necessary (new component, new feature)
  • update sandbox app
    • in case of new component, add new component page
    • in case of new features, add variation to existing component page
    • nice to have: add it to the demo application as well
  • test changes in both light and dark theme?

Screenshot of functionality (including design for comparison)

  • I've checked the design and this PR matches it

Снимок экрана 2023-07-20 в 22 45 17
Снимок экрана 2023-07-24 в 21 51 56

@status-im-auto
Copy link
Member

status-im-auto commented Jul 20, 2023

Jenkins Builds

Click to see older builds (41)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5621802 #1 2023-07-20 19:55:34 ~5 min tests/nim 📄log
✔️ 5621802 #1 2023-07-20 19:55:39 ~5 min tests/imports 📄log
✔️ 5621802 #1 2023-07-20 19:59:04 ~8 min macos/aarch64 🍎dmg
✔️ 5621802 #1 2023-07-20 20:01:03 ~10 min macos/x86_64 🍎dmg
✔️ 5621802 #1 2023-07-20 20:04:24 ~14 min linux/x86_64 📦tgz
✔️ 5621802 #1 2023-07-20 20:15:04 ~24 min windows/x86_64 💿exe
✔️ 5621802 #1 2023-07-20 20:23:30 ~33 min tests/e2e 📄log
✔️ 43ae52c #2 2023-07-24 19:01:46 ~5 min tests/nim 📄log
✔️ 43ae52c #2 2023-07-24 19:01:51 ~5 min tests/imports 📄log
✔️ 43ae52c #2 2023-07-24 19:04:17 ~7 min macos/aarch64 🍎dmg
✔️ 43ae52c #2 2023-07-24 19:05:19 ~8 min macos/x86_64 🍎dmg
✔️ 43ae52c #2 2023-07-24 19:10:25 ~13 min linux/x86_64 📦tgz
✔️ 43ae52c #2 2023-07-24 19:17:39 ~20 min windows/x86_64 💿exe
✔️ 43ae52c #2 2023-07-24 19:29:25 ~32 min tests/e2e 📄log
✔️ fa01c41 #3 2023-07-25 11:58:57 ~5 min tests/imports 📄log
✔️ fa01c41 #3 2023-07-25 11:59:23 ~5 min tests/nim 📄log
✔️ fa01c41 #3 2023-07-25 11:59:30 ~5 min macos/aarch64 🍎dmg
fa01c41 #3 2023-07-25 12:02:27 ~8 min linux/x86_64 📄log
✔️ fa01c41 #3 2023-07-25 12:04:38 ~10 min macos/x86_64 🍎dmg
✔️ fa01c41 #3 2023-07-25 12:13:29 ~19 min windows/x86_64 💿exe
✔️ fa01c41 #3 2023-07-25 12:35:27 ~41 min tests/e2e 📄log
✔️ f19e844 #4 2023-07-25 14:05:13 ~4 min tests/imports 📄log
✔️ f19e844 #4 2023-07-25 14:07:12 ~6 min tests/nim 📄log
✔️ f19e844 #4 2023-07-25 14:08:17 ~7 min macos/aarch64 🍎dmg
✔️ f19e844 #4 2023-07-25 14:08:47 ~8 min macos/x86_64 🍎dmg
✔️ f19e844 #4 2023-07-25 14:30:17 ~29 min tests/e2e 📄log
✔️ f19e844 #4 2023-07-25 14:36:20 ~35 min windows/x86_64 💿exe
✔️ 93d4435 #5 2023-07-26 12:21:55 ~5 min tests/imports 📄log
✔️ 93d4435 #5 2023-07-26 12:23:15 ~6 min tests/nim 📄log
✔️ 93d4435 #5 2023-07-26 12:23:38 ~7 min macos/aarch64 🍎dmg
✔️ 93d4435 #5 2023-07-26 12:25:21 ~8 min macos/x86_64 🍎dmg
✔️ 93d4435 #5 2023-07-26 12:30:45 ~14 min linux/x86_64 📦tgz
✔️ 93d4435 #5 2023-07-26 12:37:56 ~21 min windows/x86_64 💿exe
✔️ 93d4435 #5 2023-07-26 12:42:58 ~26 min tests/e2e 📄log
✔️ bc3abdc #6 2023-07-26 14:47:04 ~4 min tests/imports 📄log
✔️ bc3abdc #6 2023-07-26 14:48:03 ~5 min tests/nim 📄log
✔️ bc3abdc #6 2023-07-26 14:48:47 ~6 min macos/aarch64 🍎dmg
bc3abdc #6 2023-07-26 14:50:21 ~8 min linux/x86_64 📄log
✔️ bc3abdc #6 2023-07-26 14:53:18 ~10 min macos/x86_64 🍎dmg
✔️ bc3abdc #6 2023-07-26 15:03:44 ~21 min windows/x86_64 💿exe
✔️ bc3abdc #6 2023-07-26 15:11:55 ~29 min tests/e2e 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8d53a27 #7 2023-07-27 11:18:16 ~5 min tests/imports 📄log
✔️ 8d53a27 #7 2023-07-27 11:18:40 ~5 min tests/nim 📄log
✔️ 8d53a27 #7 2023-07-27 11:18:58 ~6 min macos/aarch64 🍎dmg
✔️ 8d53a27 #7 2023-07-27 11:21:29 ~8 min macos/x86_64 🍎dmg
✔️ 156955f #8 2023-07-27 11:27:50 ~5 min tests/nim 📄log
✔️ 156955f #8 2023-07-27 11:28:07 ~5 min tests/imports 📄log
✔️ 156955f #8 2023-07-27 11:28:07 ~5 min macos/aarch64 🍎dmg
✔️ 156955f #8 2023-07-27 11:30:13 ~7 min macos/x86_64 🍎dmg
✔️ 156955f #8 2023-07-27 11:51:39 ~28 min windows/x86_64 💿exe
✔️ 156955f #8 2023-07-27 11:55:25 ~32 min tests/e2e 📄log

Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Looks good.

I added one comment about the functions probably not belonging in the main module, but I don't really have a better option form the top of my head.

I had two questions though:

  1. does the "Start chat" work with the new urls too? Like pasting the profile url of someone should open their chat or the contact request popup
  2. Does the community data in the unfurl update if the community info changes? For example, if the community name changes after it unfurled, does it change to use the new name?

jsonObj["displayName"] = %* contactData.displayName
jsonObj["description"] = %* contactData.description
jsonObj["publicKey"] = %* contactData.publicKey
return $jsonObj
Copy link
Member

Choose a reason for hiding this comment

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

Can we put those in the urls_manager instead?
I think we just need to expose it to the QML using setRootContextProperty.
Though I think it can't have access to services.

Anyway, maybe someone has an idea where we could put them? Putting them in the main module works, it just feels like it's a bit random

Copy link
Contributor

Choose a reason for hiding this comment

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

Having a url service and mvc makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so probably, I should move generators to new url service as well? otherwise, its service with just one method. @jrainville @MishkaRogachev what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I do believe that urls could become massive in the future

@jrainville jrainville requested review from a team and imagiMary and removed request for a team July 20, 2023 20:14
@borismelnik
Copy link
Contributor Author

Looks good.

I added one comment about the functions probably not belonging in the main module, but I don't really have a better option form the top of my head.

I had two questions though:

  1. does the "Start chat" work with the new urls too? Like pasting the profile url of someone should open their chat or the contact request popup
  2. Does the community data in the unfurl update if the community info changes? For example, if the community name changes after it unfurled, does it change to use the new name?

Looks good.

I added one comment about the functions probably not belonging in the main module, but I don't really have a better option form the top of my head.

I had two questions though:

  1. does the "Start chat" work with the new urls too? Like pasting the profile url of someone should open their chat or the contact request popup
  2. Does the community data in the unfurl update if the community info changes? For example, if the community name changes after it unfurled, does it change to use the new name?

unfortunately, i forgot about start chat... will do.

@borismelnik borismelnik force-pushed the feat/issue-10852-unfurl-links branch from 5621802 to 43ae52c Compare July 24, 2023 18:56
@borismelnik borismelnik requested a review from jrainville July 24, 2023 18:56
Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

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

Nice job

@@ -22,6 +22,7 @@ import ../../../app_service/service/wallet_account/service as wallet_account_ser
import ../../../app_service/service/token/service as token_service
import ../../../app_service/service/network/service as networks_service
import ../../../app_service/service/collectible/service as collectible_service
import ../../../app_service/service/general/service as general_service
Copy link
Member

Choose a reason for hiding this comment

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

I think this one is no longer needed

}

let communityDataString = sharedUrlsModuleInst.parseCommunitySharedUrl(link)
return JSON.parse(communityDataString)
Copy link
Member

Choose a reason for hiding this comment

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

Might need a try/catch?

@borismelnik borismelnik force-pushed the feat/issue-10852-unfurl-links branch from 43ae52c to fa01c41 Compare July 25, 2023 11:53
@igor-sirotin
Copy link
Contributor

Currently community link previews are not shown in chat. I commented them out to implement after this:

@jrainville do you think we can merge this without working link previews and I will take care of them when backend is ready?

@jrainville
Copy link
Member

Currently community link previews are not shown in chat. I commented them out to implement after this:

@jrainville do you think we can merge this without working link previews and I will take care of them when backend is ready?

Sure, as long as clicking the link takes you to the community

@borismelnik borismelnik force-pushed the feat/issue-10852-unfurl-links branch 2 times, most recently from f19e844 to 93d4435 Compare July 26, 2023 12:16
Copy link
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

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

Great new service and mvc for shared links

src/app/modules/main/controller.nim Outdated Show resolved Hide resolved
error "error: ", procName="backupData", errName = e.name, errDesription = e.msg

Copy link
Member

Choose a reason for hiding this comment

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

Stray empty line?

Copy link
Contributor

Choose a reason for hiding this comment

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

An empty line at the end of a file is good idea, isn't it?
I don't remember the actual reason, but even GitHub marks it with a red icon 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

And btw, QtC can help here :)

image

Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure VSCode has something like that too

ui/app/AppLayouts/Chat/stores/RootStore.qml Outdated Show resolved Hide resolved
@borismelnik borismelnik force-pushed the feat/issue-10852-unfurl-links branch from 93d4435 to bc3abdc Compare July 26, 2023 14:42
@borismelnik borismelnik requested a review from caybro July 26, 2023 14:42
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@lukaszso lukaszso left a comment

Choose a reason for hiding this comment

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

Tested and it works fine. As mentioned before the preview is not available but clicking on the link takes the user to the community. User links also work :)

@lukaszso lukaszso added tested and removed testing labels Jul 27, 2023
@borismelnik borismelnik force-pushed the feat/issue-10852-unfurl-links branch from bc3abdc to 8d53a27 Compare July 27, 2023 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update UI to use the new CreateShareURL api
7 participants