Add validation failure and exception tracking with nested scope support to CommandScope#2166
Merged
Merged
Conversation
… CommandScope - ICommandScope gains hasValidationFailures, hasExceptions, validationFailures, exceptions, and addChildScope members - CommandScopeImplementation tracks per-command ValidationResult[] and exception message[] maps; clears them before each re-execution of that command - hasValidationFailures and hasExceptions recurse into registered child scopes so an outer scope always reflects the aggregate state of the full hierarchy - Child scopes self-register with their parent on construction via addChildScope - CommandScope.tsx default context stub updated with no-op implementations
- when_executing_command_with_validation_failure: failures stored per command - when_executing_command_with_exception: exception messages stored per command - when_executing_command_again_after_validation_failure: cleared on re-execution - when_executing_command_again_after_exception: cleared on re-execution - when_child_scope_has_validation_failure: parent aggregates child failures - when_child_scope_has_exception: parent aggregates child exceptions - when_command_registers_to_nearest_scope: commands bind to nearest scope only - when_parent_and_child_scopes_have_validation_failures: each scope owns its own
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
hasValidationFailuresandhasExceptionsboolean properties onICommandScopeandCommandScopeImplementation— aggregate across the scope and all nested child scopesvalidationFailures(ReadonlyMap<ICommand, ValidationResult[]>) andexceptions(ReadonlyMap<ICommand, string[]>) maps for per-command inspection of the most recent execution resultaddChildScopeonICommandScope; child scopes self-register with their parent on construction so nesting is fully automatic — commands always bind to the nearest enclosing<CommandScope>scope.mddocumentation with nested-scope explanation, validation/exception sections, and extended API table