App
App copied to clipboard
[HOLD for payment 2024-04-05 / #39226] [$500] Workspace - Error message is left and bottom aligned in WS menus
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 1.4.47-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): [email protected] Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
- Access staging.new.expensify.com
- Sign into [email protected] account
- Go to WS settings and turn off internet
- Remove "[email protected]" user and then turn the internet back on Another way to simulate this error message is by simply turning on "Simulate failing network requests" in Troubleshooting. This will work on any account and is much simpler to reproduce
Expected Result:
User expects the error message to match the rest of the UI
Actual Result:
The error message seems too much aligned to the left and also aligned to the bottom
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [x] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~015595ed66487a0e2e
- Upwork Job ID: 1765366719409008640
- Last Price Increase: 2024-04-05
Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
@laurenreidexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
Proposal
Please re-state the problem that we are trying to solve in this issue.
Error message is left and bottom aligned in WS menus
What is the root cause of that problem?
We always add bottom margin to the list item:
https://github.com/Expensify/App/blob/a50923478ce163873c905e3566ccdc22f5284ce1/src/styles/index.ts#L4270-L4279
although the bottom margin should be on the outermost OfflineWithFeedback here.
What changes do you think we should make in order to solve the problem?
We should introduce a new prop in BaseListItem which allows passing custom style to the underneath OfflineWithFeedback component and move the marginBottom to that new prop (define a separate style key for that as well).
By this, we can make sure the error looks "stick" to its corresponding item and the error looks more horizontally aligned with the item.
Before
After
What alternative solutions did you explore? (Optional)
NA
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace - Error message is left and bottom aligned in WS menus
What is the root cause of that problem?
We have margin bottom applied to BaseListItem pressable inside TableListItem.
https://github.com/Expensify/App/blob/a50923478ce163873c905e3566ccdc22f5284ce1/src/styles/index.ts#L4276
What changes do you think we should make in order to solve the problem?
We need to remove bottom margin from selectionListPressableItemWrapper style object and then introduce new prop (containerStyle)inside BaseListItem for passing a style object to OfflineWithFeedback. From TableListItem, now we need to pass containerStyle={styles.pb3} to BaseListItem. And from BaseListItem we will pass the style prop to OfflineWithFeedback as style={containerStyle}. We will also apply styles.pt3 to errorRowStyles to align the error message to center.
We might also want to reduce padding horizontal from listHeaderWrapperStyle because the first item will have some padding top.
https://github.com/Expensify/App/blob/5199604ac28f9db9fdcdc8bf7e8b4ce4e406ded8/src/pages/workspace/WorkspaceMembersPage.tsx#L518
PS: I think the left alignment is fine, we have similar alignment in multiple places, we might want to just centre or move to top those error messages.
If we need some more margin, it can be added to errorRowStyle, but that can be handled in the PR after final decision is made by the design team
Result
Alternatively
We will remove bottom margin from selectionListPressableItemWrapper and check if the item has error or not and based on that we will add styles.m3, we will only add styles.m3 when we don't have any errors. Otherwise error message container is enough for spacing. Or we can also introduce a new prop for passing errorRowStyles to BaseListItem > OfflineWithFeedback for minor vertical margin.
const hasErrors = !isEmptyObject(item.errors);
pressableStyle={[[...otherstyles, !hasErrors && styles.mb3]]}
Result with vertical margin of 4px on error row:
Bug 2
There is also a bug in WorkspacesListPage, in that component we have nested OfflineWithFeedback inside PressableWithoutFeedback and due to that when we hover on error message it shows hand cursor and if we click it takes to workspace details page.
https://github.com/Expensify/App/blob/e3b10f7da5a6935a0fe461f7acf950129d6a04f0/src/pages/workspace/WorkspacesListPage.tsx#L173-L187
https://github.com/Expensify/App/assets/85894871/d1d8a781-84e3-423f-aa7c-3ee0e4a6e9cd
Solution for bug 2
I prefer to use my alternative solution fir this bug stylings also, apart from that we need to move OfflineWithFeedback outside PressableWithoutFeedback as a parent component of PressableWithoutFeedback. Then we need to add styles.mb3 only if there is no error & add some vertical spacing for errorRowStyles.
After fix
https://github.com/Expensify/App/assets/85894871/55e1cc37-8d16-4623-9dfb-485d17553780
Job added to Upwork: https://www.upwork.com/jobs/~015595ed66487a0e2e
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)
@Expensify/design can you confirm this is a bug and not expected behaviour? It definitely sounds like an inconsistency
@lanitochka17 can you elaborate more on your bug report, specifically this part here:
Expected result: User expects the error message to match the rest of the UI
Just want to clarify what "match the rest of the UI" means, and if this might have failed a certain test, etc?
I agree though, we could probably just add some bottom margin to the error message and we should be good to go here. Do we want to have this as an external bug fix, or @luacmartins should we just have this fixed by whoever implemented it in the first place?
This view was introduced as part of ideal nav a few weeks ago and it's past the regression period, so I think we can keep it external.
@shawnborton Now we have two approaches for the error message to show as you can see in our proposal screenshots.I proposed to make the error more "stick" to the corresponding item. The other proposed to keep the space evenly between the items and errors.
I think this style makes sense:
But maybe with slightly more margin below the error message so it feels more attached to the row above. Curious if @Expensify/design has any differing opinions though!
But maybe with slightly more margin below the error message so it feels more attached to the row above
I think this is what you're looking for (from my proposal:
Not quite - I think the width of the error message in the other proposal might be better. I see where this one aligns with the content a little more, but I feel like we should avoid trying to be too crafty with these messages and just use the same standard style everywhere.
Updated my proposal to reflect the latest expectation since the solutions in both proposals are the same, just differ in CSS styling.
PS: Initially, I identified the correct styles, aiming to ensure consistency with the rest of the UI. Consequently, I invested time in exploring the similar UIs to determine the appropriate stylings, resulting in the addition of multiple different styles for demo. Additionally, during this exploration, I uncovered another bug that requires attention. I've included a fix for this issue in the 'Bug 2' section of my proposal.
Initially, I identified the correct styles
That's not completely correct as per feedback here. My styles cover one aspect of the expectation while yours cover the other. We both had incomplete styles but the implementation idea was similar. Let's see what C+ weigh in here.
Next step: @rushatgabhane to review
@gijoe0295's proposal was first and it looks fine. @Krishna2323 has given a more detailed solution.
I think we should hire @Krishna2323 because they have explained the implementation in more details π π π
Triggered auto assignment to @Gonals, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Please use plain English, be brief and avoid jargon. Do not post large multi-line diffs or write walls of text.
Keep the language simple - Reduce every word down to its most plain and straightforward manner.
ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The difference should be important, meaningful or considerable.
(Quoted from contributingGuides)
I think just paraphrasing words isn't ideal and "detailed" π if the ideas are the same, implementation is straightforward and there's no specific notes.
@gijoe0295, it's not paraphrasing words. I provided all the implementation details and also invested time in exploring other components to ensure correct styling, rather than applying random styles. Additionally, in my proposal, I'm addressing another bug in WorkspacesListPage, specifically concerning error message alignment. It's important we address all the similar bugs in the same PR. Please checkout Bug 2 section in proposal.
@Gonals bump for assignment thanks
β There was an error making the offer to @Krishna2323 for the Contributor role. The BZ member will need to manually hire the contributor.
@Gonals bump for assignment thanks
On it
@rushatgabhane, PR ready for review.
@rushatgabhane, friendly bump for review.
β οΈ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
β οΈ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.