mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Implement startup visual behavior, de-duplicate startup attempts, and improve failure UX. Key changes: - Add spec and docs for startup visuals and timing contract (.trae/specs and docs/LAUNCHER_STARTUP_VISUALS.md). - Introduce StartupVisualPreferences contract and resolver; create SplashWindow via resolved mode. - Add StartupAttemptRecord model and a file-backed StartupAttemptRegistry to persist and coordinate in-progress startup attempts (attach/adopt, soft/hard timeouts, IPC/connect state, lifecycle updates). - Update LauncherFlowCoordinator to: adopt/attach to existing attempts, track IPC connection and soft/hard timeouts (30s/120s), show delayed UI state, attempt foreground recovery via public IPC, compose detailed launch result metadata, and mark registry states (soft timeout, detached waiting, succeeded, failed). - Add TryActivateExistingInstanceAsync to attempt activating an existing desktop via IPC. - Change failure flow: ShowFailureWindowAsync now returns user choice; ErrorWindow updated to present Activate/Wait/Open Logs/Exit semantics and new layouts/styles; improved button wiring and debug/dev mode handling. - Add UI and resource tweaks (ErrorWindow and SplashWindow changes), project asset link for nightly logo, and unit tests for StartupVisualPreferences. These changes prevent duplicate desktop processes during slow startups, provide clearer UX for delayed startups, and persist startup attempt state across Launcher invocations for safer recovery/attach behavior.
100 lines
3.2 KiB
XML
100 lines
3.2 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:views="clr-namespace:LanMountainDesktop.Launcher.Views"
|
|
mc:Ignorable="d"
|
|
x:Class="LanMountainDesktop.Launcher.Views.ErrorWindow"
|
|
x:DataType="views:ErrorWindow"
|
|
Title="LanMountain Desktop"
|
|
Width="560"
|
|
Height="320"
|
|
CanResize="False"
|
|
WindowStartupLocation="CenterScreen"
|
|
Background="#111318"
|
|
TransparencyLevelHint="None"
|
|
Icon="/Assets/logo.ico">
|
|
<Design.DataContext>
|
|
<views:ErrorWindow />
|
|
</Design.DataContext>
|
|
|
|
<Grid RowDefinitions="*,Auto">
|
|
<Grid Grid.Row="0"
|
|
Margin="24"
|
|
ColumnDefinitions="Auto,*">
|
|
<Border x:Name="ErrorIconBorder"
|
|
Grid.Column="0"
|
|
Width="52"
|
|
Height="52"
|
|
Margin="0,4,18,0"
|
|
Background="#2B161A"
|
|
CornerRadius="26"
|
|
VerticalAlignment="Top">
|
|
<TextBlock Text="!"
|
|
FontSize="24"
|
|
FontWeight="Bold"
|
|
Foreground="#FFB4AB"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" />
|
|
</Border>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
Spacing="10">
|
|
<TextBlock x:Name="TitleText"
|
|
Text="Launcher could not confirm startup"
|
|
FontSize="20"
|
|
FontWeight="SemiBold"
|
|
Foreground="#F6F7FB"
|
|
TextWrapping="Wrap" />
|
|
|
|
<TextBlock x:Name="ErrorMessageText"
|
|
Text="LanMountain Desktop did not reach the expected startup state."
|
|
FontSize="14"
|
|
Foreground="#D2D7E1"
|
|
TextWrapping="Wrap"
|
|
LineHeight="22" />
|
|
|
|
<TextBlock x:Name="SuggestionText"
|
|
Text="You can inspect logs, retry when the old process is gone, or reactivate the current instance."
|
|
FontSize="13"
|
|
Foreground="#9BA5B7"
|
|
TextWrapping="Wrap"
|
|
LineHeight="20" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<Border Grid.Row="1"
|
|
Padding="24,16"
|
|
Background="#171A21">
|
|
<Grid ColumnDefinitions="*,Auto,Auto,Auto"
|
|
ColumnSpacing="8">
|
|
<Button x:Name="OpenLogButton"
|
|
Grid.Column="0"
|
|
Content="Open Logs"
|
|
MinWidth="108"
|
|
Height="34"
|
|
HorizontalAlignment="Left" />
|
|
|
|
<Button x:Name="SecondaryActionButton"
|
|
Grid.Column="1"
|
|
Content="Wait"
|
|
MinWidth="108"
|
|
Height="34"
|
|
IsVisible="False" />
|
|
|
|
<Button x:Name="ExitButton"
|
|
Grid.Column="2"
|
|
Content="Exit"
|
|
MinWidth="90"
|
|
Height="34" />
|
|
|
|
<Button x:Name="PrimaryActionButton"
|
|
Grid.Column="3"
|
|
Content="Retry"
|
|
MinWidth="108"
|
|
Height="34" />
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Window>
|