Buttons which change the content in the compose textarea were so far
enabled even in preview mode, and would work, but those changes would
not be reflected in the visible preview. This is extremely confusing,
and can lead to the possibility of a user accidentally changing the
content of the compose textarea while previewing, and sending that.
Now we disable those buttons in preview mode, both when composing a new
message and when editing an existing one. We still show the tooltips,
but grey them out and make them unclickable.
Fixes: #20962
This commit removes the code to initialize
"realm-default-notification-sound-audio" element from
"notifications.initialize", because we do not need this
now as the previous commit added code to initialize it
in "settings_realm_user_settings_default.set_up".
This change works because the realm default notification sound
can only be played from the settings UI and so it is fine to
initialize it only when opening the default user settings panel.
Fixes#25744
By rendering the emojis after initializing the simplebar container,
the rendering time is decreased by ~30% as observed at 6x CPU
cooldown on mac i7.
This naming more accurately reflects the functionality of these types
of functions. They are not only responsible for displaying the
popovers but also for toggling them off.
The intent behind this commit is to tidy up how we handle user info
popovers. The first step is to move everything related to them into
its own module. This commit should not have any functional changes.
This commit aims to extract all logic related to obtaining
notification title from the `process_notification` function into
a separate `get_notification_title` function.
This commit aims to extract all logic related to obtaining
notification key from the `process_notification` function into a
separate `get_notification_key` function.
This commit aims to extract all logic related to debugging the value
of `notification_source` from the `process_notification` function into
a separate `debug_notification_source_value` function.
This commit aims to extract all logic related to obtaining
notification content from the `process_notification` function into a
separate `get_notification_content` function.
Also register these click handlers just on the popover itself directly
in the onMount helper, like we do with all the other popover_menus.js
functions.
stream_popover.is_open() much more accurately describes what this
does, and in particular the fact that the function applies to all
places the stream popover might be.
Commit 61f7ede43c (#25759) introduced a
bug: browser_history tried to access user_settings.default_view at top
level as soon as it was imported, before
user_settings.initialize_user_settings has been called, so
browser_history.state.spectator_old_hash was always initialized to
"#undefined".
Signed-off-by: Anders Kaseorg <anders@zulip.com>
For sorting topics in the left sidebar topics list, the "Followed"
topics are treated the same as "Unmuted" topics.
In a muted stream and not zoomed state:
* followed/unmuted topics at the top.
In an unmuted stream or zoomed state in a muted stream:
* normal recency sorting
The reason is that the "Followed" topics have a tier of interest
above being unmuted, so they shouldn't lie below the "Unmuted" topics
in the list.
This commit adds the follow icon to the right end
(before the three-dot menu icon) of the topic list item
for followed topics.
The icon replaces '@' instead of showing both the '@' and "Follow"
icons in the case of unread mentions, as users don't care if they
are following a topic if they've got unread mentions there.
In a muted stream, the text color of followed topics in the topic list
is set to be similar to that of unmuted topics.
The reason is that the followed topic has a tier of interest above
being unmuted, so it shouldn't stay faded in the topic list.
This commit adds the CSS variable '--color-unmuted-topic-list-item'
for the unmuted topic's color in the topic list.
The color for both the light and dark themes is defined in
'zulip.css' and used in 'left_sidebar.css'.
This approach helps to remove the use of the selector 'unmuted_topic'
only for color definition in 'dark_theme.css'.
We don't have a "Manage user" tab in your own profile, so it would
throw an exception to do the default thing here, and the mechanism for
editing your own settings should be the main "your profile" panel,
which is a bit bigger and more user-friendly.
I'm not totally convinced that the extra logic for not having a
"Manage user" tab is worth it; the alternative of figuring out a
non-confusing label would not be terrible here. But this version is
non-broken, and it'll be easy to change later if we change our mind.
This commit adds Tippy tooltips to the edit pencil button
in the user profile. Now, when a user opens another user's
profile, they will see the tooltip 'Manage user', and when
they open their own user profile, they will see the tooltip
'Edit profile'.
This commit unsets the padding of the bot icon and, as the anchor
tag has been replaced with the i tag, we have also set the color
and pointer. This is done so that when the user hovers over the
icon, it will appear as a clickable button.
This commit moves the bot icon to the left of the name in the user
profile and adds a margin-left and margin-right to the name to ensure
there is enough space between the icon, name, and edit pencil.
This commit redirects the edit pencil in the user profile modal to
the 'manage user' tab whenever a user with permission to manage
other users via the user profile opens another user's profile.
However, we still want to redirect the edit pencil to
'settings/profile' if the user opens their own profile. The user
management permission is granted if the user is an admin or the
owner of the bot. However, we do not want system bots to have
access to the edit pencil or the 'manage user' tab. Therefore,
a new variable called 'can_manage_profile' has been introduced
to manage all these permissions, and the CSS has been updated
accordingly.
To redirect to the manage user tab without opening another modal,
I have extracted the toggler. This toggler will store the
component, and if the edit pencil button is clicked, we can use
the goto function to redirect to a different tab.
Changed the id names of both the edit pencil icons to explain
better of what they do.
This commit increases the gap between the labels and input/select
of the user profile manage user/bot tab for clearer visibility.
It also reduces the gap between the 'deactivate user' button and
the last input to make it look better.