Skip to content

annotation-style-presets - #98

Merged
dimitar-radenkov merged 4 commits into
masterfrom
feature/annotation-style-presets
May 3, 2026
Merged

annotation-style-presets#98
dimitar-radenkov merged 4 commits into
masterfrom
feature/annotation-style-presets

Conversation

@dimitar-radenkov

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 3, 2026 12:27
@codecov-commenter

codecov-commenter commented May 3, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 83.47107% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
Pointframe/ViewModels/SettingsViewModel.cs 54.83% 14 Missing ⚠️
Pointframe/ViewModels/AnnotationViewModel.cs 91.66% 3 Missing ⚠️
...frame/ViewModels/AnnotationStylePresetViewModel.cs 88.23% 2 Missing ⚠️
...tframe/ViewModels/AnnotationPresetItemViewModel.cs 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable annotation style presets (color + stroke thickness) that can be edited in Settings and applied from a new dropdown in the overlay annotation toolbar, persisting selected presets back into user settings.

Changes:

  • Introduces AnnotationStylePreset and stores presets in UserSettings.StylePresets (with defaults).
  • Adds Settings UI + view models to add/remove/edit presets and save them to settings.json.
  • Adds overlay toolbar dropdown UI + AnnotationViewModel logic/tests to apply presets and update defaults.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Pointframe/ViewModels/SettingsViewModel.cs Adds preset collection state + commands; saves presets to UserSettings.
Pointframe/ViewModels/OverlayViewModel.cs Ensures preset selection is cleared and menu closes when picking a custom color.
Pointframe/ViewModels/AnnotationViewModel.cs Loads presets for the overlay UI; adds menu state + command to apply presets and persist defaults.
Pointframe/ViewModels/AnnotationStylePresetViewModel.cs New editable preset row VM for Settings.
Pointframe/ViewModels/AnnotationPresetItemViewModel.cs New read-only overlay item VM for preset dots/menu rows.
Pointframe/SettingsWindow.xaml Adds “Style Presets” section UI for editing presets.
Pointframe/Services/UserSettingsService.cs Updates settings cloning to include StylePresets.
Pointframe/OverlayWindow.xaml Replaces color button with dropdown that shows preset dots + popup menu.
Pointframe/Models/UserSettings.cs Adds StylePresets with default preset values.
Pointframe/Models/AnnotationStylePreset.cs New model defining preset structure and max constraints.
Pointframe.Tests/ViewModels/AnnotationViewModelTests.cs Adds unit tests covering preset application behavior and menu state.
Pointframe.Tests/SettingsWindowTests.cs Removes an unused using.
Pointframe.Tests/Services/AnnotationCanvasRendererTests.cs Formatting-only changes to improve readability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Pointframe/OverlayWindow.xaml Outdated
<Button Width="34" Height="42" Cursor="Hand"
Style="{StaticResource ActionBtn}"
Command="{Binding ToggleColorMenuCommand}"
ToolTip="Colour / Style presets">
Comment thread Pointframe/SettingsWindow.xaml Outdated
<TextBox Grid.Column="1"
Margin="0,0,10,0"
Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
MaxLength="24"
Comment on lines +140 to +145
StylePresets = [.. settings.StylePresets.Select(p => new Pointframe.Models.AnnotationStylePreset
{
Name = p.Name,
Color = p.Color,
StrokeThickness = p.StrokeThickness,
})],
_defaultAnnotationColor = ParseAnnotationColorOrFallback(s.DefaultAnnotationColor);
_stylePresets = new ObservableCollection<AnnotationStylePresetViewModel>(
s.StylePresets.Select(p => new AnnotationStylePresetViewModel(p)));
_stylePresets.CollectionChanged += (_, _) => OnPropertyChanged(nameof(CanAddPreset));
Comment on lines +164 to +170
var presets = _settingsService.Current.StylePresets;
if (index < 0 || index >= presets.Count)
{
return;
}

var preset = presets[index];
Comment on lines +764 to +766
<TextBlock Text="Style Presets" Style="{StaticResource GroupTitle}"/>
<TextBlock Text="Up to 5 colour and thickness shortcuts in the annotation toolbar."
Style="{StaticResource GroupDescription}"/>
Replaced dynamic binding for style preset max count with static text in the Settings window, clarifying the toolbar shortcut limit.
@dimitar-radenkov
dimitar-radenkov merged commit 3e1f6d1 into master May 3, 2026
5 checks passed
@dimitar-radenkov
dimitar-radenkov deleted the feature/annotation-style-presets branch May 3, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants