Convert ngOnInit input reads to computed() for full signal reactivity
Los mantenedores suelen responder en 5 días
@bracyw ya está trabajando en esto.
Desde el 29/3/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Description
Several components read @Input() values inside ngOnInit to derive local state. This breaks signal reactivity -- if the parent updates the input after init, the derived values go stale.
Migrate these components to use the input() signal function and computed() for derived state so values stay reactive. Remove ngOnInit from components where it only existed to compute derived input state.
Example
circular-percentage.component.ts reads this.dimension in ngOnInit to compute sizing values:
// Before
@Input() dimension!: number;
innerCircleDimension: number = 0;
ngOnInit() {
this.innerCircleDimension = this.dimension * 0.87;
}
// After
dimension = input.required<number>();
innerCircleDimension = computed(() => this.dimension() * 0.87);
Affected Components
- SwitchComponent (
src/components/switch/switch.component.ts) --chargingStringderived fromisOn,onString,offString - HStackComponent (
src/components/hstack/hstack.component.ts) --alignmentderived fromjustifyContent,alignItems - CircularPercentageComponent (
src/components/circular-percentage/circular-percentage.component.ts) -- 4 sizing properties derived fromdimension - BatteryPercentageComponent (
src/components/battery-percentage/battery-percentage.component.ts) -- 7 rendering properties derived frompercentage,height,width - HalfGaugeComponent (
src/components/half-gauge/half-gauge.component.ts) --widthpx,heightpx,label,percentage,fontsizederived fromcurrent,min,max,unit,size - GraphComponent (
src/components/graph/graph.component.ts) --timeRangeMsderived fromtimeRangeSec - DoubleLineGraphComponent (
src/components/double-line-graph/double-line-graph.component.ts) --timeRangeMsderived fromtimeRangeSec - PieChartComponent (
src/components/pie-chart/pie-chart.component.ts) -- already usesinput()signals but reads them inngOnInitinstead ofcomputed()/effect() - SidebarCardComponent (
src/pages/graph-page/graph-sidebar/sidebar-card/sidebar-card.component.ts) --iconIdderived fromtitle - GraphSidebarMobileComponent (
src/pages/graph-page/graph-sidebar/graph-sidebar-mobile/graph-sidebar-mobile.component.ts) --nodes,nodesWithVisibilityTogglederived fromdataTypes
Acceptance Criteria
- All 10 components migrated from
@Input()+ngOnInitderived state toinput()+computed() ngOnInitremoved from components where it only existed to compute derived input state- Templates updated to call signal getters (e.g.
innerCircleDimension()instead ofinnerCircleDimension) - No regressions in component rendering
npx ng lintandnpx prettier --checkpass
- Lenguaje dominante
- TypeScript
- Estrellas
- 5
- Forks
- 1
- Merge medio
- 5 d 13 h
- PR fusionados (30 d)
- 24
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Northeastern-Electric-Racing/Argos
-
Deliver telemetry selectively per screen over the existing Socket.IO transportPosiblemente ocupada @bracyw la tomó hace 18 días. Abiertoangular-client difficult new feature scylla-server
Northeastern-Electric-Racing/Argos#777 · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Handle broker-initiated MQTT disconnects in the Flutter clientPosiblemente ocupada @bracyw la tomó hace 23 días. Abiertobug dart medium
Northeastern-Electric-Racing/Argos#768 · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Prune CONTEXT.md glossary to genuinely ambiguous termsQuizá libre de nuevo @bracyw la tomó hace 77 días y no hay ningún pull request abierto. Abiertoai-workflow needs-triage
Northeastern-Electric-Racing/Argos#716 · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Fix clipped content on BMS segment-detail cards at ~1028px widthQuizá libre de nuevo @bracyw la tomó hace 77 días y no hay ningún pull request abierto. Abiertoangular-client bug needs-triage straightforward
Northeastern-Electric-Racing/Argos#715 · 1 asignado ·
Los mantenedores suelen responder en 5 días
-
Fix BMS At A Glance stat overlap and clipping at narrow widthsQuizá libre de nuevo @bracyw la tomó hace 77 días y no hay ningún pull request abierto. Abiertoangular-client bug medium needs-triage
Northeastern-Electric-Racing/Argos#714 · 1 asignado ·
Los mantenedores suelen responder en 5 días
Todos los issues de Northeastern-Electric-Racing/Argos
Issues similares
-
refactor
Dificultad 2/5 Medio día Aptitud para principiantes 84/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OHDSI/Data2Evidence#3450 ·
Los mantenedores suelen responder en 2 días
-
e2e-failure ready-to-code
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
redhat-developer/rhdh-plugin-export-overlays#4011 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
automation missing-model model-sync provider:ofox
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/models.dev#8421 ·
Los mantenedores suelen responder en 1 día
-
SlackAdapter and TelegramAdapter are not assignable to Adapter under exactOptionalPropertyTypesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día