refactor(signals): migrate simple components to signal APIs#53
Merged
refactor(signals): migrate simple components to signal APIs#53
Conversation
Migrate ZvHeader, ZvFlipContainer, ZvView, ZvForm to Angular signal inputs/queries. ZvDialogWrapper keeps setter pattern (eslint-disable) because subscription teardown must be synchronous. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… APIs Co-committed: table directives + all consuming components because directive signal inputs break all downstream template/TS access. - ZvTableColumn: 7 @input → input(), 2 @ContentChild → contentChild() - ZvTableRowDetail directive: 2 @input → input(), 1 @ContentChild → contentChild() - Fix isExpanded() to read signal value with () - ZvTableHeader: 10 @input → input(), 2 @output → output(), @HostBinding → computed()+host - ZvTableSettings: 5 @input → input(), 2 @output → output() - ZvTableData: 11 @input → input(), 3 @output → output(), OnChanges → effect() - Cascade: all template/TS references to directive properties updated with () Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ZvFormField: 5 @input → input(), @ViewChild → viewChild.required(), 3 @ContentChild → contentChild(), 2 @ContentChildren → contentChildren(), @HostBinding → computed()+host, OnChanges → effect() - ZvTable: 12 @input → input(), @output → output(), @ViewChild → viewChild.required(), 3 @ContentChild → contentChild(), @ContentChildren → contentChildren(), 2 @HostBinding → host metadata, OnChanges+AfterContentInit → single consolidated effect() with previous dataSource tracking Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Migrate signal-compatible properties to input()/output()/viewChild()/ contentChild(). MatFormFieldControl interface properties kept as getter/setters per design decision D2. - ZvFileInput: accept → input(), @output → output(), @ViewChild → viewChild() Remove eslint-disable no-conflicting-lifecycle, remove OnChanges - ZvNumberInput: min/max/decimals/tabindex → input(), stepSize → input()+computed() @output → output(), @ViewChild → viewChild() Remove eslint-disable no-conflicting-lifecycle, remove OnChanges - ZvDateTimeInput: matDatepicker → input.required(), @output → output() 4 @ViewChild → viewChild(), disabled → getter/setter pair Remove eslint-disable no-conflicting-lifecycle, remove OnChanges - ZvSelect: clearable/showToggleAll/multiple/panelClass/selectedLabel → input() 3 @output → output(), @ViewChild → viewChild.required()+afterNextRender() 2 @ContentChild → contentChild(), @HostBinding → host metadata - ZvTimeInput: 2 @output → output(), remove OnChanges Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Turn off prefer-signals for spec files (test hosts keep @ViewChild decorators per established convention) - Add eslint-disable prefer-signals to CVA source files where @input decorators are kept for MatFormFieldControl interface compatibility - Result: 0 prefer-signals warnings, 0 errors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix contentChild() undefined→null coercion in header/flip-container templates (ngTemplateOutlet expects null, not undefined) - Replace non-null assertions (!) with optional chaining (?.) on viewChild() signals in date-time-input - Fix _matSelect null in ngOnInit by reading viewChild signal directly instead of relying on afterNextRender mutable field - Add stateChanges.next() effect for number-input signal inputs (replaces removed ngOnChanges notification) - Simplify date-time-input empty getter logic Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix all 118 test compilation errors caused by signals migration: - Replace direct signal input assignments with fixture.componentRef.setInput() - Add () to unwrap signal values before accessing properties - Replace removed APIs (columnDefsSetter, ngOnChanges, ngAfterContentInit) - Fix template errors (self-closing div, missing required inputs) - Add writable signal replacements for imperative test setups Verified: tsc --noEmit passes with 0 errors on spec tsconfig. Browser-based test runner cannot execute in this container (chromium binary crashes), but compilation is confirmed clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- table.component.spec: wrap createColDef() in runInInjectionContext (input() requires DI context, new ZvTableColumn() outside DI fails) - select.component: assign _matSelect early in ngOnInit before _switchDataSource, add null guard for _matSelect.panelOpen - select.component.spec: read signal inputs with (), rewrite close() monkey-patch test - view.component: add guard in effect for undefined dataSource (test host initializes signal with undefined) - form-field.component.spec: read floatLabel signal with () - table-header.component.spec: read paddingTop computed with () Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The consolidated effect doesn't run in isolated tests (no CD/fixture). Explicitly call updateTableState() after setting columnDefs and _rowDetail to build displayedColumns before assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The consolidated effect reads columnDefsQuery/rowDetailQuery and overwrites columnDefs/rowDetail. In isolated tests, override these signal queries so the effect populates the correct values instead of resetting to empty. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zvo-qla
approved these changes
Mar 30, 2026
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.
Migrate ZvHeader, ZvFlipContainer, ZvView, ZvForm to Angular signal
inputs/queries. ZvDialogWrapper keeps setter pattern (eslint-disable)
because subscription teardown must be synchronous.
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com