mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
inbox: Show muted icon for muted channels.
This commit is contained in:
@@ -36,6 +36,7 @@ import * as pm_list from "./pm_list.ts";
|
|||||||
import * as stream_color from "./stream_color.ts";
|
import * as stream_color from "./stream_color.ts";
|
||||||
import * as stream_data from "./stream_data.ts";
|
import * as stream_data from "./stream_data.ts";
|
||||||
import * as stream_list from "./stream_list.ts";
|
import * as stream_list from "./stream_list.ts";
|
||||||
|
import * as stream_settings_api from "./stream_settings_api.ts";
|
||||||
import * as stream_topic_history from "./stream_topic_history.ts";
|
import * as stream_topic_history from "./stream_topic_history.ts";
|
||||||
import * as stream_topic_history_util from "./stream_topic_history_util.ts";
|
import * as stream_topic_history_util from "./stream_topic_history_util.ts";
|
||||||
import * as sub_store from "./sub_store.ts";
|
import * as sub_store from "./sub_store.ts";
|
||||||
@@ -2356,6 +2357,40 @@ export function initialize({hide_other_views}: {hide_other_views: () => void}):
|
|||||||
compose_closed_ui.set_standard_text_for_reply_button();
|
compose_closed_ui.set_standard_text_for_reply_button();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("body").on(
|
||||||
|
"click",
|
||||||
|
"#inbox-list .toggle-channel-visibility",
|
||||||
|
function (this: HTMLElement, e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
const $elt = $(this);
|
||||||
|
focus_clicked_list_element($elt);
|
||||||
|
const stream_id = Number($elt.attr("data-stream-id"));
|
||||||
|
if (stream_id) {
|
||||||
|
const sub = sub_store.get(stream_id);
|
||||||
|
if (sub) {
|
||||||
|
stream_settings_api.set_stream_property(sub, {
|
||||||
|
property: "is_muted",
|
||||||
|
value: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
$("body").on("keydown", "#inbox-list .toggle-channel-visibility", (e) => {
|
||||||
|
if (e.metaKey || e.ctrlKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (keydown_util.is_enter_event(e)) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
const $elt = $(e.currentTarget);
|
||||||
|
$elt.trigger("click");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on("compose_canceled.zulip", () => {
|
$(document).on("compose_canceled.zulip", () => {
|
||||||
if (inbox_util.is_visible()) {
|
if (inbox_util.is_visible()) {
|
||||||
revive_current_focus();
|
revive_current_focus();
|
||||||
|
@@ -209,27 +209,14 @@
|
|||||||
.inbox-topic-name {
|
.inbox-topic-name {
|
||||||
grid-area: recipient_info;
|
grid-area: recipient_info;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.inbox-right-part-wrapper {
|
.channel-visibility-policy-indicator,
|
||||||
flex-grow: 1;
|
.visibility-policy-indicator {
|
||||||
|
display: flex;
|
||||||
.inbox-right-part {
|
align-items: center;
|
||||||
display: flex;
|
border-radius: 3px;
|
||||||
justify-content: space-between;
|
margin-left: 3px;
|
||||||
flex-grow: 1;
|
|
||||||
|
|
||||||
> .inbox-action-button:first-child {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.visibility-policy-indicator {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
border-radius: 3px;
|
|
||||||
margin-left: 3px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.unread-count-focus-outline {
|
.unread-count-focus-outline {
|
||||||
@@ -359,8 +346,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.inbox-right-part-wrapper {
|
.inbox-right-part-wrapper {
|
||||||
display: flex;
|
flex-grow: 1;
|
||||||
align-items: center;
|
|
||||||
|
.inbox-right-part {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-grow: 1;
|
||||||
|
|
||||||
|
> .inbox-action-button:first-child {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.inbox-row,
|
.inbox-row,
|
||||||
@@ -717,6 +713,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.channel-visibility-policy-indicator,
|
||||||
.visibility-policy-indicator {
|
.visibility-policy-indicator {
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
outline: 2px solid var(--color-outline-focus);
|
outline: 2px solid var(--color-outline-focus);
|
||||||
@@ -741,6 +738,7 @@
|
|||||||
on the element or one of the elements within it. */
|
on the element or one of the elements within it. */
|
||||||
&:focus-within:not(:focus),
|
&:focus-within:not(:focus),
|
||||||
&:focus-visible {
|
&:focus-visible {
|
||||||
|
.channel-visibility-policy-indicator,
|
||||||
.inbox-row-visibility-policy-inherit,
|
.inbox-row-visibility-policy-inherit,
|
||||||
.inbox-action-button {
|
.inbox-action-button {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@@ -26,6 +26,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="inbox-right-part-wrapper">
|
<div class="inbox-right-part-wrapper">
|
||||||
<div class="inbox-right-part">
|
<div class="inbox-right-part">
|
||||||
|
{{#if is_muted}}
|
||||||
|
<span class="channel-visibility-policy-indicator toggle-channel-visibility tippy-zulip-tooltip" data-stream-id="{{stream_id}}" tabindex="0" data-col-index="{{ column_indexes.TOPIC_VISIBILITY }}" data-tooltip-template-id="inbox-channel-mute-toogle-tooltip-template">
|
||||||
|
<i class="zulip-icon zulip-icon-mute recipient_bar_icon" role="button"></i>
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
<div class="inbox-action-button inbox-stream-menu" data-stream-id="{{stream_id}}" tabindex="0" data-col-index="{{ column_indexes.ACTION_MENU }}">
|
<div class="inbox-action-button inbox-stream-menu" data-stream-id="{{stream_id}}" tabindex="0" data-col-index="{{ column_indexes.ACTION_MENU }}">
|
||||||
<i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i>
|
<i class="zulip-icon zulip-icon-more-vertical" aria-hidden="true"></i>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -295,3 +295,11 @@
|
|||||||
{{t 'Filter left sidebar' }}
|
{{t 'Filter left sidebar' }}
|
||||||
{{tooltip_hotkey_hints "Q"}}
|
{{tooltip_hotkey_hints "Q"}}
|
||||||
</template>
|
</template>
|
||||||
|
<template id="inbox-channel-mute-toogle-tooltip-template">
|
||||||
|
<div>
|
||||||
|
<div>{{t "You have muted this channel." }}</div>
|
||||||
|
<div class="italic">
|
||||||
|
{{t "Click to unmute this channel." }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
Reference in New Issue
Block a user