Content
View differences
Updated by Alexander Coles 7 days ago
## Summary
Primer TreeView's TreeView's form integration (`form_arguments:`) maintains hidden inputs for checked tree items via a MutationObserver. The observer's observer's guard only recognized `aria-checked` attribute changes, so checked nodes **inserted** after the component connects (e.g. async fragments) appeared selected in the tree but were omitted from form submission. Code review also confirmed the mirror gap: checked nodes **removed** from the DOM leave a stale hidden input behind.
## Scope
* - Insertion gap: fixed in https://github.com/opf/primer\_view\_components/pull/515 https://github.com/opf/primer_view_components/pull/515 (follow-up to https://github.com/opf/primer\_view\_components/pull/512)
* https://github.com/opf/primer_view_components/pull/512)
- Removal gap + `attributeOldValue` observer hardening: to be added to the same PR
*
- ESLint cleanup (7 pre-existing errors) + changeset, same branch
## Relation to OP-19878
https://community.openproject.org/wp/OP-19878 / https://github.com/opf/openproject/pull/24757: the projects-tab Stimulus controller re-implements TreeView form sync app-side with its own MutationObserver and JSON hidden input. Once this fix (incl. removal handling) ships in the gem, that controller can be replaced by TreeView's TreeView's native `form_arguments:` hidden inputs.
### Hints for QA
This is logged as a code correctness bug. This issue currently manifests itself as the user-facing bug <mention class="mention" data-id="78282" data-type="work_package" data-text="#OP-19878" data-display-id="OP-19878">#OP-19878</mention> (although that will received a separate, interim fix)
Primer TreeView's
## Scope
*
*
-
*
-
https://community.openproject.org/wp/OP-19878 / https://github.com/opf/openproject/pull/24757: the projects-tab Stimulus controller re-implements TreeView form sync app-side with its own MutationObserver and JSON hidden input. Once this fix (incl. removal handling) ships in the gem, that controller can be replaced by TreeView's
### Hints for QA
This is logged as a code correctness bug. This issue currently manifests itself as the user-facing bug <mention class="mention" data-id="78282" data-type="work_package" data-text="#OP-19878" data-display-id="OP-19878">#OP-19878</mention> (although that will received a separate, interim fix)