inbox_row: Don't show topic visibility toggle button by default.

We emulate the same behaviour of hiding topic visibility button
by using opacity if for default topic visibility state.
This commit is contained in:
Aman Agrawal 2024-03-14 15:07:50 +00:00 committed by Tim Abbott
parent f4d58f1ba6
commit 9846c4c476
2 changed files with 10 additions and 1 deletions

View File

@ -448,12 +448,17 @@
&:focus, &:focus,
&:focus-within, &:focus-within,
&:hover { &:hover {
.inbox-row-visibility-policy-inherit,
.inbox-action-button { .inbox-action-button {
opacity: 1; opacity: 1;
} }
} }
} }
.inbox-row-visibility-policy-inherit {
opacity: 0;
}
.inbox-action-button { .inbox-action-button {
display: flex; display: flex;
border-radius: 3px; border-radius: 3px;

View File

@ -47,7 +47,8 @@
<div class="inbox-right-part-wrapper"> <div class="inbox-right-part-wrapper">
<div class="inbox-right-part"> <div class="inbox-right-part">
{{#if is_topic}} {{#if is_topic}}
<span class="visibility-policy-indicator change_visibility_policy hidden-for-spectators" data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" tabindex="0"> <span class="visibility-policy-indicator change_visibility_policy hidden-for-spectators{{#if (eq visibility_policy all_visibility_policies.INHERIT)}} inbox-row-visibility-policy-inherit{{/if}}"
data-stream-id="{{stream_id}}" data-topic-name="{{topic_name}}" tabindex="0">
{{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}} {{#if (eq visibility_policy all_visibility_policies.FOLLOWED)}}
<i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}" <i class="zulip-icon zulip-icon-follow recipient_bar_icon" data-tippy-content="{{t 'You follow this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i> role="button" aria-haspopup="true" aria-label="{{t 'You follow this topic' }}"></i>
@ -57,6 +58,9 @@
{{else if (eq visibility_policy all_visibility_policies.MUTED)}} {{else if (eq visibility_policy all_visibility_policies.MUTED)}}
<i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}" <i class="zulip-icon zulip-icon-mute-new recipient_bar_icon" data-tippy-content="{{t 'You have muted this topic'}}"
role="button" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i> role="button" aria-haspopup="true" aria-label="{{t 'You have muted this topic' }}"></i>
{{else if (eq visibility_policy all_visibility_policies.INHERIT)}}
<i class="zulip-icon zulip-icon-inherit recipient_bar_icon" data-tippy-content="{{t 'Default'}}"
role="button" aria-haspopup="true" aria-label="{{t 'Default' }}"></i>
{{/if}} {{/if}}
</span> </span>
{{/if}} {{/if}}