-
Notifications
You must be signed in to change notification settings - Fork 169
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
Move time ago and score to a flowrow layout #1615
Conversation
- Adding a fade to the post body preview. - Getting rid of muted, using colorScheme.outlined instead. - Making label-type text use label rather than body style. - Getting rid of some unecessary surface and onSurface colors. - Fixes #1608
- Also separating time from score component. - Using a start-based flowrow, for better responsiveness. - Re-organizing PostCard / PostListingCard
I've been using this for a few days, and I'm liking it a lot. |
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 split the card and list into different files, and this is now the generic one.
@@ -286,3 +286,28 @@ fun PostReply( | |||
) | |||
} | |||
} | |||
|
|||
@Composable | |||
fun PostNodeHeader( |
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.
Moved this as its only used here.
isDistinguished = isDistinguished, | ||
isCommunityBanned = isCommunityBanned, | ||
showAvatar = showAvatar, | ||
val centerMod = Modifier.align(Alignment.CenterVertically) |
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.
This centerMod is necessary on FlowRows unfortunately. I wish it could do some cross-axis alignment, but it doesn't seem to work.
fullBody = false, | ||
) | ||
} | ||
|
||
// Title + metadata | ||
PostBody( | ||
post = postView.post, | ||
read = postView.read, | ||
postView = postView, |
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.
These were all "optimizations"
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.
Any field that changes in postView will cause it recompose instead only if the relevant field changed
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.
Erps, my bad, I'll go through and fix some of these.
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.
Actually I'm not sure if its worth it. A lot of these use like 5+ fields from PostView
, and if that's the case, it just seems like we should pass in the full thing anyway.
IE, is there any field on PostView that changes frequently enough to justify separating these out? I don't think there is, as instantScores is the main one, but that's separated.
I am honestly not such a fan of it. Maybe its worth here using a post view mode for the old view. With current layout, it "forces" you to read community + votes each time. If you go like vertical: title -> content, you see the community + votes then the content. it also seems to be behaving weirdly? With the community + user at the bottom? Or is that intended because I don't like that at all vs old Much better at using the "screen real estate", takes up less vertical space Can directly see title -> content, want to see, user/community votes look up |
The community line below the image post is a weirdness I couldn't figure out a great way around. Part of the problem is that the title block wraps the post subtitle in a single row, but the community info is below that block. You can test this by looking at any link-type post (or going to small card mode to force images into a smaller thumbnail). Or look above, see how the I could move the community info into that title block, or move the post subtitle below that title block. Both options aren't ideal, because they end up with wasted screen real estate, but I'll mess around with them. A few possibilities I could use your input on:
The main 2 things I want to keep are:
|
moved |
This looks better. But personally I would like title directly against content. Have time top right and votes in bottom bar? |
I'll give that a try. |
- Moving time into the header bar, right aligned. - Moving scores back to the action bar.
K this is ready to be looked at again. |
Great stuff I believe we show the full title of the community? Maybe its better to just use the shorter "name"? And use the title in the opened post, where we have more space to work with? Interesting behaviour If its easier for you, it would definitely be okay with time being part of the flow row there. And it thus not always being in the top right. |
It uses the shorter name only if its local. In lemmy-ui (and I think here?) we used to conditionally not show the I tried messing around with a few non-flow layouts there, but it always ends up looking strange. So ya I'd say lets just go with this for now. If you'd like to mess around with it, its |
With that I meant using Yeah sure. I have been testing this out and images sometimes "jump". Have you noticed that? |
Hrm... we should pry just always prefer the display name if it exists, and I'd rather not more context-dependent rules around it. The reflow stuff is only an issue for people using the display name improperly, as a long description.
Yup... I didn't change anything related to images, and I'm convinced its a bug from one of the recent coil dep updates. |
@MV-GH lmk when you can get to reviewing these 2 PRs, I'd like to do a release this week, as I'll be away from a computer next week. |
Yeah sure. |
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 haven't really tested. But I ll run master after this locally and see if anything pops up.
Cool. |
A few reasons for doing this:
SpaceBetween
/SpaceAround
layouts aren't going to work well when we start adding larging screen size support.What it looks like now:
Comes after #1614