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

Respect CTRL/CMD+Click for opening instance editor in new tab #4800

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

Steve-Mcl
Copy link
Contributor

Description

Opens the instance editor in a new tab when CTRL/CMD is held
This is not as straight forward as setting target since the URL for immersive is different to the URL for standalone (thought that is something that could potentially be handled with more effort)
For now, this is a simple mod that adds to the current working logic. i.e. currently, we do already support middle mouse button click, this PR builds on that to check the key held and opens in a new tab if it is.

Very much a nice to have but worth the 20 mins

Related Issue(s)

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.72%. Comparing base (5475a81) to head (53dd1c2).
Report is 32 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4800   +/-   ##
=======================================
  Coverage   78.72%   78.72%           
=======================================
  Files         314      314           
  Lines       15053    15053           
  Branches     3457     3457           
=======================================
  Hits        11851    11851           
  Misses       3202     3202           
Flag Coverage Δ
backend 78.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@@ -89,7 +89,15 @@ export default {
if (this.disabled) {
return false
}
window.open(this.url, !this.isImmersiveEditor ? '_blank' : '_self')
let href = this.url
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a viable solution but for only one specific use case.

My take on this problem would be in the frontend/src/ui-components/components/Button.vue component, to completely remove the button and used an anchor stylized as a button or switch the type='anchor' where needed on the said component. That way we'd let the default html events take their course and we wouldn't need to intervene for niche cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but the issue is the URL is different depending on accessing the editor direct or immersive. As it stands, we have no option but to have a click handler for the descision stuff and a href for the middle click.

Copy link
Contributor

Choose a reason for hiding this comment

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

my bad, my solution was focused on other places where this is happening!

@@ -89,7 +89,15 @@ export default {
if (this.disabled) {
return false
}
window.open(this.url, !this.isImmersiveEditor ? '_blank' : '_self')
let href = this.url
Copy link
Contributor

Choose a reason for hiding this comment

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

my bad, my solution was focused on other places where this is happening!

@cstns cstns merged commit bb77f60 into main Nov 20, 2024
13 checks passed
@cstns cstns deleted the improve-new-window-opening branch November 20, 2024 15:31
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.

2 participants