# Implementation OP-20892 - Signal inputs from plain attributes: OpPrincipalComponent

Project: OpenProject
Status: in development
URL: https://community.openproject.org/work_packages/OP-20892

## OPEN POINTS

_No work packages_

## People

| Attribute | Value |
| --- | --- |
| Assignee | Alexander Coles |
| Designer |  |
| Developers | Alexander Coles |

## Technical details

| Attribute | Value |
| --- | --- |
| Target versions |  |
| Module | Frontend components and Primer design system, Modules and project features / Work packages, Modules and project features / Backlogs |
| Requires doc change | No |

## Belongs to

_No work packages_

## Previous chunks

_No work packages_

## Next chunks

| ID | Subject | Status | Assignee |
| --- | --- | --- | --- |
| OP-20893 | Signal inputs from plain attributes: work package and page entry components | new |  |
| OP-20894 | Signal inputs from plain attributes: date pickers | new |  |
| OP-20895 | Signal inputs from plain attributes: attachments, editor, help texts and remaining components | new |  |
| OP-20896 | Signal inputs from plain attributes: autocompleters and helper removal | new |  |
| OP-20897 | Signal inputs from plain attributes: charts and graphs | new |  |
| OP-20898 | Signal inputs from plain attributes: dataset readers | new |  |

## Estimates

| Attribute | Value |
| --- | --- |
| Work |  |

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| % Complete |  |
| Category |  |
| Sprint |  |
| Backlog bucket |  |
| Priority | Medium |
| List |  |
| Pull preview |  |
| Labels |  |

## Description

### Goal

Move `OpPrincipalComponent` (`opce-principal`) from `populateInputsFromDataset` to signal inputs set from plain attributes, and add the shared pieces the later waves reuse. Part of <mention class="mention" data-id="OP-19550" data-type="work_package" data-text="#OP-19550">#OP-19550</mention>.

### Scope

  - Add the `custom_element_tag.<name>` builder in Rails. Element name and attribute keys are dasherized. Strings are written as-is and numbers as text. `true` becomes a bare attribute and `false` becomes `"false"`. `nil` leaves the attribute out. Arrays and hashes are JSON-encoded. Native boolean attributes (`disabled`, `required`, `multiple`, …) are present when `true` and left out when `false`.
  - Add the attribute transforms for signal inputs (string, boolean, number, JSON). Each restores the input default when the attribute is removed (`null`) and accepts the typed value Angular templates pass.
  - Mark converted custom elements explicitly when they are registered. On a Turbo morph, marked elements copy their observed attributes from the new element (`setAttribute`, or `removeAttribute` when gone) instead of being skipped. Unmarked elements keep today's behaviour.
  - Convert the 13 inputs of `OpPrincipalComponent`. Inputs that clash with native host attributes (`title`) are renamed. Remove the `populateInputsFromDataset(this)` call.
  - Move the Rails call sites of `opce-principal` to `custom_element_tag`, together with the specs that read its `data-*` attributes.
  - Add a spec helper that creates a registered custom element from plain attributes, and use it to cover principal: attribute → input, attribute removal → default.

### Notes

  - The signal input migration converts all 13 inputs without TODOs (trial run, 2026-11-27).
  - Offer a backport to `release/18.0` in the PR as the alternative to the <mention class="mention" data-id="AGILE-552" data-type="work_package" data-text="#AGILE-552">#AGILE-552</mention> workaround in <https://github.com/opf/openproject/pull/27341>.

### Hints for Reviewers

  - Avatars and names render as before in work package lists, the activity tab, boards and the backlogs and sprint views, both server-rendered and inside Angular views.
  - In the backlogs view, open a work package in the split view and unassign the user: the row's assignee updates without a reload (<mention class="mention" data-id="AGILE-462" data-type="work_package" data-text="#AGILE-462">#AGILE-462</mention>).
  - Check the rendered HTML of a principal for `hover-card-url`, `link="false"` and a bare `hide-name`.
