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: Use anchor tag for link preview #15039

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

p1gp1g
Copy link
Contributor

@p1gp1g p1gp1g commented Apr 19, 2023

This allows one to use the browser's context
menu for instance to copy the link or open
it in a new window.


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

We currently can't use the browser's context menu when a link is previewed. We can't copy/open in new (private) windows etc.

Causes (Optional)

The link previews use a paragraph tag.

Solutions

The link previews use an anchor tag.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@p1gp1g p1gp1g requested review from a team and otto-the-bot as code owners April 19, 2023 08:42
@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@p1gp1g p1gp1g changed the title featt: Use anchor tag for link preview feat: Use anchor tag for link preview Apr 19, 2023
@p1gp1g
Copy link
Contributor Author

p1gp1g commented Sep 6, 2023

Gentle ping for this MR. The current behavior can be frustrating and the fix is very simple

@p1gp1g
Copy link
Contributor Author

p1gp1g commented Sep 13, 2023

@atomrc : Sorry if you are not the right person to contact, I didn't find the information on the README.

Almost every day, I have to look at the DOM of the application to copy links/open in private windows because the links are not in anchor tags. Do you think it is possible to review this PR ?

className="link-preview-info-link text-foreground ellipsis"
href={preview.url}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the prependProtocol function on the preview.url from UrlUtil to make sure the link has the right protocol.

href={prependProtocol(preview.url)}

@atomrc
Copy link
Contributor

atomrc commented Sep 13, 2023

Hi @p1gp1g and thanks for your contribution 👌

A few things to consider that I have added as a review.

Thanks again and let me know if you have any question :)

@p1gp1g
Copy link
Contributor Author

p1gp1g commented Sep 13, 2023

Thanks for your review ! I have amended the commit with your changes

Note: noreferrer alone should be enough: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel#noreferrer

This allows one to use the browser's context
menu for instance to copy the link or open
it in a new window.
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #15039 (59d0a4b) into dev (607f51b) will increase coverage by 1.06%.
Report is 676 commits behind head on dev.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev   #15039      +/-   ##
==========================================
+ Coverage   43.42%   44.48%   +1.06%     
==========================================
  Files         645      672      +27     
  Lines       21582    22707    +1125     
  Branches     4945     5167     +222     
==========================================
+ Hits         9372    10102     +730     
- Misses      11025    11316     +291     
- Partials     1185     1289     +104     

Copy link
Contributor

@atomrc atomrc left a comment

Choose a reason for hiding this comment

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

Approved 😎
Thanks @p1gp1g

@atomrc atomrc merged commit ca6e537 into wireapp:dev Sep 13, 2023
12 of 13 checks passed
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.

None yet

3 participants