Repository navigation
Conversation
Adds a helper that renders custom elements with plain attributes. Rails tag does not dasherize underscore keys and flattens hash values, so Angular custom elements need a dedicated serializer for inputs. https://community.openproject.org/wp/OP-20892
Adds transform factories that turn attribute strings, or null when an attribute is removed, into typed signal input values. Custom elements receive plain attributes from Rails, so inputs need defaults for removed attributes and bare-attribute booleans. https://community.openproject.org/wp/OP-20892
Marks custom elements registered with attribute inputs and copies their observed attributes from the incoming element during Turbo morphs, so signal inputs update. Removing a marked element is no longer prevented, and elements not yet upgraded are morphed so they read the new attributes. Other opce-* elements keep the no-morph behavior. https://community.openproject.org/wp/OP-20892
Converts OpPrincipalComponent to signal inputs that parse plain attributes, and has the avatar helper render opce-principal with custom_element_tag instead of JSON data-* attributes. The element no longer depends on the one-shot populateInputsFromDataset, so avatars re-render when Turbo morphs change their attributes. The title input and option become nameTitle and name-title. https://community.openproject.org/wp/OP-20892
Adds split view scenarios that unassign and change the assignee of a backlog work package and check the card avatar updates without a reload, guarding the AGILE-462 morph regression. https://community.openproject.org/wp/OP-20892
Adds the frozen string literal magic comment and drops an empty comment line flagged by RuboCop in files touched on this branch.
myabc
force-pushed
the
code-maintenance/op-20892-principal-signal-inputs
branch
from
November 28, 2026 01:34
a85841f to
d6570e6
Compare
myabc
commented
Nov 28, 2026
| return; | ||
| } | ||
|
|
||
| // Turbo dispatches this event without newElement when removing a node, although its types say otherwise. |
OpPrincipalComponent
This branch has not been deployed
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.
Ticket
https://community.openproject.org/wp/OP-20892
What are you trying to accomplish?
tl;dr for humans: User avatars rendered by the server now update in place when the page is refreshed by Turbo, for example after unassigning someone in the split view, without a special-case workaround.
First wave of OP-19550:
opce-principaltakes its inputs as signal inputs set from plain attributes instead of JSON indata-*read bypopulateInputsFromDataset. It also adds the shared pieces the next waves reuse. Fixes the AGILE-462 case ondev; a backport torelease/18.0is offered as an alternative to the workaround in #27341.Hints for dev review
custom_element_tag(app/helpers/custom_element_helper.rb),attribute-inputs.ts, then the morph refresh inopenproject-custom-element.ts.<opce-principal>now renders e.g.principal='{"href":…}' hide-name link="false" hover-card-url="…".What approach did you choose and why?
populateInputsFromDatasetwrites parsed JSON straight onto component fields through Angular's privatedeclaredInputs. That cannot work with signal inputs, and Turbo morphs could not refresh these elements.setInput, so each signal input gets atransform(booleanAttributeOr,jsonAttribute, …) that turns the attribute string, ornullon removal, into the typed value or the input's default.custom_element_tag.<name>mirrors Rails'tag.<name>but dasherizes keys and serializes values:true→ bare attribute,false→"false"(several inputs default totrue),nil→ omitted, arrays/hashes → JSON.{ attributeInputs: true }get their observed attributes copied onturbo:before-morph-elementinstead of being morphed, because a morph would replace the children Angular renders into light DOM. Otheropce-*elements keep today's behaviour (neither morphed nor removed), and elements Angular hasn't upgraded yet morph normally. An explicit marker is needed because Angular Elements lists decorator inputs inobservedAttributestoo.link:getlink="false", matching the old rendering (the Angular input defaults totruefor template callers).titlebecamenameTitle(name-title) to avoid the nativetitleattribute.AI involvement
Directed – I specified the requirements and AI implemented most of it; I validated via testing rather than a full line-by-line review.
Merge checklist