Skip to content

[Dev UI] Migrate RenderedFieldComponent to OnPush change detection #4167

@MichaelDoyle

Description

@MichaelDoyle

Description

This task tracks the migration of src/app/pages/evaluations/components/rendered-field/rendered-field.component.ts to OnPush change detection in preparation for zoneless Angular. (Parent Issue: #4106).

Tooling & Setup

This repository is configured for the Gemini CLI with the Angular MCP server. Please ensure your environment is set up according to .gemini/settings.json.

Task

Migrate the component to OnPush using the provided AI tooling and ensure strict adherence to modern Angular testing and style patterns.

Steps

  1. Run Migration Tool:
    Use the onpush_zoneless_migration tool via the Gemini CLI. This tool analyzes the component and provides iterative steps to safely convert it to OnPush.

    • Prompt: "Run onpush_zoneless_migration on src/app/pages/evaluations/components/rendered-field/rendered-field.component.ts"
  2. Update Tests for Zoneless:
    Refactor unit tests to rely on the framework's change detection scheduling rather than manual forcing.

    • Replace: fixture.detectChanges()
    • With: await fixture.whenStable()
    • Note: fixture.detectChanges() forces a check synchronously (Zone.js behavior), whereas whenStable() waits for the framework to settle, simulating how a zoneless application behaves.
  3. Enforce Styleguide Access Patterns:
    Review the component members and ensure they follow the project's strict visibility rules:

    • private: For internal state/logic not used in the template.
    • protected: For state/methods accessed by the template.
    • public: ONLY for API boundaries (inputs/outputs) or methods accessed by parent components via @ViewChild.
  4. Verification:

    • Ensure the UI updates correctly during interaction.
    • Run unit tests to ensure no regressions.

Resources

Acceptance Criteria

  • Component uses ChangeDetectionStrategy.OnPush.
  • onpush_zoneless_migration reports no further actions needed.
  • Tests use await fixture.whenStable() instead of manual change detection.
  • Member visibility (private/protected/public) adheres to the styleguide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions