files-community / Files

Building the best file manager for Windows
https://files.community
MIT License
33.92k stars 2.17k forks source link

Bug: Open in new tab doesn't show infomation #15825

Closed Josh65-2201 closed 1 month ago

Josh65-2201 commented 2 months ago

Description

The icon and name is blank until opened.

Steps To Reproduce

  1. Open a folder or sidebar item in a new tab (Middle click or context menu)

Requirements

Files Version

3.5.10.0

Windows Version

10.0.22621.3737

Log File

debug.log

yaira2 commented 2 months ago

Does the icon load if you switch tabs?

Josh65-2201 commented 2 months ago

Yes it show normally when switch to

MrFrawsty commented 2 months ago

I believe I found the issue. at Files.App\Helpers\Navigation\NavigationHelpers.cs inside the UpdateTabInfoAsync method there is this bit of code. I did not add this comment and I am not familiar enough with the project to understand exactly how a1 and a2 are checking if the contents of the tab have changed. However, it is keeping the tab from initially loading the header, icon and tooltip.

If someone more familiar with how this works would like to advise me, I'd be happy to fix it. Otherwise feel free to just fix it if that's faster/easier for you :)

// Don't update tabItem if the contents of the tab have already changed
if (result.Item1 is not null)
{
    var navigationParameter = tabItem.NavigationParameter.NavigationParameter;
    var a1 = navigationParameter is PaneNavigationArguments pna1 ? pna1 : new PaneNavigationArguments() { LeftPaneNavPathParam = navigationParameter as string };
    var a2 = navigationArg is PaneNavigationArguments pna2 ? pna2 : new PaneNavigationArguments() { LeftPaneNavPathParam = navigationArg as string };

    if (a1 == a2)
        (tabItem.Header, tabItem.IconSource, tabItem.ToolTipText) = result;
}
yaira2 commented 2 months ago

Fyi @hishitetsu

hishitetsu commented 1 month ago

That code is for #12939. It used to work fine, so the recent changes must have prevented it from working properly.

hishitetsu commented 1 month ago

I submitted a PR to fix this issue. #15898 @MrFrawsty thank you for the information!