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

fix: added configurable padding #133

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vanlooverenkoen
Copy link
Contributor

Description

Add the option to use padding around a GoldenTestScenario

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Copy link
Contributor

@btrautmann btrautmann left a comment

Choose a reason for hiding this comment

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

Is this purely used for aesthetics?

@vanlooverenkoen
Copy link
Contributor Author

Because we have a lot of GoldenTestScenarios with the removal of the padding widget it is a lot harder to do visual pr review. The cognitive load is much higher when there is no padding. (I get that this is not required for everyone, that is why I made it optionally configurable)

@btrautmann
Copy link
Contributor

Because we have a lot of GoldenTestScenarios with the removal of the padding widget it is a lot harder to do visual pr review. The cognitive load is much higher when there is no padding. (I get that this is not required for everyone, that is why I made it optionally configurable)

Understood. Yeah I think GoldenTestTheme created a nice place to put these optional parameters. I'm cool with this 👍

Copy link
Contributor

@btrautmann btrautmann left a comment

Choose a reason for hiding this comment

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

Can we just add a test for this?

@vanlooverenkoen
Copy link
Contributor Author

Test added ✅

Copy link
Collaborator

@jeroen-meijer jeroen-meijer left a comment

Choose a reason for hiding this comment

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

Couple comments.

I'll leave the rest to @btrautmann. Nice job!

lib/src/golden_test_theme.dart Outdated Show resolved Hide resolved
lib/src/golden_test_theme.dart Outdated Show resolved Hide resolved
test/src/golden_test_adapter_test.dart Outdated Show resolved Hide resolved
test/src/golden_test_adapter_test.dart Show resolved Hide resolved
@mx1up
Copy link

mx1up commented Oct 7, 2024

Is this purely used for aesthetics?

it seems in 0.10.0, a breaking change was introduced that removed the padding ( 5139917 ). But since it is not documented, maybe it was an accidental change? If so, it might be better to introduce a default padding of 8dp as it used to be before.

@btrautmann
Copy link
Contributor

Is this purely used for aesthetics?

it seems in 0.10.0, a breaking change was introduced that removed the padding ( 5139917 ). But since it is not documented, maybe it was an accidental change? If so, it might be better to introduce a default padding of 8dp as it used to be before.

The change was intentional, I'd rather that padding be configurable than to add it back.

@mx1up
Copy link

mx1up commented Oct 7, 2024

it seems in 0.10.0, a breaking change was introduced that removed the padding ( 5139917 ). But since it is not documented, maybe it was an accidental change? If so, it might be better to introduce a default padding of 8dp as it used to be before.

The change was intentional, I'd rather that padding be configurable than to add it back.

ok, fine. just a suggestion: it might be helpful to document this change somewhere for users migrating to 0.10+

@btrautmann
Copy link
Contributor

ok, fine. just a suggestion: it might be helpful to document this change somewhere for users migrating to 0.10+

Yeah, apologies for not being more transparent in the changelog about the change. Once this lands (CC @vanlooverenkoen) I'll make sure to make note of it in the changelog indicating the correct path for migrating.

@vanlooverenkoen
Copy link
Contributor Author

@btrautmann fixed all comments

@mx1up
Copy link

mx1up commented Oct 9, 2024

@btrautmann fixed all comments

thanks @vanlooverenkoen , i can confirm, using this branch, all our golden tests are green again 🥳

@vanlooverenkoen
Copy link
Contributor Author

Nice!! Do you like the documentation I added?

@mx1up
Copy link

mx1up commented Oct 9, 2024

Nice!! Do you like the documentation I added?

yes, clear to me 👌

I don't know if this project follows Effective dart doc recommendations though, specifically:

DO start doc comments with a single-sentence summary

@btrautmann
Copy link
Contributor

@vanlooverenkoen thanks for updates; unfortunately it looks like we have a couple failing tests.

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.

4 participants