Skip to content

Commit f9a8910

Browse files
committed
add teachingtip
1 parent 3cbe16f commit f9a8910

5 files changed

Lines changed: 44 additions & 0 deletions

File tree

StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@
359359
</controls:BetterFlyout>
360360
</Button.Flyout>
361361
</Button>
362+
<ui:TeachingTip
363+
Title="{x:Static lang:Resources.TeachingTip_PromptAmplifier}"
364+
IsOpen="{Binding IsPromptAmplifyTeachingTipOpen, Mode=TwoWay}"
365+
Target="{Binding #PART_AmplifyButton}" />
362366
<Button
363367
Padding="8,4"
364368
Command="{Binding DebugShowTokensCommand}"

StabilityMatrix.Avalonia/Languages/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StabilityMatrix.Avalonia/Languages/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,4 +1341,7 @@ Nope! Stability Matrix is still fully functional without one. But, your Lykos ac
13411341
<data name="Action_GoToSettings" xml:space="preserve">
13421342
<value>Go to Settings</value>
13431343
</data>
1344+
<data name="TeachingTip_PromptAmplifier" xml:space="preserve">
1345+
<value>Try out the new Prompt Amplifier! Enhance your prompts for better results!</value>
1346+
</data>
13441347
</root>

StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public partial class PromptCardViewModel
7979
[ObservableProperty]
8080
private bool isHelpButtonTeachingTipOpen;
8181

82+
[ObservableProperty]
83+
private bool isPromptAmplifyTeachingTipOpen;
84+
8285
[ObservableProperty]
8386
private bool isNegativePromptEnabled = true;
8487

@@ -182,6 +185,22 @@ partial void OnIsHelpButtonTeachingTipOpenChanging(bool oldValue, bool newValue)
182185
{
183186
settings.SeenTeachingTips.Add(TeachingTip.InferencePromptHelpButtonTip);
184187
});
188+
189+
if (!settingsManager.Settings.SeenTeachingTips.Contains(TeachingTip.InferencePromptAmplifyTip))
190+
{
191+
IsPromptAmplifyTeachingTipOpen = true;
192+
}
193+
}
194+
}
195+
196+
partial void OnIsPromptAmplifyTeachingTipOpenChanging(bool oldValue, bool newValue)
197+
{
198+
if (oldValue && !newValue)
199+
{
200+
settingsManager.Transaction(settings =>
201+
{
202+
settings.SeenTeachingTips.Add(TeachingTip.InferencePromptAmplifyTip);
203+
});
185204
}
186205
}
187206

@@ -196,6 +215,14 @@ public override async Task OnLoadedAsync()
196215
IsHelpButtonTeachingTipOpen = true;
197216
}
198217

218+
if (
219+
!IsHelpButtonTeachingTipOpen
220+
&& !settingsManager.Settings.SeenTeachingTips.Contains(TeachingTip.InferencePromptAmplifyTip)
221+
)
222+
{
223+
IsPromptAmplifyTeachingTipOpen = true;
224+
}
225+
199226
_ = Task.Run(async () =>
200227
{
201228
try

StabilityMatrix.Core/Models/Settings/TeachingTip.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public record TeachingTip(string Value) : StringValue(Value)
1818
public static TeachingTip LykosAccountMigrateTip => new("LykosAccountMigrateTip");
1919
public static TeachingTip SharedFolderMigrationTip => new("SharedFolderMigrationTip");
2020
public static TeachingTip FolderMapTip => new("FolderMapTip");
21+
public static TeachingTip InferencePromptAmplifyTip => new("InferencePromptAmplifyTip");
2122

2223
/// <inheritdoc />
2324
public override string ToString()

0 commit comments

Comments
 (0)