Skip to content

[FEATURE] Refactor the Runner classes to use a single instance per runner #235

Closed
@Arcitec

Description

From a comment during our discussions:


The only "unsolved" things that we've talked about earlier, are that STL always shows up in the "Only Installed" mode, and that "Only Installed" and "All Versions" are 2 separate UI panels.

Neither issue is particularly important. All other runners offer a way to reinstall after you remove them in the "Only Installed" view, so might as well keep STL like that (doing its version check/download ability) in that tab too. People can see the download icon and realize it's not installed. It's a nice feature and a really minor issue, which is only really solvable with some big refactoring of the app.

Since you wanted to refactor the app later to make 1 single class instance handle both "Only Installed" and "All Versions" lists, I have some ideas for that:

  • Only instantiate one class instance per Runner.
  • Every Runner class internally has version_rows (a List of Gtk Widgets for all of the web-based + any locally installed versions).
  • The List[Gtk.Widget] version_rows is a list of all rows, and whenever the user toggles "Only Installed", you loop through that and set the row's visible state based on whether it's installed.
  • And hiding the Load More button in "Only Installed" view.

That way, a runner's class would know the entire state in a single class instance which can seamlessly change the visible rows based on which mode is active. This way, the runner's class-state and UI rows all use the same memory and there's no state desync issues.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions