Removed migrations. New onboarding screen and wizard like steps.

This commit is contained in:
Burak Kaan Köse
2026-03-06 03:42:08 +01:00
parent db5ecd60e4
commit aaa6e8a2c9
56 changed files with 1843 additions and 554 deletions
@@ -22,40 +22,16 @@
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<controls:UpdateNotesFlipViewControl x:Name="UpdateNotesControl" Sections="{x:Bind Sections, Mode=OneTime}" />
<StackPanel
x:Name="MigrationPanel"
Grid.Row="1"
Spacing="8"
Visibility="Collapsed">
<TextBlock x:Name="MigrationTitleText" Style="{StaticResource BodyStrongTextBlockStyle}" />
<TextBlock x:Name="MigrationDescriptionText" TextWrapping="WrapWholeWords" />
<ProgressBar
x:Name="MigrationProgressBar"
IsIndeterminate="True"
Visibility="Collapsed" />
<TextBlock
x:Name="MigrationErrorText"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
TextWrapping="WrapWholeWords"
Visibility="Collapsed" />
</StackPanel>
<StackPanel
Grid.Row="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="8">
<Button
x:Name="ContinueAnywayButton"
Click="OnContinueAnywayClicked"
Content="{x:Bind domain:Translator.WhatIsNew_ContinueAnywayButton}"
Visibility="Collapsed" />
<Button
x:Name="GetStartedButton"
Click="OnGetStartedClicked"
@@ -1,8 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Wino.Core.Domain;
using Wino.Core.Domain.Interfaces;
using Wino.Core.Domain.Models.Updates;
@@ -11,7 +9,6 @@ namespace Wino.Dialogs;
public sealed partial class WhatIsNewDialog : ContentDialog
{
private readonly IUpdateManager _updateManager;
private readonly UpdateNotes _notes;
public List<UpdateNoteSection> Sections { get; }
@@ -21,15 +18,12 @@ public sealed partial class WhatIsNewDialog : ContentDialog
{
InitializeComponent();
_notes = notes;
_updateManager = updateManager;
Sections = notes.Sections;
// Show the Get Started button immediately when there is only one page.
UpdateNotesControl.SelectedIndexChanged += OnUpdateSectionChanged;
UpdateGetStartedButtonVisibility(UpdateNotesControl.SelectedIndex);
InitializeMigrationStatus();
Closing += OnDialogClosing;
}
@@ -43,17 +37,6 @@ public sealed partial class WhatIsNewDialog : ContentDialog
: Visibility.Collapsed;
}
private void InitializeMigrationStatus()
{
if (!_notes.HasPendingMigrations ||
string.IsNullOrWhiteSpace(_notes.Migration.TitleKey) ||
string.IsNullOrWhiteSpace(_notes.Migration.DescriptionKey))
return;
MigrationTitleText.Text = Translator.GetTranslatedString(_notes.Migration.TitleKey);
MigrationDescriptionText.Text = Translator.GetTranslatedString(_notes.Migration.DescriptionKey);
}
private void OnDialogClosing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
// Only allow closing when Get Started button was clicked.
@@ -61,41 +44,9 @@ public sealed partial class WhatIsNewDialog : ContentDialog
args.Cancel = true;
}
private async void OnGetStartedClicked(object sender, RoutedEventArgs e)
private void OnGetStartedClicked(object sender, RoutedEventArgs e)
{
GetStartedButton.IsEnabled = false;
ContinueAnywayButton.Visibility = Visibility.Collapsed;
MigrationErrorText.Visibility = Visibility.Collapsed;
if (_notes.HasPendingMigrations)
{
GetStartedButton.Content = Translator.WhatIsNew_PreparingForNewVersionButton;
MigrationPanel.Visibility = Visibility.Visible;
MigrationProgressBar.Visibility = Visibility.Visible;
}
try
{
await _updateManager.RunPendingMigrationsAsync();
_updateManager.MarkUpdateNotesAsSeen();
}
catch (System.Exception ex)
{
MigrationProgressBar.Visibility = Visibility.Collapsed;
MigrationErrorText.Text = string.Format(Translator.WhatIsNew_MigrationFailedMessage, ex.GetType().Name);
MigrationErrorText.Visibility = Visibility.Visible;
ContinueAnywayButton.Visibility = Visibility.Visible;
GetStartedButton.IsEnabled = true;
GetStartedButton.Content = Translator.WhatIsNew_GetStartedButton;
return;
}
_canClose = true;
Hide();
}
private void OnContinueAnywayClicked(object sender, RoutedEventArgs e)
{
_updateManager.MarkUpdateNotesAsSeen();
_canClose = true;
Hide();