-
Notifications
You must be signed in to change notification settings - Fork 57
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
[MM-57266] UX improvements to call card (post component) #675
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## styled-components-v6 #675 +/- ##
=====================================================
Coverage 11.05% 11.05%
=====================================================
Files 27 27
Lines 5690 5690
=====================================================
Hits 629 629
Misses 5003 5003
Partials 58 58 ☔ View full report in Codecov by Sentry. |
Would css container queries work? I'm not sure what browsers we have to support (it's newer) (https://caniuse.com/css-container-queries). |
Thanks! Let me look into that.
It's not really the viewport the main issue, but the fact the component renders in RHS and RHS is expansible so it's a bit more tricky. Unless of course we wrapped when in RHS always but that would be a big generalization. |
@cpoile Container queries seem to be exactly what we require here! The only problem now is that we need to bump styled components to make them work (from v5 to v6) which may turn out to be a bit of a pain, getting all sorts of errors. Will keep you posted. |
`; | ||
|
||
const SubMessage = styled.div` | ||
white-space: normal; | ||
font-size: 12px; | ||
line-height: 16px; | ||
color: rgba(var(--center-channel-color-rgb), 0.72); | ||
`; | ||
|
||
const Profiles = styled.div` |
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.
Add here as well
&:empty {
display: none;
}
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 is looking great. Thanks for the work on it @streamer45. A few minor things from me:
-
In the "Call ended" state, in the RHS there is extra space at the bottom of the card. It's likely because the right content container is still present, but empty and the gap is added.
-
For the divider, it would be great if we can add it somehow as it helps make it look more organized when it wraps. If we are able to do
@container
queries so that the border and gap shows only when the component is below 400px (roughly) that could work.
Rebased and applied the changes (using |
webapp/src/components/custom_post_types/post_type/component.tsx
Outdated
Show resolved
Hide resolved
Thanks @streamer45. Looks great now. Just one minor comment. Should be good to go once that's updated. |
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.
Thanks @streamer45
webapp/src/components/custom_post_types/post_type/component.tsx
Outdated
Show resolved
Hide resolved
* Migrate to styled components v6 * [MM-57266] UX improvements to call card (post component) (#675) * UX improvements to call card * Proper wrapping * Language update * Fixes after icon update * Update snapshots * Update e2e test * Implement narrow layout * Update e2e snapshots * Fix row gap * Fix divider's border
Summary
PR implements improvements as suggested in the design file
@matthewbirtch One bit missing here is the row divider in "narrow" view. This is because it's a bit tricky to change layout dynamically as we'd need to show an element that is not there naturally. It can be done but it may end up being hacky as CSS would handle any wrapping naturally when necessary. But let me know how important this is and whether we should reconsider.
@cpoile On the above, let me know if you have any ideas but the only solution I could think of so far would be to hook up a
ResizeObserver
and dynamically check on div width to render the divider but it's probably going to be a perf nightmare.Screenshots
Ticket Link
https://mattermost.atlassian.net/browse/MM-57266