docs(rules): fix contradictions, update technical rules, enforce rule structure
CI / CI configuration security checks (pull_request) Successful in 2s
CI / Capabilities and shell quality (pull_request) Successful in 15s
CI / Python tests and compilation (pull_request) Successful in 36s
CI / QMD unit tests (pull_request) Successful in 7s
CI / Build and inspect generated packages (pull_request) Successful in 16s
CI / Bash integration and installation guards (pull_request) Failing after 51s
CI / PowerShell tests on Ubuntu (pull_request) Failing after 1m45s
CI / Installed client configuration smoke tests (pull_request) Canceled after 1m24s
CI / CI configuration security checks (pull_request) Successful in 2s
CI / Capabilities and shell quality (pull_request) Successful in 15s
CI / Python tests and compilation (pull_request) Successful in 36s
CI / QMD unit tests (pull_request) Successful in 7s
CI / Build and inspect generated packages (pull_request) Successful in 16s
CI / Bash integration and installation guards (pull_request) Failing after 51s
CI / PowerShell tests on Ubuntu (pull_request) Failing after 1m45s
CI / Installed client configuration smoke tests (pull_request) Canceled after 1m24s
- Resolve contradictions: authorization is never a skipped "boundary check"; one browser token policy (BFF/HttpOnly cookies first, RFC 10017); one sanitizer-bypass rule; Angular responses are unknown until validated. - Add security rules for AI/LLM integration and Java XXE, concrete crypto and password-hashing parameters, and RFC 8725 JWT validation. - Update version-dependent guidance after checking official sources: Angular 22, TypeScript 6/7, Node 24+, .NET 10/C# 14, JDK 21-25, Spring Boot 4; add a Spring Boot and Spring Security topic. - Give every rule a unique level-1 title and scope line, keep language security files to language specifics, and fix routing for inbound vs outbound HTTP, XML parsing, and WPF/Angular parent rules. - Validate rule structure and routing in validate-config.py, with tests. - Fix CI issues found by a local run: shellcheck directive order, pinned ruff rule set, Invoke-Python test mock, CRLF-tolerant package checks, Windows-only credential test, and refreshed prompt-budget baselines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
79694fbaa2
commit
6159c6373c
62 files changed
+453
-300
No files matched your search
@@ -1,11 +1,15 @@
|
||||
# WPF Collections, XAML, Layout, and Virtualization
|
||||
|
||||
Apply these rules when binding collections, writing XAML, building layouts, or rendering large lists.
|
||||
|
||||
## Collections
|
||||
|
||||
* Use `ObservableCollection<T>` only when collection change notifications are required.
|
||||
* Do not use `ObservableCollection<T>` as a general-purpose collection.
|
||||
* Use `List<T>` or other suitable collections for non-observable internal data.
|
||||
* Avoid replacing entire observable collections when incremental updates are sufficient.
|
||||
* Avoid thousands of individual collection notifications when a bulk update is more appropriate.
|
||||
* Keep collection mutations on the correct thread.
|
||||
* Use incremental `Add` and `Remove` for small changes. For bulk changes, assign a new collection instance or raise a single `Reset`; never raise multi-item `Add`, `Remove`, or `Replace` notifications to WPF bindings, because `ListCollectionView` throws `NotSupportedException` for range actions.
|
||||
* Wrap sort and filter changes in `ICollectionView.DeferRefresh()`.
|
||||
* Mutate bound collections on the UI thread. Use `BindingOperations.EnableCollectionSynchronization` only when off-thread mutation is unavoidable.
|
||||
* Avoid exposing mutable internal collections unnecessarily.
|
||||
* Prefer read-only views where consumers should not modify data.
|
||||
|
||||
@@ -35,15 +39,10 @@
|
||||
* Avoid fixed sizes unless the design requires them.
|
||||
* Prefer responsive sizing with `Auto` and `*`.
|
||||
* Avoid layout configurations that cause excessive measure/arrange passes.
|
||||
* Be careful with large visual trees inside scrolling containers.
|
||||
* Avoid disabling virtualization accidentally.
|
||||
* Be careful with large visual trees inside scrolling containers; see the virtualization section.
|
||||
|
||||
## Virtualization
|
||||
|
||||
* Keep UI virtualization enabled for large collections.
|
||||
* Do not use container layouts that disable virtualization without a reason.
|
||||
* Avoid wrapping large virtualized item lists in additional scrolling containers.
|
||||
* Use virtualizing panels where appropriate.
|
||||
* Verify virtualization when displaying large data sets.
|
||||
* Avoid rendering thousands of controls simultaneously.
|
||||
* Prefer paging, incremental loading or virtualization for very large data sets.
|
||||
* Keep UI virtualization enabled for large collections and use `VirtualizingPanel.VirtualizationMode="Recycling"`.
|
||||
* These settings silently disable virtualization: `ScrollViewer.CanContentScroll="False"`, grouping without `VirtualizingPanel.IsVirtualizingWhenGrouping="True"`, a non-virtualizing `ItemsPanel` such as `StackPanel` or `WrapPanel`, and placing the list inside a `ScrollViewer` or `StackPanel` that gives it unlimited height.
|
||||
* Verify virtualization with large data sets, and use paging or incremental loading for very large ones.
|
||||
Reference in new issue
Block a user