Commit Graph

73 Commits

Author SHA1 Message Date
chinboy 34d525a885 fix(Drawer): optimize dialog size handling by replacing style configuration with token bindings 2026-04-22 10:08:06 +08:00
chinboy d0f2470eeb fix(Space): optimize spacing handling by applying token bindings instead of styles 2026-04-22 09:26:58 +08:00
chinboy 4020ab36e3 fix(AvatarGroup, CompactSpace, Space): optimize collection handling by removing unnecessary list creation 2026-04-22 08:24:25 +08:00
chinboy cc9665e781 fix(SpinIndicator): add CustomIndicatorSize property and update related styles 2026-04-21 21:08:28 +08:00
chinboy b8fb9cd056 fix(NavMenu): optimize item retrieval by avoiding unnecessary list conversion 2026-04-21 18:38:23 +08:00
chinboy 7980b70319 fix: simplify visibility subscription logic by introducing SubscribeAncestorIsVisible method 2026-04-21 17:59:30 +08:00
chinboy a002397dcc fix(LineEdit): enhance right content bindings and improve layout efficiency 2026-04-21 16:51:45 +08:00
chinboy 7b0d636e50 fix(AddOnDecoratedBox): implement status foreground and icon brush properties to enhance visual feedback 2026-04-21 13:52:29 +08:00
chinboy 79305e7122 fix(BaseTabStrip, CardTabStrip, BaseTabControl, CardTabControl): refactor binding management to eliminate memory leaks and improve performance 2026-04-21 13:52:29 +08:00
chinboy a47fd6e097 fix(OverlayDialogHeader): ensure disposables are properly disposed and reset on visual tree attachment/detachment 2026-04-21 13:52:29 +08:00
chinboy b7fb6c6740 fix(WindowTitleBar): ensure disposables are properly disposed and reset on visual tree attachment/detachment 2026-04-21 13:52:29 +08:00
chinboy 31eff3e495 fix(MemoryLeakPatterns): update documentation to clarify static constructor subscription patterns and their impact on memory management 2026-04-21 13:52:29 +08:00
chinboy 0069f95f81 fix(AddOnDecoratedBox): add Underlined pseudo-class and update style selectors to prevent memory leaks 2026-04-21 13:52:29 +08:00
chinboy 4809883503 fix(GradientColorSlider): replace global Property.Changed.Subscribe with instance-level GetObservable and remove redundant subscription 2026-04-21 13:52:29 +08:00
chinboy 49165bf572 fix(TimePickerPresenter): replace global Property.Changed.Subscribe with instance-level GetObservable to fix LightweightSubject memory leak 2026-04-21 13:52:29 +08:00
chinboy 614832839e fix(DatePickerPresenter): replace global Property.Changed.Subscribe with instance-level GetObservable to fix LightweightSubject memory leak 2026-04-21 13:52:29 +08:00
chinboy b32fd8f8ee fix(FlyoutStateHelper): replace global Property.Changed.Subscribe with instance-level GetObservable to fix LightweightSubject memory leak 2026-04-21 13:52:29 +08:00
chinboy d640f2c332 refactor(AddOnDecoratedBox): optimize input control theme structure for performance
Remove code-behind theme classes, consolidate theme definitions into ResourceDictionary format,
add TransitionProvider and SharedTokenResourceValue infrastructure, and remove redundant styles.
2026-04-19 15:51:21 +08:00
chinboy 50ac96478e fix: Improve layout form configuration by adding proper disposal of PropertyChanged subscriptions 2026-04-18 17:59:46 +08:00
chinboy ef5baea0f1 fix: Change IList<double>? to IReadOnlyList<double>? for strokeDashArray in multiple files 2026-04-18 09:55:52 +08:00
chinboy 4f134f3592 fix: Change ButtonTheme.DashedStyle to IReadOnlyList to prevent modification 2026-04-18 09:28:54 +08:00
chinboy 968ffaad13 fix: Ensure proper disposal of CancellationTokenSource in AbstractSpinIndicator, SwitchKnob, and WaveSpiritDecorator 2026-04-18 09:09:01 +08:00
chinboy ce7bc9cf1a fix: AbstractMarqueeLabel 统一 Cancel + Dispose 模式 2026-04-18 08:59:05 +08:00
chinboy 27295dd934 fix: ColorPickerHelpers.CreateBitmapFromPixelData 修正 XML doc,更新文档删除 4.2 2026-04-18 08:49:44 +08:00
chinboy 562e3bf3b3 fix: AbstractQRCode/PreviewImageSource/AbstractImagePreviewer Bitmap 释放,更新文档
- AbstractQRCode: SetupQRCode 加 Value 空值守卫,oldBitmap?.Dispose(),Bitmap? 可空,switch expression 替换 TryParse,移除 using static System.Enum
- PreviewImageSource: 实现 IDisposable
- AbstractImagePreviewer: HandleSourceChanged 替换 EffectiveSources 时 Dispose 旧列表
2026-04-18 08:41:53 +08:00
chinboy 0cebcc8c3d fix: Badge Adorner CTS 补加 Dispose,新增 OnDetachedFromVisualTree 清理,更新文档删除 P4 2026-04-18 00:23:56 +08:00
chinboy 6ba0b2696a fix: FileUploadScheduler CancelUploadAsync 补加 CTS Dispose,更新文档删除 P11 2026-04-18 00:17:36 +08:00
chinboy d73bcce17c docs: 删除已修复条目(6.1 Watermark/6.2 Timer/P8 Space),更新 4.1/4.5/4.6 问题描述 2026-04-18 00:15:55 +08:00
chinboy c2d4c10124 fix: 修复 2.1 - NotificationCard/NavMenuItem 缺少 OnDetachedFromVisualTree,更新文档 2026-04-17 22:08:05 +08:00
chinboy 01f96947ac fix: 修复资源泄漏 - CTS/Timer/Bitmap/事件订阅清理
- ToolTipService: StopTimer() 补加 Tick -= 解订阅
- CarouselPageIndicator: CTS Cancel 后补加 Dispose
- VirtualizingCarouselPanel: _transition CTS 取消分支和 TransitionFinished 均补加 Dispose
- Dialog: _frameCancellationTokenSource Cancel 后补加 Dispose
- Form: Validate()/Submit() 两处 _validationTokenSource Cancel 后补加 Dispose
- FormItem: _validationTokenSource Cancel 后补加 Dispose
- DataGrid: OnDetachedFromVisualTree 解除 pagination 事件订阅,OnAttachedToVisualTree 重新订阅(支持 re-attach)
- ColorSpectrum: 新增 OnDetachedFromVisualTree 释放 9 个 Bitmap 字段,OnAttachedToVisualTree re-attach 后重建
- ColorSlider: 新增 OnDetachedFromVisualTree 释放 _backgroundBitmap(re-attach 后由 BoundsProperty 变化自动重建)
2026-04-17 21:48:08 +08:00
chinboy 12f2e9252d fix: AbstractBackTopFloatButton add OnDetachedFromVisualTree cleanup
- OnAttachedToVisualTree: re-subscribe Target.ScrollChanged with
  idempotent -= before += to handle re-attach correctly
- OnDetachedFromVisualTree: unsubscribe ScrollChanged, Cancel+Dispose
  _cancellationTokenSource (does not clear Target to support re-attach)
- OnClick: Dispose old CTS before creating new one
2026-04-17 19:10:58 +08:00
chinboy bd85cc0099 docs: clean up AtomUI_issues.md, remove all fixed items 2026-04-17 17:22:07 +08:00
chinboy 516cd74f7e fix: add OnDetachedFromVisualTree cleanup to multiple controls
- MotionGhostControl: unsubscribe SizeChanged and reset _layout/
  _maskCenterFrame to null, enabling correct re-initialization on
  re-attach when Content changes while detached
- GradientColorPickerTrack: clear thumbs from LogicalChildren/
  VisualChildren on detach, preventing stale thumbs on re-attach
  when GradientValue becomes null while detached
- CollapseItem: reset InAnimating flag on detach, preventing the
  control from being stuck in animating state after re-attach
- RangeInfoPickerInput: clear _topLevel reference on detach to
  prevent holding a stale TopLevel (window) reference
- TreeViewItem: clear OwnerTreeView on detach to prevent stale
  tree operations during detached period and avoid GC retention
- Card: simplify delegate instantiation style (cosmetic only)

Partially addresses issue 2.1 in docs/Issues/AtomUI_issues.md.
Remaining: AbstractBackTopFloatButtonHost, PopupConfirm,
NotificationCard, NavMenuItem, Collapse, Card token scope.
2026-04-17 17:08:55 +08:00
chinboy 6d41a4e2b3 docs: mark issue 1.4 FloatButtonGroupHost lambda as already fixed
The code was already using named methods (OnFloatButtonGroupOpenRequest/
OnFloatButtonGroupCloseRequest) with CompositeDisposable cleanup.
Update tracking doc to reflect actual state.
2026-04-17 15:50:14 +08:00
chinboy cf9a1b5a28 fix: replace lambda with named method in GroupDescription constructors to avoid closure allocation
- AbstractListGroupDescription: lambda -> OnGroupKeysCollectionChanged
- DataGridGroupDescription: lambda -> OnGroupKeysCollectionChanged
- Eliminates closure object that captures 'this', preventing potential
  self-referencing GC issue (GroupKeys.CollectionChanged holds delegate
  -> delegate captures 'this' -> 'this' owns GroupKeys)
- Update issue tracking doc: mark 1.3 as fixed (P9 done)
2026-04-17 15:48:56 +08:00
chinboy 0af89b8de6 fix(1.2): eliminate lambda closures in WindowNotificationManager.Show()
- Add OnClick/OnClose internal properties to NotificationCard to carry
  per-notification callbacks without capturing local variables
- Replace PointerPressed lambda with static OnNotificationPointerPressed
  (zero closure allocation, reads callback from card.OnClick)
- Replace NotificationClosed lambda with instance OnNotificationClosed
  (accesses _items via 'this', no local variable capture)
- Update AtomUI_issues.md: mark 1.2 as fixed, remove from P8 list
2026-04-17 15:08:39 +08:00
chinboy f5ba2e4ebe fix(1.1): remove Closed += lambda closures in MessageBox/Dialog static APIs
Modal methods (ShowMessageBoxModalAsync, ShowMessageModalAsync,
ShowDialogModalAsync x2): OpenAsync() awaits dialog close, so cleanup
is moved after await tsc.Task — no Closed subscription needed.

Non-modal methods (ShowMessageBoxAsync, ShowMessageAsync,
ShowDialogAsync x2): OpenAsync() returns after dialog is shown, so
Closed lambda is retained as the only close notification point.
The lambda is harmless: Closed fires exactly once, dialog is removed
from parent and GC'd immediately after, releasing the closure.

- Update AtomUI_issues.md: mark 1.1 as fixed, remove from P3 list
- Delete performance_memory_leak.md (tracking moved to AtomUI_issues.md)
2026-04-17 15:01:37 +08:00
chinboy ad6a346c30 fix(3.2): prevent memory leaks in DataGridCell by managing event subscriptions - dispose old subscriptions in OnApplyTemplate to avoid accumulation - release subscriptions in OnDetachedFromVisualTree 2026-04-17 13:55:01 +08:00
chinboy 7f3ab08fd4 docs(3.3): mark ColorPicker complex state management as fixed - Update progress to 34/39 (87.2%) - Mark 3.3 ColorPicker OnApplyTemplate event subscription as fixed - ColorPickerInput, AbstractColorPickerView, ColorSliderThumb all use named handlers with remove-before-add pattern - Remove 3.3 from P2 pending list - Medium: 17/19 fixed 2026-04-17 13:24:51 +08:00
chinboy cea4bb8fa9 fix(2.1): implement IDisposable on AbstractNotifiableTransition and dispose at call sites
- INotifyTransitionCompleted interface now extends IDisposable
- AbstractNotifiableTransition<T>.Dispose() disposes Subject<bool> and nulls it
- NotifyTransitionCompleted() guards against null _subject (post-dispose)
- CompletedObservable throws ObjectDisposedException if accessed after Dispose
- AbstractMotion.RunTransitions: dispose all Transitions after await completes
  (covers both normal completion and Task.Delay timeout path)
- AbstractMotion.ConfigureTransitions: dispose existing Transitions before Clear
  to prevent Subject leaks when transitions are rebuilt
- Update performance_memory_leak.md: 32/39 fixed (82.1%), High 8/8 all done
2026-04-17 13:04:41 +08:00
chinboy bd1b270c81 revert(3.4): Form Items.CollectionChanged lambda is a false positive — no fix needed
Items is an internal ItemCollection owned by Form with identical lifetime.
The subscription cannot leak across lifetimes: when Form is GC'd, Items and
its event subscriptions are collected with it. Mark 3.4 as false positive in docs.
2026-04-17 12:56:24 +08:00
chinboy fae2788bc5 fix(3.4): extract Form Items.CollectionChanged lambda to named method HandleItemsCollectionChanged
- Replace anonymous lambda with named method to allow precise -=  unsubscription
- Prevents subscription leak when Items is replaced by an external CollectionView
- Update performance_memory_leak.md: 32/39 fixed (82.1%), Medium 16/19
2026-04-17 12:54:33 +08:00
chinboy ca1c990e7b fix(1.2): replace anonymous lambda with WeakReference forwarder in DataGridCollectionView to eliminate CollectionChanged memory leak
- Mirror the same WeakCollectionChangedForwarder pattern applied to ListCollectionView (29452afe)
- Add IDisposable to DataGridCollectionView class declaration
- Add _collectionChangedForwarder field (WeakCollectionChangedForwarder?)
- Replace anonymous lambda subscription with forwarder in constructor
- Add Dispose() for eager cleanup
- Add WeakCollectionChangedForwarder nested class with self-unsubscribe on GC
- All Critical (P0) issues now fully resolved
- Update performance_memory_leak.md: 31/39 fixed (79.5%), Critical 7/7
2026-04-17 12:48:57 +08:00
chinboy a896c7833e docs(1.1): annotate section title with fix status and commit hash 2026-04-17 12:46:14 +08:00
chinboy ea59ecac29 docs(1.1): fill in commit hash 29452afe and update critical/total fix counts 2026-04-17 12:43:05 +08:00
chinboy 652398a207 fix(1.1): replace anonymous lambda with WeakReference forwarder in ListCollectionView to eliminate CollectionChanged memory leak
- Add WeakCollectionChangedForwarder nested class: source holds strong ref to
  forwarder, forwarder holds WeakReference<ListCollectionView> — prevents the
  source collection from rooting the view
- Self-unsubscribes on next event after view is GC'd; no lingering delegate
- Keep IDisposable.Dispose() for eager cleanup when ItemsSource changes in ListView
- ListView: track _ownsCollectionView flag and call Dispose() on old view only
  when we created it (not user-provided IListCollectionView)
- Remove OnDetachedFromVisualTree disposal to avoid breaking reattach scenarios
  (tab switching, panel rebuilds, etc.) — WeakReference handles lifetime safely
- Update performance_memory_leak.md: mark 1.1 as fixed, progress 30/39 (76.9%)
2026-04-17 12:40:09 +08:00
chinboy 9ec5bc9fa7 fix(Statistic): remove dead code in GenerateRemainingTimeText and use smart default time format 2026-04-17 10:48:35 +08:00
chinboy 87e9a8b572 perf(Tag): replace static Dictionary with FrozenDictionary for PresetColorMap, StatusColorMap and PresetPalettes 2026-04-17 10:41:57 +08:00
chinboy 4d94e60cfc perf(Notification): reduce polling to 200ms, add PollingInterval property, and use HashSet for O(1) cleanup queue dedup 2026-04-17 10:13:16 +08:00
chinboy b18d82e56a docs(MemoryLeak): mark 5.18 as fixed, update progress to 14/39 (35.9%) 2026-04-17 10:06:04 +08:00