Skip to content

Feat: Added Tooltip for Jump to msg button#751

Closed
dhairyashiil wants to merge 8 commits intoRocketChat:developfrom
dhairyashiil:feat/add-tooltip-for-send-and-arrow-back-button
Closed

Feat: Added Tooltip for Jump to msg button#751
dhairyashiil wants to merge 8 commits intoRocketChat:developfrom
dhairyashiil:feat/add-tooltip-for-send-and-arrow-back-button

Conversation

@dhairyashiil
Copy link
Contributor

@dhairyashiil dhairyashiil commented Dec 29, 2024

Acceptance Criteria fulfillment

  • After pointing the mouse at the Send button icon, the user should see the text "Send Message".
  • After pointing the mouse at the Arrow-back button in the Starred Messages and Pinned Messages sidebar, the user should see the text "Go To Message".

Fixes #750

Screenshots

Send Button:

image

Starred Messages:

image

Pinned Messages:

image

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-751 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

@Spiral-Memory
Copy link
Collaborator

"Send Message" -> A tooltip for send icon is unnecessary, pls remove that.

For the Go to Message, change it to Jump to Message, Let's be consistent with Rocket.Chat channel terminologies

@Spiral-Memory Spiral-Memory changed the title Feat: Added Tooltip for Send button & Arrow-back button Feat: Added Tooltip for Jump to msg button Jan 1, 2025
@dhairyashiil
Copy link
Contributor Author

Hello @Spiral-Memory,
I’ve updated it to "Jump to message." From now on, I will follow Rocket.Chat channel’s terminologies. Thank you.

font-family: sans-serif;
top: ${position === 'top' ? 'calc(-100% - 20px)' : 'calc(100% + 10px)'};

top: ${position === 'top'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any specific reason we need this huge change for this ?
I am just worried that it should not affect the other existing tooltips

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I double-checked the changed code. I also tried reducing the code, but I was unable to reduce many lines because, earlier, we were only considering the top and bottom positions, and we were hardcoding the CSS values for the left and transform properties in the tooltip. Now, we have 4 positions and are setting the required fields dynamically.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay,
That is fine, but the code is not very readable

Any other way we can have this dynamic positioning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, Let's see. I will look into it.

@dhairyashiil
Copy link
Contributor Author

Hello @Spiral-Memory, Please refer to the video in which I have shown that all the tooltips are working as expected.

all.tooltips.mp4

and

image

onClick={() => setJumpToMessage(msg._id)}
css={{
position: 'relative',
zIndex: 10,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any specific reason to hardcode this zIndex ?
The thing is, if you notice, we are using specific set of zIndex mentioned in the documentation

We might want to align with that standard

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, that z-index logic was not added by me. I added only the tooltip part here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay cool then, still not sure how it is there.. there was specific set of z-indexes I made after my gsoc..
That's fine
Will see..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see PR #667. It looks like this hardcoded code came from there. No worries, I’ll fix the logic in the current PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Spiral-Memory, what value should I set for zIndex?

I can see that in the codebase, the zIndex value can come from the theme, but if not, we’re maintaining specific zIndex values for certain components, like:

z-index: ${theme.zIndex?.sidebar || 1200};
z-index: ${theme.zIndex?.menu || 1300};
z-index: ${theme.zIndex?.tooltip || 1400};
z-index: ${theme.zIndex?.modal || 1500};
z-index: ${theme.zIndex?.toastbar || 1600};

font-family: sans-serif;
top: ${position === 'top' ? 'calc(-100% - 20px)' : 'calc(100% + 10px)'};

top: ${position === 'top'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay,
That is fine, but the code is not very readable

Any other way we can have this dynamic positioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Add Tooltip For Jump to Msg Button

2 participants