Bug 388769

Summary: Please add the possibility to open new tabs in the foreground
Product: [Applications] dolphin Reporter: Thomas Vde <ThomasvonderElbe>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: carsten888, correosinuso23, ed2, elvis.angelaccio, felixernst, kdedev, nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Thomas Vde 2018-01-10 09:44:19 UTC
I would like to have the option to open a new tab in the foreground. Like most browsers have. Default could still be "open in the background" but under Settings could be an option to switch to "open a new tab in the foreground".

That would be wonderful!
I love dolphin!
Comment 1 edbe 2024-08-22 12:44:30 UTC
In Dolphin, new tabs should by default open in the foreground. 

Reason: When I open a folder in a new tab, I want to work within this folder right away in 98% of the cases. Today I need to open the new tab with the folder and then to click on the tab in order to bring the new tab into the foreground. The new tab should be immediately shown after choosing to open a folder in a new tab.

Old workflow
1. Choose "Open in a new tab" (opens the folder in the new tab)
2. Click on the new tab (to see the content of the opened folder)

Improved workflow
1. Choose "Open in a new tab" (should bring you directly to the new tab with the opened folder)
Comment 2 Felix Ernst 2024-08-25 10:12:05 UTC
>I would like to have the option to open a new tab in the foreground. Like most browsers have.

Shift+middle clicking a folder will open it as a new tab in the foreground, which is a feature which was also inspired by web browsers.

>under Settings could be an option to switch to "open a new tab in the foreground".

>When I open a folder in a new tab, I want to work within this folder right away
>in 98% of the cases. Today I need to open the new tab with the folder and then
>to click on the tab in order to bring the new tab into the foreground. The new
>tab should be immediately shown after choosing to open a folder in a new tab.

Interesting use cases. I agree that it makes some sense, I have just never encountered anyone having such a workflow. Considering that e.g. Firefox places this option in the settings quite prominently, it seems to be more popular than I expected. Especially for users who have this setting enabled in web browsers it must be quite jarring to see different behaviour happening in Dolphin when they open a new tab. I'll mark this bug report as confirmed.

>In Dolphin, new tabs should by default open in the foreground. 

I would say opening in an activated tab should not be the default currently because it is not the default behaviour in browsers either. It would IMO be a mistake to create an inconsistency for all KDE users by default there.

>I love dolphin!

Thanks! Many volunteers have brought us to where we are.
Comment 3 Thomas Vde 2024-08-25 11:53:40 UTC
(In reply to Felix Ernst from comment #2)

> I'll mark this bug report as
> confirmed.

Ah, wonderful! ... So there is hope! :-)


> >When I open a folder in a new tab, I want to work within this folder right away
> >in 98% of the cases. Today I need to open the new tab with the folder and then
> >to click on the tab in order to bring the new tab into the foreground. The new
> >tab should be immediately shown after choosing to open a folder in a new tab.
> 
> Interesting use cases. I agree that it makes some sense, I have just never
> encountered anyone having such a workflow. 

I am curious: How else could the "normal" workflow be (in the cases where one opens a folder in a new tab)? ... Mine is exactly like edbe's: After I opened it, I want to look inside. Why else would you open a new tab?


> >I love dolphin!
> 
> Thanks! Many volunteers have brought us to where we are.

Yes, Dolphin is the best! ... I use it for 15 years already. I know of no other browser coming even close to it! :-)
Comment 4 Felix Ernst 2024-08-27 21:34:25 UTC
(In reply to ThomasvonderElbe from comment #3)
> > >When I open a folder in a new tab, I want to work within this folder right away
> > >in 98% of the cases. Today I need to open the new tab with the folder and then
> > >to click on the tab in order to bring the new tab into the foreground. The new
> > >tab should be immediately shown after choosing to open a folder in a new tab.
> > 
> > Interesting use cases. I agree that it makes some sense, I have just never
> > encountered anyone having such a workflow. 
> 
> I am curious: How else could the "normal" workflow be (in the cases where
> one opens a folder in a new tab)? ... Mine is exactly like edbe's: After I
> opened it, I want to look inside. Why else would you open a new tab?

Well, if it is only about looking inside one folder, then simply activating the folder (by left clicking or pressing Enter) would accomplish that.

So opening tabs only ever makes sense for slightly more complex workflows. It is always about a user being interested in multiple folders, but not all of them immediately. So the current Dolphin default is to middle-click the folder one does not want to look at immediately, but open it in an inactive tab so it can be looked at later or be used for moving files between folders.

This bug report on the other hand is about wanting to use middle-click (or Ctrl+Enter) to directly look at the tab, while the previous location is kept around in a tab to be looked at or used some time later.

Here is an example of a workflow that seems way easier to me with Dolphin's current behaviour of opening inactive tabs by default:
A user has a folder with all their music by their favourite artist (e.g. the Beatles). All the tracks are currently sorted in folders for each album. The user wants to put all the tracks in one folder on an usb stick because only then it gets correctly shuffled on their music player. They now go into the Beatles folder and open every album in a new inactive tab. They then go from one tab to the next, move all songs in it to another folder before closing said tab.

Opening all folders for each music album in a tab would have been a lot more difficult if opening a tab would always move them away from the parent "Beatles" folder.
Comment 5 Thomas Vde 2024-08-28 08:08:55 UTC
(In reply to Felix Ernst from comment #4)

> Opening all folders for each music album in a tab would have been a lot more
> difficult if opening a tab would always move them away from the parent
> "Beatles" folder.

Thank you Felix, for this example! 
I understand better now.
And yes, in this case the workflow is much easier when the tabs open in the background.
And indeed sometimes these kinds of workflows happen here too.

On the other hand, the vast majority of the times, about 90%, my use-case is the following:  
I have a folder open, which I am working in and which I want to keep. And then the need arises to look something up in another folder. And for that I go to my list of bookmarks and find the folder or one of its parent folders and middle-click it. ... Yes, and then I need the extra additional step to bring it to the foreground. 

And yes, like you already anticipated: My Firefox is set up in a way, that I can open new tabs in the foreground too.  And it makes this really easy for me with a simple check-box in the settings.


Thank you again! :-)
Comment 6 edbe 2024-08-28 11:27:15 UTC
Thanks for the shortcut "Shift+middle clicking" which is already helpful. 

In Firefox, I usually want to open multiple links in the background while staying on the current page, especially on pages with search results. 

I work on documents which are in very different folders that are often far apart. Tabs are very helpful so I don't have to constantly click through many folders and subfolders every time. When I open a folder in a tab, I always have to open a folder or a file there. It would therefore be very helpful if “Open folder in tab” would open it in the foreground. 

Thanks for considering this.
Comment 7 Thomas Vde 2025-02-15 15:29:53 UTC
I can not wait any longer and would like to change the source code and compile my own dolphin with this feature.

Can someone tell me, where in the code this "new tab in background/foreground" decision is being made? ... Or where else I could ask this question?
Comment 8 Felix Ernst 2025-02-15 17:08:37 UTC
(In reply to ThomasvonderElbe from comment #7)
> I can not wait any longer and would like to change the source code and
> compile my own dolphin with this feature.
> 
> Can someone tell me, where in the code this "new tab in
> background/foreground" decision is being made? ... Or where else I could ask
> this question?

For middle-clicking the places panel, I assume it is this line https://invent.kde.org/system/dolphin/-/blob/f81d73a7f3a851dc755ef0cd1fd2a2507587a900/src/dolphinmainwindow.cpp#L2390 – just replace `openNewTab` with `openNewTabAndActivate` there should be enough. (Haven't tested.)

For middle-clicking folders within the view, you can probably do the same as above in https://invent.kde.org/system/dolphin/-/blob/f81d73a7f3a851dc755ef0cd1fd2a2507587a900/src/dolphinmainwindow.cpp#L2647 .
Comment 9 Thomas Vde 2025-02-17 11:41:17 UTC
(In reply to Felix Ernst from comment #8)
> For middle-clicking the places panel, I assume it is this line
> https://invent.kde.org/system/dolphin/-/blob/
> f81d73a7f3a851dc755ef0cd1fd2a2507587a900/src/dolphinmainwindow.cpp#L2390 –
> just replace `openNewTab` with `openNewTabAndActivate` there should be
> enough. (Haven't tested.)

This worked flawlessly!

> For middle-clicking folders within the view, you can probably do the same as
> above in
> https://invent.kde.org/system/dolphin/-/blob/
> f81d73a7f3a851dc755ef0cd1fd2a2507587a900/src/dolphinmainwindow.cpp#L2647 .

This did not work as expected. 
In the end I did exchange every `openNewTab` with `openNewTabAndActivate` and vice versa(!) in the lower part of dolphin/src/dolphinmainwindow.cpp.

And now it works just beautiful! ... Such an easy and unimpeded workflow for me ... a huge relief! ... All tabs open on Middle-Click in the foreground, even from the address-bar.. And for some rare occasions with Shift+Middle-Click I still have the option to open them in the background.

This is just wonderful! 
Dear Felix Ernst, ... thank you soo much !!!
:-)
Comment 10 Felix Ernst 2025-02-17 17:03:42 UTC
(In reply to ThomasvonderElbe from comment #9)
> This is just wonderful! 
> Dear Felix Ernst, ... thank you soo much !!!
> :-)

You are very welcome! I am glad my tips helped.
Comment 11 TraceyC 2025-06-10 19:52:36 UTC
*** Bug 505266 has been marked as a duplicate of this bug. ***
Comment 12 TraceyC 2025-06-10 19:54:06 UTC
We just had another user ask for a setting checkbox to toggle opening a new tab with focus by default

This seems reasonable
The option could go in Settings - Interface - Folders & Tabs
under "Open new tabs"
Comment 13 Thomas Vde 2025-06-11 06:09:59 UTC
(In reply to TraceyC from comment #12)

> This seems reasonable
> The option could go in Settings - Interface - Folders & Tabs
> under "Open new tabs"

Yes, this would be a real improvement!

I have been using this setting in my self-compiled Dolphin for 4 month now, daily. 
It is soo much more of a natural workflow to have the tab-opening-behavior consistent between file-browser and web-browser! It is great!

Thank you for the wonderful Dolphin! :-)