Commit f1d65b0
committed
feat: gate optimizations by system conditions and refresh the bloatware list
Introduce a reflection-driven condition system that evaluates every optimization and customize setting against a live system snapshot, so items that cannot work on the current machine (wrong Windows version, CPU/GPU brand, RAM, missing service or registry key) are flagged instead of applied blindly.
Conditions:
* Add Domain/Conditions: ICondition, ConditionBase, ConditionResult, ConditionState, discovery-time ConditionValidation and WindowsBuilds
* Add built-in conditions: Windows 10 / Windows 11 / Windows 11 24H2+ build checks, Intel/AMD CPU brand, NVIDIA/AMD/Intel GPU brand, 16 GB RAM, Recall installed (24H2 + CoreAISpeech present), registry key exists and service exists
* Add ConditionEvaluator service: caches ICondition instances, evaluates against the snapshot and fails open when detection is incomplete or the snapshot is unpopulated, so a failed check never hides a usable item
* Declare conditions via [Optimization(Condition = ...)] and [CustomizeSetting(Condition = ...)]; both registries validate the type at discovery time (fail fast at startup)
* BaseOptimization and BaseCustomizeSetting now extend ObservableObject and expose ConditionType, ConditionResult, IsConditionBlocked and a session-only IsConditionHidden ("show anyway") state; applied or hidden items are never blocked
SystemInfo:
* Add CpuVendor enum (Unknown/Intel/AMD) detected from the WMI manufacturer string, replacing the old free-text vendor
* Raise SnapshotRefreshed after every refresh and add EnsureSnapshotAsync() so conditions always evaluate against a populated snapshot
UI:
* Add UiThread helper that marshals to the dispatcher but degrades to inline execution when no WPF Application exists (unit tests / headless hosts)
* Optimization page evaluates conditions on load and re-evaluates on snapshot refresh and language change; unsupported items are hidden unless the user chooses to show them (new HideCondition command)
* Customize page partitions unsupported settings into their own section with a header and count
* CustomizeItemViewModel: move registry I/O (state, options, current value) off the UI thread, publish options before the selection value, and refresh from a single RefreshFromRegistryAsync reusing a new UiThread helper
* Wire SystemInfoService into category page factories and replace GpuOptimizerPage with AIOptimizerPage
Customize dropdowns:
* Options now appends a memory-only "Custom" (or "Not set" via MissingValueSentinel) fallback when the live registry value is outside the declared options; it stays in sync with registry changes, is never persisted, and applying it is a safe no-op (no duplicate values on partial multi-binding matches)
Optimizations:
* Add new AI category: Disable Windows Recall (24H2+, gated on Recall being installed) and Disable Windows AI features
* SecurityAndPrivacy: split DisableAdvertisingAndSuggestions into focused items — new DisableNewsAndInterests, HideMeetNowButton (Win10-only via Windows10Condition), DisableFindMyDevice and DisableDeliveryOptimization; drop the Dosvc/SysMain service and StorageSense writes; add Speech OneCore and Start_TrackProgs privacy keys; make DisableCortana Win10-only and gate DisableCopilot on Windows 11
* UserExperience: add Hide Recommended in Start (Win11) and Disable M365 ads in Settings
* Performance: rename SvcHostSplit to ConsolidateServiceHosts with a new RAM-based description
Bloatware list (Shared.cs):
* SafeApps: drop apps no longer in Win11 images (BingSearch, GetHelp, FeedbackHub, QuickAssist, YourPhone, OutlookForWindows, LinkedIn, Paint3D, ZuneMusic, Sway, DrawboardPDF, XboxApp, StartExperiencesApp, WebExperience, Phone Link) and move them to CautionApps where still present; add Windows.AIHub and ~30 commonly pre-installed third-party apps (Netflix, TikTok, Instagram, LinkedIn, Candy Crush, Hulu, Sling, etc.)
* CautionApps: add OEM support suites (HP, Dell, Lenovo, LG, CyberLink) and default handlers (OneDrive, Whiteboard, M365, Media Player, Widgets, Phone Link, Quick Assist, GetHelp)
i18n:
* Add keys for condition messages, new optimizations, renamed items and custom dropdown labels across all 14 locale files
Tests:
* Add ConditionTests, CustomizeItemViewModelTests and StubOptimization; extend BaseCustomizeSetting tests for the new Options fallback behaviour; update suites for the CpuVendor enum and new constructor signatures1 parent ef56395 commit f1d65b0
95 files changed
Lines changed: 4253 additions & 2131 deletions
File tree
- optimizerDuck.Test
- Domain
- Conditions
- Customize
- Services
- Managers
- OptimizationServices
- TestDoubles
- UI/ViewModels
- optimizerDuck
- Common
- Converters
- Extensions
- Helpers
- Domain
- Abstractions
- Attributes
- Conditions
- BuiltIn
- Customize
- Categories
- Models
- Optimizations
- Categories
- Models
- UI
- Resources/Languages
- Services
- Conditions
- Customize
- Optimization
- Providers
- System
- UI
- Pages
- Customize/Categories
- Optimize/Categories
- ViewModels
- Customize
- Optimizer
- Pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
Lines changed: 275 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
| 45 | + | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
| |||
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | | - | |
60 | 56 | | |
61 | 57 | | |
62 | 58 | | |
| |||
72 | 68 | | |
73 | 69 | | |
74 | 70 | | |
75 | | - | |
76 | 71 | | |
77 | 72 | | |
78 | 73 | | |
| |||
311 | 306 | | |
312 | 307 | | |
313 | 308 | | |
314 | | - | |
315 | 309 | | |
316 | 310 | | |
317 | 311 | | |
318 | 312 | | |
319 | 313 | | |
320 | | - | |
321 | 314 | | |
322 | 315 | | |
323 | 316 | | |
324 | 317 | | |
325 | 318 | | |
326 | 319 | | |
327 | 320 | | |
328 | | - | |
329 | 321 | | |
330 | 322 | | |
331 | 323 | | |
332 | 324 | | |
333 | 325 | | |
334 | 326 | | |
335 | 327 | | |
336 | | - | |
337 | 328 | | |
338 | 329 | | |
339 | 330 | | |
| |||
342 | 333 | | |
343 | 334 | | |
344 | 335 | | |
345 | | - | |
346 | 336 | | |
347 | 337 | | |
348 | 338 | | |
| |||
351 | 341 | | |
352 | 342 | | |
353 | 343 | | |
354 | | - | |
355 | 344 | | |
356 | 345 | | |
357 | 346 | | |
| |||
714 | 703 | | |
715 | 704 | | |
716 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
717 | 979 | | |
718 | 980 | | |
719 | 981 | | |
| |||
0 commit comments