From 95ac89c5ecf226a06831caacc3fc96eee1200342 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Sat, 7 Jun 2025 17:51:49 -0700 Subject: [PATCH] remove file --- .../Refactor-Get-UIConfig-Implemented.md | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 completeworkitems/Refactor-Get-UIConfig-Implemented.md diff --git a/completeworkitems/Refactor-Get-UIConfig-Implemented.md b/completeworkitems/Refactor-Get-UIConfig-Implemented.md deleted file mode 100644 index ce0f645..0000000 --- a/completeworkitems/Refactor-Get-UIConfig-Implemented.md +++ /dev/null @@ -1,23 +0,0 @@ -- Work item name: Refactor `Get-UIConfig` -- Work item issue (e.g. what is the work item solving): The `Get-UIConfig` function currently accesses UI elements directly, making it tightly coupled to the main UI script and harder to maintain and test. This work item will refactor it to accept a central state object, improving modularity and aligning with the project's overall refactoring goals. -- Work Item plan: - - What the plan is: I will modify the `Get-UIConfig` function in `FFUUI.Core.psm1`. The function will be updated to accept a single `$State` object as a parameter. Inside the function, all references to UI controls will be changed to access them from the `$State.Controls` hashtable. This will decouple the function from the main script's global variables. I will then update the call to this function in `BuildFFUVM_UI.ps1` to pass the new `$script:uiState` object. - - Files modified: - - `FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1` - - `FFUDevelopment/BuildFFUVM_UI.ps1` - - Global/script variables and/or parameters created: None - - Functions created: None - - Any other important functionality: This change is a key part of the "Tame the script: Scope with a Central State Object" initiative. It will make the code cleaner, more maintainable, and easier to debug. - -# Current Work Item - -# Summary of Changes -- **Refactored `Get-UIConfig` function**: - - Moved the `Get-UIConfig` function from `BuildFFUVM_UI.ps1` to the `FFUUI.Core.psm1` module to improve code modularity and separation of concerns. - - Modified the function to accept a central `$State` object as a parameter, eliminating direct dependencies on global UI variables like `$window`. - - Updated all internal logic within `Get-UIConfig` to retrieve UI control values from the `$State.Controls` hashtable (e.g., `$State.Controls.chkCompactOS.IsChecked`). - - Updated the function calls in `BuildFFUVM_UI.ps1` (within the `btnRun` and `btnBuildConfig` click events) to pass the `$script:uiState` object to the refactored function. - - Exported `Get-UIConfig` from the `FFUUI.Core.psm1` module, making it accessible to the main UI script. -- **Files Modified**: - - `FFUDevelopment/BuildFFUVM_UI.ps1`: Removed the original function definition and updated the calls. - - `FFUDevelopment/FFUUI.Core/FFUUI.Core.psm1`: Added the refactored function and exported it.