Skip to content

Refactor(react-component): Architecture work #5247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nilscognite
Copy link
Contributor

@nilscognite nilscognite commented Jul 30, 2025

Type of change

Refactor

Description 📝

Renames:
Rename DomainObject.removeCore to DomainObject.dispose
Rename Views.clear to Views.dispose
These names was misleading.

Synchronize:
Synchronize the code so all DomainObject, BaseComand and RevealSettingsController has addDisposable and addEffect function. This saves lines and complexity. Used them where it was possible.

How has this been tested? 🔍

Checklist ☑️

  • I am happy with this implementation.
  • I have performed a self-review of my own code.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have added documentation to new and changed elements; both public and internally shared ones
  • I have refactored the code for testability, readability and extendibility to the best of my ability.
  • I have listed the JIRA tasks covering remaining work or tech debt related to this PR in the description.

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 81.13208% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.84%. Comparing base (2637647) to head (f975ea3).

Files with missing lines Patch % Lines
...rc/architecture/base/domainObjects/DomainObject.ts 44.44% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5247      +/-   ##
==========================================
- Coverage   63.86%   63.84%   -0.02%     
==========================================
  Files        1171     1171              
  Lines       82503    82517      +14     
  Branches     7407     7409       +2     
==========================================
- Hits        52693    52686       -7     
- Misses      29669    29690      +21     
  Partials      141      141              
Files with missing lines Coverage Δ
...ents/src/architecture/base/commands/BaseCommand.ts 94.92% <100.00%> (+0.31%) ⬆️
...ture/base/concreteCommands/KeyboardSpeedCommand.ts 95.34% <100.00%> (-0.31%) ⬇️
...concreteCommands/SetFlexibleControlsTypeCommand.ts 87.50% <100.00%> (-0.50%) ⬇️
...ncreteCommands/SetOrbitOrFirstPersonModeCommand.ts 100.00% <100.00%> (ø)
...ualitySliderCommand/QualityWarningBannerCommand.ts 100.00% <100.00%> (ø)
...rc/architecture/base/domainObjectsHelpers/Views.ts 98.21% <100.00%> (ø)
...age360Collection/Image360CollectionDomainObject.ts 100.00% <100.00%> (ø)
...ecture/concrete/reveal/RevealSettingsController.ts 75.82% <100.00%> (+0.82%) ⬆️
...rchitecture/concrete/reveal/cad/CadDomainObject.ts 100.00% <100.00%> (ø)
...ncrete/reveal/pointCloud/PointCloudDomainObject.ts 100.00% <100.00%> (ø)
... and 1 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@danpriori danpriori left a comment

Choose a reason for hiding this comment

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

LGTM in general. But some questions if you can reply before approving it :)

private addEffect(effectFunction: () => void): void {
this._disposables.push(
this.addDisposable(
Copy link
Contributor

Choose a reason for hiding this comment

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

As the same method addEffect for the other classes are protected, can we change this one also to be protected (to at least be accessible in subclasses) or this one specifically needs to be private and why?

})
);
this.addEffect(() => {
this.renderTarget.revealSettingsController.renderQuality();
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that it is not part of this refactoring scope but can we think somehow refactor this in order to follow the Demeter's Law?

})
);
this.addEffect(() => {
this.renderTarget.revealSettingsController.cameraControlsType();
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that it is not part of this refactoring scope but can we think somehow refactor this in order to follow the Demeter's Law?

})
);
this.addEffect(() => {
this.renderTarget.revealSettingsController.cameraKeyBoardSpeed();
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that it is not part of this refactoring scope but can we think somehow refactor this in order to follow the Demeter's Law?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants