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: WrapLayout #73

Closed
wants to merge 1 commit into from
Closed

Fix: WrapLayout #73

wants to merge 1 commit into from

Conversation

Poker-sang
Copy link
Contributor

Description

  • Fix: When all the items in WrapLayout are Collapsed, the method WrapLayoutState.GetHeight() would throw "Nullable object must have a value."
  • Fix: Once an item is collapsed in the WrapLayout(such as a Image that is loaded later), it would not be visible without refreshing.
  • Other: Some code efficiency optimizations.

closes #70

@Poker-sang Poker-sang marked this pull request as ready for review May 26, 2023 18:30
@niels9001 niels9001 requested a review from Arlodotexe May 26, 2023 19:37
@Poker-sang
Copy link
Contributor Author

Poker-sang commented May 27, 2023

It seems that this feature has been implemented by RiverFlowLayout. Maybe we can just make WrapLayout Obsoleted.

<RiverFlowLayout
    ItemsJustification="Start"
    ItemsStretch="None"
    LineSize="200"
    LineSpacing="5"
    MinItemSpacing="5" />

image

@niels9001 niels9001 requested a review from michael-hawker June 7, 2023 13:02
@Arlodotexe
Copy link
Member

It seems that this feature has been implemented by RiverFlowLayout. Maybe we can just make WrapLayout Obsoleted.

<RiverFlowLayout
    ItemsJustification="Start"
    ItemsStretch="None"
    LineSize="200"
    LineSpacing="5"
    MinItemSpacing="5" />

image

It looks like RiverFlowLayout is only available in the prerelease versions of WinUI 😕

@Arlodotexe
Copy link
Member

@Poker-sang We need you to complete the Contributor License Agreement before we can approve this PR.

@niels9001
Copy link
Collaborator

@Arlodotexe @Poker-sang Yeah, and not sure if this will layout will be coming to UWP as well.

@Poker-sang
Copy link
Contributor Author

@dotnet-policy-service agree

@Poker-sang
Copy link
Contributor Author

It looks like RiverFlowLayout is only available in the prerelease versions of WinUI 😕

Yes, and I think it will be available in next release, soon. Maybe use #if wsapp to make it obsoleted?

@michael-hawker
Copy link
Member

CI issue is due to a problem with the build setup, adding a fix in #178

@Arlodotexe
Copy link
Member

@Poker-sang Noticed you submitted this PR directly from the main branch of your fork. That causes a lot of issues, typically it's best to create a branch for every new feature/issue you work on.

When this gets approval, we'll need to cherry-pick the changes into a new branch so we can get this merged in. You'll still receive authorship, but then we'll be able to close this PR out.

@michael-hawker michael-hawker marked this pull request as draft August 23, 2023 20:05
@Poker-sang
Copy link
Contributor Author

@Arlodotexe Thanks for your review! I'm sorry, I probably didn't quite understand what you mean. Do you mean to create a new branch in my fork for each of my following fixes?

  • Fix: When all the items in WrapLayout are Collapsed, the method WrapLayoutState.GetHeight() would throw "Nullable object must have a value."
  • Fix: Once an item is collapsed in the WrapLayout(such as a Image that is loaded later), it would not be visible without refreshing.
  • Other: Some code efficiency optimizations.

If so, I'm concerned that these fixes are more coupled. So it's not easy to separate them.

@niels9001
Copy link
Collaborator

@Arlodotexe Thanks for your review! I'm sorry, I probably didn't quite understand what you mean. Do you mean to create a new branch in my fork for each of my following fixes?

  • Fix: When all the items in WrapLayout are Collapsed, the method WrapLayoutState.GetHeight() would throw "Nullable object must have a value."
  • Fix: Once an item is collapsed in the WrapLayout(such as a Image that is loaded later), it would not be visible without refreshing.
  • Other: Some code efficiency optimizations.

If so, I'm concerned that these fixes are more coupled. So it's not easy to separate them.

I think what @Arlodotexe is saying is to just move all the changes into a single branch :).. so instead of commiting from Poker-sang:main you'd have a separate branch in your repo (e.g. Poker-sang/wraplayout-fixes) and you'd use that branch instead to commit from.

@Poker-sang
Copy link
Contributor Author

I think what Arlodotexe is saying is to just move all the changes into a single branch :).. so instead of commiting from Poker-sang:main you'd have a separate branch in your repo (e.g. Poker-sang/wraplayout-fixes) and you'd use that branch instead to commit from.

Thank you for telling me! I'll create a new branch right away. But I'm not very clear about the benefits of that. Can you explain if it's convenient for you?

@Poker-sang Poker-sang deleted the branch CommunityToolkit:main August 24, 2023 10:46
@Poker-sang Poker-sang closed this Aug 24, 2023
@Poker-sang Poker-sang deleted the main branch August 24, 2023 10:46
@Poker-sang Poker-sang restored the main branch August 24, 2023 10:56
@Poker-sang Poker-sang reopened this Aug 24, 2023
@Poker-sang
Copy link
Contributor Author

Looks like I cannot rename a branch without closing this PR. Should I open a new PR instead?

@niels9001
Copy link
Collaborator

Looks like I cannot rename a branch without closing this PR. Should I open a new PR instead?

Yeah let's do that! If you have any review/testing recommendations please add that to the description and I'll look at it once it's up 👍 .

@Poker-sang Poker-sang closed this Aug 24, 2023
@Poker-sang Poker-sang deleted the main branch August 24, 2023 11:04
@Poker-sang Poker-sang mentioned this pull request Aug 24, 2023
@michael-hawker
Copy link
Member

Thank you for telling me! I'll create a new branch right away. But I'm not very clear about the benefits of that. Can you explain if it's convenient for you?

To answer your question here, main is a special branch for a fork, it should really just be used to keep your fork in sync with our main. If you use your main for PRs then it's like re-using a branch over and over again for multiple PRs (which isn't something you'd do). That's the best way to think about it.

So by re-using main to make PRs, GitHub can't easily differentiate what's changed between the repos, so if you reverted something or removed files somewhere, even if they're in sync now, merging a PR across mains can cause those to be reapplied and delete code from our source instead (which is very bad) and doesn't always show up in the diff for the PR. We've had this happen a couple of times in the past, so we're very cognizant of it now. 🙂

@Poker-sang
Copy link
Contributor Author

@michael-hawker It was the first time I knew there would be these problems! I learnt a lot. Thank you so much for the long reply. I'll be on the lookout for it in all PRs from now on! 😀

@Poker-sang
Copy link
Contributor Author

LinedFlowLayout is now available in WindowsAppSDK 1.4, not sure if it is coming to UWP as well.

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.

Bug report: WrapLayout
4 participants