-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[CP Staging] Fix: align badge in workspace list #40599
Conversation
@cubuspl42 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/styles/index.ts
Outdated
@@ -3207,6 +3207,20 @@ const styles = (theme: ThemeColors) => | |||
marginLeft: 3, | |||
}, | |||
|
|||
WorkspaceRightColumn: { | |||
marginLeft: 99, |
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.
Hmm why are we taking this kind of approach with hard-coded values instead of just using flex to fill up space?
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.
Where did you get 99 from?
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.
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 can use 100 or any higher value
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.
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.
Hmm but you can tell that the columns in the header don't perfectly match up with the content below. Owner looks like it's too far to the left for instance, compared to the content below it.
Why wouldn't that invisible 4th column header just match the width of the 4th column in the table?
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.
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.
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.
Right, but if there is no badge present, that means we just have a bunch of dead space?
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.
Yes and No
Yes because technically it's true.
No because the space is already empty:
and if you think we need the space in small screens, the layout change on small screens to
So I think it's not a wasted space.
But if you want, I can create a logic to find out if there well be a badge for Request, then adjust this value 100/40
src/styles/index.ts
Outdated
}, | ||
|
||
workspaceThreeDotMenu: { | ||
marginLeft: 59, |
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.
Where does 59 come from?
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.
99 (badge width) - 40 (3 dots width)
src/styles/index.ts
Outdated
@@ -3207,6 +3207,20 @@ const styles = (theme: ThemeColors) => | |||
marginLeft: 3, | |||
}, | |||
|
|||
WorkspaceRightColumn: { | |||
marginLeft: 100, |
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.
Can you show me exactly what this looks like? I don't understand why we are hard coding so much margin. Does that mean we have 100px of space that can only be occupied by margin? How does that work when the viewport is bigger or smaller? It just feels like these hard coded margins are a hack and don't provide good responsiveness.
This comment has been minimized.
This comment has been minimized.
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 agree with @shawnborton that this logic feels fragile, I can assure you that if someone changes the width of the badge or adds a badge of a different width, they will bring this bug back.
Could you please try to find solution which wont depend on the width of the badge?
src/styles/index.ts
Outdated
@@ -3207,6 +3207,20 @@ const styles = (theme: ThemeColors) => | |||
marginLeft: 3, | |||
}, | |||
|
|||
WorkspaceRightColumn: { |
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.
WorkspaceRightColumn: { | |
workspaceRightColumn: { |
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.
solved.
@mountiny @shawnborton This layout and the way to use content width value was there, I didn't create it. I just changed the value from 40 to 100. 40 was the width of the 3 dots menu. The idea from this aspect, is to use 4 columns keeping the 4th one small as possible. To solve the issue you mentioned, we have 2 main solutions: 1- Use flex for the 4th column as it's been used for the other 3 columnsThis solution creates 4 equal columns, equal in width. The issue here there will be a more empty space between the "Workspace type" and the final 4th column. 2- change the table to only 3 columnswhere the action will be part of the 3rd column but aligned to the right. What do you think? I like solution 2 |
@dragnoir I think the option 2 is quite elegant, how does it scale on other screensizes? |
Same, I will update the layout to keep it as it us now (fixed) |
Lets watch out to make sure the style changes will not influence any other components |
@mountiny bad news, we can't use solution 2, in very tight screens, this UI bug will happen It happens because we made the Workspace type + the action in one column. I think it's better to keep the 4th column with a max width equal to 100px. What do you see? below a screenshot from the solution with 100 and in the same tight screen: |
Ah alright, that I guess makes sense. I dont think we should be doing some major styling changes in cherry pick PR, so since as you mentioned this fragile pixel logic existed before, I think we could just update it for now to fix the styling in staging, but follow up with exploration on how to make this styling responsive without the esoteric pixel math |
@cubuspl42 you can review the code, please. |
Asking for a C+ who is available now |
Reviewer Checklist
Screenshots/Videos |
Fixing now.. |
@allroundexperts fixed |
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.
Works good!
@dragnoir Found another bug. The types are not aligned. |
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.
Found another bug.
@allroundexperts fixed |
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.
Works good now. Thank you!
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 think this is good to fix the deploy blocker, but as mentioned before, we should look into removing this pixel-based logic for styles because it will break again soon.
I will wait for Monday morning for @shawnborton to review but since this is a deploy blocker I would merge it past 10am CET to unblock deploy |
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
Based on NewDot, Shawn is in the US so to make sure we can deploy sooner than later, I am going to go ahead with the merge here, I have tested as well and it looks good (do not worry about the blinking that is my local thing) |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[CP Staging] Fix: align badge in workspace list (cherry picked from commit 0f30b3d)
🚀 Cherry-picked to staging by https://github.com/Beamanator in version: 1.4.63-18 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
Cool, I think that looks good. Only minor comment is that the overflow icon (three dots) on mobile feels like it's not quite as far to the right as it should be? I should have caught this sooner but it's strange that we're wrapping the overflow icon in a 40x40 wrapper and then sending that wrapper to the edge of the view. I think that's what's causing the weirdness above: Ideally the icon should just be 20x20 and there should be even 20px padding both vertically and horizontally on the entire row: None of that was caused by @dragnoir - but just noting in case we want to do a follow up PR to clean that stuff up. |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
Details
This PR fixes the misalignment of the badge inside a row in workspace list.
Fixed Issues
$ #40524
PROPOSAL: #40524 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop