Skip to content

Commit dd814f2

Browse files
committed
Phase 3: Consolidate global state into AppState object
- #28: Created centralized AppState object consolidating 11 global variables - Organized state into logical sections: * focusTraps (includeEditor, validationReport, diffReport) * Configuration data (publishers, copyrights, selectedCopyrights) * Include blocks (includeBlocks, currentEditingIncludeId) * Form state (hasUnsavedChanges, originalLoadedValueSet) * Drag and drop (draggedElement, draggedIncludeElement) * Preview debouncing (updatePreviewTimeoutId) - Replaced ~102 references throughout codebase - Reduced global variables from 11 to 1 - Improves code organization and maintainability Completes Option C (Enhanced Single File) implementation. All 6 medium-priority tasks now complete (#25, #26, #27, #28, #29, #31). Resolves #28 Co-Authored-By: Claude Code - Sonnet 4.5 <anthropic.com>
1 parent 817e2dd commit dd814f2

File tree

2 files changed

+118
-113
lines changed

2 files changed

+118
-113
lines changed

TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This document contains recommended enhancements for the FHIR ValueSet Creator, o
110110
- Theme Management
111111
- **Implementation**: Added 17 comprehensive section headers throughout 2,413 lines of JavaScript code: THEME MANAGEMENT, CONFIGURATION CONSTANTS, FOCUS MANAGEMENT & ACCESSIBILITY, APPLICATION STATE, INITIALIZATION, PUBLISHER & COPYRIGHT CONFIGURATION, COPYRIGHT MANAGEMENT, INCLUDE BLOCK MANAGEMENT, FORM VALIDATION, FHIR VALUESET GENERATION, DIFF ENGINE, PREVIEW & UI UPDATES, PREVIEW DEBOUNCING, FILE SIZE VALIDATION, FILE I/O OPERATIONS, UI UTILITIES & HELPERS, and FILE LOADING. Dramatically improves code navigation and maintainability.
112112

113-
- [ ] **Consolidate global state** ([#28](https://github.com/MattCordell/Stoker/issues/28))
113+
~~**Consolidate global state**~~ ([#28](https://github.com/MattCordell/Stoker/issues/28)) **COMPLETED**
114114
- Create `AppState` object to wrap:
115115
- `includeBlocks`
116116
- `selectedCopyrights`
@@ -119,6 +119,7 @@ This document contains recommended enhancements for the FHIR ValueSet Creator, o
119119
- `publishers`
120120
- `copyrights`
121121
- Update all references throughout code
122+
- **Implementation**: Created centralized AppState object at lines 1567-1594 consolidating 11 global variables into logical sections (focusTraps, configuration data, include blocks, form state, drag and drop, preview debouncing). Removed 3 scattered global variable declarations. Replaced ~102 references throughout the codebase using systematic pattern matching. Reduced global variables from 11 to 1, dramatically improving code organization and maintainability while preserving all functionality.
122123

123124
### Code Quality
124125

0 commit comments

Comments
 (0)