Skip to content

Commit ae5354d

Browse files
authored
Feature: Replaced Release Notes dialog with dedicated tab (#17016)
1 parent 19c6f1e commit ae5354d

40 files changed

+402
-276
lines changed

src/Files.App/Actions/Content/Archives/Compress/BaseCompressArchiveAction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ private bool IsContextPageTypeAdaptedToCommand()
5151
return
5252
context.PageType != ContentPageTypes.RecycleBin &&
5353
context.PageType != ContentPageTypes.ZipFolder &&
54+
context.PageType != ContentPageTypes.ReleaseNotes &&
55+
context.PageType != ContentPageTypes.Settings &&
5456
context.PageType != ContentPageTypes.None;
5557
}
5658

src/Files.App/Actions/Content/Archives/Decompress/BaseDecompressArchiveAction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ protected bool IsContextPageTypeAdaptedToCommand()
4343
return
4444
context.PageType != ContentPageTypes.RecycleBin &&
4545
context.PageType != ContentPageTypes.ZipFolder &&
46+
context.PageType != ContentPageTypes.ReleaseNotes &&
47+
context.PageType != ContentPageTypes.Settings &&
4648
context.PageType != ContentPageTypes.None;
4749
}
4850

src/Files.App/Actions/Content/Background/BaseSetAsAction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ internal abstract class BaseSetAsAction : ObservableObject, IAction
2121
ContentPageContext.ShellPage is not null &&
2222
ContentPageContext.PageType != ContentPageTypes.RecycleBin &&
2323
ContentPageContext.PageType != ContentPageTypes.ZipFolder &&
24+
ContentPageContext.PageType != ContentPageTypes.ReleaseNotes &&
25+
ContentPageContext.PageType != ContentPageTypes.Settings &&
2426
(ContentPageContext.ShellPage?.SlimContentPage?.SelectedItemsPropertiesViewModel?.IsCompatibleToSetAsWindowsWallpaper ?? false);
2527

2628
public BaseSetAsAction()

src/Files.App/Actions/Content/ImageManipulation/BaseRotateAction.cs

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ private bool IsContextPageTypeAdaptedToCommand()
4545
return
4646
context.PageType != ContentPageTypes.RecycleBin &&
4747
context.PageType != ContentPageTypes.ZipFolder &&
48+
context.PageType != ContentPageTypes.ReleaseNotes &&
49+
context.PageType != ContentPageTypes.Settings &&
4850
context.PageType != ContentPageTypes.None;
4951
}
5052

src/Files.App/Actions/FileSystem/CopyPathAction.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ public string Description
1818
public RichGlyph Glyph
1919
=> new RichGlyph(themedIconStyle: "App.ThemedIcons.CopyAsPath");
2020

21-
public bool IsExecutable
22-
=> context.PageType != ContentPageTypes.Home && context.PageType != ContentPageTypes.RecycleBin;
21+
public bool IsExecutable =>
22+
context.PageType != ContentPageTypes.Home &&
23+
context.PageType != ContentPageTypes.RecycleBin &&
24+
context.PageType != ContentPageTypes.ReleaseNotes &&
25+
context.PageType != ContentPageTypes.Settings;
2326

2427
public CopyPathAction()
2528
{

src/Files.App/Actions/FileSystem/CopyPathWithQuotesAction.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ public string Description
1818
public RichGlyph Glyph
1919
=> new RichGlyph(themedIconStyle: "App.ThemedIcons.CopyAsPath");
2020

21-
public bool IsExecutable
22-
=> context.PageType != ContentPageTypes.Home && context.PageType != ContentPageTypes.RecycleBin;
21+
public bool IsExecutable =>
22+
context.PageType != ContentPageTypes.Home &&
23+
context.PageType != ContentPageTypes.RecycleBin &&
24+
context.PageType != ContentPageTypes.ReleaseNotes &&
25+
context.PageType != ContentPageTypes.Settings;
2326

2427
public CopyPathWithQuotesAction()
2528
{

src/Files.App/Actions/FileSystem/PasteItemAction.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public bool GetIsExecutable()
5353
App.AppModel.IsPasteEnabled &&
5454
context.PageType != ContentPageTypes.Home &&
5555
context.PageType != ContentPageTypes.RecycleBin &&
56-
context.PageType != ContentPageTypes.SearchResults;
56+
context.PageType != ContentPageTypes.SearchResults &&
57+
context.PageType != ContentPageTypes.ReleaseNotes &&
58+
context.PageType != ContentPageTypes.Settings;
5759
}
5860

5961
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)

src/Files.App/Actions/FileSystem/PasteItemAsShortcutAction.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public bool GetIsExecutable()
4242
App.AppModel.IsPasteEnabled &&
4343
context.PageType != ContentPageTypes.Home &&
4444
context.PageType != ContentPageTypes.RecycleBin &&
45-
context.PageType != ContentPageTypes.SearchResults;
45+
context.PageType != ContentPageTypes.SearchResults &&
46+
context.PageType != ContentPageTypes.ReleaseNotes &&
47+
context.PageType != ContentPageTypes.Settings;
4648
}
4749

4850
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)

src/Files.App/Actions/FileSystem/PasteItemToSelectionAction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public bool GetIsExecutable()
4747
if (!App.AppModel.IsPasteEnabled)
4848
return false;
4949

50-
if (context.PageType is ContentPageTypes.Home or ContentPageTypes.RecycleBin or ContentPageTypes.SearchResults)
50+
if (context.PageType is ContentPageTypes.Home or ContentPageTypes.RecycleBin or ContentPageTypes.SearchResults or ContentPageTypes.ReleaseNotes or ContentPageTypes.Settings)
5151
return false;
5252

5353
if (!context.HasSelection)

src/Files.App/Actions/FileSystem/RenameAction.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ private bool IsPageTypeValid()
5252
context.PageType != ContentPageTypes.None &&
5353
context.PageType != ContentPageTypes.Home &&
5454
context.PageType != ContentPageTypes.RecycleBin &&
55-
context.PageType != ContentPageTypes.ZipFolder;
55+
context.PageType != ContentPageTypes.ZipFolder &&
56+
context.PageType != ContentPageTypes.ReleaseNotes &&
57+
context.PageType != ContentPageTypes.Settings;
5658
}
5759

5860
private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)

src/Files.App/Actions/Open/OpenReleaseNotesAction.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ namespace Files.App.Actions
55
{
66
internal sealed partial class OpenReleaseNotesAction : ObservableObject, IAction
77
{
8-
private readonly IDialogService DialogService = Ioc.Default.GetRequiredService<IDialogService>();
8+
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
99
private readonly IUpdateService UpdateService = Ioc.Default.GetRequiredService<IUpdateService>();
10+
1011
public string Label
11-
=> Strings.WhatsNew.GetLocalizedResource();
12+
=> Strings.ReleaseNotes.GetLocalizedResource();
1213

1314
public string Description
14-
=> Strings.WhatsNewDescription.GetLocalizedResource();
15+
=> Strings.ReleaseNotesDescription.GetLocalizedResource();
1516

1617
public RichGlyph Glyph
1718
=> new(themedIconStyle: "App.ThemedIcons.AppUpdatedBox");
@@ -26,10 +27,7 @@ public OpenReleaseNotesAction()
2627

2728
public Task ExecuteAsync(object? parameter = null)
2829
{
29-
var viewModel = new ReleaseNotesDialogViewModel(Constants.ExternalUrl.ReleaseNotesUrl);
30-
var dialog = DialogService.GetDialog(viewModel);
31-
32-
return dialog.TryShowAsync();
30+
return NavigationHelpers.OpenPathInNewTab("ReleaseNotes", true);
3331
}
3432

3533
private void UpdateService_PropertyChanged(object? sender, PropertyChangedEventArgs e)

src/Files.App/Actions/Open/OpenTerminalAction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected virtual string[] GetPaths()
9696

9797
private bool GetIsExecutable()
9898
{
99-
if (context.PageType is ContentPageTypes.None or ContentPageTypes.Home or ContentPageTypes.RecycleBin or ContentPageTypes.ZipFolder)
99+
if (context.PageType is ContentPageTypes.None or ContentPageTypes.Home or ContentPageTypes.RecycleBin or ContentPageTypes.ZipFolder or ContentPageTypes.ReleaseNotes or ContentPageTypes.Settings)
100100
return false;
101101

102102
var isFolderNull = context.Folder is null;

src/Files.App/Data/Contexts/ContentPage/ContentPageContext.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ private void InstanceViewModel_PropertyChanged(object? sender, PropertyChangedEv
147147
case nameof(CurrentInstanceViewModel.IsPageTypeCloudDrive):
148148
case nameof(CurrentInstanceViewModel.IsPageTypeMtpDevice):
149149
case nameof(CurrentInstanceViewModel.IsPageTypeSearchResults):
150+
case nameof(CurrentInstanceViewModel.IsPageTypeReleaseNotes):
151+
case nameof(CurrentInstanceViewModel.IsPageTypeSettings):
150152
UpdatePageType();
151153
break;
152154
case nameof(CurrentInstanceViewModel.IsGitRepository):
@@ -210,13 +212,15 @@ private void UpdatePageType()
210212
{
211213
null => ContentPageTypes.None,
212214
{ IsPageTypeNotHome: false } => ContentPageTypes.Home,
215+
{ IsPageTypeReleaseNotes: true } => ContentPageTypes.ReleaseNotes,
213216
{ IsPageTypeRecycleBin: true } => ContentPageTypes.RecycleBin,
214217
{ IsPageTypeZipFolder: true } => ContentPageTypes.ZipFolder,
215218
{ IsPageTypeFtp: true } => ContentPageTypes.Ftp,
216219
{ IsPageTypeLibrary: true } => ContentPageTypes.Library,
217220
{ IsPageTypeCloudDrive: true } => ContentPageTypes.CloudDrive,
218221
{ IsPageTypeMtpDevice: true } => ContentPageTypes.MtpDevice,
219222
{ IsPageTypeSearchResults: true } => ContentPageTypes.SearchResults,
223+
{ IsPageTypeSettings: true } => ContentPageTypes.Settings,
220224
_ => ContentPageTypes.Folder,
221225
};
222226
SetProperty(ref pageType, type, nameof(PageType));
@@ -246,7 +250,9 @@ and not ContentPageTypes.Home
246250
and not ContentPageTypes.RecycleBin
247251
and not ContentPageTypes.ZipFolder
248252
and not ContentPageTypes.SearchResults
249-
and not ContentPageTypes.MtpDevice;
253+
and not ContentPageTypes.MtpDevice
254+
and not ContentPageTypes.ReleaseNotes
255+
and not ContentPageTypes.Settings;
250256
}
251257
}
252258
}

src/Files.App/Data/Contexts/ContentPage/ContentPageTypes.cs

+2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ public enum ContentPageTypes : ushort
1515
CloudDrive,
1616
MtpDevice,
1717
SearchResults,
18+
ReleaseNotes,
19+
Settings,
1820
}
1921
}

src/Files.App/Data/Contracts/IShellPage.cs

+5
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ public interface IShellPage : ITabBarItemContent, IMultiPaneInfo, IDisposable, I
6565
/// Navigates to the home page
6666
/// </summary>
6767
public void NavigateHome();
68+
69+
/// <summary>
70+
/// Navigates to the release notes page
71+
/// </summary>
72+
public void NavigateToReleaseNotes();
6873

6974
void NavigateWithArguments(Type sourcePageType, NavigationArguments navArgs);
7075

src/Files.App/Data/Items/LocationItem.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public string Path
4848
Path.Contains('?', StringComparison.Ordinal) ||
4949
Path.StartsWith("shell:", StringComparison.OrdinalIgnoreCase) ||
5050
Path.EndsWith(ShellLibraryItem.EXTENSION, StringComparison.OrdinalIgnoreCase) ||
51-
Path == "Home"
51+
Path == "Home" ||
52+
Path == "ReleaseNotes" ||
53+
Path == "Settings"
5254
? Text
5355
: Path;
5456
}

src/Files.App/Data/Models/CurrentInstanceViewModel.cs

+26-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,30 @@ public bool IsPageTypeNotHome
5252
OnPropertyChanged(nameof(CanCopyPathInPage));
5353
}
5454
}
55+
56+
private bool isPageTypeReleaseNotes = false;
57+
public bool IsPageTypeReleaseNotes
58+
{
59+
get => isPageTypeReleaseNotes;
60+
set
61+
{
62+
SetProperty(ref isPageTypeReleaseNotes, value);
63+
OnPropertyChanged(nameof(CanCreateFileInPage));
64+
OnPropertyChanged(nameof(CanCopyPathInPage));
65+
}
66+
}
67+
68+
private bool isPageTypeSettings = false;
69+
public bool IsPageTypeSettings
70+
{
71+
get => isPageTypeSettings;
72+
set
73+
{
74+
SetProperty(ref isPageTypeSettings, value);
75+
OnPropertyChanged(nameof(CanCreateFileInPage));
76+
OnPropertyChanged(nameof(CanCopyPathInPage));
77+
}
78+
}
5579

5680
private bool isPageTypeMtpDevice = false;
5781
public bool IsPageTypeMtpDevice
@@ -124,12 +148,12 @@ public bool IsPageTypeLibrary
124148

125149
public bool CanCopyPathInPage
126150
{
127-
get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults;
151+
get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults && !IsPageTypeReleaseNotes && !IsPageTypeSettings;
128152
}
129153

130154
public bool CanCreateFileInPage
131155
{
132-
get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults && !isPageTypeFtp && !isPageTypeZipFolder;
156+
get => !isPageTypeMtpDevice && !isPageTypeRecycleBin && isPageTypeNotHome && !isPageTypeSearchResults && !isPageTypeFtp && !isPageTypeZipFolder && !IsPageTypeReleaseNotes && !IsPageTypeSettings;
133157
}
134158

135159
public bool CanTagFilesInPage

src/Files.App/Dialogs/ReleaseNotesDialog.xaml

-87
This file was deleted.

0 commit comments

Comments
 (0)