Add margin-top for custom report name error row - #75524
Conversation
|
@dannymcclain @abdulrahuman5196 One of you needs to 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] |
|
Hi @abdulrahuman5196 While working on the PR, I noticed that we had a negative margin that raised all content above it by this value (12px) to the top. I couldn't find the reason why it was added, so I decided it would be better to remove it. This way, we would have a layout without unexpected indents, as in this case. At the same time, I added an 8px indent to the error line and reduced the indent of the next element by 12px (since I removed the 12px negative margin), so the layout remained the same as it was, but without negative values. If this option does not suit us, we can simply give the error line a negative margin (12px) + the indent itself (8px), resulting in 20px. Let me know your thoughts, thank you! |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good from a product perspective 👍
|
checking now |
|
What's the current margin-top/spacing for the error? It feels just a tiny bit too far away from the push row above it (basically it feels equal distance from the push row above and below it, so the error feels a little less related to the push row than I think it could). If it's at 8px now, can we see 4px? Sorry for being nitpicky! cc @dubielzyk-expensify |
|
Hi @dannymcclain, I will give you some options, and you can see which one we like best. While working on the PR, I noticed that we had a negative indentation in the previous element, which caused one element to overlap another. This pattern is not good because, depending on the length of the line, it can give unexpected results. For example, in this case, when the error message is short, everything is fine and there is just not enough indentation(we decided 8px), but when the message is long, the error spills over onto the previous element. I noticed that in many places there is no additional indentation, such as here, but it all depends on whether there can be an error in several lines or not. For example, there is no indentation at all here, so a correction with a negative indentation may be sufficient in this case: |
|
Can we prevent the error message from spilling over and instead just increase the heigh of the whole error element to keep consistent top/bottom padding on it all the time? |
|
To be honest, I don't really understand what you mean, but for now, the screenshots I sent are standard behavior for the error row used in the project. Perhaps you have an example of what you're talking about so I can understand better? |
Haha sorry, this is tricky to talk about 😅. What I mean is, for a single-line OR multi-line error message, why can't we have the same space above the text for both cases? Why do long error message "spill over" at all? |
|
I think I understand what you are referring to. Currently, this behavior occurs throughout the project because the error line consists of three elements:
The entire error line is centered. And when the message is short (takes up one line), height of the container is 40px, because the close button is 40px high and wide, but the message text itself is not 40px high, so it is centered (accordingly, there is indentation at the top and bottom, because all elements of the line are centered). But when the message text has more lines, then the height of the entire line is determined by the text itself, the red dot and the close button are in the middle, and the message text takes up the entire height (it is the text that determines it), which is why there is no indentation in this case.
cc: @dannymcclain |
|
Hmm... I think it's possible, but I'm not sure if it's within the scope of this PR, since we don't currently have mechanisms to add this style to a specific place. However, it can be done globally for all locations, but in this case, it will be necessary to check all locations that use this component (and I am sure there are many) throughout the project and check if they have indents, and if so, change them to this approach, which is definitely outside the scope of this PR. The only thing we can try is to add a chain of props for text styles and transfer them specifically from this location. |
|
So what should i do? I think that in order not to go beyond the scope of the PR, I can add this indentation for the text in this PR only for this specific place. |
Let's go ahead and do that and keep the scope limited to this particular error. Maybe in the future we can go through and update all the errors to have this new spacing (which would be ideal), but for now, I'm fine to just fix it here. Does that work for everyone? |
|
Updated PR! |
|
Sounds good to me 👍 Let us know when there's new screenshots and we'll get this over the line |
|
Hi @dannymcclain screenshots is also added |
|
Screenshots/videos are looking good to me 👍 |
|
@Eskalifer1 Could you kindly check on the Jest Unit Tests failures? |
|
Done! |
|
Checking now |
| errors={reportTitleErrors} | ||
| errorRowStyles={styles.mh0} | ||
| errorRowStyles={[styles.mh0]} | ||
| errorRowTextStyles={[styles.mv2]} |
There was a problem hiding this comment.
@Eskalifer1 I don't understand why are we creating new errorRowTextStyles just to add margin? why can't we reuse the errorRowStyles and add margin there?
There was a problem hiding this comment.
Hi @abdulrahuman5196 This was decided with the design team, we discussed it in this conversation. If you can, please reread it starting with this message so that I don't have to write the same things again:
#75524 (comment)
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-11-29.at.3.05.53.PM.movAndroid: mWeb ChromeScreen.Recording.2025-11-29.at.3.08.10.PM.moviOS: HybridAppScreen.Recording.2025-11-29.at.3.03.12.PM.moviOS: mWeb SafariScreen.Recording.2025-11-29.at.3.05.12.PM.movMacOS: Chrome / SafariScreen.Recording.2025-11-29.at.2.58.54.PM.mov |
abdulrahuman5196
left a comment
There was a problem hiding this comment.
Changes looks good and works well. Reviewers checklist is also complete.
All yours. @neil-marcellini
🎀 👀 🎀
C+ Reviewed
neil-marcellini
left a comment
There was a problem hiding this comment.
Looks great, thank you
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.2.67-0 🚀
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.2.70-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.70-0 🚀
|
















Explanation of Change
This PR adds top indentation for the error line in the custom report name section.
Fixed Issues
$#74737
PROPOSAL:#74737 (comment)
Tests
Precondition: have created workspace
default report titleOffline tests
No offline behaviour since we need respose from backend
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
74737-android-native.1.mp4
Android: mWeb Chrome
74737-android-web.1.mp4
iOS: Native
74737-ios-native.1.mp4
iOS: mWeb Safari
74737-ios-web.1.mp4
MacOS: Chrome / Safari
74737-web.mov