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

recent topics: Display other sender names in tooltip. #18502

Merged
merged 1 commit into from
Jun 3, 2021
Merged

recent topics: Display other sender names in tooltip. #18502

merged 1 commit into from
Jun 3, 2021

Conversation

m-e-l-u-h-a-n
Copy link
Member

It is a follow up for #18451 and #18480.
Testing plan: Manually on dev server.

As can be seen in the gif, when tooltip is shown with max allowed width(300) and is on the first row, it is not shown in the top. While it's position is as expected(top), when it is not in the first row. On searching more about this on tiipyjs repo issues I found it is a popper.js problem. I'm not sure how to debug that, so I am trying to find a fix about that.

Other than that this work is ready for review.

GIFs or screenshots:
other_sender_tooltip

if (muting.is_user_muted(id)) {
other_senders_fullname_string = other_senders_fullname_string.concat("Muted user, ");
} else {
const fullname = people.get_full_name(id);
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use people.get_display_full_names here and avoid some duplication.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Yeah, we should definitely do that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Made these changes.

@timabbott
Copy link
Sponsor Member

I think the positioning issue is that the tooltip is not allowed to go outside the <tbody> container. @amanagr may know how to fix that.

@m-e-l-u-h-a-n
Copy link
Member Author

m-e-l-u-h-a-n commented May 14, 2021

I think the positioning issue is that the tooltip is not allowed to go outside the <tbody> container. @amanagr may know how to fix that.

Ohh, that could be possible.

@timabbott
Copy link
Sponsor Member

Would it makes sense to do this tooltip with one user per line, rather than joining the names with ,s? That might be substantially more readable.

@m-e-l-u-h-a-n
Copy link
Member Author

Would it makes sense to do this tooltip with one user per line, rather than joining the names with ,s? That might be substantially more readable.

I posted on chat.zulip.org regarding this and also about first row showing bottom(if content tries to go out of table).

@m-e-l-u-h-a-n
Copy link
Member Author

I've made following changes so that extra senders tooltip will show, only first 10 recent extra senders with 11th line saying and {n - 14} more., n is total number of participants.
Also regarding tooltip placed at bottom sometime, I think it would be better to have that behavior, as tooltip can use it to intelligently decide which vertical(top or bottom) position to choose for showing the tooltip and if we fix it by some way to lets say top only we will have a lot of overlapping problems like tooltip overlapping filter input or input overlapping tooltips.
GIF for current behavior:
extra_senders gif

if (extra_sender_ids.length > MAX_EXTRA_SENDERS) {
const extra_sender_count = extra_sender_ids.length - MAX_EXTRA_SENDERS;
other_senders_fullname_string = other_senders_fullname_string.concat(
$t({defaultMessage: `<br/>and {extra_sender_count} others.`}, {extra_sender_count}),
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

The <br/> should be kept outside of the translateable string, and ideally just added via the join operation you have above.

With a bit of refactoring to collect a list (and have this block just append an extra item) and then join with <br /> items at the end, this'll read a lot more cleanly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated this.

@m-e-l-u-h-a-n
Copy link
Member Author

Updated this pr by refactoring how this list is collected, and then finally apply join with <br/>.
It is ready for another look.

@timabbott timabbott merged commit fa34f79 into zulip:master Jun 3, 2021
@timabbott
Copy link
Sponsor Member

Merged, thanks @m-e-l-u-h-a-n! I think it'd be well worth extending the frontend tests for this module to actually cover the cases added by the new logic.

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

Successfully merging this pull request may close these issues.

4 participants