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 GameCard for better maintainability and readability #121

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

marcusziade
Copy link
Contributor

@marcusziade marcusziade commented Jun 24, 2024

⚠️ Note: No behavior has been changed

  • This is groundwork for issues
    [BUG] Game Thumbnail doesn't save #102
    and
    [BUG] Adding or deleting custom launch arguments does not save #99
    that I will fix. I will split this up as several pull requests, for easier reviewing.

  • Disables the opening_brace swiftlint rule. Reasoning is simple: Xcode 16 has swift-format built-in and the default config clashes with this rule. Xcode's setting is the obvious priority as it improves consistency through an easy to use tool.

  • Refactors the code of GameCard.swift. It's now much faster to find each component in this view that has many dependencies. This work lays out the code and allows easier debugging. Zero behavior is changed.

- This is groundwork for issues
and
that I will fix. I will split this up as several pull requests, for easier reviewing.

- Disables the `opening_brace` swiftlint rule. Reasoning is simple: Xcode 16 has swift-format built-in and the default config clashes with this rule. Xcode's setting is the obvious priority as it improves consistency through an easy to use tool.
- Refactors the code of `GameCard.swift`. It's now much faster to find each component in this view that has many dependencies. This work lays out the code and allows easier debugging. **Zero behavior is changed.**
@marcusziade marcusziade merged commit 093fae3 into main Jun 24, 2024
4 checks passed
@marcusziade marcusziade deleted the gamecard-refactor branch June 24, 2024 18:29
@blackxfiied
Copy link
Member

This makes the file less messy, but in turn makes it more difficult to navigate and directly modify logic affecting its presentation. There's also not much point to having variables if they don't actually vary and are only going to be called once

@blackxfiied blackxfiied restored the gamecard-refactor branch June 26, 2024 03:53
@marcusziade marcusziade deleted the gamecard-refactor branch June 26, 2024 11:36
@marcusziade
Copy link
Contributor Author

i fully disagree. this is much better and how any professional swiftui ui is built. i recommend you reassess this. being called once doesn't mean you shouldn't make the body clean. any future iteration is much easier to change when everything is broken down into smaller pieces. swiftui itself works better as well.

take my professional over yours in this case and trust i know better.

@blackxfiied
Copy link
Member

blackxfiied commented Jun 26, 2024

@marcusziade Alright, will do. I'll reimplement this change shortly, just fixing up some minor errors in some of the other PRs

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