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

Properly open selected folder on middle click #612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leomoty
Copy link
Contributor

@leomoty leomoty commented Jun 28, 2024

Now I have no clue how to test this, is there an easy way to figure out if the browser opened a new tab?

Fixes #545

@leomoty
Copy link
Contributor Author

leomoty commented Jun 28, 2024

Noticed I missed ctrl + click, will amend

@martinpitt
Copy link
Member

There is indeed no way to monitor the browser for multiple tabs in CDP. We also don't do this anywhere as we don't really want people to have a lot of parallel cockpit sessions in multiple tabs - we never test this, and at some point the communication overhead becomes quite severe.

I triggered the tests, I'll leave the functional review to @jelly . Thank you!

Comment on lines +147 to +148
if (newTab) {
open(`#/?path=${newPath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 2 added lines are not executed by any test.

@@ -194,7 +198,7 @@ export const FilesCardBody = ({
}

if (ev.detail > 1) {
onDoubleClickNavigate(file);
onClickNavigate(file);
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test.

}
};

const handleAuxClick = (ev: MouseEvent) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This added line is not executed by any test.

Comment on lines +220 to +223
if (ev.button === 1) {
ev.preventDefault();
const name = getFilenameForEvent(ev);
const file = sortedFiles?.find(file => file.name === name);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 4 added lines are not executed by any test.

Comment on lines +225 to +227
if (file) {
setSelected([file]);
onClickNavigate(file, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 3 added lines are not executed by any test.

@leomoty
Copy link
Contributor Author

leomoty commented Jul 1, 2024

There is indeed no way to monitor the browser for multiple tabs in CDP. We also don't do this anywhere as we don't really want people to have a lot of parallel cockpit sessions in multiple tabs - we never test this, and at some point the communication overhead becomes quite severe.

I triggered the tests, I'll leave the functional review to @jelly . Thank you!

Thanks Martin, yea, I guess a middle ground is merging the middle click, which works as expected, I didn't really put much thought into CTRL + CLICK, as it currently fights with multiple selection, just wanted to showcase that.

@leomoty
Copy link
Contributor Author

leomoty commented Jul 3, 2024

@jelly can I get a review? :), do not mind the ctrl click, I think we need to discuss it further, but if you are happy I can remove it and we could partially work only the middle click

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.

Properly support opening in browser tabs
3 participants