Skip to content

#193 Migrate to signal-based inputs#557

Draft
bracyw wants to merge 6 commits intodevelopfrom
193-migrate-to-signal-based-inputs
Draft

#193 Migrate to signal-based inputs#557
bracyw wants to merge 6 commits intodevelopfrom
193-migrate-to-signal-based-inputs

Conversation

@bracyw
Copy link
Copy Markdown
Collaborator

@bracyw bracyw commented Mar 29, 2026

Changes

Migrates the entire Angular frontend from decorator-based @Input/@Output/@ViewChild/@ContentChild to signal-based input()/output()/viewChild()/contentChild() APIs. Also replaces broken ngOnChanges hooks with computed() and effect() where inputs were migrated to signals.

  • Convert all @input() to input() / input.required() across ~80 components
  • Convert all @output() to output()
  • Convert @ViewChild/@ContentChild to viewChild()/contentChild()
  • Replace ngOnChanges in BatteryLevelIndicator, StatDisplay, InfoValueDisplay, and FormTemplate with computed()/effect() since signal inputs don't trigger ngOnChanges
  • Extract shared formatDisplayValue utility into pipes.utils.ts (was duplicated in stat-display and info-value-display)
  • Convert get accessors to computed() in GlanceThermometer for memoization
  • Simplify SwitchComponent by deriving chargingString as computed() instead of manually synced signal
  • Remove dead alignment property and ngOnInit from HStackComponent
  • Fix GraphDialogComponent to use plain fields instead of signal inputs (data comes from DynamicDialogConfig, not parent bindings)
  • Fix FormTemplate effect to use untracked() to prevent accidental dependency tracking

Notes

  • Components that receive data from DynamicDialogConfig (like GraphDialogComponent) were intentionally kept as plain class fields rather than signal inputs, since they're not bound from parent templates
  • A few properties (ChargingPageMobile.time, SidebarCard.dataValue) were converted from @input to local signal() rather than input() because they were only ever set internally, never bound from a parent
  • All components still have standalone: true explicitly set — removing it (since it's the Angular 19 default) is left for a follow-up to keep this PR focused on the signal migration

Test Cases

  • Full Angular build passes with zero errors
  • Lint passes clean across all changed files
  • Prettier formatting verified on all changed .ts, .html, and .scss files
  • No merge conflicts with develop

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No package-lock.json changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #193

bracyw and others added 6 commits March 12, 2026 06:00
Replace all decorator-based @input(), @output(), @ViewChild(), and
@ContentChild() with their signal-based equivalents across 43 components.

- Convert @input() to input()/input.required() with proper typing
- Convert @output() with EventEmitter to output()
- Convert @ViewChild() to viewChild()/viewChild.required()
- Convert @ContentChild() to contentChild()/contentChild.required()
- Update all templates to call signal inputs as functions (e.g. prop())
- Update TypeScript code to read signal values with () accessor
- Fix components that wrote to inputs by using writable signal() instead
  (switch, sidebar-card, charging-page-mobile)
- Remove unused EventEmitter imports
- Fix circular-percentage spacing input to optional with default

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bracyw bracyw self-assigned this Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to Signal-based Input/Output/Queries

1 participant