Skip to content

Commit ffc1152

Browse files
mohnjilesclaude
andcommitted
refactor: pages declare their own docs target; filled help icon
Replaces per-page ? buttons in the package manager with a single one in the shell header bound to the current page's DocsPath. Each page names its own help target once, the shell renders exactly one button, and no surface can end up with two — the console previously showed a stacked pair. Also switches the icon to the filled variant for legibility at 16px, and drops the redundant question-mark glyph from the inference Launch button, which sat next to the docs button meaning something entirely different. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a4b0458 commit ffc1152

10 files changed

Lines changed: 43 additions & 35 deletions

StabilityMatrix.Avalonia/Styles/ControlThemes/DocsHelpButtonStyles.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
Height="16"
4040
FontSize="16"
4141
Foreground="{TemplateBinding Foreground}"
42+
IconVariant="Filled"
4243
Symbol="QuestionCircle" />
4344
</Border>
4445
</ControlTemplate>

StabilityMatrix.Avalonia/ViewModels/Base/PageViewModelBase.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@ public abstract class PageViewModelBase : DisposableViewModelBase
1919

2020
public abstract string Title { get; }
2121
public abstract IconSource IconSource { get; }
22+
23+
/// <summary>
24+
/// Documentation page this surface links to, as a
25+
/// <see cref="Core.Models.Documentation.DocumentationPages"/> constant. A shell that hosts
26+
/// pages renders this as a single help button in its header, so pages declare their own
27+
/// help target instead of the shell guessing — and no surface ends up with two.
28+
/// Null means this page has no contextual documentation.
29+
/// </summary>
30+
public virtual string? DocsPath => null;
2231
}

StabilityMatrix.Avalonia/ViewModels/PackageManager/MainPackageManagerViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using StabilityMatrix.Core.Attributes;
1919
using StabilityMatrix.Core.Helper;
2020
using StabilityMatrix.Core.Models;
21+
using StabilityMatrix.Core.Models.Documentation;
2122
using StabilityMatrix.Core.Models.FileInterfaces;
2223
using StabilityMatrix.Core.Models.Packages;
2324
using StabilityMatrix.Core.Services;
@@ -46,6 +47,9 @@ public partial class MainPackageManagerViewModel : PageViewModelBase
4647
public override IconSource IconSource =>
4748
new SymbolIconSource { Symbol = Symbol.Box, IconVariant = IconVariant.Filled };
4849

50+
/// <inheritdoc />
51+
public override string? DocsPath => DocumentationPages.SupportedPackages;
52+
4953
/// <summary>
5054
/// List of installed packages
5155
/// </summary>

StabilityMatrix.Avalonia/ViewModels/PackageManager/PackageInstallDetailViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using StabilityMatrix.Core.Helper.Factory;
2626
using StabilityMatrix.Core.Models;
2727
using StabilityMatrix.Core.Models.Database;
28+
using StabilityMatrix.Core.Models.Documentation;
2829
using StabilityMatrix.Core.Models.FileInterfaces;
2930
using StabilityMatrix.Core.Models.PackageModification;
3031
using StabilityMatrix.Core.Models.Packages;
@@ -52,6 +53,9 @@ IPyInstallationManager pyInstallationManager
5253
public override string Title { get; } = package.DisplayName;
5354
public override IconSource IconSource => new SymbolIconSource();
5455

56+
/// <inheritdoc />
57+
public override string? DocsPath => DocumentationPages.InstallingPackages;
58+
5559
public string FullInstallPath => Path.Combine(settingsManager.LibraryDir, "Packages", InstallName);
5660
public bool ShowReleaseMode => SelectedPackage.ShouldIgnoreReleases == false;
5761
public bool ShowBranchMode => SelectedPackage.ShouldIgnoreBranches == false;

StabilityMatrix.Avalonia/ViewModels/RunningPackageViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using StabilityMatrix.Core.Attributes;
1111
using StabilityMatrix.Core.Helper;
1212
using StabilityMatrix.Core.Models;
13+
using StabilityMatrix.Core.Models.Documentation;
1314
using StabilityMatrix.Core.Models.Packages;
1415
using StabilityMatrix.Core.Processes;
1516
using StabilityMatrix.Core.Services;
@@ -33,6 +34,9 @@ public partial class RunningPackageViewModel : PageViewModelBase, IDisposable, I
3334
public override string Title => RunningPackage.InstalledPackage.DisplayName ?? "Running Package";
3435
public override IconSource IconSource => new SymbolIconSource();
3536

37+
/// <inheritdoc />
38+
public override string? DocsPath => DocumentationPages.CommonIssues;
39+
3640
[ObservableProperty]
3741
private bool autoScrollToEnd;
3842

StabilityMatrix.Avalonia/Views/ConsoleOutputPage.axaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@
7373
</ui:CommandBar.PrimaryCommands>
7474
</ui:CommandBar>
7575

76-
<controls:DocsHelpButton
77-
Grid.Row="0"
78-
Margin="0,0,16,4"
79-
HorizontalAlignment="Right"
80-
VerticalAlignment="Center"
81-
DocsPath="{x:Static docs:DocumentationPages.CommonIssues}" />
82-
8376
<avaloniaEdit:TextEditor
8477
x:Name="Console"
8578
Grid.Row="1"

StabilityMatrix.Avalonia/Views/InferencePage.axaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,7 @@
182182
<Binding Path="!IsWaitingForConnection" />
183183
</MultiBinding>
184184
</Button.IsVisible>
185-
<StackPanel Orientation="Horizontal">
186-
<icons:Icon
187-
Margin="0,0,8,0"
188-
FontSize="14"
189-
Value="fa-solid fa-circle-question" />
190-
<TextBlock Text="{x:Static lang:Resources.Action_Launch}" />
191-
</StackPanel>
185+
<TextBlock Text="{x:Static lang:Resources.Action_Launch}" />
192186
</Button>
193187

194188
<!-- Successful connection icon -->

StabilityMatrix.Avalonia/Views/PackageManager/MainPackageManagerView.axaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
</controls:UserControlBase.Resources>
2929

3030
<Grid Margin="16" RowDefinitions="Auto,*,Auto">
31-
<controls:DocsHelpButton
32-
Grid.Row="0"
33-
HorizontalAlignment="Right"
34-
DocsPath="{x:Static docs:DocumentationPages.SupportedPackages}" />
35-
3631
<ScrollViewer Grid.Row="1">
3732
<ui:ItemsRepeater x:Name="PackageCardsRepeater" ItemsSource="{Binding PackageCards}">
3833
<ui:ItemsRepeater.Layout>

StabilityMatrix.Avalonia/Views/PackageManager/PackageInstallDetailView.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
IsVisible="{Binding SelectedPackage.LicenseUrl, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
4747
NavigateUri="{Binding SelectedPackage.LicenseUrl}" />
4848
<controls:HyperlinkIconButton Content="{x:Static lang:Resources.Action_OpenGithub}" NavigateUri="{Binding SelectedPackage.GithubUrl}" />
49-
<controls:DocsHelpButton DocsPath="{x:Static docs:DocumentationPages.InstallingPackages}" />
5049
</StackPanel>
5150

5251
<!-- Version Selector -->

StabilityMatrix.Avalonia/Views/PackageManagerPage.axaml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,27 @@
2929
<!-- ReSharper restore Xaml.RedundantResource -->
3030
</controls:UserControlBase.Resources>
3131

32-
<!--
33-
No docs button on this shell: each page hosted in the frame below owns its own
34-
contextual help, so a shell-level one would stack a second ? in the same corner.
35-
-->
3632
<Grid RowDefinitions="Auto,*">
37-
<ui:BreadcrumbBar
38-
x:Name="BreadcrumbBar"
39-
Grid.Row="0"
40-
Margin="16,8"
41-
ItemsSource="{Binding CurrentPagePath}">
42-
<ui:BreadcrumbBar.ItemTemplate>
43-
<DataTemplate x:DataType="base:PageViewModelBase">
44-
<ui:BreadcrumbBarItem Content="{Binding Title}" />
45-
</DataTemplate>
46-
</ui:BreadcrumbBar.ItemTemplate>
47-
</ui:BreadcrumbBar>
33+
<Grid Grid.Row="0" ColumnDefinitions="*,Auto">
34+
<ui:BreadcrumbBar
35+
x:Name="BreadcrumbBar"
36+
Grid.Column="0"
37+
Margin="16,8"
38+
ItemsSource="{Binding CurrentPagePath}">
39+
<ui:BreadcrumbBar.ItemTemplate>
40+
<DataTemplate x:DataType="base:PageViewModelBase">
41+
<ui:BreadcrumbBarItem Content="{Binding Title}" />
42+
</DataTemplate>
43+
</ui:BreadcrumbBar.ItemTemplate>
44+
</ui:BreadcrumbBar>
45+
46+
<!-- One button for the whole shell, targeting whichever page is showing. -->
47+
<controls:DocsHelpButton
48+
Grid.Column="1"
49+
Margin="0,8,16,8"
50+
DocsPath="{Binding CurrentPage.DocsPath}"
51+
IsVisible="{Binding CurrentPage.DocsPath, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" />
52+
</Grid>
4853

4954
<controls1:Frame Name="FrameView" Grid.Row="1">
5055
<controls1:Frame.NavigationPageFactory>

0 commit comments

Comments
 (0)