Skip to content

chore(frontend): remove the disabled CollabWrapperComponent - #7351

Open
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:cleanup-collab-wrapper
Open

chore(frontend): remove the disabled CollabWrapperComponent#7351
aglinxinyuan wants to merge 2 commits into
apache:mainfrom
aglinxinyuan:cleanup-collab-wrapper

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

CollabWrapperComponent cannot be instantiated. It is wired in, but nothing reaches it:

app.module.ts            declares CollabWrapperComponent
formly-config.ts         registers it as wrapper "collab-wrapper"
     │
     └── who applies the name "collab-wrapper" to a field?
             only CollabWrapperComponent.setupFieldConfig  (inside the component's own file)
                  └── its only caller, in operator-property-edit-frame, is COMMENTED OUT

It is currently the largest uncovered frontend file at 6.8% of 73 lines.

Please read this as a proposal, not a routine cleanup. The caller was disabled deliberately:

// TODO: we temporarily disable this due to Yjs update causing issues in Formly.

I am not treating "temporarily" as decisive, for these reasons:

Evidence
the disabling predates the Oct 2025 core/gui relocation off for well over a year
Angular 19 upgrade (#4445) mechanical
standalone-components refactor (#4873) mechanical
dependabot y-quill 0.1.5 → 1.0.0 (#6418) keeping a dependency current for code that never runs

Nobody has worked on the feature itself since it was switched off — it has only been carried along by upgrades. But if the intent to restore is still live, say so and I will close this. The implementation is one git revert away, and the sibling PresetWrapperComponent.setupFieldConfig is still in use at operator-property-edit-frame.component.ts:1084, so the pattern to rebuild from remains in the tree either way.

Removed: the component with its template and styles, the app.module import and declaration, the formly-config import and wrapper registration, and the commented-out caller that referenced the deleted class.

One knock-on, handled explicitly. operator-property-edit-frame.component.spec.ts imported COLLAB_DEBOUNCE_TIME_MS from the component — but only as a tick() duration during fixture setup, before the change under test, and unrelated to the debounce its assertions actually wait on (FORM_DEBOUNCE_TIME_MS, 150ms). It was an incidental borrow of a convenient 10. Replaced with a locally named SETUP_FLUSH_MS = 10, so behaviour is byte-identical and the intent is now stated where it is used.

No package.json change. quill, y-quill and quill-cursors look like they should go with it, but they do not: operator-property-edit-frame and port-property-edit-frame both still use all three.

Any related issues, documentation, discussions?

Closes #7350

How was this PR tested?

Deletions need proof that nothing else depended on the removed code, so:

npx tsc --noEmit -p tsconfig.json      ->  exit 0, 0 errors across the whole app
npx ng test --watch=false --include="**/formly-config.spec.ts" --include="**/operator-property-edit-frame.component.spec.ts"

 ✓ src/app/common/formly/formly-config.spec.ts (11 tests)
 ✓ .../operator-property-edit-frame.component.spec.ts (195 tests | 1 skipped)
 Test Files  2 passed (2)

Those two specs are the ones that actually exercise the touched wiring — formly-config.spec covers the wrapper registry, and the other is the spec whose import changed. yarn format:ci passes; it flagged formly-config.ts on the first attempt, since removing the entry changed the array's wrapping.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 5)

CollabWrapperComponent cannot be instantiated. It is declared in
app.module and registered as the formly wrapper "collab-wrapper", but
nothing ever applies that wrapper name to a field: the only code that
does is CollabWrapperComponent.setupFieldConfig, inside the component's
own file, and its sole caller in operator-property-edit-frame is
commented out.

That caller was disabled with "TODO: we temporarily disable this due to
Yjs update causing issues in Formly". The disabling predates the
October 2025 core/gui relocation, so it has been off for well over a
year, and every commit touching the component since has been mechanical
upkeep -- an Angular 19 upgrade, the standalone-components refactor, and
a dependabot y-quill bump keeping a dependency current for code that
never runs.

This is a proposal rather than an obvious cleanup: the TODO states an
intent to restore, so if that is still live, say so and I will close
this. The implementation is one `git revert` away either way, and the
sibling PresetWrapperComponent.setupFieldConfig remains in use, so the
pattern to restore it from is still in the tree.

Removed: the component and its template/styles, the app.module import
and declaration, the formly-config import and wrapper registration, and
the commented-out caller block that referenced the deleted class.

One knock-on. operator-property-edit-frame.component.spec.ts imported
COLLAB_DEBOUNCE_TIME_MS purely as a tick() duration during fixture
setup, unrelated to the debounce its assertions actually wait on
(FORM_DEBOUNCE_TIME_MS). It is replaced by a locally named
SETUP_FLUSH_MS with the same 10ms value, so behaviour is unchanged.

quill, y-quill and quill-cursors are NOT removable:
operator-property-edit-frame and port-property-edit-frame both still use
them. No package.json change here.

Verified: tsc --noEmit clean across the app, formly-config.spec (11) and
operator-property-edit-frame.spec (195) green, yarn format:ci passing.
Copilot AI lite review requested due to automatic review settings August 6, 2026 06:46
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @rbelavadi, @zyratlo, @ELin2025
    You can notify them by mentioning @rbelavadi, @zyratlo, @ELin2025 in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the disabled CollabWrapperComponent wiring from the Angular frontend, cleaning up dead Formly wrapper code that was registered but not reachable/exercised. It also adjusts the affected unit test to stop importing a debounce constant from the removed component.

Changes:

  • Removed CollabWrapperComponent (TS + template + styles) and its registration as the collab-wrapper Formly wrapper.
  • Deleted the long-disabled (commented-out) call site in OperatorPropertyEditFrameComponent.
  • Updated operator-property-edit-frame unit tests to use a locally defined setup flush duration instead of importing COLLAB_DEBOUNCE_TIME_MS.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.ts Removes the commented-out CollabWrapperComponent.setupFieldConfig(...) block.
frontend/src/app/workspace/component/property-editor/operator-property-edit-frame/operator-property-edit-frame.component.spec.ts Replaces the removed constant import with a locally defined setup flush constant.
frontend/src/app/common/formly/formly-config.ts Drops collab-wrapper import and wrapper registration from Formly config.
frontend/src/app/common/formly/collab-wrapper/collab-wrapper/collab-wrapper.component.ts Deletes the unused collaborative wrapper component implementation.
frontend/src/app/common/formly/collab-wrapper/collab-wrapper/collab-wrapper.component.html Deletes the wrapper template.
frontend/src/app/common/formly/collab-wrapper/collab-wrapper/collab-wrapper.component.css Deletes the wrapper styles.
frontend/src/app/app.module.ts Removes the component import/declaration from AppModule.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The constant landed at the exact line the deleted COLLAB_DEBOUNCE_TIME_MS
import used to occupy, which left it wedged between imports with thirty
more import statements after it. Move it, with its comment, to just above
the other module-level constant so the import block stays contiguous.

Pure reorder: the only read is a tick() call inside a test body, far after
the declaration, so there is no temporal-dead-zone concern and no
behaviour change.

Addresses the review comment on apache#7351.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.84%. Comparing base (cc83087) to head (60c6416).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7351      +/-   ##
============================================
+ Coverage     83.72%   83.84%   +0.12%     
  Complexity     4137     4137              
============================================
  Files          1169     1167       -2     
  Lines         46520    46444      -76     
  Branches       5179     5164      -15     
============================================
- Hits          38947    38941       -6     
+ Misses         5860     5791      -69     
+ Partials       1713     1712       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from fb9e593
agent-service 83.65% <ø> (ø) Carriedforward from fb9e593
amber 80.66% <ø> (ø) Carriedforward from fb9e593
computing-unit-managing-service 50.72% <ø> (ø) Carriedforward from fb9e593
config-service 65.97% <ø> (ø) Carriedforward from fb9e593
file-service 69.05% <ø> (ø) Carriedforward from fb9e593
frontend 85.00% <ø> (+0.28%) ⬆️
notebook-migration-service 78.89% <ø> (ø) Carriedforward from fb9e593
pyamber 97.36% <ø> (ø) Carriedforward from fb9e593
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from fb9e593

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide whether the disabled CollabWrapperComponent should be removed

3 participants