Skip to content

Conversation

@QThund
Copy link
Contributor

@QThund QThund commented May 28, 2025

Pull Request Description

The ViewDependencies class was conceived as a way to provide views with general UI-related tools, like events, inputs or context menu. It was not meant for giving underground access to data services.

In order to prevent other devs from extending the class with more methods that access data services, this should be fixed as soon as possible. Views should not access data directly unless provided by controllers, although there are cases that overcomplicate things and may suggest to directly provide a reference or delegate to the data provider. If that was the case, that must be something explicit.

What does this PR change?

  • Now MVC.ViewDependencies does not depend on DCL.Profiles.
  • Now DCL.Profiles does not depend on DCL.UI.Profiles.Helpers.
  • ProfileNameColorHelper moved from DCL.UI.Profiles.Helpers to DCL.Profiles.
  • Created ProfileRepositoryWrapper class to contain the methods that were previously in ViewDependencies. ViewDependencies has been replaced with the new class everywhere UI utilities provided by ViewDependencies were not being used.

Test Instructions

Smoke testing in features that use profile pictures.

Now MVC.ViewDependencies does not depend on DCL.Profiles.
Now DCL.Profiles does not depend on DCL.UI.Profiles.Helpers.
ProfileNameColorHelper moved from DCL.UI.Profiles.Helpers to DCL.Profiles.
Created ProfileRepositoryWrapper class to contain the methods that were previously in ViewDependencies. ViewDependencies has been replaced with the new class everywhere UI utilities provided by ViewDependencies were not being used.
@QThund QThund added this to the Cycle 12 milestone May 28, 2025
@QThund QThund self-assigned this May 28, 2025
@QThund QThund requested a review from a team as a code owner May 28, 2025 12:50
@QThund QThund added the refactor Refactoring of a system label May 28, 2025
@QThund QThund requested a review from a team as a code owner May 28, 2025 12:50
@QThund QThund added the shape-up It has been shaped and is awaiting the cycle. label May 28, 2025
@QThund QThund removed the request for review from mikhail-dcl May 28, 2025 15:21
…apper as not set

The profile picture view was hiding the null reference exception.
Now the GenericContextMenu asmdef depends on DCL.UI.Profiles.Helpers.
@QThund QThund closed this May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring of a system shape-up It has been shaped and is awaiting the cycle.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants