@myrmidon/cadmus-thesaurus-store 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Internally, this component uses:
|
|
|
75
75
|
- an instance of the `StaticThesaurusPagedTreeStoreService`.
|
|
76
76
|
- an instance of the `ThesaurusBrowserComponent`, which is a readonly paged tree browser specialized to display thesaurus entries.
|
|
77
77
|
|
|
78
|
-
###
|
|
78
|
+
### ThesaurusEntriesPickerComponent
|
|
79
79
|
|
|
80
80
|
- 🔑 `cadmus-thesaurus-entries-picker`
|
|
81
81
|
|
|
@@ -109,6 +109,37 @@ An editable paged tree browser for thesaurus entries. Editing happens in memory
|
|
|
109
109
|
|
|
110
110
|
## History
|
|
111
111
|
|
|
112
|
+
### 0.0.3
|
|
113
|
+
|
|
114
|
+
- 2026-01-31: fixes to thesaurus browser and editable thesaurus browser. The ThesaurusTreeComponent wasn't updating when data arrived because of an Angular effect timing issue:
|
|
115
|
+
|
|
116
|
+
- The @if (service() && entries()?.length) guard in thesaurus-tree.component.html:3 only creates cadmus-thesaurus-browser once entries has data
|
|
117
|
+
- When the component is created, the effect() in the constructor is scheduled (not run immediately)
|
|
118
|
+
- Angular completes the initial render with empty nodes() signal
|
|
119
|
+
- The effect then runs, loads data, and updates the nodes signal via RxJS subscription callbacks
|
|
120
|
+
- But subscription callbacks run outside Angular's change detection zone, so no re-render is triggered
|
|
121
|
+
- On component close, Angular's final change detection cycle picks up the changes, causing the "flash"
|
|
122
|
+
|
|
123
|
+
Solution: added ChangeDetectorRef.markForCheck() calls in the subscription callbacks (thesaurus-browser.component.ts:121-137) to explicitly notify Angular when signals are updated from async contexts.
|
|
124
|
+
|
|
125
|
+
The fix needed to address:
|
|
126
|
+
|
|
127
|
+
Signal writes inside effect execution: When subscribing to a BehaviorSubject inside an effect(), the subscription callback executes synchronously (BehaviorSubject emits its current value immediately on subscribe). This means signal writes like this.nodes.set(nodes) occur during the effect's execution, which requires { allowSignalWrites: true }.
|
|
128
|
+
|
|
129
|
+
Inconsistent markForCheck() calls: The original fix only added markForCheck() in the effect's subscriptions and the initial load's .finally(), but left other async callbacks (expand, collapse, page change, filter change) without it.
|
|
130
|
+
|
|
131
|
+
The issue appears in newer Angular apps because they may use:
|
|
132
|
+
|
|
133
|
+
- Zoneless change detection (Angular 18+)
|
|
134
|
+
- OnPush change detection as default in project configuration
|
|
135
|
+
- Different timing of change detection cycles
|
|
136
|
+
|
|
137
|
+
When RxJS subscription callbacks update Angular signals, they run outside Angular's reactive tracking context. Without explicit notification via markForCheck(), Angular may not know to re-render the component.
|
|
138
|
+
|
|
139
|
+
### 0.0.2
|
|
140
|
+
|
|
141
|
+
- 2026-01-31: fixes to thesaurus browser and editable thesaurus browser replacing `ngOnInit` with `effect` and using signals instead of observables to avoid having side effects in computed signals.
|
|
142
|
+
|
|
112
143
|
### 0.0.1
|
|
113
144
|
|
|
114
145
|
- 2026-01-17:
|