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: Make external portals open in new tab when clicked #3497

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

RODO94
Copy link
Contributor

@RODO94 RODO94 commented Aug 6, 2024

What does this PR do?

This PR adds functionality to open external portals in new tabs when they are clicked in the flow editor.

The work follows this Trello ticket: https://trello.com/c/MJ5VSADN/2960-could-external-portals-open-in-a-new-browser-tab-rather-than-in-window

I did think if it were better to enable right clicking to select what you'd like depending on your brower (new tab, new window etc...) but decided I'd follow the ticket explicitly first and see if more is required.

@RODO94 RODO94 requested a review from a team August 6, 2024 16:09
Copy link

github-actions bot commented Aug 6, 2024

Removed vultr server and associated DNS entries

Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

Also left this on Trello for full visibility - bit of a design issue here I've just realised.

The default behaviour when right-clicking (opening the context menu) is disabled when clicking on nodes as this is our hidden copy/paste shortcut.

If we enable right-click on a node, we’d need an alternative copy/paste option handled somehow.

Currently I can click on a node and open in-place, or ⌘ + click to open in a new tab - both options are available. If we just make nodes open in a new tab, the user loses the option to open in-place and is forced to open in new tab.

The PR does exactly as the ticket asks, but on reflection maybe this is not the right approach?

@RODO94
Copy link
Contributor Author

RODO94 commented Aug 7, 2024

@DafyddLlyr Great feedback! We're definitely on the same wavelength with this, I was tossing and turning over whether it is a simpler flow to ⌘ + click or click to open in a new tab and navigate back to the previous tab if you wanted to stay on the same tab.

Are you suggesting we look rather into a feature to right click and open in a new tab?

@DafyddLlyr
Copy link
Contributor

Are you suggesting we look rather into a feature to right click and open in a new tab?

I actually think the right thing to do here is nothing (for now!), until we design and implement an alternative approach to copy/paste which is currently hijacking the right-click interaction. We can discuss with the wider group on Thursday at planning 👍

Any thoughts on this @ianjon3s?

@ianjon3s
Copy link
Contributor

ianjon3s commented Aug 7, 2024

@RODO94 and I briefly discussed this and our thoughts are — as external portals cannot be cloned, if there is a simple way to allow right-click on only external portals (removing the right-click hijack for only them), then we'll proceed with that.

If not, leave as-is for now in favour of moving towards a context menu (or alternative to right-click to clone) for all components.

@DafyddLlyr
Copy link
Contributor

Ah that's a very good thought 🙌

There is already error handling for pasting external portals - so it makes sense to not allow them to be copied. If you just remove the onContextMenu prop from external portals this should solve it 👍

@RODO94 RODO94 marked this pull request as draft August 8, 2024 09:55
@RODO94
Copy link
Contributor Author

RODO94 commented Aug 8, 2024

Converting to Draft as there's still a bit of investigation and code to be added prior to any further review

@RODO94
Copy link
Contributor Author

RODO94 commented Aug 8, 2024

@RODO94 RODO94 marked this pull request as ready for review August 8, 2024 15:01
@RODO94 RODO94 requested a review from DafyddLlyr August 8, 2024 15:13
@RODO94 RODO94 requested a review from a team August 8, 2024 15:30
Copy link
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

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

One small thing which has been missed!

@jessicamcinchak
Copy link
Member

@RODO94 happy to do a final review of this one once that final comment from Daf is accounted for so it can be merged before he's back ! Will check back later today 🚀

@RODO94 RODO94 requested a review from a team August 12, 2024 09:37
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Thanks for final adjustments here, works exactly as expected for me ✔️

@RODO94 RODO94 merged commit 12d008a into main Aug 12, 2024
12 checks passed
@RODO94 RODO94 deleted the rory/external-portal-clickable branch August 12, 2024 12:22
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.

4 participants