Skip to content

Conversation

@lisannengel
Copy link
Collaborator

Refactored Receiver and Heliostat by introducing a new MovableCanvasObjects class to extract shared functionality not used by LightSource.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.79%. Comparing base (0f20f22) to head (439f443).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #93   +/-   ##
=======================================
  Coverage   98.79%   98.79%           
=======================================
  Files          60       60           
  Lines        1493     1493           
=======================================
  Hits         1475     1475           
  Misses         18       18           

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

🚀 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.

@plhrtr
Copy link
Collaborator

plhrtr commented Nov 15, 2025

A general note.

I think the idea of separating the objects into different classes for each functionality is a very good idea, but in the current implementation we would have a Problem if a e.g. RotatableCanvasObject gets added.

Maybe a different pattern would be more fitting here, as there is no multiple inheritance in Js.
Something like Composition or even Mixins (We used them in the backend for stuff like the LoginRequiredMixin, but I don't now how nice something like this is implementable in Js with proper JsDocs), could work

@lisannengel lisannengel marked this pull request as draft November 18, 2025 08:52
@lisannengel
Copy link
Collaborator Author

@plhrtr fair point, I implemented it as a composition pattern now. :)

@lisannengel lisannengel marked this pull request as ready for review November 18, 2025 12:06
Copy link
Collaborator

@plhrtr plhrtr left a comment

Choose a reason for hiding this comment

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

Besides renaming the class, lgtm!

Copy link
Collaborator

@fluegelk fluegelk left a comment

Choose a reason for hiding this comment

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

Mostly looking good, just a few comments to address

lisannengel and others added 4 commits November 23, 2025 16:05
…-by-implementing-shared-functionality-in-canvasobject
…nting-shared-functionality-in-canvasobject' of https://github.com/ARTIST-Association/CANVAS into 73-reduce-code-duplication-in-canvas-objects-by-implementing-shared-functionality-in-canvasobject
@sonarqubecloud
Copy link

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.

Reduce code duplication in CANVAS objects by implementing shared functionality in CanvasObject

4 participants