Skip to content

Show 'About this version' for CivitAI models #1243

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
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions StabilityMatrix.Avalonia/Languages/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions StabilityMatrix.Avalonia/Languages/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@
<data name="Label_ModelDescription" xml:space="preserve">
<value>Model Description</value>
</data>
<data name="Label_ModelVersionDescription" xml:space="preserve">
<value>About this version</value>
</data>
<data name="Label_NewVersionAvailable" xml:space="preserve">
<value>A new version of Stability Matrix is available!</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace StabilityMatrix.Avalonia.ViewModels.Dialogs;
public partial class ModelVersionViewModel : ObservableObject
{
private readonly IModelIndexService modelIndexService;

public string VersionDescription { get; set; }

[ObservableProperty]
private CivitModelVersion modelVersion;
Expand Down Expand Up @@ -37,6 +39,9 @@ public ModelVersionViewModel(IModelIndexService modelIndexService, CivitModelVer
ModelVersion.Files?.Select(file => new CivitFileViewModel(modelIndexService, file))
?? new List<CivitFileViewModel>()
);

VersionDescription =
$"""<html><body class="markdown-body">{modelVersion.Description}</body></html>""";
}

public void RefreshInstallStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
MinHeight="450"
Margin="8"
ColumnDefinitions="*,Auto,*"
RowDefinitions="Auto, Auto, *, Auto">
RowDefinitions="Auto, Auto, *, Auto, Auto">

<Grid.Resources>
<input:StandardUICommand x:Key="ImportCommand" Command="{Binding Import}" />
Expand Down Expand Up @@ -287,10 +287,22 @@
</ScrollViewer>
</Expander>

<StackPanel
<Expander
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="8,8"
ExpandDirection="Down"
Header="{x:Static lang:Resources.Label_ModelVersionDescription}">
<ScrollViewer MaxHeight="300">
<controls:MarkdownViewer Html="{Binding SelectedVersionViewModel.VersionDescription}" />
</ScrollViewer>
</Expander>

<StackPanel
Grid.Row="4"
Grid.Column="0"
Grid.ColumnSpan="3"
Margin="0,8,0,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
Expand Down