-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix: Center button has no hover and press effect #43452
Fix: Center button has no hover and press effect #43452
Conversation
@jjcoffee I asked to confirm the hover and press value in #43058 (comment). Then I will complete the PR author checklist. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-app-2024-06-13_11.32.28.mp4Android: mWeb Chromeandroid-chrome-2024-06-13_11.28.04.mp4iOS: Nativeios-app-2024-06-13_11.08.45.mp4iOS: mWeb Safariios-safari-2024-06-13_11.10.00.mp4MacOS: Chrome / Safaridesktop-chrome-2024-06-13_10.54.53.mp4MacOS: Desktopdesktop-app-2024-06-13_10.56.33.mp4 |
@truph01 Could you add the dimming values that you've used to post the video on the issue to the PR for now, so I can start testing? |
@jjcoffee You mean this video #43058 (comment), right? This video uses the hoverDimValue: 1 and is the same as the PR. |
@truph01 See this comment for the values to apply. |
@jjcoffee I addressed this comment #43452 (comment) |
I think the idea here is to just make this button match the same :hover and :press styles of all of our other buttons. There shouldn't really be anything special about this button. Do all of our buttons have that kind of reduced opacity on press? I have a feeling that could be an artifact of the Pressable component we use. FWIW though, we do have a button-press color var we use in Figma. (Though @Expensify/design looks like our button component does not ship with a "Pressed" state 😱 ) |
@shawnborton Oh boy. I agree that the states for these icon buttons should match the states of our default buttons. Here's an updated spec sheet for these:
😬 we can get this updated in Figma easily, though I think the bigger issue is making sure these states are reflected in code. It looks like the pressed state for buttons currently does not reflect that in the product. So the question is, do we update this button to be correct, or do we leave it using defaults and globally update all our buttons to use the proper pressed state? |
I say we make this button just match our current global styles, and then we update our global styles to be correct per our Figma guidelines. |
@shawnborton What is the global style you mentioned above, is it something like the below (the "Share code" icon and "Emoji" icon): |
Yup, agree with Danny's observation there. But oh boy, how many button components do we have in the code 🤣 |
@shawnborton I updated the PR which uses this suggestion #43452 (comment). Here is the result: output.mp4 |
@shawnborton Here is the current button size: |
How big is the icon inside of it though? |
@shawnborton The icon have size 20*20 |
Sweet, I think we're all good then! |
@truph01 Sorry, could you explain what the benefit of switching to the
@shawnborton I think so yes, but it's usually obscured by the fact that the button sits on top of a flat background element. Do you think it's an issue here? |
</PressableWithoutFeedback> | ||
iconFill={theme.icon} | ||
medium | ||
icon={Expensicons.Crosshair} |
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 we'd want to keep the accessibilityLabel
if going down this route.
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.
@truph01 Bump on this 🙏
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.
@jjcoffee I updated it
I think there is no issue with making this PR use our standard buttons, but our standard buttons ideally would use a different color on press instead of reduced opacity. We can sort that out in a separate issue though.
This is correct because this is essentially a button. It's just a button with no label and only an icon. And this way we automatically get all of our default button styles. |
Essentially, the Button component is built on PressableWithFeedback. After numerous design changes to the button (this, this and this), I'm choosing to use the Button component because it already includes all the hover and press styles, ensuring consistency with this final decision. With our previous suggested design like this, we cannot use the |
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.
LGTM!
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 guys, the code LGTM!
✋ 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/marcochavezf in version: 1.4.86-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.86-0 🚀
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 1.4.86-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.0.0-9 🚀
|
Details
Fixed Issues
$ #43058
PROPOSAL: #43058 (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
Screen.Recording.2024-06-13.at.10.41.53.mov
Android: mWeb Chrome
Screen.Recording.2024-06-13.at.10.40.55.mov
iOS: Native
Screen.Recording.2024-06-13.at.10.38.32.mov
iOS: mWeb Safari
Screen.Recording.2024-06-13.at.10.35.52.mov
MacOS: Chrome / Safari
- Dark mode:Screen.Recording.2024-06-13.at.10.26.04.mov
Screen.Recording.2024-06-13.at.10.27.19.mov
MacOS: Desktop
Screen.Recording.2024-06-13.at.10.37.15.mov