-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Implement NewsSideBar component #12736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine otherwise.
{ | ||
IdleColour = isCurrent ? Color4.White : colourProvider.Light2; | ||
HoverColour = isCurrent ? Color4.White : colourProvider.Light1; | ||
Action = () => { }; // Avoid button being disabled since there's no proper action assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in comment, we probably want this to do more than nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relies on integration since we will be calling a method in a NewsOverlay which will trigger a new request, which will reconstruct the whole side bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I'm saying is that in the test scene this should be hooked up locally. So that it doesn't do nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be resolved in 586c5c7
Due to a callback set up in another place, clicking away from the 2022 year after launching the test scene would remove the 2022 button (because the callback was returning metadata without it). For simplicity just trim the 2022 year to make sure both test scenes use the same consistent set of years.
have applied further cleanups. seems passable for now. |
private bool autoSizeTransitionApplied; | ||
|
||
// Workaround to allow the dropdown to be opened immediately since FinishTransforms doesn't work for AutoSize{Duration,Easing}. | ||
protected override void UpdateAfterAutoSize() | ||
{ | ||
base.UpdateAfterAutoSize(); | ||
|
||
if (!autoSizeTransitionApplied) | ||
{ | ||
AutoSizeDuration = animation_duration; | ||
AutoSizeEasing = Easing.OutQuint; | ||
|
||
autoSizeTransitionApplied = true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is trying to achieve, but it looks fine without this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes the posts container autosize immediately on first frame while applying autosize transforms on state changes afterwards.
For some reason this can't be done with a scheduled FinishTransforms
, although I got to admit I haven't checked thoroughly why, will do in a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with removing. It's not like this looks bad if the section expand animation plays out on first load instead of the section showing instantly.
The reason this can't be done with a schedule is that schedules (both normal, and after children) run too early. Autosize is the last thing in a subtree update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did actually mean a 2-frame scheduling but yeah, what's the point at this point, let the animation play and call it a day.
HoverColour = colourProvider.Light1; | ||
|
||
TooltipText = "view in browser"; | ||
Action = () => host.OpenUrlExternally("https://osu.ppy.sh/home/news/" + post.Slug); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up that the news system is the only placed these domains are hard-coded. It's going to need to be fixed at some point to use EndpointConfiguration
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, although I expect that action will be going away at some point anyway, for I expect news to be ultimately shown in the client when the implementation is complete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, although I think we will still have "open on web" buttons like in user profile etc.
Anyways that's for another day, as these hard-coded urls are also in other classes this PR doesn't touch.
Basic implementation with no integration. Integration will come in a separate pr.
![pr_web](https://user-images.githubusercontent.com/22874522/117620616-50d18680-b179-11eb-9697-b16e44812d93.png)
![pr_osu](https://user-images.githubusercontent.com/22874522/117620638-562ed100-b179-11eb-8d74-9ea20ea496b2.png)
Implemented API components have been tested, results on the screenshots:
web:
pr: