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

fix(files): Allow Ctrl/Command click on file entries to open in a new tab #42457

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Dec 22, 2023

Bring back opening files in a new tab by Ctrl-clicking on the file list entry. metaKey is needed for macOS support.

@juliushaertl juliushaertl requested review from skjnldsv, susnux, a team and Fenn-CS and removed request for a team December 22, 2023 13:07
@juliushaertl juliushaertl added bug 3. to review Waiting for reviews labels Dec 22, 2023
@juliushaertl juliushaertl added this to the Nextcloud 29 milestone Dec 22, 2023
@juliushaertl
Copy link
Member Author

/backport to stable28

@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Dec 27, 2023
@skjnldsv
Copy link
Member

/compile /

… tab

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl
Copy link
Member Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@skjnldsv
Copy link
Member

skjnldsv commented Dec 27, 2023

The bot is soooo weird @juliushaertl
image

@juliushaertl
Copy link
Member Author

juliushaertl commented Dec 27, 2023

I restarted the action manually as it didn't seem to be working smoothly on self-hosted runners

@juliushaertl
Copy link
Member Author

@skjnldsv
Copy link
Member

Oooh, it fails if init ran on a different runner type than process

@skjnldsv skjnldsv merged commit 1fbfc4f into master Dec 27, 2023
42 checks passed
@skjnldsv skjnldsv deleted the bugfix/noid/ctrl-click branch December 27, 2023 09:57
@backportbot-nextcloud
Copy link

The backport to stable28 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable28
git pull origin stable28

# Create the new backport branch
git checkout -b fix/foo-stable28

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123

# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable28

Error: Unknown error

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@juliushaertl
Copy link
Member Author

/backport 2c7f632 to stable28

@ShGKme
Copy link
Contributor

ShGKme commented Jan 25, 2024

This solution overrides browser default behavior. While it allows to open link on new tab, the link is still invalid:

  • Middle click is invalid
  • Context menu is invalid
  • title and attributes are invalid

For example, for a folder it says that it is a link to download a file via /remote.php while actually click opens a folder.

@ShGKme
Copy link
Contributor

ShGKme commented Jan 25, 2024

This line doesn't work, we cannot take data from another child through parent on initial render. There is no another child on this moment.

const enabledDefaultActions = this.$parent?.$refs?.actions?.enabledDefaultActions

And anyway I don't think it is a good approach to transfer data by manually going through nodes...

@juliushaertl
Copy link
Member Author

I'm not sure what URL I would expect...

  • Internal file link (/f/12345) would work for middle click and context menu open in new tab/window, but would not work when using the browsers "Save link as"
  • WebDAV URL does not work for open in a new tab then

@ShGKme
Copy link
Contributor

ShGKme commented Jan 25, 2024

Link should be the same as what it opens. If a link opens /foo/bar, then it should have href /foo/bar.

Here it also makes the link download link and the title says "Download".

The source of the issue is that this line, that was supposed to find the default action, fails on initial rendering.

There is the default action for a folder (open it), but this line on component creation doesn't work, because it tries to get data from another not mounted component, not from the state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot open documents/files in new tabs anymore (using Ctrl+Click) since NC 28
5 participants