Skip to content
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

Refactor: Extract rule window UI into a module #2462

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

Conversation

MattHag
Copy link
Contributor

@MattHag MattHag commented Apr 28, 2024

Extract the rule window related code in order to simplify and shrink the diversion rule module.

Related #2390

@MattHag MattHag force-pushed the extract_rule_ui branch 3 times, most recently from 06ee777 to 10274a3 Compare April 30, 2024 11:08
@MattHag
Copy link
Contributor Author

MattHag commented Apr 30, 2024

Further splits up the diversion rules module and updates the interfaces as, necessary.

@pfps Please review this

@MattHag MattHag force-pushed the extract_rule_ui branch 8 times, most recently from b379175 to 239fb01 Compare May 5, 2024 14:07
@pfps
Copy link
Collaborator

pfps commented May 5, 2024

There are some conflicts that need to be addressed.

@MattHag
Copy link
Contributor Author

MattHag commented May 5, 2024

Yeah, that's still WIP currently. Needs a little more work until it's ready. I've accidentally overridden the first commits, which were ready for merging.

@MattHag MattHag marked this pull request as draft May 5, 2024 14:50
@pfps
Copy link
Collaborator

pfps commented May 5, 2024

Why are there seven new files?

@MattHag MattHag marked this pull request as ready for review May 6, 2024 22:23
@MattHag MattHag force-pushed the extract_rule_ui branch 3 times, most recently from f54e201 to 22e88f1 Compare May 6, 2024 22:56
@MattHag
Copy link
Contributor Author

MattHag commented May 6, 2024

That's because it's a refactoring, which once more moves 600 lines of code from the diversion rules module into smaller modules, which do one thing and already became quite close to unit testable. This leads to a clearer structure and maintenance easier.

@MattHag MattHag force-pushed the extract_rule_ui branch 2 times, most recently from efd8f61 to d297aca Compare May 6, 2024 23:36
@MattHag
Copy link
Contributor Author

MattHag commented May 27, 2024

This change further splits up the huge diversion rules module and creates a hierarchy. The aim are self-contained modules, which are testable. Avoid hard dependencies on e.g. GTK to enable lightweight unit tests of UI related code. Also aim for a common code base to share business logic between CLI and UI. The interface is only an add-on, which connects to the provided interface.

  • The ActionMenu becomes its own module
  • GTK dependent UI code is moved to a module

@MattHag
Copy link
Contributor Author

MattHag commented Jul 8, 2024

Without changes like that, nobody will ever be able to work on the UI without owning a huge amount of supported Logitech devices.

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