before_code
stringlengths
30
149k
reviewer_comment
stringlengths
16
20.6k
after_code
stringlengths
30
163k
diff_context
stringlengths
0
22.4k
file_path
stringlengths
6
155
comment_line
int64
0
26
language
stringclasses
19 values
quality_score
float64
0.07
1
comment_type
stringclasses
9 values
comment_length
int64
16
20.6k
before_lines
int64
2
4.61k
after_lines
int64
2
4.4k
is_negative
bool
2 classes
pr_title
stringlengths
7
140
pr_number
int64
18
61.2k
repo_name
stringclasses
29 values
repo_stars
int64
321
56k
repo_language
stringclasses
14 values
reviewer_username
stringclasses
378 values
author_username
stringclasses
739 values
user
stringlengths
361
200k
assistant
stringlengths
16
20.6k
system
stringclasses
1 value
case LandmarkComplementary: return @"complementary"; case LandmarkContentInfo: return @"content"; case LandmarkRegion: return @"region"; case LandmarkForm: return @"form"; case LandmarkMain: return @"main"; case LandmarkNavigation: return @"navigation"; case Landm...
Use the `kAXARIALiveAttribute` constant instead.
case LandmarkComplementary: return @"complementary"; case LandmarkContentInfo: return @"content"; case LandmarkRegion: return @"region"; case LandmarkForm: return @"form"; case LandmarkMain: return @"main"; case LandmarkNavigation: return @"navigation"; case Landm...
@@ -166,6 +167,32 @@ - (NSString *)accessibilityRoleDescription return NSAccessibilityRoleDescription([self accessibilityRole], [self accessibilitySubrole]); } +// Note: Apple has deprecated this API, but it's still used to set attributes not supported by NSAccessibility +- (NSArray<NSString *> *)accessibilityA...
native/Avalonia.Native/src/OSX/automation.mm
26
Objective-C++
0.286
suggestion
48
51
51
false
Implemented AutomationProperties.LiveSetting
20,473
AvaloniaUI/Avalonia
24,333
C#
MrJul
codecat
Review this pull request change. Language: Objective-C++ File: native/Avalonia.Native/src/OSX/automation.mm PR Title: Implemented AutomationProperties.LiveSetting BEFORE CODE: case LandmarkComplementary: return @"complementary"; case LandmarkContentInfo: return @"content"; case LandmarkRegio...
Use the `kAXARIALiveAttribute` constant instead.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} - (void)raiseChildrenChanged { auto changed = _children ? [NSMutableSet setWithArray:_children] : [NSMutableSet set]; [self recalculateChildren]; if (_children) [changed addObjectsFromArray:_children]; NSAccessibilityPostNotificationWithUserInfo( self, NSAccessibilityLa...
Use the `kAXLiveRegionChangedNotification` constant instead.
} - (void)raiseChildrenChanged { auto changed = _children ? [NSMutableSet setWithArray:_children] : [NSMutableSet set]; [self recalculateChildren]; if (_children) [changed addObjectsFromArray:_children]; NSAccessibilityPostNotificationWithUserInfo( self, NSAccessibilityLa...
@@ -421,8 +448,15 @@ - (void)raiseChildrenChanged @{ NSAccessibilityUIElementsKey: [changed allObjects]}); } -- (void)raisePropertyChanged +- (void)raisePropertyChanged:(AvnAutomationProperty)property +{ + if (property == AutomationPeer_Name && _peer->GetLiveSetting() != LiveSettingOff) + [self ra...
native/Avalonia.Native/src/OSX/automation.mm
26
Objective-C++
0.429
suggestion
60
51
51
false
Implemented AutomationProperties.LiveSetting
20,473
AvaloniaUI/Avalonia
24,333
C#
MrJul
codecat
Review this pull request change. Language: Objective-C++ File: native/Avalonia.Native/src/OSX/automation.mm PR Title: Implemented AutomationProperties.LiveSetting BEFORE CODE: } - (void)raiseChildrenChanged { auto changed = _children ? [NSMutableSet setWithArray:_children] : [NSMutableSet set]; [self reca...
Use the `kAXLiveRegionChangedNotification` constant instead.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
_avaloniaSaveTargetsAtom = XInternAtom(_x11.Display, "AVALONIA_SAVE_TARGETS_PROPERTY_ATOM", false); _textAtoms = new[] { _x11.Atoms.XA_STRING, _x11.Atoms.OEMTEXT, _x11.Atoms.UTF8_STRING, _x11.Atoms.UTF16_STRING ...
Are you sure that we won't have a dangling Task if we won't complete it here? e. g. in the case if clipboard manager misbehaves? Clearing selection should mean that we are no longer required to hold clipboard data, right?
_avaloniaSaveTargetsAtom = XInternAtom(_x11.Display, "AVALONIA_SAVE_TARGETS_PROPERTY_ATOM", false); _textAtoms = new[] { _x11.Atoms.XA_STRING, _x11.Atoms.OEMTEXT, _x11.Atoms.UTF8_STRING, _x11.Atoms.UTF16_STRING ...
@@ -53,12 +53,9 @@ private unsafe void OnEvent(ref XEvent ev) // We night have already regained the clipboard ownership by the time a SelectionClear message arrives. if (GetOwner() != _handle) _storedDataTransfer = null; - - _storeAtomTcs?.TrySetResu...
src/Avalonia.X11/Clipboard/X11Clipboard.cs
26
C#
0.5
question
222
51
51
false
Fix X11 clipboard manager store completion
20,514
AvaloniaUI/Avalonia
24,333
C#
kekekeks
MrJul
Review this pull request change. Language: C# File: src/Avalonia.X11/Clipboard/X11Clipboard.cs PR Title: Fix X11 clipboard manager store completion BEFORE CODE: _avaloniaSaveTargetsAtom = XInternAtom(_x11.Display, "AVALONIA_SAVE_TARGETS_PROPERTY_ATOM", false); _textAtoms = new[] ...
Are you sure that we won't have a dangling Task if we won't complete it here? e. g. in the case if clipboard manager misbehaves? Clearing selection should mean that we are no longer required to hold clipboard data, right?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (SelectedContentTemplate != SelectContentTemplate(container.GetValue(ContentTemplateProperty))) { // If the value of SelectedContentTemplate is about to change, clear it first. This ensures // that the template is not reused as s...
```suggestion Debug.Assert(!contentElement.IsSet(DataContextProperty)); if (contentElement.Parent is not null) { // Best approximation of an inherited property ...
// (which is typically their DataContext) changes. SelectedContentTemplate = null; } _selectedItemSubscriptions = new CompositeDisposable( container.GetObservable(ContentControl.ContentProperty).Subscribe(co...
@@ -231,7 +235,24 @@ private void UpdateSelectedContent(Control? container = null) } _selectedItemSubscriptions = new CompositeDisposable( - container.GetObservable(ContentControl.ContentProperty).Subscribe(v => SelectedContent = v), + ...
src/Avalonia.Controls/TabControl.cs
26
C#
0.929
bug
1,090
51
51
false
Fix TabItem's Content inheriting TabControl's DataContext instead of TabItem's
20,541
AvaloniaUI/Avalonia
24,333
C#
ptasev
ptasev
Review this pull request change. Language: C# File: src/Avalonia.Controls/TabControl.cs PR Title: Fix TabItem's Content inheriting TabControl's DataContext instead of TabItem's BEFORE CODE: if (SelectedContentTemplate != SelectContentTemplate(container.GetValue(ContentTemplateProperty))) ...
```suggestion Debug.Assert(!contentElement.IsSet(DataContextProperty)); if (contentElement.Parent is not null) { // Best approximation of an inherited property ...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter) { return RegisterContentPresenter(presenter); } protected internal override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) { return new Ta...
Could you please explain why this was moved to `ContainerForItemPreparedOverride`? The `DataContext` should probably be set asap and `PrepareContainerForItemOverride` seems like the right place for that. Reverting this still makes the new test passes so I'm a bit confused.
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter) { return RegisterContentPresenter(presenter); } protected internal override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) { return new Ta...
@@ -171,10 +170,15 @@ protected internal override void PrepareContainerForItemOverride(Control element { tabItem.TabStripPlacement = TabStripPlacement; } + } + + protected internal override void ContainerForItemPreparedOverride(Control container, object? item, in...
src/Avalonia.Controls/TabControl.cs
26
C#
0.643
question
274
51
51
false
Fix TabItem's Content inheriting TabControl's DataContext instead of TabItem's
20,541
AvaloniaUI/Avalonia
24,333
C#
MrJul
ptasev
Review this pull request change. Language: C# File: src/Avalonia.Controls/TabControl.cs PR Title: Fix TabItem's Content inheriting TabControl's DataContext instead of TabItem's BEFORE CODE: bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter) { return RegisterC...
Could you please explain why this was moved to `ContainerForItemPreparedOverride`? The `DataContext` should probably be set asap and `PrepareContainerForItemOverride` seems like the right place for that. Reverting this still makes the new test passes so I'm a bit confused.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
void IAvnTopLevelEvents.ScalingChanged(double scaling) { _parent._savedScaling = scaling; _parent.ScalingChanged?.Invoke(scaling); } void IAvnTopLevelEvents.RunRenderPriorityJobs() { Dispatcher.UIThread.RunJobs(DispatcherPriority.UiThreadRend...
Note, Avalonia.Native is technically a platform agnostic project. One can write com bindings to another platform, where such capture code migth be incorrect. Can be solved here by adding a parameter to indicate that any implicit focus needs to be released on lost focus. But not a dealbreaker for me either.
void IAvnTopLevelEvents.ScalingChanged(double scaling) { _parent._savedScaling = scaling; _parent.ScalingChanged?.Invoke(scaling); } void IAvnTopLevelEvents.RunRenderPriorityJobs() { Dispatcher.UIThread.RunJobs(DispatcherPriority.UiThreadRend...
@@ -480,6 +480,18 @@ void IAvnTopLevelEvents.RunRenderPriorityJobs() void IAvnTopLevelEvents.LostFocus() { _parent.LostFocus?.Invoke(); + + // macOS doesn't have the concept of mouse capture. If we're losing the focus during an implicit capture + // (standard mouse d...
src/Avalonia.Native/TopLevelImpl.cs
26
C#
0.429
bug
308
51
51
false
Release implicit mouse capture on focus lost
20,574
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
MrJul
Review this pull request change. Language: C# File: src/Avalonia.Native/TopLevelImpl.cs PR Title: Release implicit mouse capture on focus lost BEFORE CODE: void IAvnTopLevelEvents.ScalingChanged(double scaling) { _parent._savedScaling = scaling; _parent.ScalingChanged?.Invok...
Note, Avalonia.Native is technically a platform agnostic project. One can write com bindings to another platform, where such capture code migth be incorrect. Can be solved here by adding a parameter to indicate that any implicit focus needs to be released on lost focus. But not a dealbreaker for me either.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
typeof(IOpenGlTextureSharingRenderInterfaceContextFeature)); var interop = await gpuInteropTask; if (interop == null) { Logger.TryGet(LogEventLevel.Error, "OpenGL")?.Log("OpenGlControlBase", "Compositor backend doesn't support ...
Not sure if this one can/should be removed. With no `new void InvalidateVisual` - users will be able to call standard `Visual.InvalidateVisual`, and get ineffective results. This obsoletion was meant to notify users about more efficient method.
typeof(IOpenGlTextureSharingRenderInterfaceContextFeature)); var interop = await gpuInteropTask; if (interop == null) { Logger.TryGet(LogEventLevel.Error, "OpenGL")?.Log("OpenGlControlBase", "Compositor backend doesn't support ...
@@ -245,11 +245,6 @@ await _compositor.TryGetRenderInterfaceFeature( return true; } - /// <inheritdoc cref="Visual.InvalidateVisual"/> - [Obsolete("Use RequestNextFrameRendering()"), EditorBrowsable(EditorBrowsableState.Never)] - // ReSharper disable once MemberCanBeProtecte...
src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs
26
C#
0.643
performance
245
51
51
false
Remove obsolete members from various assemblies
20,628
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
MrJul
Review this pull request change. Language: C# File: src/Avalonia.OpenGL/Controls/OpenGlControlBase.cs PR Title: Remove obsolete members from various assemblies BEFORE CODE: typeof(IOpenGlTextureSharingRenderInterfaceContextFeature)); var interop = await gpuInteropTask; i...
Not sure if this one can/should be removed. With no `new void InvalidateVisual` - users will be able to call standard `Visual.InvalidateVisual`, and get ineffective results. This obsoletion was meant to notify users about more efficient method.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
virtual HRESULT CreatePlatformRenderTimer(IAvnPlatformRenderTimer** ppv) override { START_COM_CALL; @autoreleasepool { *ppv = ::CreatePlatformRenderTimer(); return S_OK; } } virtual HRESULT ImportMTLSharedEvent(void* event, IAvnMTLSha...
What happens if this is called after initial startup?
virtual HRESULT CreatePlatformRenderTimer(IAvnPlatformRenderTimer** ppv) override { START_COM_CALL; @autoreleasepool { *ppv = ::CreatePlatformRenderTimer(); return S_OK; } } virtual HRESULT ImportMTLSharedEvent(void* event, IAvnM...
@@ -475,14 +475,23 @@ virtual HRESULT ImportMTLSharedEvent(void* event, IAvnMTLSharedEvent** ppv) over return *ppv != nullptr ? S_OK : E_FAIL; } - HRESULT CreateMemoryManagementHelper(IAvnNativeObjectsMemoryManagement **ppv) override { + HRESULT CreateMemoryManagementHelper(IAvnNativeObjectsM...
native/Avalonia.Native/src/OSX/main.mm
26
Objective-C++
0.214
question
53
51
51
false
[macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon
20,634
AvaloniaUI/Avalonia
24,333
C#
kekekeks
drasticactions
Review this pull request change. Language: Objective-C++ File: native/Avalonia.Native/src/OSX/main.mm PR Title: [macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon BEFORE CODE: virtual HRESULT CreatePlatformRenderTimer(IAvnPlatformRenderTimer** ppv) override { START_COM_CALL; ...
What happens if this is called after initial startup?
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
[s_appMenuItem setSubmenu:[NSMenu new]]; } } else { s_appMenuItem = nullptr; } } extern void SetServicesMenu (IAvnMenu* menu) { auto nativeMenu = dynamic_cast<AvnAppMenu*>(menu); [NSApplication sharedApplication].servicesMenu = nativeMenu->GetNative(); } extern IAvn...
Actually, you can just save `NSMenu*` reference somewhere in `app.mm`, no need to keep a COM reference here.
[s_appMenuItem setSubmenu:[NSMenu new]]; } } else { s_appMenuItem = nullptr; } } extern void SetServicesMenu (IAvnMenu* menu) { auto nativeMenu = dynamic_cast<AvnAppMenu*>(menu); [NSApplication sharedApplication].servicesMenu = nativeMenu->GetNative(); } extern IAvn...
@@ -534,4 +534,19 @@ extern void SetServicesMenu (IAvnMenu* menu) return s_appMenuItem; } +static IAvnMenu* s_dockMenu = nullptr;
native/Avalonia.Native/src/OSX/menu.mm
26
Objective-C++
0.5
suggestion
108
42
27
false
[macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon
20,634
AvaloniaUI/Avalonia
24,333
C#
kekekeks
drasticactions
Review this pull request change. Language: Objective-C++ File: native/Avalonia.Native/src/OSX/menu.mm PR Title: [macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon BEFORE CODE: [s_appMenuItem setSubmenu:[NSMenu new]]; } } else { s_appMenuItem = nullptr; ...
Actually, you can just save `NSMenu*` reference somewhere in `app.mm`, no need to keep a COM reference here.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
public void Opening() { _parent?.RaiseOpening(); } public void Closed() { _parent?.RaiseClosed(); } } partial interface IAvnMenu { void RaiseNeedsUpdate(); void RaiseOpening(); void RaiseClosed(); void...
Since I got rid of the common interface, I changed the internal calls in IAvnMenu to Actions so they could be called by both Menu and DockMenu calls. If you feel this should be different I'm open to it.
public void Opening() { _parent?.RaiseOpening(); } public void Closed() { _parent?.RaiseClosed(); } } partial interface IAvnMenu { void RaiseNeedsUpdate(); void RaiseOpening(); void RaiseClosed(); void...
@@ -45,7 +45,8 @@ namespace Avalonia.Native.Interop.Impl { partial class __MicroComIAvnMenuProxy { - private AvaloniaNativeMenuExporter _exporter; + private Action _queueReset = null!; + private Action _updateIfNeeded = null!;
src/Avalonia.Native/IAvnMenu.cs
26
C#
0.5
suggestion
202
51
51
false
[macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon
20,634
AvaloniaUI/Avalonia
24,333
C#
drasticactions
drasticactions
Review this pull request change. Language: C# File: src/Avalonia.Native/IAvnMenu.cs PR Title: [macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon BEFORE CODE: public void Opening() { _parent?.RaiseOpening(); } public void Closed() { ...
Since I got rid of the common interface, I changed the internal calls in IAvnMenu to Actions so they could be called by both Menu and DockMenu calls. If you feel this should be different I'm open to it.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
namespace Avalonia.Controls { public class NativeDock { public static readonly AttachedProperty<NativeMenu?> MenuProperty = AvaloniaProperty.RegisterAttached<NativeDock, AvaloniaObject, NativeMenu?>("Menu"); public static void SetMenu(AvaloniaObject o, NativeMenu? menu) => o.SetValu...
Make `static`, we don't want users to extend this class.
namespace Avalonia.Controls { /// <summary> /// Allows native menu support on platforms where a <see cref="NativeMenu"/> can be attached to the dock. /// </summary> public static class NativeDock { /// <summary> /// Defines the Menu attached property. /// </summary> p...
@@ -0,0 +1,12 @@ +namespace Avalonia.Controls +{ + public class NativeDock
src/Avalonia.Controls/NativeDock.cs
3
C#
0.429
suggestion
56
13
28
false
[macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon
20,634
AvaloniaUI/Avalonia
24,333
C#
MrJul
drasticactions
Review this pull request change. Language: C# File: src/Avalonia.Controls/NativeDock.cs PR Title: [macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon BEFORE CODE: namespace Avalonia.Controls { public class NativeDock { public static readonly AttachedProperty<NativeMenu?> MenuPro...
Make `static`, we don't want users to extend this class.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
namespace Avalonia.Controls { public static class NativeDock { public static readonly AttachedProperty<NativeMenu?> MenuProperty = AvaloniaProperty.RegisterAttached<AvaloniaObject, NativeMenu?>("Menu", typeof(NativeDock)); public static void SetMenu(AvaloniaObject o, NativeMenu? men...
New public class, please add some basic XML documentation.
namespace Avalonia.Controls { /// <summary> /// Allows native menu support on platforms where a <see cref="NativeMenu"/> can be attached to the dock. /// </summary> public static class NativeDock { /// <summary> /// Defines the Menu attached property. /// </summary> p...
@@ -0,0 +1,12 @@ +namespace Avalonia.Controls +{ + public static class NativeDock
src/Avalonia.Controls/NativeDock.cs
6
C#
0.214
suggestion
58
13
29
false
[macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon
20,634
AvaloniaUI/Avalonia
24,333
C#
MrJul
drasticactions
Review this pull request change. Language: C# File: src/Avalonia.Controls/NativeDock.cs PR Title: [macOS] Add NativeDock.Menu API for adding menu items to macOS dock icon BEFORE CODE: namespace Avalonia.Controls { public static class NativeDock { public static readonly AttachedProperty<NativeMenu?> ...
New public class, please add some basic XML documentation.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
yield return v; v = v.VisualParent; } } /// <summary> /// Finds first ancestor of given type. /// </summary> /// <typeparam name="T">Ancestor type.</typeparam> /// <param name="visual">The visual.</param> /// <param nam...
Should `Predicate<Visual>?` be used instead? https://learn.microsoft.com/en-us/dotnet/api/system.predicate-1?view=net-10.0
yield return v; v = v.VisualParent; } } /// <summary> /// Finds first ancestor of given type. /// </summary> /// <typeparam name="T">Ancestor type.</typeparam> /// <param name="visual">The visual.</param> /// <param nam...
@@ -147,6 +147,19 @@ public static IEnumerable<Visual> GetVisualAncestors(this Visual visual) /// <param name="includeSelf">If given visual should be included in search.</param> /// <returns>First ancestor of given type.</returns> public static T? FindAncestorOfType<T>(this Visual? visual, bo...
src/Avalonia.Base/VisualTree/VisualExtensions.cs
26
C#
0.571
suggestion
122
51
51
false
FindAncestorOfType and FindDescendantOfType with predicates
20,661
AvaloniaUI/Avalonia
24,333
C#
ptasev
miloush
Review this pull request change. Language: C# File: src/Avalonia.Base/VisualTree/VisualExtensions.cs PR Title: FindAncestorOfType and FindDescendantOfType with predicates BEFORE CODE: yield return v; v = v.VisualParent; } } /// <summary> /// Finds...
Should `Predicate<Visual>?` be used instead? https://learn.microsoft.com/en-us/dotnet/api/system.predicate-1?view=net-10.0
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private void OnDetachedFromVisualTree(object? sender, VisualTreeAttachmentEventArgs e) { UnsubscribeFromAncestors(); _changed(); } public void Dispose() { if (_isDisposed) return; _isDisposed = true; U...
`CalculateAdornerClip` starts the walk at `adornedElement.VisualParent`, so it ignores clipping on the adorned element itself (`ClipToBounds` / `Clip`). This can diverge from compositor behavior. Start the walk from `adornedElement` so its own clip settings are included. ```suggestion var ancestor = adornedElem...
private void OnDetachedFromVisualTree(object? sender, VisualTreeAttachmentEventArgs e) { UnsubscribeFromAncestors(); _changed(); } public void Dispose() { if (_isDisposed) return; _isDisposed = true; U...
@@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using Avalonia.Media; +using Avalonia.VisualTree; + +namespace Avalonia.Controls.Primitives; + +class AdornerHelper +{ + + public static IDisposable SubscribeToAncestorPropertyChanges(Visual visual, + bool includeClip, Action changed) + ...
src/Avalonia.Controls/Primitives/AdornerHelper.cs
26
C#
0.786
suggestion
328
51
51
false
Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends
20,691
AvaloniaUI/Avalonia
24,333
C#
Copilot
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.Controls/Primitives/AdornerHelper.cs PR Title: Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends BEFORE CODE: private void OnDetachedFromVisualTree(object? sender, VisualTreeAttachmentE...
`CalculateAdornerClip` starts the walk at `adornedElement.VisualParent`, so it ignores clipping on the adorned element itself (`ClipToBounds` / `Clip`). This can diverge from compositor behavior. Start the walk from `adornedElement` so its own clip settings are included. ```suggestion var ancestor = adornedElem...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (visualAncestor.ClipToBounds) { ancestorClip = new RectangleGeometry(new Rect(visualAncestor.Bounds.Size)); } // Check if ancestor has explicit Clip geometry if (visualAncestor.Clip != null) { ...
When transforming an ancestor's `Clip` geometry, the code assigns `ancestorClip.Transform = new MatrixTransform(...)`. If the clip geometry already has a transform, this overwrites it and produces an incorrect clip. Combine the existing geometry transform with the `TransformToVisual` matrix instead of replacing it. ```...
if (visualAncestor.ClipToBounds) { ancestorClip = new RectangleGeometry(new Rect(visualAncestor.Bounds.Size)); } // Check if ancestor has explicit Clip geometry if (visualAncestor.Clip != null) { ...
@@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using Avalonia.Media; +using Avalonia.VisualTree; + +namespace Avalonia.Controls.Primitives; + +class AdornerHelper +{ + + public static IDisposable SubscribeToAncestorPropertyChanges(Visual visual, + bool includeClip, Action changed) + ...
src/Avalonia.Controls/Primitives/AdornerHelper.cs
26
C#
1
bug
1,035
47
50
false
Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends
20,691
AvaloniaUI/Avalonia
24,333
C#
Copilot
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.Controls/Primitives/AdornerHelper.cs PR Title: Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends BEFORE CODE: if (visualAncestor.ClipToBounds) { ...
When transforming an ancestor's `Clip` geometry, the code assigns `ancestorClip.Transform = new MatrixTransform(...)`. If the clip geometry already has a transform, this overwrites it and produces an incorrect clip. Combine the existing geometry transform with the `TransformToVisual` matrix instead of replacing it. ```...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (_visual != null && _visual.VisualRoot != null) matrix = _visual.TransformToVisual((Visual)_visual.VisualRoot); if (Matrix != matrix) { Matrix = matrix; MatrixChanged?.Invoke(); } } private void OnAttache...
`EnqueueForUpdate` sets `_queuedForUpdate = true` but it is never reset back to `false` (e.g. in `UpdateMatrix`). After the first queued update, subsequent Bounds changes will be ignored and `Matrix` can become stale. Reset `_queuedForUpdate` when `UpdateMatrix` runs (preferably at the beginning) so new updates can be ...
Matrix? matrix = null; if (_visual != null && _visual.VisualRoot != null) matrix = _visual.TransformToVisual((Visual)_visual.VisualRoot); if (Matrix != matrix) { Matrix = matrix; MatrixChanged?.Invoke(); } ...
@@ -91,7 +95,10 @@ private void EnqueueForUpdate() if(_queuedForUpdate) return; _queuedForUpdate = true; - Dispatcher.UIThread.Post(UpdateMatrix, DispatcherPriority.AfterRender); + if (_deferAfterRenderPass) + Dispatcher.UIThread.Post(Updat...
src/Avalonia.Base/Input/TextInput/TransformTrackingHelper.cs
26
C#
0.643
suggestion
327
51
51
false
Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends
20,691
AvaloniaUI/Avalonia
24,333
C#
Copilot
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.Base/Input/TextInput/TransformTrackingHelper.cs PR Title: Make sure that adorners are actually correctly positioned in visual tree for TransformToVisual and friends BEFORE CODE: if (_visual != null && _visual.VisualRoot != null) ...
`EnqueueForUpdate` sets `_queuedForUpdate = true` but it is never reset back to `false` (e.g. in `UpdateMatrix`). After the first queued update, subsequent Bounds changes will be ignored and `Matrix` can become stale. Reset `_queuedForUpdate` when `UpdateMatrix` runs (preferably at the beginning) so new updates can be ...
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
protected override Size ArrangeOverride(Size finalSize) { var parent = Parent; foreach (var child in Children) { var info = child.GetValue(s_adornedElementInfoProperty); if (info != null && info.Bounds.HasValue) { ...
No issues found.
protected override Size ArrangeOverride(Size finalSize) { var parent = Parent; foreach (var child in Children) { var info = child.GetValue(s_adornedElementInfoProperty); if (info != null && info.Bounds.HasValue) { ...
@@ -53,12 +53,13 @@ protected override Size ArrangeOverride(Size finalSize) foreach (var child in Children) { - var info = (AdornedElementInfo)child.GetValue(s_adornedElementInfoProperty); + var info = child.GetValue(s_adornedElementInfoProperty); ...
src/Avalonia.Controls/Primitives/AdornerLayer.cs
0
C#
1
none
16
51
51
true
Clip Focus Adorners
1,350
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Controls/Primitives/AdornerLayer.cs PR Title: Clip Focus Adorners BEFORE CODE: protected override Size ArrangeOverride(Size finalSize) { var parent = Parent; foreach (var child in Children) { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
movement = true; break; case Key.Up: movement = MoveVertical(-1, modifiers); break; case Key.Down: movement = MoveVertical(1, modifiers); break; case...
No issues found.
movement = true; break; case Key.Up: movement = MoveVertical(-1, modifiers); break; case Key.Down: movement = MoveVertical(1, modifiers); break; case...
@@ -85,6 +85,7 @@ public UndoRedoState(string text, int caretPosition) private int _selectionEnd; private TextPresenter _presenter; private UndoRedoHelper<UndoRedoState> _undoRedoHelper; + private bool _isUndoingRedoing; private bool _ignoreTextChanges; private static...
src/Avalonia.Controls/TextBox.cs
0
C#
1
none
16
51
51
true
Clear TextBox undo stack on binding change.
1,450
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Controls/TextBox.cs PR Title: Clear TextBox undo stack on binding change. BEFORE CODE: movement = true; break; case Key.Up: movement = MoveVertical(-1, modifiers); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var expressionObserver = (BindingExpression)target.Initiate( textBlock, TextBlock.TextProperty).Observable; Assert.IsType<StringFormatValueConverter>(expressionObserver.Converter); } } public class When_Binding_To_Obj...
No issues found.
var expressionObserver = (BindingExpression)target.Initiate( textBlock, TextBlock.TextProperty).Observable; Assert.IsType<StringFormatValueConverter>(expressionObserver.Converter); } } public class When_Binding_To_Obj...
@@ -0,0 +1,146 @@ +// Copyright (c) The Avalonia Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +using System; +using Avalonia.Controls; +using Avalonia.Data; +using Avalonia.Data.Converters; +using Avalonia.Data.Core; +using Xun...
tests/Avalonia.Markup.UnitTests/Data/BindingTests_Converters.cs
0
C#
1
none
16
51
51
true
Add StringFormat to Binding.
1,684
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Markup.UnitTests/Data/BindingTests_Converters.cs PR Title: Add StringFormat to Binding. BEFORE CODE: var expressionObserver = (BindingExpression)target.Initiate( textBlock, TextBlock.TextPrope...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/// Gets or sets the <see cref="IValueConverter"/> to use. /// </summary> public IValueConverter Converter { get; set; } /// <summary> /// Gets or sets a parameter to pass to <see cref="Converter"/>. /// </summary> public object ConverterParameter { get; set; } ...
No issues found.
/// Gets or sets the <see cref="IValueConverter"/> to use. /// </summary> public IValueConverter Converter { get; set; } /// <summary> /// Gets or sets a parameter to pass to <see cref="Converter"/>. /// </summary> public object ConverterParameter { get; set; } ...
@@ -0,0 +1,178 @@ +using System; +using System.Globalization; +using System.Reactive.Subjects; +using Avalonia.Data.Converters; +using Avalonia.Reactive; + +namespace Avalonia.Data +{ + /// <summary> + /// A XAML binding to a property on a control's templated parent. + /// </summary> + public class Templat...
src/Markup/Avalonia.Markup/Data/TemplateBinding.cs
0
C#
1
none
16
51
51
true
Simplify TemplateBindings
1,695
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Markup/Avalonia.Markup/Data/TemplateBinding.cs PR Title: Simplify TemplateBindings BEFORE CODE: /// Gets or sets the <see cref="IValueConverter"/> to use. /// </summary> public IValueConverter Converter { get; set; } /// <summa...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Avalonia.Animation { /// <summary> /// Interface for Animation objects /// </summary> public interface IAnimation { /// <summary> /// Apply the animation to the specified contr...
No issues found.
using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Avalonia.Animation { /// <summary> /// Interface for Animation objects /// </summary> public interface IAnimation { /// <summary> /// Apply the animation to the specified contr...
@@ -1,6 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Text; +using System.Threading.Tasks; namespace Avalonia.Animation { @@ -12,6 +13,11 @@ public interface IAnimation /// <summary> /// Apply the animation to the specified control /// </summary> ...
src/Avalonia.Animation/IAnimation.cs
0
C#
1
none
16
24
24
true
Code-behind Animation Trigger
1,774
AvaloniaUI/Avalonia
24,333
C#
jmacato
Review this pull request change. Language: C# File: src/Avalonia.Animation/IAnimation.cs PR Title: Code-behind Animation Trigger BEFORE CODE: using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Avalonia.Animation { /// <summary> /// Interface for Anima...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (m.HasValue) { var bounds = new Rect(visual.Bounds.Size).TransformToAABB(m.Value); _renderRoot?.Invalidate(bounds); } } } /// <summary> /// Ends the operation of the renderer. /// </su...
No issues found.
if (m.HasValue) { var bounds = new Rect(visual.Bounds.Size).TransformToAABB(m.Value); _renderRoot?.Invalidate(bounds); } } } /// <summary> /// Ends the operation of the renderer. /// </su...
@@ -200,7 +200,16 @@ static IEnumerable<IVisual> HitTest( if (filter?.Invoke(visual) != false) { - bool containsPoint = visual.TransformedBounds?.Contains(p) == true; + bool containsPoint = false; + + if (visual is ICustomSimpleHitTest custom) + ...
src/Avalonia.Visuals/Rendering/ImmediateRenderer.cs
0
C#
1
none
16
51
51
true
Add in custom hit testing for ImmediateRenderer.
1,901
AvaloniaUI/Avalonia
24,333
C#
jkoritzinsky
Review this pull request change. Language: C# File: src/Avalonia.Visuals/Rendering/ImmediateRenderer.cs PR Title: Add in custom hit testing for ImmediateRenderer. BEFORE CODE: if (m.HasValue) { var bounds = new Rect(visual.Bounds.Size).TransformToAABB(m.Value); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Width='18' Height='18' VerticalAlignment='Center'> <Path Name='checkMark' Fill='{StaticResource HighlightBrush}' Width='11' Height='10' Stretch='Uniform' Horizontal...
No issues found.
Width='18' Height='18' VerticalAlignment='Center'> <Path Name='checkMark' Fill='{StaticResource HighlightBrush}' Width='11' Height='10' Stretch='Uniform' Horizontal...
@@ -924,6 +924,45 @@ Hello World! } } + [Fact] + public void Design_Mode_Properties_Should_Be_Ignored_At_Runtime_And_Set_In_Design_Mode() + { + using (UnitTestApplication.Start(TestServices.MockWindowingPlatform)) + { + var xaml = @" +<Wi...
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
0
C#
1
none
16
51
51
true
Support for d:DataContext, d:DesignWidth and d:DesignHeight
1,952
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs PR Title: Support for d:DataContext, d:DesignWidth and d:DesignHeight BEFORE CODE: Width='18' Height='18' VerticalAlignment='Center'> <Path Na...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
_styled = true; } } protected void InitializeIfNeeded() { if (_initCount == 0 && !IsInitialized) { IsInitialized = true; Initialized?.Invoke(this, EventArgs.Empty); } } /// <inheritd...
No issues found.
_styled = true; } } protected void InitializeIfNeeded() { if (_initCount == 0 && !IsInitialized) { IsInitialized = true; Initialized?.Invoke(this, EventArgs.Empty); } } /// <inheritd...
@@ -49,8 +49,11 @@ public class StyledElement : Animatable, IStyledElement, ISetLogicalParent, ISet /// <summary> /// Defines the <see cref="TemplatedParent"/> property. /// </summary> - public static readonly StyledProperty<ITemplatedControl> TemplatedParentProperty = - Ava...
src/Avalonia.Styling/StyledElement.cs
0
C#
1
none
16
51
51
true
[Perf] Make TemplatedParent a direct property.
2,085
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Styling/StyledElement.cs PR Title: [Perf] Make TemplatedParent a direct property. BEFORE CODE: _styled = true; } } protected void InitializeIfNeeded() { if (_initCount == 0 && !IsInitial...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (hadResources || _resources.Count > 0) { ((ISetStyleParent)this).NotifyResourcesChanged(new ResourcesChangedEventArgs()); } } } /// <inheritdoc/> IResourceNode IResourceNode.ResourceParent => _parent; /...
No issues found.
if (hadResources || _resources.Count > 0) { ((ISetStyleParent)this).NotifyResourcesChanged(new ResourcesChangedEventArgs()); } } } /// <inheritdoc/> IResourceNode IResourceNode.ResourceParent => _parent; /...
@@ -2,6 +2,7 @@ // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; +using System.Collections.Generic; using System.Linq; using Avalonia.Collections; using Avalonia.Controls; @@ -15,6 +16,7 @@ public class Styles : AvaloniaList<IStyle>, IStyle, I...
src/Avalonia.Styling/Styling/Styles.cs
0
C#
1
none
16
51
51
true
[Perf] Cache the possible styles for control types.
2,088
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Styling/Styling/Styles.cs PR Title: [Perf] Cache the possible styles for control types. BEFORE CODE: if (hadResources || _resources.Count > 0) { ((ISetStyleParent)this).NotifyResourcesChanged(new Re...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
"{Property} changed from {$Old} to {$Value} with priority {Priority}", property, oldValue, newValue, (BindingPriority)priority); } } internal void BindingNotificationReceived(Avalonia...
No issues found.
"{Property} changed from {$Old} to {$Value} with priority {Priority}", property, oldValue, newValue, (BindingPriority)priority); } } internal void BindingNotificationReceived(Avalonia...
@@ -22,27 +22,10 @@ namespace Avalonia /// </remarks> public class AvaloniaObject : IAvaloniaObject, IAvaloniaObjectDebug, INotifyPropertyChanged { - /// <summary> - /// The parent object that inherited values are inherited from. - /// </summary> private IAvaloniaObject _inh...
src/Avalonia.Base/AvaloniaObject.cs
0
C#
1
none
16
51
51
true
[Perf] Cache AvaloniaObject initialization notifications.
2,127
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Base/AvaloniaObject.cs PR Title: [Perf] Cache AvaloniaObject initialization notifications. BEFORE CODE: "{Property} changed from {$Old} to {$Value} with priority {Priority}", property, oldVal...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using System.Threading; using Avalonia; using Avalonia.Skia; namespace ControlCatalog.NetCore { static class Program { static void Main(string[] args) { Thread.CurrentThread.TrySetApartmentState(ApartmentState.STA); if (args.Contains("--wait-for-attach")) ...
No issues found.
using System.Threading; using Avalonia; using Avalonia.Skia; namespace ControlCatalog.NetCore { static class Program { static void Main(string[] args) { Thread.CurrentThread.TrySetApartmentState(ApartmentState.STA); if (args.Contains("--wait-for-attach")) ...
@@ -23,14 +23,20 @@ static void Main(string[] args) break; } } + if (args.Contains("--fbdev")) AppBuilder.Configure<App>().InitializeWithLinuxFramebuffer(tl => { tl.Content = new MainView(); ...
samples/ControlCatalog.NetCore/Program.cs
0
C#
1
none
16
51
51
true
Additional `Start` method overload
2,146
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: samples/ControlCatalog.NetCore/Program.cs PR Title: Additional `Start` method overload BEFORE CODE: using System.Threading; using Avalonia; using Avalonia.Skia; namespace ControlCatalog.NetCore { static class Program { static void Main(st...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
public bool PublishTestResults { get; } public string Version { get; } public AbsolutePath ArtifactsDir { get; } public AbsolutePath NugetIntermediateRoot { get; } public AbsolutePath NugetRoot { get; } public AbsolutePath ZipRoot { get; } public AbsolutePath BinR...
No issues found.
public bool PublishTestResults { get; } public string Version { get; } public AbsolutePath ArtifactsDir { get; } public AbsolutePath NugetIntermediateRoot { get; } public AbsolutePath NugetRoot { get; } public AbsolutePath ZipRoot { get; } public AbsolutePath BinR...
@@ -14,13 +14,13 @@ public partial class Build { [Parameter("configuration")] - public string NukeArgConfiguration { get; set; } + public string Configuration { get; set; } [Parameter("skip-tests")] - public bool NukeArgSkipTests { get; set; } + public bool SkipTests { get; set; } ...
nukebuild/BuildParameters.cs
0
C#
1
none
16
51
51
true
Parameter properties names must be same as command-line
2,164
AvaloniaUI/Avalonia
24,333
C#
wieslawsoltes
Review this pull request change. Language: C# File: nukebuild/BuildParameters.cs PR Title: Parameter properties names must be same as command-line BEFORE CODE: public bool PublishTestResults { get; } public string Version { get; } public AbsolutePath ArtifactsDir { get; } public Abso...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
sub.Dispose(); Assert.Equal(0, data.PropertyChangedSubscriptionCount); GC.KeepAlive(data); } } [Fact] public void Should_Get_Simple_Observable_Value_With_DataValidation_Enabled() { using (var sync = UnitTestSynchro...
No issues found.
sub.Dispose(); Assert.Equal(0, data.PropertyChangedSubscriptionCount); GC.KeepAlive(data); } } [Fact] public void Should_Get_Simple_Observable_Value_With_DataValidation_Enabled() { using (var sync = UnitTestSynchro...
@@ -150,6 +150,26 @@ public void Should_Return_BindingNotification_If_Stream_Operator_Applied_To_Not_ } } + [Fact] + public void Should_Work_With_Value_Type() + { + using (var sync = UnitTestSynchronizationContext.Begin()) + { + var sourc...
tests/Avalonia.Base.UnitTests/Data/Core/ExpressionObserverTests_Observable.cs
0
C#
1
none
16
51
51
true
Fix stream bindings with observable value types
2,257
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Base.UnitTests/Data/Core/ExpressionObserverTests_Observable.cs PR Title: Fix stream bindings with observable value types BEFORE CODE: sub.Dispose(); Assert.Equal(0, data.PropertyChangedSubscriptionCount); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var destinationTypeProvider = context.GetService(typeof(IDestinationTypeProvider)) as IDestinationTypeProvider; if (rootObjectProvider != null && destinationTypeProvider != null) { var target = rootObjectProvider.RootObject; var eve...
No issues found.
var destinationTypeProvider = context.GetService(typeof(IDestinationTypeProvider)) as IDestinationTypeProvider; if (rootObjectProvider != null && destinationTypeProvider != null) { var target = rootObjectProvider.RootObject; var eve...
@@ -0,0 +1,99 @@ +using System; +using System.ComponentModel; +using System.Globalization; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using Avalonia.Controls; +using Avalonia.Markup.Xaml.PortableXaml; +using Portable.Xaml; + +namespace Avalonia.Markup.Xaml.Converters +{ + interna...
src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaEventConverter.cs
0
C#
1
none
16
51
51
true
Updates for better designer integration.
2,307
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaEventConverter.cs PR Title: Updates for better designer integration. BEFORE CODE: var destinationTypeProvider = context.GetService(typeof(IDestinationTypeProvider)) as IDestinationTypeProvider; ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
SKPaint paint, float maxWidth, out int trailingCount) { int lengthBreak; if (maxWidth == -1) { lengthBreak = stop - textIndex; } else { ...
No issues found.
SKPaint paint, float maxWidth, out int trailingCount) { int lengthBreak; if (maxWidth == -1) { lengthBreak = stop - textIndex; } else { ...
@@ -89,7 +89,7 @@ public FormattedTextImpl( public Size Constraint => _constraint; - public Size Size => _size; + public Rect Bounds => _bounds; public IEnumerable<FormattedTextLine> GetLines() { @@ -135,7 +135,7 @@ public TextHitTestResult HitTestPoint(Point point) ...
src/Skia/Avalonia.Skia/FormattedTextImpl.cs
0
C#
1
none
16
51
51
true
Fix text rendering where TextAlignment != Left.
2,344
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Skia/Avalonia.Skia/FormattedTextImpl.cs PR Title: Fix text rendering where TextAlignment != Left. BEFORE CODE: SKPaint paint, float maxWidth, out int trailingCount) { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
namespace Avalonia.Animation.UnitTests { public class TransitionsTests { [Fact] public void Check_Transitions_Interpolation_Negative_Bounds_Clamp() { var clock = new MockGlobalClock(); using (UnitTestApplication.Start(new TestServices(globalClock: clock))) ...
No issues found.
namespace Avalonia.Animation.UnitTests { public class TransitionsTests { [Fact] public void Check_Transitions_Interpolation_Negative_Bounds_Clamp() { var clock = new MockGlobalClock(); using (UnitTestApplication.Start(new TestServices(globalClock: clock))) ...
@@ -0,0 +1,73 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Avalonia.Animation; +using Avalonia.Controls; +using Avalonia.Styling; +using Avalonia.UnitTests; +using Avalonia.Data; +using Xunit; +using Avalonia.Animation.Easings; + +namespace Avalonia.Animation.UnitTests...
tests/Avalonia.Animation.UnitTests/TransitionsTests.cs
0
C#
1
none
16
51
51
true
Fixes for Transitions + Sidebar hover effect speedup.
2,517
AvaloniaUI/Avalonia
24,333
C#
jmacato
Review this pull request change. Language: C# File: tests/Avalonia.Animation.UnitTests/TransitionsTests.cs PR Title: Fixes for Transitions + Sidebar hover effect speedup. BEFORE CODE: namespace Avalonia.Animation.UnitTests { public class TransitionsTests { [Fact] public void Check_Transition...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} /// <summary> /// Determines whether the rectangle fully contains another rectangle. /// </summary> /// <param name="r">The rectangle.</param> /// <returns>true if the rectangle is fully contained; otherwise false.</returns> public bool Contains(Rect r) ...
No issues found.
} /// <summary> /// Determines whether the rectangle fully contains another rectangle. /// </summary> /// <param name="r">The rectangle.</param> /// <returns>true if the rectangle is fully contained; otherwise false.</returns> public bool Contains(Rect r) ...
@@ -256,7 +256,7 @@ public Rect CenterRect(Rect rect) /// <summary> /// Inflates the rectangle. /// </summary> - /// <param name="thickness">The thickness.</param> + /// <param name="thickness">The thickness to be subtracted for each side of the rectangle.</param> /// <...
src/Avalonia.Visuals/Rect.cs
0
C#
1
none
16
51
51
true
Fix RectangleNode hit-testing and Rect.Deflate
2,537
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Visuals/Rect.cs PR Title: Fix RectangleNode hit-testing and Rect.Deflate BEFORE CODE: } /// <summary> /// Determines whether the rectangle fully contains another rectangle. /// </summary> /// <param name="r">Th...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
TransformedBounds? IVisual.TransformedBounds { get { return _transformedBounds; } set { SetAndRaise(TransformedBoundsProperty, ref _transformedBounds, value); } } /// <summary> /// Invalidates the visual and queues a repaint. /// </summar...
No issues found.
TransformedBounds? IVisual.TransformedBounds { get { return _transformedBounds; } set { SetAndRaise(TransformedBoundsProperty, ref _transformedBounds, value); } } /// <summary> /// Invalidates the visual and queues a repaint. /// </summar...
@@ -291,29 +291,6 @@ public virtual void Render(DrawingContext context) Contract.Requires<ArgumentNullException>(context != null); } - /// <summary> - /// Returns a transform that transforms the visual's coordinates into the coordinates - /// of the specified <paramref name=...
src/Avalonia.Visuals/Visual.cs
0
C#
1
none
16
51
51
true
Make VisualExtensions.TranslatePoint respect render transforms
2,539
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Visuals/Visual.cs PR Title: Make VisualExtensions.TranslatePoint respect render transforms BEFORE CODE: TransformedBounds? IVisual.TransformedBounds { get { return _transformedBounds; } set { SetAndRais...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Assert.Throws<ArgumentException>(() => target.Value = double.PositiveInfinity); Assert.Throws<ArgumentException>(() => target.Value = double.NegativeInfinity); } [Theory] [InlineData(true)] [InlineData(false)] public void SetValue_Should_Not_Cause_StackOv...
No issues found.
Assert.Throws<ArgumentException>(() => target.Value = double.PositiveInfinity); Assert.Throws<ArgumentException>(() => target.Value = double.NegativeInfinity); } [Theory] [InlineData(true)] [InlineData(false)] public void SetValue_Should_Not_Cause_StackOv...
@@ -8,6 +8,7 @@ using Avalonia.Data; using Avalonia.Markup.Data; using Avalonia.Styling; +using Avalonia.UnitTests; using Xunit; namespace Avalonia.Controls.UnitTests.Primitives @@ -22,6 +23,7 @@ public void Maximum_Should_Be_Coerced_To_Minimum() Minimum = 100, Maximum = 50, ...
tests/Avalonia.Controls.UnitTests/Primitives/RangeBaseTests.cs
0
C#
1
none
16
51
51
true
Don't coerce RangeBase values until initialized.
2,683
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/Primitives/RangeBaseTests.cs PR Title: Don't coerce RangeBase values until initialized. BEFORE CODE: Assert.Throws<ArgumentException>(() => target.Value = double.PositiveInfinity); Assert.Throws<ArgumentEx...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
.Select(x => x.DataContext) .ToList(); Assert.Equal( new object[] { items[0], items[1], "Base", "Base" }, dataContexts); } [Fact] public void Control_Item_Should_Not_Be_NameScope() { var items = new...
No issues found.
.Select(x => x.DataContext) .ToList(); Assert.Equal( new object[] { items[0], items[1], "Base", "Base" }, dataContexts); } [Fact] public void Control_Item_Should_Not_Be_NameScope() { var items = new...
@@ -11,6 +11,7 @@ using Avalonia.Data.Core; using Avalonia.Input; using Avalonia.Input.Platform; +using Avalonia.Interactivity; using Avalonia.LogicalTree; using Avalonia.UnitTests; using Xunit; @@ -719,6 +720,129 @@ public void Pressing_SelectAll_Gesture_With_Upward_Range_Selected_Should_Select_ } ...
tests/Avalonia.Controls.UnitTests/TreeViewTests.cs
0
C#
1
none
16
51
51
true
Some more selection improvements to `TreeView` and `SelectingItemsControl`
2,702
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/TreeViewTests.cs PR Title: Some more selection improvements to `TreeView` and `SelectingItemsControl` BEFORE CODE: .Select(x => x.DataContext) .ToList(); Assert.Equal( n...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ var root = new TestRoot { Width = 100, Height = 100, Child = new Border { Background = Brushes.Red, Opacity = 0.5, } }; root.Measure(Size.Inf...
No issues found.
{ var root = new TestRoot { Width = 100, Height = 100, Child = new Border { Background = Brushes.Red, Opacity = 0.5, } }; root.Measure(Size.Inf...
@@ -96,6 +96,180 @@ public void Should_Update_Dirty_Controls_In_Order() Assert.Equal(new List<IVisual> { root, decorator, border, canvas }, result); } + [Fact] + public void Should_Update_VisualNode_Order_On_Child_Remove_Insert() + { + var dispatcher = new Immedia...
tests/Avalonia.Visuals.UnitTests/Rendering/DeferredRendererTests.cs
0
C#
1
none
16
51
51
true
Fix ZIndex rendering.
2,776
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Visuals.UnitTests/Rendering/DeferredRendererTests.cs PR Title: Fix ZIndex rendering. BEFORE CODE: { var root = new TestRoot { Width = 100, Height = 100, Child = new Bord...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Assert.NotSame(collection, node.Children); } [Fact] public void Empty_DrawOperations_Collections_Should_Be_Shared() { var node1 = new VisualNode(Mock.Of<IVisual>(), null); var node2 = new VisualNode(Mock.Of<IVisual>(), null); Assert.Same(...
No issues found.
Assert.NotSame(collection, node.Children); } [Fact] public void Empty_DrawOperations_Collections_Should_Be_Shared() { var node1 = new VisualNode(Mock.Of<IVisual>(), null); var node2 = new VisualNode(Mock.Of<IVisual>(), null); Assert.Same(...
@@ -92,5 +92,14 @@ public void DrawOperations_In_Cloned_Node_Are_Cloned() Assert.Same(node1.DrawOperations[0].Item, node2.DrawOperations[0].Item); Assert.NotSame(node1.DrawOperations[0], node2.DrawOperations[0]); } + + [Fact] + public void SortChildren_Does_Not_Throw_On_...
tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/VisualNodeTests.cs
0
C#
1
none
16
51
51
true
Fix NRE in VisualNode.SortChildren.
2,793
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/VisualNodeTests.cs PR Title: Fix NRE in VisualNode.SortChildren. BEFORE CODE: Assert.NotSame(collection, node.Children); } [Fact] public void Empty_DrawOperations_Collection...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Avalonia.Markup.Xaml; using System; using Avalonia.Input; namespace ControlCatalog { public class DecoratedWindow : Window { public DecoratedWindow() { this.InitializeComponent(); this.AttachDevTools(); } void SetupSide(string name, StandardCursorT...
No issues found.
using Avalonia.Markup.Xaml; using System; using Avalonia.Input; namespace ControlCatalog { public class DecoratedWindow : Window { public DecoratedWindow() { this.InitializeComponent(); this.AttachDevTools(); } void SetupSide(string name, StandardCursorT...
@@ -34,7 +34,7 @@ private void InitializeComponent() SetupSide("Left", StandardCursorType.LeftSide, WindowEdge.West); SetupSide("Right", StandardCursorType.RightSide, WindowEdge.East); SetupSide("Top", StandardCursorType.TopSide, WindowEdge.North); - SetupSide("Bottom",...
samples/ControlCatalog/DecoratedWindow.xaml.cs
0
C#
1
none
16
51
51
true
Fix typo in StandardCursorType.
2,797
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: samples/ControlCatalog/DecoratedWindow.xaml.cs PR Title: Fix typo in StandardCursorType. BEFORE CODE: using Avalonia.Markup.Xaml; using System; using Avalonia.Input; namespace ControlCatalog { public class DecoratedWindow : Window { public Decorat...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Assert.Same(decorator, decoratorNode.Visual); Assert.Same(decoratorNode, result.FindNode(decorator)); var canvasNode = (VisualNode)decoratorNode.Children[0]; Assert.Same(canvas, canvasNode.Visual); Assert.Same(canvasNode, result.FindNode(c...
No issues found.
Assert.Same(decorator, decoratorNode.Visual); Assert.Same(decoratorNode, result.FindNode(decorator)); var canvasNode = (VisualNode)decoratorNode.Children[0]; Assert.Same(canvas, canvasNode.Visual); Assert.Same(canvasNode, result.FindNode(c...
@@ -475,6 +475,64 @@ public void Should_Update_When_Control_Removed() } } + [Fact] + public void Should_Update_When_Control_Moved() + { + using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface)) + { + Decorator moveFrom...
tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/SceneBuilderTests.cs
0
C#
1
none
16
51
51
true
Correctly handle reparenting of controls
3,004
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Visuals.UnitTests/Rendering/SceneGraph/SceneBuilderTests.cs PR Title: Correctly handle reparenting of controls BEFORE CODE: Assert.Same(decorator, decoratorNode.Visual); Assert.Same(decoratorNode, result.FindNode(deco...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
add { AddHandler(PointerPressedEvent, value); } remove { RemoveHandler(PointerPressedEvent, value); } } /// <summary> /// Occurs when the pointer is released over the control. /// </summary> public event EventHandler<PointerReleasedEventArgs> PointerRelea...
No issues found.
add { AddHandler(PointerPressedEvent, value); } remove { RemoveHandler(PointerPressedEvent, value); } } /// <summary> /// Occurs when the pointer is released over the control. /// </summary> public event EventHandler<PointerReleasedEventArgs> PointerRelea...
@@ -169,18 +169,18 @@ static InputElement() { IsEnabledProperty.Changed.Subscribe(IsEnabledChanged); - GotFocusEvent.AddClassHandler<InputElement>(x => x.OnGotFocus); - LostFocusEvent.AddClassHandler<InputElement>(x => x.OnLostFocus); - KeyDownEvent.AddClassHandl...
src/Avalonia.Input/InputElement.cs
0
C#
1
none
16
51
51
true
Remove usage of AddClassHandler that returns new lambda per invocation.
3,088
AvaloniaUI/Avalonia
24,333
C#
MarchingCube
Review this pull request change. Language: C# File: src/Avalonia.Input/InputElement.cs PR Title: Remove usage of AddClassHandler that returns new lambda per invocation. BEFORE CODE: add { AddHandler(PointerPressedEvent, value); } remove { RemoveHandler(PointerPressedEvent, value); } ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
items[1].IsSelected = false; items[1].RaiseEvent(new RoutedEventArgs(SelectingItemsControl.IsSelectedChangedEvent)); Assert.Equal(-1, target.SelectedIndex); Assert.Null(target.SelectedItem); } [Fact] public void Raising_IsSelectedChanged_On_Someo...
No issues found.
items[1].IsSelected = false; items[1].RaiseEvent(new RoutedEventArgs(SelectingItemsControl.IsSelectedChangedEvent)); Assert.Equal(-1, target.SelectedIndex); Assert.Null(target.SelectedItem); } [Fact] public void Raising_IsSelectedChanged_On_Someo...
@@ -1000,6 +1000,26 @@ public void Can_Set_Both_SelectedItem_And_SelectedItems_During_Initialization() Assert.Equal(new[] { "Bar" }, selectedItems); } + [Fact] + public void MoveSelection_Wrap_Does_Not_Hang_With_No_Focusable_Controls() + { + // Issue #3094. + ...
tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs
0
C#
1
none
16
51
51
true
Fix hang in ItemsControl.MoveSelection
3,096
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs PR Title: Fix hang in ItemsControl.MoveSelection BEFORE CODE: items[1].IsSelected = false; items[1].RaiseEvent(new RoutedEventArgs(SelectingItemsControl.IsSelectedCh...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
public sealed class PointerPointProperties { public bool IsLeftButtonPressed { get; } public bool IsMiddleButtonPressed { get; } public bool IsRightButtonPressed { get; } public PointerUpdateKind PointerUpdateKind { get; } private PointerPointProperties() { ...
No issues found.
public sealed class PointerPointProperties { public bool IsLeftButtonPressed { get; } public bool IsMiddleButtonPressed { get; } public bool IsRightButtonPressed { get; } public PointerUpdateKind PointerUpdateKind { get; } private PointerPointProperties() { ...
@@ -49,17 +49,6 @@ public PointerPointProperties(RawInputModifiers modifiers, PointerUpdateKind kin } public static PointerPointProperties None { get; } = new PointerPointProperties(); - - public MouseButton GetObsoleteMouseButton() - { - if (PointerUpdateKind == Poi...
src/Avalonia.Input/PointerPoint.cs
0
C#
1
none
16
51
51
true
Added InitialPressMouseButton to PointerReleasedEventArgs
3,101
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.Input/PointerPoint.cs PR Title: Added InitialPressMouseButton to PointerReleasedEventArgs BEFORE CODE: public sealed class PointerPointProperties { public bool IsLeftButtonPressed { get; } public bool IsMiddleButtonPressed { g...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
[DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr SetActiveWindow(...
No issues found.
[DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr SetActiveWindow(...
@@ -1031,6 +1031,9 @@ internal static extern int CoCreateInstance(ref Guid clsid, [DllImport("shcore.dll")] public static extern long GetDpiForMonitor(IntPtr hmonitor, MONITOR_DPI_TYPE dpiType, out uint dpiX, out uint dpiY); + [DllImport("gdi32.dll")] + public static extern int GetDevi...
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
0
C#
1
none
16
51
51
true
Fallback to GDI when ShCore.dll isnt found (win7/8).
3,124
AvaloniaUI/Avalonia
24,333
C#
jmacato
Review this pull request change. Language: C# File: src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs PR Title: Fallback to GDI when ShCore.dll isnt found (win7/8). BEFORE CODE: [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
for (int i = 0; i < defCount; ++i) { DefinitionBase def = definitions[i]; if (def.SizeType == LayoutTimeSizeType.Star) { if (def.MeasureSize < 0.0) { // this def was resolved in phase...
No issues found.
for (int i = 0; i < defCount; ++i) { DefinitionBase def = definitions[i]; if (def.SizeType == LayoutTimeSizeType.Star) { if (def.MeasureSize < 0.0) { // this def was resolved in phase...
@@ -6,6 +6,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using System.Diagnostics; using System.Linq; using System.Threading; @@ -178,6 +179,7 @@ public ColumnDefinitions ColumnDefinitions if (_data == null) { _data = new Ext...
src/Avalonia.Controls/Grid.cs
0
C#
1
none
16
51
51
true
fixed for few major issues with grid
3,157
AvaloniaUI/Avalonia
24,333
C#
donandren
Review this pull request change. Language: C# File: src/Avalonia.Controls/Grid.cs PR Title: fixed for few major issues with grid BEFORE CODE: for (int i = 0; i < defCount; ++i) { DefinitionBase def = definitions[i]; if (def.SizeType == LayoutTimeSizeType.Star...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
[Fact] public void Should_Exit_After_MainWindow_Closed() { using (UnitTestApplication.Start(TestServices.StyledWindow)) using(var lifetime = new ClassicDesktopStyleApplicationLifetime()) { lifetime.ShutdownMode = ShutdownMode.OnMainWindowClose;...
No issues found.
[Fact] public void Should_Exit_After_MainWindow_Closed() { using (UnitTestApplication.Start(TestServices.StyledWindow)) using(var lifetime = new ClassicDesktopStyleApplicationLifetime()) { lifetime.ShutdownMode = ShutdownMode.OnMainWindowClose;...
@@ -16,7 +16,7 @@ public class DesktopStyleApplicationLifetimeTests public void Should_Set_ExitCode_After_Shutdown() { using (UnitTestApplication.Start(TestServices.MockThreadingInterface)) - using(var lifetime = new ClassicDesktopStyleApplicationLifetime(Application.Current)) ...
tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs
0
C#
1
none
16
51
51
true
Fix AppBuilderBase.Start<TMainWindow>
3,159
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs PR Title: Fix AppBuilderBase.Start<TMainWindow> BEFORE CODE: [Fact] public void Should_Exit_After_MainWindow_Closed() { using (UnitTestApplication.Start(T...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var focus = FocusManager.Instance; var navigation = AvaloniaLocator.Current.GetService<IKeyboardNavigationHandler>(); var data = CreateTestTreeData(); var target = new TreeView { Template = CreateTreeViewTemplate(), ...
No issues found.
var focus = FocusManager.Instance; var navigation = AvaloniaLocator.Current.GetService<IKeyboardNavigationHandler>(); var data = CreateTestTreeData(); var target = new TreeView { Template = CreateTreeViewTemplate(), ...
@@ -10,6 +10,7 @@ using Avalonia.Controls.Templates; using Avalonia.Data; using Avalonia.Data.Core; +using Avalonia.Diagnostics; using Avalonia.Input; using Avalonia.Input.Platform; using Avalonia.Interactivity; @@ -33,6 +34,8 @@ public void Items_Should_Be_Created() Items = CreateTestTreeData(),...
tests/Avalonia.Controls.UnitTests/TreeViewTests.cs
0
C#
1
none
16
51
51
true
Prevent adding duplicate TreeViewItems to index
3,216
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/TreeViewTests.cs PR Title: Prevent adding duplicate TreeViewItems to index BEFORE CODE: var focus = FocusManager.Instance; var navigation = AvaloniaLocator.Current.GetService<IKeyboardNavigationHand...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
InitializeStylesIfNeeded(); InitializeIfNeeded(); } } private void InitializeStylesIfNeeded(bool force = false) { if (_initCount == 0 && (!_styled || force)) { ApplyStyling(); _styled = true; ...
No issues found.
InitializeStylesIfNeeded(); InitializeIfNeeded(); } } private void InitializeStylesIfNeeded(bool force = false) { if (_initCount == 0 && (!_styled || force)) { ApplyStyling(); _styled = true; ...
@@ -59,7 +59,7 @@ public class StyledElement : Animatable, IDataContextProvider, IStyledElement, I private int _initCount; private string _name; private readonly Classes _classes = new Classes(); - private IStyleRoot _styleRoot; + private ILogicalRoot _logicalRoot; priv...
src/Avalonia.Styling/StyledElement.cs
0
C#
1
none
16
51
51
true
Rename IStyleRoot to ILogicalRoot
3,346
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Styling/StyledElement.cs PR Title: Rename IStyleRoot to ILogicalRoot BEFORE CODE: InitializeStylesIfNeeded(); InitializeIfNeeded(); } } private void InitializeStylesIfNeeded(bool force = fa...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Media; namespace ControlCatalog.Pages { public class ImagePage : UserControl { private readonly Image _bitmapImage; private readonly Image _drawingImage; public ImagePage() { InitializeComponent(); ...
No issues found.
using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Media; namespace ControlCatalog.Pages { public class ImagePage : UserControl { private readonly Image _bitmapImage; private readonly Image _drawingImage; public ImagePage() { InitializeComponent(); ...
@@ -1,40 +1,41 @@ -using System.IO; -using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; -using Avalonia.Media.Imaging; +using Avalonia.Media; namespace ControlCatalog.Pages { public class ImagePage : UserControl { - private Image iconImage; + private readonly Image _bitma...
samples/ControlCatalog/Pages/ImagePage.xaml.cs
0
C#
1
none
16
43
43
true
Display Drawings in Image control
3,378
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: samples/ControlCatalog/Pages/ImagePage.xaml.cs PR Title: Display Drawings in Image control BEFORE CODE: using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.Media; namespace ControlCatalog.Pages { public class ImagePage : UserControl { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Assert.True(called); } [Fact] public void Assigning_SelectedItems_Should_Raise_SelectionChanged() { var items = new[] { "foo", "bar", "baz" }; var target = new TestSelector { Items = items, Template = Templ...
No issues found.
Assert.True(called); } [Fact] public void Assigning_SelectedItems_Should_Raise_SelectionChanged() { var items = new[] { "foo", "bar", "baz" }; var target = new TestSelector { Items = items, Template = Templ...
@@ -683,6 +683,57 @@ public void Shift_Selecting_From_No_Selection_Selects_From_Start() Assert.Equal(new[] { 0, 1, 2 }, SelectedContainers(target)); } + [Fact] + public void Ctrl_Selecting_Raises_SelectionChanged_Events() + { + var target = new ListBox + ...
tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests_Multiple.cs
0
C#
1
none
16
51
51
true
Failing unit tests for SelectingItemsControl events
3,435
AvaloniaUI/Avalonia
24,333
C#
MarchingCube
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests_Multiple.cs PR Title: Failing unit tests for SelectingItemsControl events BEFORE CODE: Assert.True(called); } [Fact] public void Assigning_SelectedItems_Sh...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e) => PlatformImpl?.BeginResizeDrag(edge, e); /// <summary> /// Carries out the arrange pass of the window. /// </summary> /// <param name="finalSize">The final window size.</param> /// <returns...
No issues found.
public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e) => PlatformImpl?.BeginResizeDrag(edge, e); /// <summary> /// Carries out the arrange pass of the window. /// </summary> /// <param name="finalSize">The final window size.</param> /// <returns...
@@ -129,7 +129,7 @@ static Window() ShowInTaskbarProperty.Changed.AddClassHandler<Window>((w, e) => w.PlatformImpl?.ShowTaskbarIcon((bool)e.NewValue)); - IconProperty.Changed.AddClassHandler<Window>((s, e) => s.PlatformImpl?.SetIcon(((WindowIcon)e.NewValue).PlatformImpl)); + IconP...
src/Avalonia.Controls/Window.cs
0
C#
1
none
16
51
51
true
Allow assigning null to Window.Icon.
3,558
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Avalonia.Controls/Window.cs PR Title: Allow assigning null to Window.Icon. BEFORE CODE: public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e) => PlatformImpl?.BeginResizeDrag(edge, e); /// <summary> /// Carrie...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
<TextBlock Text='{Binding Name}' Background='Purple'/> </DataTemplate> </UserControl.Resources> <ListBox Name='listBox' ItemTemplate='{DynamicResource PurpleData}'/> </UserControl>"; var loader = new AvaloniaXamlLoader(); var userControl = (UserControl)loader.Load(xam...
No issues found.
<TextBlock Text='{Binding Name}' Background='Purple'/> </DataTemplate> </UserControl.Resources> <ListBox Name='listBox' ItemTemplate='{DynamicResource PurpleData}'/> </UserControl>"; var loader = new AvaloniaXamlLoader(); var userControl = (UserControl)loader.Load(xam...
@@ -627,6 +627,137 @@ public void Control_Property_Is_Updated_When_Parent_Is_Changed() Assert.Equal(0xff506070, brush.Color.ToUint32()); } + [Fact] + public void Resource_With_DynamicResource_Is_Updated_When_Added_To_Parent() + { + var xaml = @" +<UserControl xmln...
tests/Avalonia.Markup.Xaml.UnitTests/MarkupExtensions/DynamicResourceExtensionTests.cs
0
C#
1
none
16
51
51
true
Fix DynamicResource in Style resources
3,597
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/MarkupExtensions/DynamicResourceExtensionTests.cs PR Title: Fix DynamicResource in Style resources BEFORE CODE: <TextBlock Text='{Binding Name}' Background='Purple'/> </DataTemplate> </UserControl.Resource...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
namespace Avalonia.Input.UnitTests { public class KeyGestureTests { public static readonly IEnumerable<object[]> ParseData = new object[][] { new object[]{"Ctrl+A", new KeyGesture(Key.A, KeyModifiers.Control)}, new object[]{" \tShift\t+Alt +B", new KeyGesture(Key.B, KeyM...
No issues found.
namespace Avalonia.Input.UnitTests { public class KeyGestureTests { public static readonly IEnumerable<object[]> ParseData = new object[][] { new object[]{"Ctrl+A", new KeyGesture(Key.A, KeyModifiers.Control)}, new object[]{" \tShift\t+Alt +B", new KeyGesture(Key.B, KeyM...
@@ -1,19 +1,31 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Xunit; namespace Avalonia.Input.UnitTests { public class KeyGestureTests { - public static readonly IEnumerable<object[]> SampleData = new object[][] + public static readonly IEnumerable<object[]>...
tests/Avalonia.Input.UnitTests/KeyGestureTests.cs
0
C#
1
none
16
51
51
true
Add MenuItem.InputGestureText.
3,602
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Input.UnitTests/KeyGestureTests.cs PR Title: Add MenuItem.InputGestureText. BEFORE CODE: namespace Avalonia.Input.UnitTests { public class KeyGestureTests { public static readonly IEnumerable<object[]> ParseData = new object[][] ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
protected abstract void DoEmit(XamlIlEmitContext context, IXamlIlEmitter codeGen); protected void EmitCall(XamlIlEmitContext context, IXamlIlEmitter codeGen, Func<IXamlIlMethod, bool> method) { var selectors = context.Configuration.TypeSystem.GetType("Avalonia.Styling.Selec...
No issues found.
protected abstract void DoEmit(XamlIlEmitContext context, IXamlIlEmitter codeGen); protected void EmitCall(XamlIlEmitContext context, IXamlIlEmitter codeGen, Func<IXamlIlMethod, bool> method) { var selectors = context.Configuration.TypeSystem.GetType("Avalonia.Styling.Selec...
@@ -104,6 +104,11 @@ XamlIlSelectorNode Create(IEnumerable<SelectorGrammar.ISyntax> syntax, } } + if (results != null && result != null) + { + results.Add(result); + } + return results ?? result; ...
src/Markup/Avalonia.Markup.Xaml/XamlIl/CompilerExtensions/Transformers/AvaloniaXamlIlSelectorTransformer.cs
0
C#
1
none
16
51
51
true
Fix XAML compiler handling of comma/or style selector.
3,678
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: src/Markup/Avalonia.Markup.Xaml/XamlIl/CompilerExtensions/Transformers/AvaloniaXamlIlSelectorTransformer.cs PR Title: Fix XAML compiler handling of comma/or style selector. BEFORE CODE: protected abstract void DoEmit(XamlIlEmitContext context, IXa...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Assert.Equal(new Vector(0, 0), target.Offset); } [Fact] public void Test_ScrollToEnd() { var target = new ScrollViewer(); target.SetValue(ScrollViewer.ExtentProperty, new Size(50, 50)); target.SetValue(ScrollViewer.ViewportProperty, new Si...
No issues found.
Assert.Equal(new Vector(0, 0), target.Offset); } [Fact] public void Test_ScrollToEnd() { var target = new ScrollViewer(); target.SetValue(ScrollViewer.ExtentProperty, new Size(50, 50)); target.SetValue(ScrollViewer.ViewportProperty, new Si...
@@ -4,6 +4,8 @@ using Avalonia.Controls.Primitives; using Avalonia.Controls.Templates; using Avalonia.Layout; +using Avalonia.LogicalTree; +using Moq; using Xunit; namespace Avalonia.Controls.UnitTests @@ -86,6 +88,65 @@ public void Test_ScrollToEnd() Assert.Equal(new Vector(0, 40), target.Offset); ...
tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs
0
C#
1
none
16
51
51
true
Fix large/small scroll in ScrollViewer.
3,725
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs PR Title: Fix large/small scroll in ScrollViewer. BEFORE CODE: Assert.Equal(new Vector(0, 0), target.Offset); } [Fact] public void Test_ScrollToEnd() { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Avalonia.Controls.Shapes; using Avalonia.Media; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Controls.UnitTests.Shapes { public class PathTests { [Fact] public void Path_With_Null_Data_Does_Not_Throw_On_Measure() { var target = new Path(); ta...
No issues found.
using Avalonia.Controls.Shapes; using Avalonia.Media; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Controls.UnitTests.Shapes { public class PathTests { [Fact] public void Path_With_Null_Data_Does_Not_Throw_On_Measure() { var target = new Path(); ta...
@@ -1,4 +1,6 @@ using Avalonia.Controls.Shapes; +using Avalonia.Media; +using Avalonia.UnitTests; using Xunit; namespace Avalonia.Controls.UnitTests.Shapes @@ -12,5 +14,21 @@ public void Path_With_Null_Data_Does_Not_Throw_On_Measure() target.Measure(Size.Infinity); } + + [Fact] + ...
tests/Avalonia.Controls.UnitTests/Shapes/PathTests.cs
0
C#
1
none
16
35
35
true
Invalidate Path on geometry change.
3,757
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/Shapes/PathTests.cs PR Title: Invalidate Path on geometry change. BEFORE CODE: using Avalonia.Controls.Shapes; using Avalonia.Media; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Controls.UnitTests.Shapes { publi...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ throw new ArgumentException("Height can't be less than 1", nameof(size)); } var createInfo = new SurfaceRenderTarget.CreateInfo { Width = size.Width, Height = size.Height, Dpi = dpi, Disabl...
No issues found.
{ throw new ArgumentException("Height can't be less than 1", nameof(size)); } var createInfo = new SurfaceRenderTarget.CreateInfo { Width = size.Width, Height = size.Height, Dpi = dpi, Disabl...
@@ -149,6 +149,16 @@ public IWriteableBitmapImpl CreateWriteableBitmap(PixelSize size, Vector dpi, Pi return new WriteableBitmapImpl(size, dpi, format); } + private static readonly SKPaint s_paint = new SKPaint + { + TextEncoding = SKTextEncoding.GlyphId, + Is...
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
0
C#
1
none
16
51
51
true
More text rendering improvements
3,782
AvaloniaUI/Avalonia
24,333
C#
Gillibald
Review this pull request change. Language: C# File: src/Skia/Avalonia.Skia/PlatformRenderInterface.cs PR Title: More text rendering improvements BEFORE CODE: { throw new ArgumentException("Height can't be less than 1", nameof(size)); } var createInfo = new Surfac...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
0.5), Times.Never); } [Fact] public void Transition_Is_Not_Applied_When_StyleTrigger_Changes_With_LocalValue_Present() { var target = CreateTarget(); var control = CreateControl(target.Object); control.SetValue(Visual....
No issues found.
0.5), Times.Never); } [Fact] public void Transition_Is_Not_Applied_When_StyleTrigger_Changes_With_LocalValue_Present() { var target = CreateTarget(); var control = CreateControl(target.Object); control.SetValue(Visual....
@@ -0,0 +1,242 @@ +using System; +using Avalonia.Controls; +using Avalonia.Data; +using Avalonia.Styling; +using Avalonia.UnitTests; +using Moq; +using Xunit; + +namespace Avalonia.Animation.UnitTests +{ + public class AnimatableTests + { + [Fact] + public void Transition_Is_Not_Applied_When_Not_At...
tests/Avalonia.Animation.UnitTests/AnimatableTests.cs
0
C#
1
none
16
51
51
true
Reworked transitions.
3,854
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Animation.UnitTests/AnimatableTests.cs PR Title: Reworked transitions. BEFORE CODE: 0.5), Times.Never); } [Fact] public void Transition_Is_Not_Applied_When_StyleTrigger_Changes_With_LocalValue...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var control = new Decorator(); var root = new LayoutTestRoot { Child = control, LayoutManager = target.Object, }; root.Measure(Size.Infinity); root.Arrange(new Rect(root.DesiredSize)); Assert.True(contro...
No issues found.
var control = new Decorator(); var root = new LayoutTestRoot { Child = control, LayoutManager = target.Object, }; root.Measure(Size.Infinity); root.Arrange(new Rect(root.DesiredSize)); Assert.True(contro...
@@ -203,6 +203,125 @@ public void UseLayoutRounding_Arranges_Center_Alignment_Correctly_With_Fractiona Assert.Equal(new Rect(expectedX, 0, childWidth, 100), target.Bounds); } + [Fact] + public void LayoutUpdated_Is_Called_At_End_Of_Layout_Pass() + { + Border borde...
tests/Avalonia.Layout.UnitTests/LayoutableTests.cs
0
C#
1
none
16
51
51
true
Match LayoutUpdated and ScrollChanged event behavior to WPF/UWP
4,080
AvaloniaUI/Avalonia
24,333
C#
grokys
Review this pull request change. Language: C# File: tests/Avalonia.Layout.UnitTests/LayoutableTests.cs PR Title: Match LayoutUpdated and ScrollChanged event behavior to WPF/UWP BEFORE CODE: var control = new Decorator(); var root = new LayoutTestRoot { Child = con...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
CaptureData.Text += "\n-----"; } 4) Run the app, mess with the slider values, then click the button to capture output values **/ [Fact] public void Check_KeySpline_Handled_properly() { var keyframe1 = new KeyFrame() { ...
No issues found.
CaptureData.Text += "\n-----"; } 4) Run the app, mess with the slider values, then click the button to capture output values **/ [Fact] public void Check_KeySpline_Handled_properly() { var keyframe1 = new KeyFrame() { ...
@@ -1,4 +1,5 @@ using System; +using Avalonia.Animation.Easings; using Avalonia.Controls.Shapes; using Avalonia.Media; using Avalonia.Styling; @@ -25,6 +26,16 @@ public void Can_Parse_KeySpline_Via_TypeConverter(string input) Assert.Equal(4, keySpline.ControlPointY2); } + [Theory] + ...
tests/Avalonia.Animation.UnitTests/KeySplineTests.cs
0
C#
1
none
16
51
51
true
Spline easing
4,180
AvaloniaUI/Avalonia
24,333
C#
jmacato
Review this pull request change. Language: C# File: tests/Avalonia.Animation.UnitTests/KeySplineTests.cs PR Title: Spline easing BEFORE CODE: CaptureData.Text += "\n-----"; } 4) Run the app, mess with the slider values, then click the button to capture output values **...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
internal #else public #endif sealed class NotNullAttribute : Attribute { } /// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary> [AttributeUsage(AttributeTargets.Parameter, Inherited = fa...
No issues found.
internal #else public #endif sealed class NotNullAttribute : Attribute { } /// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary> [AttributeUsage(AttributeTargets.Parameter, Inherited = fa...
@@ -0,0 +1,140 @@ +#pragma warning disable MA0048 // File name must match type name +#define INTERNAL_NULLABLE_ATTRIBUTES +#if NETSTANDARD2_0 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NET45 || NET451 || NET452 || NET6 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48 + +// https://github.com/dot...
src/Avalonia.Base/Metadata/NullableAttributes.cs
0
C#
1
none
16
51
51
true
Remove warnings from Avalonia.Base
4,182
AvaloniaUI/Avalonia
24,333
C#
MarchingCube
Review this pull request change. Language: C# File: src/Avalonia.Base/Metadata/NullableAttributes.cs PR Title: Remove warnings from Avalonia.Base BEFORE CODE: internal #else public #endif sealed class NotNullAttribute : Attribute { } /// <summary>Specifies that when a method returns <see cr...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
"allow", "almost", "alone", "along", "aloud", "already", "also", "alteration", "altered", "alternate", "alternately", "altogether", "always", "am", ...
No issues found.
"allow", "almost", "alone", "along", "aloud", "already", "also", "alteration", "altered", "alternate", "alternately", "altogether", "always", "am", ...
@@ -105,6 +105,16 @@ public void Fires_DropDown_Events() }); } + [Fact] + public void Custom_FilterMode_Without_ItemFilter_Setting_Throws_Exception() + { + RunTest((control, textbox) => + { + control.FilterMode = AutoCompleteFilterMode.Cu...
tests/Avalonia.Controls.UnitTests/AutoCompleteBoxTests.cs
0
C#
1
none
16
51
51
true
Fix AutoCompleteBox NRE
6,536
AvaloniaUI/Avalonia
24,333
C#
Takoooooo
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/AutoCompleteBoxTests.cs PR Title: Fix AutoCompleteBox NRE BEFORE CODE: "allow", "almost", "alone", "along", "aloud", "already", "also", ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
internal IContentPresenterHost? Host { get; private set; } /// <inheritdoc/> public sealed override void ApplyTemplate() { if (!_createdChild && ((ILogical)this).IsAttachedToLogicalTree) { UpdateChild(); } } protected ...
No issues found.
internal IContentPresenterHost? Host { get; private set; } /// <inheritdoc/> public sealed override void ApplyTemplate() { if (!_createdChild && ((ILogical)this).IsAttachedToLogicalTree) { UpdateChild(); } } protected ...
@@ -107,9 +107,6 @@ static ContentPresenter() AffectsRender<ContentPresenter>(BackgroundProperty, BorderBrushProperty, BorderThicknessProperty, CornerRadiusProperty); AffectsArrange<ContentPresenter>(HorizontalContentAlignmentProperty, VerticalContentAlignmentProperty); AffectsMea...
src/Avalonia.Controls/Presenters/ContentPresenter.cs
0
C#
1
none
16
51
51
true
feat(ContentPresenter): Content of ContentPresenter should become DataContext of the subtree whenever ContentTemplate is not null
7,008
AvaloniaUI/Avalonia
24,333
C#
workgroupengineering
Review this pull request change. Language: C# File: src/Avalonia.Controls/Presenters/ContentPresenter.cs PR Title: feat(ContentPresenter): Content of ContentPresenter should become DataContext of the subtree whenever ContentTemplate is not null BEFORE CODE: internal IContentPresenterHost? Host { get; privat...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var root = new TestRoot(); var touchDevice = new TouchDevice(); var isDoubleTapped = false; var doubleTappedExecutedTimes = 0; var tappedExecutedTimes = 0; root.DoubleTapped += (a, e) => { ...
No issues found.
var root = new TestRoot(); var touchDevice = new TouchDevice(); var isDoubleTapped = false; var doubleTappedExecutedTimes = 0; var tappedExecutedTimes = 0; root.DoubleTapped += (a, e) => { ...
@@ -0,0 +1,272 @@ +using System; +using Avalonia.Input.Raw; +using Avalonia.Platform; +using Avalonia.UnitTests; +using Moq; +using Xunit; + +namespace Avalonia.Input.UnitTests +{ + public class TouchDeviceTests + { + [Fact] + public void Tapped_Event_Is_Fired_With_Touch() + { + u...
tests/Avalonia.Input.UnitTests/TouchDeviceTests.cs
0
C#
1
none
16
51
51
true
Fix DoubleTapped on touch
7,213
AvaloniaUI/Avalonia
24,333
C#
Takoooooo
Review this pull request change. Language: C# File: tests/Avalonia.Input.UnitTests/TouchDeviceTests.cs PR Title: Fix DoubleTapped on touch BEFORE CODE: var root = new TestRoot(); var touchDevice = new TouchDevice(); var isDoubleTapped = false; var dou...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ Header = "Screens", Content = new ScreenPage() }); } var themes = this.Find<ComboBox>("Themes"); themes.SelectionChanged += (sender, e) => { if (themes.SelectedItem is CatalogTheme...
No issues found.
{ Header = "Screens", Content = new ScreenPage() }); } var themes = this.Find<ComboBox>("Themes"); themes.SelectionChanged += (sender, e) => { if (themes.SelectedItem is CatalogTheme...
@@ -3,14 +3,12 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; -using Avalonia.Markup.Xaml.MarkupExtensions; -using Avalonia.Markup.Xaml.Styling; -using Avalonia.Markup.Xaml.XamlIl; using Avalonia.Media; using Avalonia.Media.Immutable; using Avalonia.Platform; -using ControlCatalog.Pages; ...
samples/ControlCatalog/MainView.xaml.cs
0
C#
1
none
16
51
51
true
Fast Fluent theme switching
7,256
AvaloniaUI/Avalonia
24,333
C#
Takoooooo
Review this pull request change. Language: C# File: samples/ControlCatalog/MainView.xaml.cs PR Title: Fast Fluent theme switching BEFORE CODE: { Header = "Screens", Content = new ScreenPage() }); } var themes = this.Fi...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Rendering; namespace Avalonia.iOS { static class Platform { public static EaglFeature GlFeature; public static DisplayLinkTimer Timer; class PlatformSettings : IPlatformSettings { /// <inheritdoc cref="IP...
No issues found.
using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Rendering; namespace Avalonia.iOS { static class Platform { public static EaglFeature GlFeature; public static DisplayLinkTimer Timer; class PlatformSettings : IPlatformSettings { /// <inheritdoc cref="IP...
@@ -1,11 +1,9 @@ using System; -using Avalonia.Controls; using Avalonia.Input; using Avalonia.Input.Platform; using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Rendering; -using Avalonia.Shared.PlatformSupport; namespace Avalonia.iOS { @@ -15,10 +13,17 @@ static class Platform public sta...
src/iOS/Avalonia.iOS/Platform.cs
0
C#
1
none
16
51
51
true
Add properties to IPlatformSettings to define double-click Size\Time for Touch input.
7,274
AvaloniaUI/Avalonia
24,333
C#
Takoooooo
Review this pull request change. Language: C# File: src/iOS/Avalonia.iOS/Platform.cs PR Title: Add properties to IPlatformSettings to define double-click Size\Time for Touch input. BEFORE CODE: using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Rendering; namespace Avalonia.iOS { static class Platf...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
/// <summary> /// Occurs when the control or its child control loses the pointer capture for any reason, /// event will not be triggered for a parent control if capture was transferred to another child of that parent control /// </summary> public event EventHandler<PointerCaptur...
No issues found.
/// <summary> /// Occurs when the control or its child control loses the pointer capture for any reason, /// event will not be triggered for a parent control if capture was transferred to another child of that parent control /// </summary> public event EventHandler<PointerCaptur...
@@ -94,15 +94,15 @@ public class InputElement : Interactive, IInputElement /// </summary> public static readonly RoutedEvent<KeyEventArgs> KeyDownEvent = RoutedEvent.Register<InputElement, KeyEventArgs>( - "KeyDown", + nameof(KeyDown), Routin...
src/Avalonia.Base/Input/InputElement.cs
0
C#
1
none
16
51
51
true
Routing event fixes
8,147
AvaloniaUI/Avalonia
24,333
C#
wieslawsoltes
Review this pull request change. Language: C# File: src/Avalonia.Base/Input/InputElement.cs PR Title: Routing event fixes BEFORE CODE: /// <summary> /// Occurs when the control or its child control loses the pointer capture for any reason, /// event will not be triggered for a parent contro...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using (UnitTestApplication.Start(TestServices.StyledWindow)) { var xaml = @" <Window xmlns='https://github.com/avaloniaui' xmlns:sys='clr-namespace:System;assembly=netstandard' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> <Window.DataTemplates> ...
No issues found.
using (UnitTestApplication.Start(TestServices.StyledWindow)) { var xaml = @" <Window xmlns='https://github.com/avaloniaui' xmlns:sys='clr-namespace:System;assembly=netstandard' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> <Window.DataTemplates> ...
@@ -1,6 +1,11 @@ using System; +using System.Linq; using Avalonia.Controls; using Avalonia.Controls.Presenters; +using Avalonia.Controls.Templates; +using Avalonia.Markup.Xaml.Templates; +using Avalonia.Markup.Xaml.UnitTests.MarkupExtensions; +using Avalonia.Metadata; using Avalonia.UnitTests; using Xunit; @@ -9...
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/DataTemplateTests.cs
0
C#
1
none
16
51
51
true
Implicitly map x:DataType to a DataType on a DataTemplate.
8,220
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/Xaml/DataTemplateTests.cs PR Title: Implicitly map x:DataType to a DataType on a DataTemplate. BEFORE CODE: using (UnitTestApplication.Start(TestServices.StyledWindow)) { var xaml = @" <W...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ Template = new FuncControlTemplate<Button>((parent, _) => new Decorator { [ToolTip.TipProperty] = new TextBlock { [~TextBlock.TextProperty] = new ...
No issues found.
{ Template = new FuncControlTemplate<Button>((parent, _) => new Decorator { [ToolTip.TipProperty] = new TextBlock { [~TextBlock.TextProperty] = new ...
@@ -3,9 +3,11 @@ using System.Linq; using Avalonia.Controls; using Avalonia.Controls.Presenters; +using Avalonia.Controls.Primitives; using Avalonia.Controls.Templates; using Avalonia.Data; using Avalonia.Data.Converters; +using Avalonia.UnitTests; using Avalonia.VisualTree; using Xunit; @@ -90,6 +92,131 @@ p...
tests/Avalonia.Markup.UnitTests/Data/TemplateBindingTests.cs
0
C#
1
none
16
51
51
true
Apply target's TemplatedParent to a Flyout and Tooltip, when it's opened
8,412
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Markup.UnitTests/Data/TemplateBindingTests.cs PR Title: Apply target's TemplatedParent to a Flyout and Tooltip, when it's opened BEFORE CODE: { Template = new FuncControlTemplate<Button>((parent, _) => ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
[Fact] public void Style_Resources_Are_Built() { var xaml = @" <Style xmlns='https://github.com/avaloniaui' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:sys='clr-namespace:System;assembly=netstandard'> <Style.Resources> <SolidColorBrush x:K...
No issues found.
[Fact] public void Style_Resources_Are_Built() { var xaml = @" <Style xmlns='https://github.com/avaloniaui' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:sys='clr-namespace:System;assembly=netstandard'> <Style.Resources> <SolidColorBrush x:K...
@@ -958,6 +958,29 @@ public void Should_Parse_Tip_With_Comment() Assert.Equal("Foo", toolTip.Content); } + [Fact] + public void AddChild_Child_Is_Set() + { + var xaml = @"<ObjectWithAddChild xmlns='clr-namespace:Avalonia.Markup.Xaml.UnitTests.Xaml'>Foo</ObjectWit...
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
0
C#
1
none
16
51
51
true
Add IAddChild support
8,436
AvaloniaUI/Avalonia
24,333
C#
Gillibald
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs PR Title: Add IAddChild support BEFORE CODE: [Fact] public void Style_Resources_Are_Built() { var xaml = @" <Style xmlns='https://github.com/avaloniaui' xmlns:x='ht...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Avalonia.Styling; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Markup.Xaml.UnitTests; public class SetterTests : XamlTestBase { [Fact] public void SetterTargetType_Should_Understand_xType_Extensions() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { ...
No issues found.
using Avalonia.Styling; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Markup.Xaml.UnitTests; public class SetterTests : XamlTestBase { [Fact] public void SetterTargetType_Should_Understand_xType_Extensions() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { ...
@@ -0,0 +1,51 @@ +using Avalonia.Controls; +using Avalonia.Styling; +using Avalonia.UnitTests; +using Xunit; + +namespace Avalonia.Markup.Xaml.UnitTests; + +public class SetterTests : XamlTestBase +{ + [Fact] + public void SetterTargetType_Should_Understand_xType_Extensions() + { + using (UnitTestAppli...
tests/Avalonia.Markup.Xaml.UnitTests/SetterTests.cs
0
C#
1
none
16
51
51
true
Add x:SetterTargetType
8,572
AvaloniaUI/Avalonia
24,333
C#
pr8x
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/SetterTests.cs PR Title: Add x:SetterTargetType BEFORE CODE: using Avalonia.Styling; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Markup.Xaml.UnitTests; public class SetterTests : XamlTestBase { [Fact] pu...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} } } return true; } private static RawInputModifiers GetModifiers(MetaKeyStates metaState, MotionEventButtonState buttonState) { var modifiers = RawInputModifiers.None; if (metaState.HasAnyFlag(MetaKeyStates.S...
No issues found.
} } } return true; } private static RawInputModifiers GetModifiers(MetaKeyStates metaState, MotionEventButtonState buttonState) { var modifiers = RawInputModifiers.None; if (metaState.HasAnyFlag(MetaKeyStates.S...
@@ -0,0 +1,251 @@ +using System; +using System.Collections.Generic; + +using Android.Views; + +using Avalonia.Android.Platform.SkiaPlatform; +using Avalonia.Collections.Pooled; +using Avalonia.Input; +using Avalonia.Input.Raw; + +#nullable enable + +namespace Avalonia.Android.Platform.Specific.Helpers +{ + internal ...
src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs
0
C#
1
none
16
51
51
true
Revamp android input handling to support mouse, pen and historical points
8,698
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidMotionEventsHelper.cs PR Title: Revamp android input handling to support mouse, pen and historical points BEFORE CODE: } } } return true; ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
public void Window_Loads_And_Unloads() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { int loadedCount = 0, unloadedCount = 0; var target = new Window(); target.Loaded += (_, _) => loadedCount++; target.Unloaded += (_, _) => unloa...
No issues found.
public void Window_Loads_And_Unloads() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { int loadedCount = 0, unloadedCount = 0; var target = new Window(); target.Loaded += (_, _) => loadedCount++; target.Unloaded += (_, _) => unloa...
@@ -0,0 +1,71 @@ +using Avalonia.Platform; +using Avalonia.Threading; +using Avalonia.UnitTests; +using Moq; +using Xunit; + +namespace Avalonia.Controls.UnitTests; + +public class LoadedTests +{ + [Fact] + public void Window_Loads_And_Unloads() + { + using (UnitTestApplication.Start(TestServices.Style...
tests/Avalonia.Controls.UnitTests/LoadedTests.cs
0
C#
1
none
16
51
51
true
Update and fix ReactiveUI on master branch + ios
8,738
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/LoadedTests.cs PR Title: Update and fix ReactiveUI on master branch + ios BEFORE CODE: public void Window_Loads_And_Unloads() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { int...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var root = new TestRoot { Child = new StackPanel { Children = { target1, target2 } } ...
No issues found.
var root = new TestRoot { Child = new StackPanel { Children = { target1, target2 } } ...
@@ -1,5 +1,7 @@ +using System; using Avalonia.Controls; using Avalonia.Input; +using Avalonia.Interactivity; using Avalonia.UnitTests; using Xunit; @@ -25,6 +27,33 @@ public void Focus_Should_Set_FocusManager_Current() } } + [Fact] + public void Focus_Should_Not_Get_Restored_...
tests/Avalonia.Base.UnitTests/Input/InputElement_Focus.cs
0
C#
1
none
16
51
51
true
Disabled controls should lose focus and don't accept keyboard events
9,627
AvaloniaUI/Avalonia
24,333
C#
Takoooooo
Review this pull request change. Language: C# File: tests/Avalonia.Base.UnitTests/Input/InputElement_Focus.cs PR Title: Disabled controls should lose focus and don't accept keyboard events BEFORE CODE: var root = new TestRoot { Child = new StackPanel ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ CheckLease(); Canvas.Save(); Canvas.ClipPath(((GeometryImpl)clip).EffectivePath, SKClipOperation.Intersect, true); } /// <inheritdoc /> public void PopGeometryClip() { CheckLease(); Canvas.Restore(); } ...
No issues found.
{ CheckLease(); Canvas.Save(); Canvas.ClipPath(((GeometryImpl)clip).EffectivePath, SKClipOperation.Intersect, true); } /// <inheritdoc /> public void PopGeometryClip() { CheckLease(); Canvas.Restore(); } ...
@@ -40,6 +40,7 @@ internal class DrawingContextImpl : IDrawingContextImpl, IDrawingContextWithAcry private static SKShader? s_acrylicNoiseShader; private readonly ISkiaGpuRenderSession? _session; private bool _leased; + private bool _useOpacitySaveLayer; /// <summary> ...
src/Skia/Avalonia.Skia/DrawingContextImpl.cs
0
C#
1
none
16
51
51
true
[SKIA] UseOpacitySaveLayer feature switch
9,964
AvaloniaUI/Avalonia
24,333
C#
Gillibald
Review this pull request change. Language: C# File: src/Skia/Avalonia.Skia/DrawingContextImpl.cs PR Title: [SKIA] UseOpacitySaveLayer feature switch BEFORE CODE: { CheckLease(); Canvas.Save(); Canvas.ClipPath(((GeometryImpl)clip).EffectivePath, SKClipOperation.Intersect, ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
Title='test'> <TextBlock Text='{CompiledBinding Length, Source=Test}' x:Name='text'/> </Window>"; var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); var target = window.FindControl<TextBlock>("text"); window.ApplyTemplate(); window.Pre...
No issues found.
Title='test'> <TextBlock Text='{CompiledBinding Length, Source=Test}' x:Name='text'/> </Window>"; var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); var target = window.FindControl<TextBlock>("text"); window.ApplyTemplate(); window.Pre...
@@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; @@ -7,6 +8,7 @@ using System.Reactive.Subjects; using System.Runtime.CompilerServices; using System.Threading.Tasks; +using Avalonia.Collections; using A...
tests/Avalonia.Markup.Xaml.UnitTests/MarkupExtensions/CompiledBindingExtensionTests.cs
0
C#
1
none
16
51
51
true
Implement support for InheritDataTypeFromItemsAttribute
10,121
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/MarkupExtensions/CompiledBindingExtensionTests.cs PR Title: Implement support for InheritDataTypeFromItemsAttribute BEFORE CODE: Title='test'> <TextBlock Text='{CompiledBinding Length, Source=Test}' x:Name='text'/> ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
new Item { Value = "Item3" }, }; vm = new MasterViewModel { Child = new ChildViewModel { Items = items, SelectedItem = items[2], } }; target.DataContext =...
No issues found.
new Item { Value = "Item3" }, }; vm = new MasterViewModel { Child = new ChildViewModel { Items = items, SelectedItem = items[2], } }; target.DataContext =...
@@ -175,6 +175,8 @@ public void SelectedIndex_Should_Be_0_After_Initialize_With_AlwaysSelected() [Fact] public void Setting_SelectedIndex_During_Initialize_Should_Select_Item_When_AlwaysSelected_Is_Used() { + using var _ = UnitTestApplication.Start(TestServices.MockPlatformRenderIn...
tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs
0
C#
1
none
16
51
51
true
Add default template to the ContentControl, remove theme specific templates
11,365
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/Primitives/SelectingItemsControlTests.cs PR Title: Add default template to the ContentControl, remove theme specific templates BEFORE CODE: new Item { Value = "Item3" }, }; vm = new MasterV...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} protected override void PointerPressed(PointerPressedEventArgs e) { if (e.Pointer.IsPrimary && (e.Pointer.Type == PointerType.Touch || e.Pointer.Type == PointerType.Pen)) { EndGesture(); _tracking = e.Pointer; ...
No issues found.
} protected override void PointerPressed(PointerPressedEventArgs e) { if (e.Pointer.IsPrimary && (e.Pointer.Type == PointerType.Touch || e.Pointer.Type == PointerType.Pen)) { EndGesture(); _tracking = e.Pointer; ...
@@ -4,7 +4,7 @@ namespace Avalonia.Input.GestureRecognizers { - public class ScrollGestureRecognizer : AvaloniaObject, IGestureRecognizer + public class ScrollGestureRecognizer : GestureRecognizer { // Pixels per second speed that is considered to be the stop of inertial scroll internal...
src/Avalonia.Base/Input/GestureRecognizers/ScrollGestureRecognizer.cs
0
C#
1
none
16
51
51
true
Rework GestureRecognizer handling
11,518
AvaloniaUI/Avalonia
24,333
C#
emmauss
Review this pull request change. Language: C# File: src/Avalonia.Base/Input/GestureRecognizers/ScrollGestureRecognizer.cs PR Title: Rework GestureRecognizer handling BEFORE CODE: } protected override void PointerPressed(PointerPressedEventArgs e) { if (e.Pointer.IsPrimary && ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
static (s, _) => s is InvocationExpressionSyntax inv && inv.Expression is MemberAccessExpressionSyntax { Name: { Identifier: { Text: "GetType" or "FindType" } } } && inv.ArgumentList.Arguments.Count == 1 && inv.ArgumentList.Arguments[0].Expression is L...
No issues found.
static (s, _) => s is InvocationExpressionSyntax inv && inv.Expression is MemberAccessExpressionSyntax { Name: { Identifier: { Text: "GetType" or "FindType" } } } && inv.ArgumentList.Arguments.Count == 1 && inv.ArgumentList.Arguments[0].Expression is L...
@@ -0,0 +1,77 @@ +using System.Linq; +using System.Text; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; + +namespace DevGenerators; + +[Generator(LanguageNames.CSharp)] +public class CompilerDynamicDependenciesGenerator : IIncrementalGenerator +{ + public void Initialize(IncrementalGene...
src/tools/DevGenerators/CompilerDynamicDependenciesGenerator.cs
0
C#
1
none
16
51
51
true
Trimmable runtime xaml loader
12,937
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/tools/DevGenerators/CompilerDynamicDependenciesGenerator.cs PR Title: Trimmable runtime xaml loader BEFORE CODE: static (s, _) => s is InvocationExpressionSyntax inv && inv.Expression is MemberAccessExpressionSyntax { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
using Foundation; using ObjCRuntime; namespace Avalonia.iOS; internal unsafe class Interop { internal const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"; internal const string libcLibrary = "/usr/lib/libc.dylib"; internal static NativeHandle kCFRunLoo...
No issues found.
using Foundation; using ObjCRuntime; namespace Avalonia.iOS; internal unsafe class Interop { internal const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"; internal const string libcLibrary = "/usr/lib/libc.dylib"; internal static NativeHandle kCFRunLoo...
@@ -7,11 +7,11 @@ namespace Avalonia.iOS; -// TODO: use LibraryImport in NET7 -internal class Interop +internal unsafe class Interop { internal const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"; - internal static NativeHandle kCFRunLoopCommonModes = ...
src/iOS/Avalonia.iOS/Interop.cs
0
C#
1
none
16
51
51
true
Fix iOS Dispatcher
13,942
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/iOS/Avalonia.iOS/Interop.cs PR Title: Fix iOS Dispatcher BEFORE CODE: using Foundation; using ObjCRuntime; namespace Avalonia.iOS; internal unsafe class Interop { internal const string CoreFoundationLibrary = "/System/Library/Frameworks/CoreFoundation.fr...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private readonly uint _cookie; private WindowsInputPane(WindowImpl windowImpl) { _windowImpl = windowImpl; _inputPane = UnmanagedMethods.CreateInstance<IFrameworkInputPane>(in CLSID_FrameworkInputPane, in SID_IFrameworkInputPane); using (var handler = new Handler(this)) { ...
No issues found.
private readonly uint _cookie; private WindowsInputPane(WindowImpl windowImpl) { _windowImpl = windowImpl; _inputPane = UnmanagedMethods.CreateInstance<IFrameworkInputPane>(in CLSID_FrameworkInputPane, in SID_IFrameworkInputPane); using (var handler = new Handler(this)) { ...
@@ -3,11 +3,15 @@ using Avalonia.MicroCom; using Avalonia.Win32.Interop; using Avalonia.Win32.Win32Com; +using Avalonia.Win32.WinRT; namespace Avalonia.Win32.Input; internal unsafe class WindowsInputPane : IInputPane, IDisposable { + private static readonly Lazy<bool> s_inputPaneSupported = new(() => + ...
src/Windows/Avalonia.Win32/Input/WindowsInputPane.cs
0
C#
1
none
16
51
51
true
Implement ApiInformation checks
14,090
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/Windows/Avalonia.Win32/Input/WindowsInputPane.cs PR Title: Implement ApiInformation checks BEFORE CODE: private readonly uint _cookie; private WindowsInputPane(WindowImpl windowImpl) { _windowImpl = windowImpl; _inputPane = Unmanag...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); var button = (Button)window.Content; window.ApplyTemplate(); button.ApplyTemplate(); var presenter = button.Presenter; Assert.Equal(Brushes.Red, presenter.Backgrou...
No issues found.
var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); var button = (Button)window.Content; window.ApplyTemplate(); button.ApplyTemplate(); var presenter = button.Presenter; Assert.Equal(Brushes.Red, presenter.Backgrou...
@@ -1,6 +1,9 @@ using System; +using System.Collections.Generic; using System.Linq; +using System.Xml; using Avalonia.Controls; +using Avalonia.Controls.Metadata; using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; using Avalonia.Data; @@ -276,7 +279,7 @@ public void ControlTemplate_With_Targe...
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/ControlTemplateTests.cs
0
C#
1
none
16
51
51
true
TemplatePart XAML diagnostics
14,180
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Markup.Xaml.UnitTests/Xaml/ControlTemplateTests.cs PR Title: TemplatePart XAML diagnostics BEFORE CODE: var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); var button = (Button)window.Content; ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ throw new ArgumentNullException(nameof(uri)); } if (!uri.IsAbsoluteUri) { return false; } if (!await Permissions.RequestPrivilegeAsync(Permissions.LaunchPrivilege)) { return false; } var appControl = new App...
No issues found.
{ throw new ArgumentNullException(nameof(uri)); } if (!uri.IsAbsoluteUri) { return false; } if (!await Permissions.RequestPrivilegeAsync(Permissions.LaunchPrivilege)) { return false; } var appControl = new App...
@@ -0,0 +1,71 @@ +using Avalonia.Platform.Storage; +using Avalonia.Tizen.Platform; +using Tizen.Applications; + +namespace Avalonia.Tizen; + +internal class TizenLauncher : ILauncher +{ + public async Task<bool> LaunchUriAsync(Uri uri) + { + if (uri is null) + { + throw new ArgumentNullE...
src/Tizen/Avalonia.Tizen/Platform/TizenLauncher.cs
0
C#
1
none
16
51
51
true
Implement TopLevel.Launcher
14,320
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/Tizen/Avalonia.Tizen/Platform/TizenLauncher.cs PR Title: Implement TopLevel.Launcher BEFORE CODE: { throw new ArgumentNullException(nameof(uri)); } if (!uri.IsAbsoluteUri) { return false; } ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var physicalKey = AndroidKeyInterop.PhysicalKeyFromScanCode(e.ScanCode); var keySymbol = GetKeySymbol(e.UnicodeChar, physicalKey); var keyDeviceType = GetKeyDeviceType(e); var rawKeyEvent = new RawKeyEventArgs( AndroidKeyboardDevice.Instance!, ...
No issues found.
var physicalKey = AndroidKeyInterop.PhysicalKeyFromScanCode(e.ScanCode); var keySymbol = GetKeySymbol(e.UnicodeChar, physicalKey); var keyDeviceType = GetKeyDeviceType(e); var rawKeyEvent = new RawKeyEventArgs( AndroidKeyboardDevice.Instance!, ...
@@ -70,6 +70,8 @@ public AndroidKeyboardEventsHelper(TView view) _view.Input?.Invoke(rawKeyEvent); + bool handled = rawKeyEvent.Handled; + if ((e.Action == KeyEventActions.Down && e.UnicodeChar >= 32) || unicodeTextInput != null) { @@ -80,6 +82,8 @@...
src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidKeyboardEventsHelper.cs
0
C#
1
none
16
51
51
true
Android - call base dispatch key event before called toplevel's override
16,969
AvaloniaUI/Avalonia
24,333
C#
emmauss
Review this pull request change. Language: C# File: src/Android/Avalonia.Android/Platform/Specific/Helpers/AndroidKeyboardEventsHelper.cs PR Title: Android - call base dispatch key event before called toplevel's override BEFORE CODE: var physicalKey = AndroidKeyInterop.PhysicalKeyFromScanCode(e.ScanCode...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} Panel.TemplatedParent = TemplatedParent; Panel.IsItemsHost = true; LogicalChildren.Add(Panel); VisualChildren.Add(Panel); if (Panel is VirtualizingPanel v) v.Attach(ItemsControl); else...
No issues found.
} Panel.TemplatedParent = TemplatedParent; Panel.IsItemsHost = true; LogicalChildren.Add(Panel); VisualChildren.Add(Panel); if (Panel is VirtualizingPanel v) v.Attach(ItemsControl); else...
@@ -3,8 +3,6 @@ using System.Diagnostics; using Avalonia.Controls.Primitives; using Avalonia.Input; -using Avalonia.Interactivity; -using Avalonia.Layout; namespace Avalonia.Controls.Presenters { @@ -198,6 +196,44 @@ private void CreateSimplePanelGenerator() return v.GetRealizedContainers(); ...
src/Avalonia.Controls/Presenters/ItemsPresenter.cs
0
C#
1
none
16
51
51
true
Search all SelectingItemsControl items with TextSearch on key input, not just realized ones
17,506
AvaloniaUI/Avalonia
24,333
C#
jonko0493
Review this pull request change. Language: C# File: src/Avalonia.Controls/Presenters/ItemsPresenter.cs PR Title: Search all SelectingItemsControl items with TextSearch on key input, not just realized ones BEFORE CODE: } Panel.TemplatedParent = TemplatedParent; Panel....
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
private static void TestTextSearch( int initialSelectedIndex, int expectedSelectedIndex, string searchTerm, Action<ComboBox> configureComboBox, IEnumerable<object> itemsSource) { using (UnitTestApplication.Start(TestServices.Styled...
No issues found.
private static void TestTextSearch( int initialSelectedIndex, int expectedSelectedIndex, string searchTerm, Action<ComboBox> configureComboBox, IEnumerable<object> itemsSource) { using (UnitTestApplication.Start(TestServices.Styled...
@@ -209,6 +209,10 @@ private static FuncControlTemplate GetTemplate() ItemsPanel = new FuncTemplate<Panel>(() => new VirtualizingStackPanel()), }.RegisterInNameScope(scope) }.RegisterInNameScope(scope) + ...
tests/Avalonia.Controls.UnitTests/ComboBoxTests.cs
0
C#
1
none
16
51
51
true
IsEditable combox box
18,094
AvaloniaUI/Avalonia
24,333
C#
almightyju
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/ComboBoxTests.cs PR Title: IsEditable combox box BEFORE CODE: private static void TestTextSearch( int initialSelectedIndex, int expectedSelectedIndex, string searchTerm, Act...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} }; SystemTitleBarEnabled = true; TitleBarHeight = -1; CanResize = true; CanMinimize = true; CanMaximize = true; } public ExtendClientAreaChromeHints ChromeHints { get {...
No issues found.
} }; SystemTitleBarEnabled = true; TitleBarHeight = -1; CanResize = true; CanMinimize = true; CanMaximize = true; } public ExtendClientAreaChromeHints ChromeHints { get {...
@@ -1,6 +1,5 @@ using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Controls.Notifications; using Avalonia.Dialogs; using Avalonia.Platform; using System; @@ -22,6 +21,9 @@ class MainWindowViewModel : ViewModelBase private bool _isSystemBarVisible; private bool ...
samples/ControlCatalog/ViewModels/MainWindowViewModel.cs
0
C#
1
none
16
51
51
true
Add Window.CanMinimize/CanMaximize
18,117
AvaloniaUI/Avalonia
24,333
C#
MrJul
Review this pull request change. Language: C# File: samples/ControlCatalog/ViewModels/MainWindowViewModel.cs PR Title: Add Window.CanMinimize/CanMaximize BEFORE CODE: } }; SystemTitleBarEnabled = true; TitleBarHeight = -1; CanResize = true; ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} } public void SetFocusedElement( IInputElement? element, NavigationMethod method, KeyModifiers keyModifiers) { SetFocusedElement(element, method, keyModifiers, true); } public void SetFocusedElement( IIn...
No issues found.
} } public void SetFocusedElement( IInputElement? element, NavigationMethod method, KeyModifiers keyModifiers) { SetFocusedElement(element, method, keyModifiers, true); } public void SetFocusedElement( IIn...
@@ -129,41 +129,89 @@ private void ClearChildrenFocusWithin(IInputElement element, bool clearRoot) } public void SetFocusedElement( - IInputElement? element, + IInputElement? element, NavigationMethod method, KeyModifiers keyModifiers) + { + ...
src/Avalonia.Base/Input/KeyboardDevice.cs
0
C#
1
none
16
51
51
true
Add ability to cancel focus change
18,373
AvaloniaUI/Avalonia
24,333
C#
emmauss
Review this pull request change. Language: C# File: src/Avalonia.Base/Input/KeyboardDevice.cs PR Title: Add ability to cancel focus change BEFORE CODE: } } public void SetFocusedElement( IInputElement? element, NavigationMethod method, KeyModifiers ke...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
return ReadProperty(sel.property); } private PropertyReadResult ReadProperty(IntPtr property) { XGetWindowProperty(_x11.Display, _window.Handle, property, IntPtr.Zero, new IntPtr (0x7fffffff), true, (IntPtr)Atom.AnyPropertyType, out var actualTypeAtom, out ...
No issues found.
return ReadProperty(sel.property); } private PropertyReadResult ReadProperty(IntPtr property) { XGetWindowProperty(_x11.Display, _window.Handle, property, IntPtr.Zero, new IntPtr (0x7fffffff), true, (IntPtr)Atom.AnyPropertyType, out var actualTypeAtom, out ...
@@ -0,0 +1,152 @@ +using System; +using System.Buffers; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using static Avalonia.X11.XLib; +namespace Avalonia.X11.Clipboard; + +class ClipboardReadSession : IDisposable +{ + private readonly AvaloniaX11Platform _platform; + pri...
src/Avalonia.X11/Clipboard/ClipboardReadSession.cs
0
C#
1
none
16
51
51
true
[X11] Added INCR support
18,428
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.X11/Clipboard/ClipboardReadSession.cs PR Title: [X11] Added INCR support BEFORE CODE: return ReadProperty(sel.property); } private PropertyReadResult ReadProperty(IntPtr property) { XGetWindowProperty(_x11.Display...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface)) { var target = new ListBox { Template = new FuncControlTemplate(CreateListBoxTemplate), ItemsSource = new[] { "Foo", "Bar", "Baz " }, ...
No issues found.
{ using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface)) { var target = new ListBox { Template = new FuncControlTemplate(CreateListBoxTemplate), ItemsSource = new[] { "Foo", "Bar", "Baz " }, ...
@@ -6,6 +6,7 @@ using Avalonia.Controls.Templates; using Avalonia.Data; using Avalonia.Input; +using Avalonia.Input.GestureRecognizers; using Avalonia.Input.Platform; using Avalonia.LogicalTree; using Avalonia.Styling; @@ -19,38 +20,42 @@ namespace Avalonia.Controls.UnitTests public class ListBoxTests_Single...
tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs
0
C#
1
none
16
51
51
true
Improve pen secondary button handling on list box
18,766
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/ListBoxTests_Single.cs PR Title: Improve pen secondary button handling on list box BEFORE CODE: { using (UnitTestApplication.Start(TestServices.MockPlatformRenderInterface)) { var ta...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
{ _caretTimer?.Start(); InvalidateVisual(); _caretTimer?.Stop(); } if (IsMeasureValid) { this.BringIntoView(_caretBounds); } else { // The measure is curre...
No issues found.
{ _caretTimer?.Start(); InvalidateVisual(); _caretTimer?.Stop(); } if (IsMeasureValid) { this.BringIntoView(_caretBounds); } else { // The measure is curre...
@@ -455,14 +455,14 @@ public sealed override void Render(DrawingContext context) internal (Point, Point) GetCaretPoints() { - var x = Math.Floor(_caretBounds.X) + 0.5; - var y = Math.Floor(_caretBounds.Y) + 0.5; - var b = Math.Ceiling(_caretBounds.Bottom) - 0.5; - ...
src/Avalonia.Controls/Presenters/TextPresenter.cs
0
C#
1
none
16
51
51
true
Fix caret handles not updating to the latest caret points
18,794
AvaloniaUI/Avalonia
24,333
C#
emmauss
Review this pull request change. Language: C# File: src/Avalonia.Controls/Presenters/TextPresenter.cs PR Title: Fix caret handles not updating to the latest caret points BEFORE CODE: { _caretTimer?.Start(); InvalidateVisual(); _caretTimer?.Stop(); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
internal enum DXGI_SWAP_EFFECT { DXGI_SWAP_EFFECT_DISCARD = 0, DXGI_SWAP_EFFECT_SEQUENTIAL = 1, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3, DXGI_SWAP_EFFECT_FLIP_DISCARD = 4, } [Flags] internal enum DXGI_SWAP_CHAIN_FLAG { DXGI_SWAP_CHAIN_FLAG_NONPREROTAT...
No issues found.
internal enum DXGI_SWAP_EFFECT { DXGI_SWAP_EFFECT_DISCARD = 0, DXGI_SWAP_EFFECT_SEQUENTIAL = 1, DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3, DXGI_SWAP_EFFECT_FLIP_DISCARD = 4, } [Flags] internal enum DXGI_SWAP_CHAIN_FLAG { DXGI_SWAP_CHAIN_FLAG_NONPREROTAT...
@@ -213,6 +213,14 @@ internal enum DXGI_ERROR : uint DXGI_ERROR_WAS_STILL_DRAWING = 0x887A000A } + [Flags] + internal enum DXGI_MWA : uint + { + DXGI_MWA_NO_WINDOW_CHANGES = 1, + DXGI_MWA_NO_ALT_ENTER = 2, + DXGI_MWA_NO_PRINT_SCREEN = 4 + } + internal static cla...
src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs
0
C#
1
none
16
51
51
true
fix: Prevent DXGI from intercepting Alt+Enter and PrintScreen
18,970
AvaloniaUI/Avalonia
24,333
C#
M0n7y5
Review this pull request change. Language: C# File: src/Windows/Avalonia.Win32/DirectX/DirectXEnums.cs PR Title: fix: Prevent DXGI from intercepting Alt+Enter and PrintScreen BEFORE CODE: internal enum DXGI_SWAP_EFFECT { DXGI_SWAP_EFFECT_DISCARD = 0, DXGI_SWAP_EFFECT_SEQUENTIAL = 1, ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
ScopedResource<GRContext>.Create(_context ?? throw new ObjectDisposedException(nameof(SkiaMetalGpu)), EnsureCurrent().Dispose); public ISkiaGpuRenderTarget? TryCreateRenderTarget(IEnumerable<object> surfaces) { foreach (var surface in surfaces) { if (surface is I...
No issues found.
ScopedResource<GRContext>.Create(_context ?? throw new ObjectDisposedException(nameof(SkiaMetalGpu)), EnsureCurrent().Dispose); public ISkiaGpuRenderTarget? TryCreateRenderTarget(IEnumerable<object> surfaces) { foreach (var surface in surfaces) { if (surface is I...
@@ -9,14 +9,15 @@ namespace Avalonia.Skia.Metal; internal class SkiaMetalGpu : ISkiaGpu, ISkiaGpuWithPlatformGraphicsContext { - private SkiaMetalApi _api = new(); private GRContext? _context; private readonly IMetalDevice _device; public SkiaMetalGpu(IMetalDevice device, long? maxResourceBytes)...
src/Skia/Avalonia.Skia/Gpu/Metal/SkiaMetalGpu.cs
0
C#
1
none
16
51
51
true
[12.0] Target SkiaSharp 3.0. Drop 2.88 support
18,981
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/Skia/Avalonia.Skia/Gpu/Metal/SkiaMetalGpu.cs PR Title: [12.0] Target SkiaSharp 3.0. Drop 2.88 support BEFORE CODE: ScopedResource<GRContext>.Create(_context ?? throw new ObjectDisposedException(nameof(SkiaMetalGpu)), EnsureCurrent().Dispose...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
throw new InvalidOperationException( "SurfaceView.Holder was not expected to be null during InvalidationAwareSurfaceView initialization."); Holder.AddCallback(this); Holder.SetFormat(global::Android.Graphics.Format.Transparent); } protected o...
No issues found.
throw new InvalidOperationException( "SurfaceView.Holder was not expected to be null during InvalidationAwareSurfaceView initialization."); Holder.AddCallback(this); Holder.SetFormat(global::Android.Graphics.Format.Transparent); } protected o...
@@ -1,102 +1,108 @@ using System; +using System.Threading; using Android.Content; using Android.Graphics; -using Android.OS; using Android.Runtime; -using Android.Util; using Android.Views; using Avalonia.Android.Platform.SkiaPlatform; +using Avalonia.Logging; using Avalonia.Platform; +using Java.Lang; namesp...
src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs
0
C#
1
none
16
51
51
true
Cleanup InvalidationAwareSurfaceView related code
19,045
AvaloniaUI/Avalonia
24,333
C#
maxkatz6
Review this pull request change. Language: C# File: src/Android/Avalonia.Android/Platform/SkiaPlatform/InvalidationAwareSurfaceView.cs PR Title: Cleanup InvalidationAwareSurfaceView related code BEFORE CODE: throw new InvalidOperationException( "SurfaceView.Holder was not expecte...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} #endif -(void)setCanBecomeKeyWindow:(bool)value { _canBecomeKeyWindow = value; } -(bool)shouldTryToHandleEvents { return _isEnabled; } -(void) setEnabled:(bool)enable { _isEnabled = enable; } -(void)becomeKeyWindow { [self showWindowMenuWithAppMenu]; auto parent = _parent.tryGet(); if(par...
No issues found.
} #endif -(void)setCanBecomeKeyWindow:(bool)value { _canBecomeKeyWindow = value; } -(bool)shouldTryToHandleEvents { return _isEnabled; } -(void) setEnabled:(bool)enable { _isEnabled = enable; } -(void)becomeKeyWindow { [self showWindowMenuWithAppMenu]; auto parent = _parent.tryGet(); if(par...
@@ -435,9 +435,23 @@ - (void)windowDidMove:(NSNotification *_Nonnull)notification return; } - if(window->WindowState() == Maximized) + // If the window has been moved into a position where it's "zoomed" + // Then it should be set as Maximized. + ...
native/Avalonia.Native/src/OSX/AvnWindow.mm
0
Objective-C++
1
none
16
51
51
true
[Avalonia.Native] Add shouldResize value to SetWindowState, don't resize on Window move
19,088
AvaloniaUI/Avalonia
24,333
C#
drasticactions
Review this pull request change. Language: Objective-C++ File: native/Avalonia.Native/src/OSX/AvnWindow.mm PR Title: [Avalonia.Native] Add shouldResize value to SetWindowState, don't resize on Window move BEFORE CODE: } #endif -(void)setCanBecomeKeyWindow:(bool)value { _canBecomeKeyWindow = value; } -(bool)sh...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var shapedBuffer = TextShaper.Current.ShapeText(text.AsMemory().Slice(6), options); Assert.Equal(1, shapedBuffer.Length); Assert.Equal(100, shapedBuffer[0].GlyphAdvance); } } [Fact] public void Should_Not_Split_Cluster() { ...
No issues found.
var shapedBuffer = TextShaper.Current.ShapeText(text.AsMemory().Slice(6), options); Assert.Equal(1, shapedBuffer.Length); Assert.Equal(100, shapedBuffer[0].GlyphAdvance); } } [Fact] public void Should_Not_Split_Cluster() { ...
@@ -2,6 +2,7 @@ using System.Globalization; using Avalonia.Media; using Avalonia.Media.TextFormatting; +using Avalonia.Media.TextFormatting.Unicode; using Avalonia.UnitTests; using Xunit; @@ -40,6 +41,74 @@ public void Should_Apply_IncrementalTabWidth() } } + [Fact] + public...
tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextShaperTests.cs
0
C#
1
none
16
51
51
true
Properly handle in cluster ShapedBuffer split
19,090
AvaloniaUI/Avalonia
24,333
C#
Gillibald
Review this pull request change. Language: C# File: tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextShaperTests.cs PR Title: Properly handle in cluster ShapedBuffer split BEFORE CODE: var shapedBuffer = TextShaper.Current.ShapeText(text.AsMemory().Slice(6), options); Assert.E...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
var textSource = new CustomTextBufferTextSource(new TextCharacters("1234", defaultProperties)); var formatter = new TextFormatterImpl(); var textLine = formatter.FormatLine(textSource, 0, double.PositiveInfinity, new GenericTex...
No issues found.
var textSource = new CustomTextBufferTextSource(new TextCharacters("1234", defaultProperties)); var formatter = new TextFormatterImpl(); var textLine = formatter.FormatLine(textSource, 0, double.PositiveInfinity, new GenericTex...
@@ -1163,6 +1163,57 @@ public void Should_Get_Run_Bounds() } } + + [Fact] + public void Should_Handle_NewLine_In_RTL_Text() + { + using (Start()) + { + var typeface = Typeface.Default; + + var defaultProperties = new Generi...
tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextLineTests.cs
0
C#
1
none
16
51
51
true
fix: Selecting multiple lines in RTL textbox
19,093
AvaloniaUI/Avalonia
24,333
C#
AhmedZero
Review this pull request change. Language: C# File: tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextLineTests.cs PR Title: fix: Selecting multiple lines in RTL textbox BEFORE CODE: var textSource = new CustomTextBufferTextSource(new TextCharacters("1234", defaultProperties)); ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
} } private void ExecuteJob(DispatcherOperation job) { lock (InstanceLock) { if(job.Status != DispatcherOperationStatus.Pending) return; _queue.RemoveItem(job); job.Status = DispatcherOperationStatus.Executing; ...
No issues found.
} } private void ExecuteJob(DispatcherOperation job) { lock (InstanceLock) { if(job.Status != DispatcherOperationStatus.Pending) return; _queue.RemoveItem(job); job.Status = DispatcherOperationStatus.Executing; ...
@@ -134,7 +134,14 @@ internal static void ResetForUnitTests() private void ExecuteJob(DispatcherOperation job) { lock (InstanceLock) + { + if(job.Status != DispatcherOperationStatus.Pending) + return; + _queue.RemoveItem(job); + job...
src/Avalonia.Base/Threading/Dispatcher.Queue.cs
0
C#
1
none
16
51
51
true
Properly check if operation is pending when executing/aborting
19,132
AvaloniaUI/Avalonia
24,333
C#
kekekeks
Review this pull request change. Language: C# File: src/Avalonia.Base/Threading/Dispatcher.Queue.cs PR Title: Properly check if operation is pending when executing/aborting BEFORE CODE: } } private void ExecuteJob(DispatcherOperation job) { lock (InstanceLock) { ...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
"Shutdown", // Normal nested frames are supposed to exit immediately "Nested frame after shutdown", "Nested frame after shutdown exited", // if frame is configured to not answer dispatcher requests, it should be allowed to run "Critical fra...
No issues found.
"Shutdown", // Normal nested frames are supposed to exit immediately "Nested frame after shutdown", "Nested frame after shutdown exited", // if frame is configured to not answer dispatcher requests, it should be allowed to run "Critical fra...
@@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -28,7 +29,7 @@ public void Signal() public event Action Timer; public long? ...
tests/Avalonia.Base.UnitTests/DispatcherTests.cs
0
C#
1
none
16
51
51
true
Capture ExecutionContext for Dispatcher.InvokeAsync
19,163
AvaloniaUI/Avalonia
24,333
C#
walterlv
Review this pull request change. Language: C# File: tests/Avalonia.Base.UnitTests/DispatcherTests.cs PR Title: Capture ExecutionContext for Dispatcher.InvokeAsync BEFORE CODE: "Shutdown", // Normal nested frames are supposed to exit immediately "Nested frame after shu...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.
if (showsPreview) { Assert.Equal(columnDefinitions[0].Width, new GridLength(1, GridUnitType.Star)); Assert.Equal(columnDefinitions[2].Width, new GridLength(1, GridUnitType.Star)); } else { Assert.Equal(columnDefi...
No issues found.
if (showsPreview) { Assert.Equal(columnDefinitions[0].Width, new GridLength(1, GridUnitType.Star)); Assert.Equal(columnDefinitions[2].Width, new GridLength(1, GridUnitType.Star)); } else { Assert.Equal(columnDefi...
@@ -1,5 +1,8 @@ +using System.Collections.Generic; +using Avalonia.Controls.Presenters; using Avalonia.Controls.Primitives; using Avalonia.Input; +using Avalonia.Markup.Xaml; using Avalonia.Platform; using Avalonia.UnitTests; using Moq; @@ -380,5 +383,164 @@ public void Pressing_Escape_Key_Cancels_Resizing() ...
tests/Avalonia.Controls.UnitTests/GridSplitterTests.cs
0
C#
1
none
16
51
51
true
Fix usage of GridSplitter inside ItemsControl as ItemsPanel
19,200
AvaloniaUI/Avalonia
24,333
C#
wieslawsoltes
Review this pull request change. Language: C# File: tests/Avalonia.Controls.UnitTests/GridSplitterTests.cs PR Title: Fix usage of GridSplitter inside ItemsControl as ItemsPanel BEFORE CODE: if (showsPreview) { Assert.Equal(columnDefinitions[0].Width, new GridLength(1, GridUni...
No issues found.
You are an expert software engineer and code reviewer. Review pull requests carefully for correctness, bugs, security issues, performance problems, maintainability, and unnecessary complexity. Only raise actionable issues supported by the code. Explain why an issue matters and suggest a concrete fix when appropriate.