Skip to content
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

Added Tooltips to the report users' titles. #1632

Merged
merged 22 commits into from
Mar 19, 2021

Conversation

parasharrajat
Copy link
Member

@parasharrajat parasharrajat commented Mar 4, 2021

@roryabraham Please review.

Details

A lot has been going on.

  1. Passing the participantList & tooltipText in options from the createOption method in the OptionsListUtils.js.

  2. Changed the Tooltip Code.

    • Now Tooltips are attached to the body of the page on Web/Desktop.
    • Mobile devices do not have hover capabilities so tooltips are just empty wrappers.
    • TooltIp styling has changed which is required for attaching it to the Body instead of inline.
  3. Added a new Component OptionRowTitle which is used to Show tooltips for Each participant name and .... It does optional tooltip rendering. For places where we don't need tooltips, it renders the Option title(Chat title).

  4. It was very hard to render the tooltips on each user name and keep the ellipsis on the chat title, so I had to use display: inline for tooltip containers. and Shift the tooltip horizontally for the names which were overflowing the container.

  5. Tooltips are added to the following places.

    - Show the tooltip for the single user Chats while hovering the title.
    - Show the tooltip on the Ellipse for Group chats only if the text is truncated.
    - Show the Tooltip with Points 1 and 2 on the search Page.
    - Show the Tooltip with Points 1 and 2 on the Report Header.
    - Show the Tooltip for the comment author.
    

Fixed Issues

Fixes #1490

Tests

  1. Hover over the various locations and See the tooltip.

Tested On

  • Web
  • Mobile Web
  • Desktop
screen-.2.mp4

@parasharrajat parasharrajat requested a review from a team as a code owner March 4, 2021 14:33
@botify botify requested review from pecanoro and removed request for a team March 4, 2021 14:33
@parasharrajat
Copy link
Member Author

Let me know if we need the same behaviour for the Report title in the Header of chat as per the sidebar.
How do you want to list the User Emails while hovering over the Ellipsis? @shawnborton any hint here or some mockup.

@parasharrajat parasharrajat changed the title [WIP] : Added Tooltips to the report users' titles. Added Tooltips to the report users' titles. Mar 11, 2021
@parasharrajat
Copy link
Member Author

Ready for Review @roryabraham

@roryabraham
Copy link
Contributor

Let me know if we need the same behaviour for the Report title in the Header of chat as per the sidebar.

Yeah, that would be great to see added

src/components/Tooltip/index.js Outdated Show resolved Hide resolved
src/components/Tooltip/index.js Outdated Show resolved Hide resolved
src/components/Tooltip/index.js Outdated Show resolved Hide resolved
src/components/Tooltip/TooltipPropTypes.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/optionPropTypes.js Outdated Show resolved Hide resolved
src/styles/getTooltipStyles.js Outdated Show resolved Hide resolved
src/styles/getTooltipStyles.js Outdated Show resolved Hide resolved
src/styles/getTooltipStyles.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
@roryabraham
Copy link
Contributor

roryabraham commented Mar 11, 2021

Let me know if we need the same behaviour for the Report title in the Header of chat as per the sidebar.

Would be great to see this added! cc @shawnborton

@shawnborton
Copy link
Contributor

Nice, sounds good to me.

@shawnborton
Copy link
Contributor

How do you want to list the User Emails while hovering over the Ellipsis? @shawnborton any hint here or some mockup.

@parasharrajat do you still need some guidance here? Can you show me what it currently looks like?

@parasharrajat
Copy link
Member Author

@shawnborton the List looks like the below tooltip.
Screenshot_20210312_035239

@shawnborton
Copy link
Contributor

Ah apologies, I was mostly responding to the comment about "hovering over the ellipsis" - can you show me what you mean by that?

@parasharrajat
Copy link
Member Author

parasharrajat commented Mar 11, 2021

@shawnborton Look at this one.
image

@shawnborton
Copy link
Contributor

Ah, thanks for clarifying. I think with the ellipsis, we'd just show all of the logins in the tooltip as you are already doing.

@parasharrajat
Copy link
Member Author

Updated. Thanks.

@roryabraham
Copy link
Contributor

@parasharrajat any update on this one? I see there's a merge conflict

@parasharrajat
Copy link
Member Author

@roryabraham I just resolved it. Thanks.

@pecanoro pecanoro removed their request for review March 19, 2021 10:47
@pecanoro
Copy link
Contributor

I am going on vacation next week so I am removing my requested review. However, I took a look at the PR but since I am not as good as @tgolen or @roryabraham with React Native, I will defer the final review to them.

Co-authored-by: Rocio Perez <pecanoro@users.noreply.github.com>
roryabraham
roryabraham previously approved these changes Mar 19, 2021
Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM! Tested it out a bit too and it seems to work well! All yours @tgolen

{props.report && props.report.reportName && (
<View
style={[
styles.flex1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB maybe rather than composing 4 styles into a new one here you could add a new style that composes these four, like flexRowCenterChildren. Up to you though. I personally think it's better not to compose too many styles inline, because it's equivalent to creating a new style, and we want our JSX to have as little style logic as possible in general.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I actually prefer is granular. All four of the classes are generic and it makes sense to create a class if we use all of them together very often. But I prefer tailwind-styled code. Let's see what @tgolen has to say here.

@parasharrajat
Copy link
Member Author

parasharrajat commented Mar 19, 2021

Ok. I tried some way but that doesn't seem to work with a dynamic number of names on the chat title. So the current PR is still valid.

@tgolen
Copy link
Contributor

tgolen commented Mar 19, 2021 via email

@parasharrajat
Copy link
Member Author

@tgolen . Sorry I updated the old comment. Here is the update #1632 (comment)

@tgolen
Copy link
Contributor

tgolen commented Mar 19, 2021

Ah, OK. I'll look at this PR next then.

src/components/Hoverable/HoverablePropTypes.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
src/pages/home/sidebar/OptionRowTitle/index.js Outdated Show resolved Hide resolved
@parasharrajat
Copy link
Member Author

@tgolen Updated. Please review.

Copy link
Contributor

@tgolen tgolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for those changes!

@tgolen
Copy link
Contributor

tgolen commented Mar 19, 2021

@pecanoro All you!

@parasharrajat
Copy link
Member Author

@tgolen She is going on leave #1632 (comment)

@tgolen
Copy link
Contributor

tgolen commented Mar 19, 2021

Ah, thanks. I missed that.

@tgolen tgolen merged commit 3431bf0 into Expensify:master Mar 19, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@roryabraham
Copy link
Contributor

OSBotify is lying! He did deploy this to staging 😠 https://github.com/Expensify/Expensify.cash/runs/2152639657?check_suite_focus=true

@roryabraham
Copy link
Contributor

Hi @parasharrajat, unfortunately this PR introduced a bug on mobile web. Tooltips in the left-hand-nav are appearing on screen and persisting after the report is opened:

image

So we need a clever way to make sure that the tooltip isn't opened by taps on touch-screen devices. Any ideas?

@marcaaron
Copy link
Contributor

I don't quite understand why we are using a component called OptionRowTitle both in the OptionRow and also in the HeaderView (which has no rows of options).

https://github.com/Expensify/Expensify.cash/blob/106c52b2410bfab984b8cc7ba786fd2affcc29aa/src/pages/home/HeaderView.js#L95-L100

This should have been given a more generic name and hopefully we can get it cleaned up? Thanks.

@roryabraham
Copy link
Contributor

Good point, thanks for finding that @marcaaron. I'll create a PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expensify chat - web/desktop, when hovering over a user's name anywhere, show their primary login details
7 participants