Skip to content

Feature: Display banner when all sections are hidden on the sidebar #17039

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
@@ -3508,7 +3508,7 @@
<data name="StatusCenter_GitCloneInProgress_SubHeader" xml:space="preserve">
<value>Cloning {0} from "{1}" to "{2}"</value>
<comment>Shown in a StatusCenter card.</comment>
</data>
</data>
<data name="StatusCenter_InstallFontCanceled_Header" xml:space="preserve">
<value>Canceled installing {0} fonts</value>
<comment>Shown in a StatusCenter card.</comment>
@@ -3540,7 +3540,7 @@
<data name="StatusCenter_InstallFontInProgress_SubHeader" xml:space="preserve">
<value>Installing {0} font(s) from "{1}"</value>
<comment>Shown in a StatusCenter card.</comment>
</data>
</data>
<data name="StatusCenter_CopyCanceled_Header" xml:space="preserve">
<value>Canceled copying {0} item(s) to "{1}"</value>
<comment>Shown in a StatusCenter card.</comment>
@@ -4193,4 +4193,10 @@
<data name="EnableOmnibar" xml:space="preserve">
<value>Enable Omnibar</value>
</data>
<data name="SectionsHidden" xml:space="preserve">
<value>Sections hidden</value>
</data>
<data name="SectionsHiddenMessage" xml:space="preserve">
<value>You can add the sections back by right-clicking the sidebar area and selecting the sections you want to add.</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/Files.App/ViewModels/UserControls/SidebarViewModel.cs
Original file line number Diff line number Diff line change
@@ -59,6 +59,7 @@ public SidebarDisplayMode SidebarDisplayMode
if (SetProperty(ref sidebarDisplayMode, value))
{
OnPropertyChanged(nameof(IsSidebarCompactSize));
OnPropertyChanged(nameof(AreSectionsHidden));
IsSidebarOpen = sidebarDisplayMode == SidebarDisplayMode.Expanded;
UpdateTabControlMargin();
}
@@ -134,6 +135,16 @@ public bool IsSidebarOpen
}
}

public bool AreSectionsHidden =>
!ShowPinnedFoldersSection &&
!ShowLibrarySection &&
!ShowDrivesSection &&
!ShowCloudDrivesSection &&
!ShowNetworkSection &&
(!ShowWslSection || WSLDistroManager.Distros.Any() == false) &&
!ShowFileTagsSection &&
SidebarDisplayMode is not SidebarDisplayMode.Compact;

public bool ShowPinnedFoldersSection
{
get => UserSettingsService.GeneralSettingsService.ShowPinnedSection;
@@ -635,30 +646,37 @@ private async void UserSettingsService_OnSettingChangedEvent(object sender, Sett
case nameof(UserSettingsService.GeneralSettingsService.ShowPinnedSection):
await UpdateSectionVisibilityAsync(SectionType.Pinned, ShowPinnedFoldersSection);
OnPropertyChanged(nameof(ShowPinnedFoldersSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowLibrarySection):
await UpdateSectionVisibilityAsync(SectionType.Library, ShowLibrarySection);
OnPropertyChanged(nameof(ShowLibrarySection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowCloudDrivesSection):
await UpdateSectionVisibilityAsync(SectionType.CloudDrives, ShowCloudDrivesSection);
OnPropertyChanged(nameof(ShowCloudDrivesSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowDrivesSection):
await UpdateSectionVisibilityAsync(SectionType.Drives, ShowDrivesSection);
OnPropertyChanged(nameof(ShowDrivesSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowNetworkSection):
await UpdateSectionVisibilityAsync(SectionType.Network, ShowNetworkSection);
OnPropertyChanged(nameof(ShowNetworkSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowWslSection):
await UpdateSectionVisibilityAsync(SectionType.WSL, ShowWslSection);
OnPropertyChanged(nameof(ShowWslSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
case nameof(UserSettingsService.GeneralSettingsService.ShowFileTagsSection):
await UpdateSectionVisibilityAsync(SectionType.FileTag, ShowFileTagsSection);
OnPropertyChanged(nameof(ShowFileTagsSection));
OnPropertyChanged(nameof(AreSectionsHidden));
break;
}
}
6 changes: 6 additions & 0 deletions src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -261,6 +261,12 @@

<controls:SidebarView.Footer>
<StackPanel Padding="4" Spacing="4">
<InfoBar
Title="{helpers:ResourceString Name=SectionsHidden}"
IsClosable="False"
IsOpen="{x:Bind SidebarAdaptiveViewModel.AreSectionsHidden, Mode=OneWay}"
Message="{helpers:ResourceString Name=SectionsHiddenMessage}" />

<Border
Height="1"
HorizontalAlignment="Stretch"

Unchanged files with check annotations Beta

/// <summary>
/// Analyzer that detects if string literals can be replaced with constants from the <c>Strings</c> class.
/// </summary>
[DiagnosticAnalyzer(LanguageNames.CSharp)]

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 12 in src/Files.Core.SourceGenerator/Analyzers/StringsPropertyAnalyzer.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class StringsPropertyAnalyzer : DiagnosticAnalyzer
{
/// <summary>
/// <summary>
/// A generator for serializing/deserializing objects to/from the Windows Registry using attributes.
/// </summary>
[Generator]

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 9 in src/Files.Core.SourceGenerator/Generators/RegistrySerializationGenerator.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class RegistrySerializationGenerator : IIncrementalGenerator
{
/// <summary>
/// <summary>
/// Generates properties for strings based on resource files.
/// </summary>
[Generator]

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Release, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Debug, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Release, arm64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

Check warning on line 13 in src/Files.Core.SourceGenerator/Generators/StringsPropertyGenerator.cs

GitHub Actions / build (Debug, x64)

This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)
internal sealed class StringsPropertyGenerator : IIncrementalGenerator
{
// Static HashSet to track generated file names
{
public unsafe struct IStorageProviderQuotaUI : IComIID
{
private void** lpVtbl;

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderQuotaUI.cs

GitHub Actions / build (Release, x64)

Field 'IStorageProviderQuotaUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderQuotaUI.cs

GitHub Actions / build (Debug, arm64)

Field 'IStorageProviderQuotaUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderQuotaUI.cs

GitHub Actions / build (Release, arm64)

Field 'IStorageProviderQuotaUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderQuotaUI.cs

GitHub Actions / build (Debug, x64)

Field 'IStorageProviderQuotaUI.lpVtbl' is never assigned to, and will always have its default value
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT GetQuotaTotalInBytes(ulong* value)
{
public unsafe struct IStorageProviderStatusUI : IComIID
{
private void** lpVtbl;

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUI.cs

GitHub Actions / build (Release, x64)

Field 'IStorageProviderStatusUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUI.cs

GitHub Actions / build (Debug, arm64)

Field 'IStorageProviderStatusUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUI.cs

GitHub Actions / build (Release, arm64)

Field 'IStorageProviderStatusUI.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUI.cs

GitHub Actions / build (Debug, x64)

Field 'IStorageProviderStatusUI.lpVtbl' is never assigned to, and will always have its default value
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT GetQuotaUI(IStorageProviderQuotaUI** result)
{
public unsafe struct IStorageProviderStatusUISource : IComIID
{
private void** lpVtbl;

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISource.cs

GitHub Actions / build (Release, x64)

Field 'IStorageProviderStatusUISource.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISource.cs

GitHub Actions / build (Debug, arm64)

Field 'IStorageProviderStatusUISource.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISource.cs

GitHub Actions / build (Release, arm64)

Field 'IStorageProviderStatusUISource.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISource.cs

GitHub Actions / build (Debug, x64)

Field 'IStorageProviderStatusUISource.lpVtbl' is never assigned to, and will always have its default value
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT GetStatusUI(IStorageProviderStatusUI** result)
{
public unsafe struct IStorageProviderStatusUISourceFactory : IComIID
{
private void** lpVtbl;

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISourceFactory.cs

GitHub Actions / build (Release, x64)

Field 'IStorageProviderStatusUISourceFactory.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISourceFactory.cs

GitHub Actions / build (Debug, arm64)

Field 'IStorageProviderStatusUISourceFactory.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISourceFactory.cs

GitHub Actions / build (Release, arm64)

Field 'IStorageProviderStatusUISourceFactory.lpVtbl' is never assigned to, and will always have its default value

Check warning on line 14 in src/Files.App.CsWin32/IStorageProviderStatusUISourceFactory.cs

GitHub Actions / build (Debug, x64)

Field 'IStorageProviderStatusUISourceFactory.lpVtbl' is never assigned to, and will always have its default value
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT GetStatusUISource(nint syncRootId, IStorageProviderStatusUISource** result)
GetKeyState
CreateDirectoryFromApp
WNetCancelConnection2
NET_USE_CONNECT_FLAGS

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found

Check warning on line 48 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

Method, type or constant "NET_USE_CONNECT_FLAGS" not found
NETRESOURCEW
WNetAddConnection3
CREDENTIALW
SetEntriesInAcl
ACL_SIZE_INFORMATION
DeleteAce
EXPLICIT_ACCESS

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?

Check warning on line 81 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

Method, type or constant "EXPLICIT_ACCESS" not found. Did you mean or "EXPLICIT_ACCESS_A" or "EXPLICIT_ACCESS_W"?
ACCESS_ALLOWED_ACE
LookupAccountSid
GetComputerName
CoTaskMemFree
QueryDosDevice
DeviceIoControl
GetLastError

Check warning on line 137 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, x64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 137 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, arm64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 137 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Release, arm64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error

Check warning on line 137 in src/Files.App.CsWin32/NativeMethods.txt

GitHub Actions / build (Debug, x64)

This API will not be generated. Do not generate GetLastError. Call Marshal.GetLastWin32Error() instead. Learn more from https://docs.microsoft.com/dotnet/api/system.runtime.interopservices.marshal.getlastwin32error
CreateFile
GetVolumeInformation
COMPRESSION_FORMAT