Commit Graph

14329 Commits

Author SHA1 Message Date
Aman Agrawal b23931bd66 recent: Fix unread counts wrappings to next line in long topic names.
We limit the word break to only text present inside the `a` tags
so that it doesn't apply to unread count.
2022-10-26 21:34:36 -07:00
Aman Agrawal 45f35a464e stream_list: Reduce stream header's height when scrolling elt into view.
Since stream header is now sticky, we need to reduce it's height
when calculation position of the element we want to scroll into view
so that it doesn't hide under the sticky header.
2022-10-26 13:47:08 -07:00
Aman Agrawal fc70921eeb scroll_util: Add support for sticky headers.
When calculating position of an element, we now take into account
the height of the sticky headers too.
2022-10-26 13:47:08 -07:00
Aman Agrawal 470553b457 left_sidebar: Fix some PMs not being displayed when PMs are zoomed in.
We added sticky headers above the PM list but forgot to subtract
it from the max-height of the scrollable container.
2022-10-26 13:47:08 -07:00
jai2201 6f9e97921d pm_section: Create collapsible private messages section.
This commit introduces the change of rendering private messages
section as collapsible, whose data-fetching logic came with zulip#21357.

We now have separated out `Private messages` from `top_left_corner`
section and shifted it below the `global_filters` in a different
separate section along with stream list with common scroll bar
in left-sidebar.

The new PM section will be opened by-default on loading the page
and will have a toggle-icon in its header, clicking on which makes the
section collapse/expand accordingly.

In default view, only recent 5 PM threads would be shown
and would append the active conversation as the 6th one at last
if not present in those 5, similar to how topics list work.

In PM section with unreads, a maximum of 8 conversations
would be shown and rest of them would be hidden behind
the 'more conversations' li-item, clicking on which takes
to the zoomedIn view of PM section where all the present
PM threads would be visible and rest of the sections of left-sidebar
will get collapsed.

Fixes #20870.

Co-authored-by: Aman Agrawal <amanagr@zulip.com>
2022-10-26 13:47:08 -07:00
Barissa-Imran 15b9e9c7cc bots: Customize reactivation confirmation modal for bots.
Since bots can't join user groups, and end users don't think of bots
as a special class of users, it's worth having special text here.

Fixes: #23270.
2022-10-26 13:26:16 -07:00
Rebecca Södereng 5814b61f00 popovers: Drop text for historical messages from three-dot menu.
Dropped text "(Message sent when you were not subscribed)" for
historical messages in the three-dot message menu.

This information was already available via the "You subscribed" type
divider lines, which were added about the same time back in 2013, and
this text feels somewhat ugly.

Also removed the historical field from the args object that is
passed to the template, as this is not used anymore.

Fixes #23198.
2022-10-26 13:20:37 -07:00
Lauryn Menard 7172a6ef13 filter: Show stream and topic title for near link narrows.
Updates the `filter.get_title` logic to return the stream name for
narrows that include the stream, topic and near operators. That
way the browser/tab title remains the same for these views, which
have a particular scroll offset.
2022-10-26 12:35:28 -07:00
Aman Agrawal ca36f23d9f recent_topics: Fix long topic and stream words squeezing other rows.
Topics and streams containing long words can cause horizontal
overflow and squeeze other columns too much.
2022-10-26 12:28:58 -07:00
Lauryn Menard 95aa9a4f83 compose-box: Remove reset max-height calculation for preview click.
Removes call to reset_compose_message_max_height when clicking on
the markdown preview button, which due to the `#compose` div element
momentarily shrinking to be empty, caused the calculation of the
max-height to grow larger on each click.

Also refactors reset_compose_message_max_height to use the height
from `getBoundingClientRect`, which defaults to zero when empty.

And fixes a small discrepancy in how max-height is applied to
a div element vs a textarea element, so that the visible height
doesn't change between the preview and write modes in the compose
box.

Fixes #23277.
2022-10-25 13:49:29 -07:00
Aman Agrawal 5ee78fc14c recent_topics: Don't process hotkeys in empty table.
The fixes errors when we are trying process user input before
anything is initialized in recent topics.
2022-10-25 11:07:26 -07:00
Aman Agrawal 2d31b52927 ui_init: Initialize hotkey handlers after other libraries are initialized.
This gives us some time to render and fetch data before allowing
user to start using hotkeys. It avoids error being thrown when
hotkeys are used when the app is still loading.
2022-10-25 11:07:26 -07:00
Lauryn Menard e66f125ee6 recent-topics: Update hash for view to be "#recent".
Updates the hash used for the recent conversations view to be
"#recent" instead of "#recent_topics".

We will need to keep the logic for handling "#recent_topics"
permanently because users potentially have messages from
Welcome Bot with links to that hash.

Including "recent_topics" as a web_public_allowed_hash in
hash_util.js can be changed once self-hosted servers cannot
upgrade directly to Zulip 5.x from the current version.

Fixes #23132.
2022-10-25 11:03:44 -07:00
Tim Abbott 530406e2ef resize: Don't call resize_page_components for new messages.
The resize handler is a somewhat expensive operation, which we'd like
to avoid when processing the receipt of new messages. It's also
unclear why it would be necesssary; bottom_whitespace is fixed in
size, and the sidebars.
2022-10-25 10:53:48 -07:00
Tim Abbott 8d33a62eca message_util: Avoid unnecessary unreads work processing new messages.
It should be very rare to discover new unread messages during a
message_fetch call. This can potentially happen due to races (fetching
just as a new message arrives), but it shouldn't be the common case.

Previously, we would trigger a full rerender of all UI displaying
unread messages every time a bulk message fetch operation returned
(including every time one narrowed), regardless of whether any actual
state had changed.

Fix this by actually checking if we discovered any new unread messages.
2022-10-25 10:53:48 -07:00
Tim Abbott 505a9119ba stream_popover: Remove unnecessary resize call.
There's no reason that opening left sidebar popovers should require
the app to recalculate the size of any of its components; popovers are
drawn on top of the rest of the UI in any case.

This appears to have been added in
9ed05a1f85 as part of prototyping the
left side user list feature.
2022-10-25 10:53:48 -07:00
Tim Abbott 20b357d8d9 popovers: Remove unused show_pm_list_sidebar.
This was likely introduced in error in
fd66d9f70336b2bdbbffb1bf13402516b9920682; it is a duplicate of
show_userlist_sidebar, which, in contrast is actually called.
2022-10-25 10:53:48 -07:00
Tim Abbott 5a83543418 stream_events: Use update_unread_counts API.
Because we can count on the unread.js data structures to be correct,
we no longer need this legacy code that tries to re-process all
messages the client has cached for whether any are present in the
target stream and marked as unread.

It's not clear we need this at all, since the current Zulip server
will mark all messages as read when unsubscribing from a stream, but
having this call protects us from future bugs should that behavior
change.

This cleanup also revealed a possible bug, where we would fail to
update global unread counts properly when unsubscribing from a stream
until the deferred_work queue processor sends us the
update_message_flags event associated with that change.
2022-10-25 10:53:48 -07:00
Tim Abbott 8265bb75cb stream_muting: Call the update_unread_counts directly.
The previous invocation message_util.do_unread_count_updates dates
from a time when `unread.js` did have any data beyond what full
message objects were present in the client, and thus we needed to
recalculate everything from those message objects when muting state
was changed.

With the modern unread.js data structures, all that's required is a
full recalculation/rerender via this function.
2022-10-25 10:53:48 -07:00
Sahil Batra b4eddad9a5 people: Use names in PM urls instead of emails.
We change the "pm-with" and "sender" narrow urls
to be of "{user-id}-{encoded_name}" form instead
of using email. This change improves performance
of changing between PM views since parseOneAddress
function was slow and we remove its usage now by
using name instead of email.

The name is encoded such that the characters that
would be encoded by the browsers are replaced by
"-".
2022-10-25 10:42:00 -07:00
Rishant Rokaha a9893fb654
settings: Add confirmation modal for reactivating a bot in personal settings.
There's already a similar modal in organization settings, so this improves 
the consistency of the UI.

Fixes #23281.
2022-10-25 10:39:16 -07:00
Tim Abbott 3d2a3f2593 popovers: Avoid focus outline on \vdots when actions popover is open.
Now that we show the \vdots icon while the actions popover is open,
there's a weird looking behavior where a focus outline appears around
the \vdots icon, only if you clicked on the icon itself, not its
square containing click arrow.

Disable this unintended behavior, which disrupts the otherwise
simulated state where focus is in the popover (but no row is focused).
2022-10-24 10:47:56 -07:00
Eyuel Berga Woldemichael 1e4e0a8155 message feed UI: Remove redundant color declaration.
The color for the message control buttons is set in the
`message_control_button` class. The `reaction_button_visible` class
also sets a color declaration with the same value.

This commit removes this declaration because it doesn't change the
color of the reaction icon(the class is currently only used in
conjunction with `message_control_button` to toggle the button
visibility) nor does it override any inherited  style (hover color
remains the same regardless) as it lacks an `!important` rule.
2022-10-24 10:29:23 -07:00
Eyuel Berga Woldemichael c8cfef0581 left-sidebar: Show the 3-dots icon when the menu is selected.
This commit fixes the issue where the 3-dots menu icons on the left
sidebar disappear even though the associated popover is open by
toggling a special CSS class on the menu item. It follows the same
approach used by the emoji picker on the message feed UI.

Fixes  #23157
2022-10-24 10:29:23 -07:00
Eyuel Berga Woldemichael 019ff29daf message feed: Show the 3-dots icon while actions popover is open.
This commit enables the 3-dot menu to be visible while the associated
actions popover is open using the fact that the 'has_actions_popover'
class is attached to the message with an open popover. This approach
solves the bug without any additional JavaScript code.

Fixes part of #23157
2022-10-24 10:29:23 -07:00
Aman Agrawal 12d42320ff recent_topics_ui: Allow unread count click in PM row to mark row as read.
Fixes #23261

We now send user to next column after marking a row read. Added a
bit of bottom padding below unread count indicator.
2022-10-24 10:25:21 -07:00
Aman Agrawal 74a97ab398 unread_ops: Add function to mark PM threads as read.
This will be used recent topics to mark PM rows as read.
2022-10-24 10:25:18 -07:00
Aman Agrawal ae5be12540 recent_topics_ui: Extend check for unread to PMs.
Since we also have PMs now, `has_unread` should consider that case
too. This seems like a good change regardless.
2022-10-24 10:23:20 -07:00
Aman Agrawal eb45b8ab70 unread: Rename function name for clarity.
Renamed num_unread_for_person to num_unread_for_user_ids_string.
2022-10-24 10:23:20 -07:00
Aman Agrawal 284c86212c unread: Rename function name for clarity.
Renamed get_msg_ids_for_person to get_msg_ids_for_user_ids_string.
2022-10-24 10:23:20 -07:00
Aman Agrawal 4bc80c30e7 recent_topics_ui: Correct column number of read and mute row. 2022-10-24 10:23:20 -07:00
Ganesh Pawar 914712beab realm_domains: Populate the table only if the modal is open.
Fixes #23315.
2022-10-23 20:38:37 -07:00
Sahil Batra 594eed646a message_edit: Add comment for currently_echoing_messages check. 2022-10-23 20:38:05 -07:00
Sahil Batra 48e31e24fa message_edit: Do not allow moving locally echoed or failed messages.
We should not show UI for moving locally echoed or failed messages.

For the edit/move icon in message controls -
- After 2451002, we showed "Move message" icon for locally echoed
messages when moving messages was allowed as per org permissions.
This was clearly a bug and this commit fixes it and we instead
show "View source" icon.

For "m" hotkey -
- After 2451002, pressing "m" opened "Move messages" modal for
locally echoed messages when moving messages was allowed as per
org permissions. This was clearly a bug and this commit fixes it
and pressing "m" does nothing.

For pencil icon in recipient header -
- Previously, the pencil icon was showed even if first message
below the recipient bar was locally echoed and the topic edit
failed silently with locally echoed or failed messages again
showing under old topic after reload. This commit fixes it
to hide the icon in such cases. The original behavior was
that server returned an error with not so appropriate
response.
- Note that we can only check the first message below the header
since it will be inefficient to check all the messages whether
each of them is successfully sent.
And in such cases when any of the later messages is locally
echoed, the topic edit succeeds but the locally echoed or failed
messages are shown under old topic after reload.
- The behavior is same for the "checkmark" icon for resolving
topics in the header.

For three-dot message menu -
- We don't need to do anything here since the three-dot icon
is not shown for locally echoed or failed messages.

For the "Move topic" option in topic popover in left sidebar -
- We cannot do anything here since it will be inefficient
to check all messages in the topic whether they are locally
echoed or not everytime we open the popover.
- If the first message in topic is locally echoed or a failed
message, then the id of first message of the topic returned
from server is undefined and we see an error in client while
trying to get message from that id. And if one or multiple of
the later messages is locally echoed, then only successful and
server-acked messages are moved.

Note that this cannot handle all cases like a user can use
a successfully sent message to access the topic edit UI
and then choose "change_all" and "change_later" propagate
modes. In such cases the locally echoed and failed messages
will remain in the old topic only.
2022-10-23 20:38:05 -07:00
Sahil Batra 9d2e8aef6d ui_init: Fix condition in message_hover.
The message_hover function in ui_init.js had an if condition
to return early when is_topic_editable was false. We instead
change it to return early when message.sent_by_me is false
since in that case the edit_content element is not present.
Note that we also show the "View source" icon when message
is locally echoed or not sent successfully.

Till now is_topic_editable is always true when message is sent
by the user itself, and when message is sent by someone else
the edit_content element does not exist in the DOM anyway. So,
basically, it just helps in returing early and not unnecessarily
move forward to set html for a non-existent div. So, we can
ideally replace it with just `sent_by_me` condition and otherwise
we already show the reaction icon.

The comment above that also mentioned that "locally echoed messages
have !is_topic_editable" which is not true since is_topic_editable
does not check whether the message is locally-echoed or not. This
comment was added in e1c4c7b80.

This also fixes the bug where "View source" icon is not shown when
"message.sent_by_me" is true and both editing and moving message
is not allowed which currently happens when allow_message_editing
setting is False.

Also, the "is_topic_editable" condition will be not valid in future
when "is_topic_editable" can be false when "sent_by_me" is true. In
such cases we would not show any icon then, so better to fix this
here.

Some history of this code-
- Intially we returned only when !sent_by_me was false, but added
a condition to return early when realm_allow_community_topic_editing
was false in 91197fa4f1. Though it was not needed since edit_content
element amyways did not existed when `sent_by_me` was false.
- Then the condition was then changed to return early if
is_topic_editable was false in 689c717284.
2022-10-23 20:38:05 -07:00
Sahil Batra a023c0bdd5 message_edit: Extract function to check whether message is valid.
We do not allow sending messages where sending request had failed
or message is locally echoed. This commit extracts these checks
to a new function so that we can avoid duplicating code.
2022-10-23 20:38:05 -07:00
Sahil Batra 0b08893147 message_edit: Remove unnecessary comment.
This comment is not required now since topic and
stream editing is not allowed from this UI now
and is instead done from a modal.
2022-10-23 20:38:05 -07:00
evykassirer aebdf6af8c drafts: Fix topic update logic handling of incomplete drafts.
This fixes a couple significant issues with the drafts logic:
* Previously, we would move drafts even when !going_forward_change; this
  is inconsistent with the compose box logic on the previous line.
* The drafts.rename_topic() function did not handle drafts with
  incomplete stream/topic fields correctly, throwing an exception in
  that case; this resulted in user-visible live update problems
  because code after the drafts.rename_topic call would not be
  executed.
2022-10-21 15:33:03 -07:00
Akarsh Jain 9e74f9f1ce message_edit: Fix vertical alignment of input area in /me messages.
Fixes #23101.
2022-10-21 12:16:15 -07:00
Akarsh Jain 3d4a2eb468 message_feed: Fix alignment of EDITED notices in /me message.
Fixes part of #23101.
2022-10-21 12:15:52 -07:00
Akarsh Jain 065f5413ae message_feed: Fix /me message alignment of message actions.
These were apparently no longer aligned with the timestamp.

Fixes #23101.
2022-10-21 12:15:16 -07:00
Lauryn Menard c9044f7acd recent-topics: Rename to "Recent conversations" in web-app and docs.
Replaces instances of "recent topics" in the web-app and documentation
to be "recent conversations".

Renames both `recent-topics.md` files in the help center to be
`recent-conversations.md` and updates/redirects links to new URL.

Does not update instances of "recent topics" in frontend code comments
and does not update the main overview changelog, for now.

Does not change case study text where "recent topics" was referenced
in a quote, but does change generic text references to be "recent
conversations".
2022-10-21 10:28:19 -07:00
Aman Agrawal 1267dce027 navbar: Add login and signup buttons for spectators.
Remove login buttons from right sidebar and add them to navbar
so that the user instantly notices them.
2022-10-21 10:10:40 -07:00
Julia Bichler 91d86a8a6f stream-create: Use simplebar.
This changes the stream creation form so that it uses simplebar
instead of the native scroll bar.

resolves #21307
2022-10-20 17:54:46 -07:00
Tim Abbott 6266954229 user_profile: Remove stale no-fields CSS class.
Previously, we had some special CSS for the user profile modals in the
case that there were no custom profile fields, to do things like hide
the <hr> divider between the normal profile fields and custom ones.

The design has for some time treated custom profile fields as just
additional profile fields; so there's no longer a need for custom CSS.
2022-10-20 11:19:12 -07:00
sayamsamal aec8ef453c user_profile: Move title and tab switcher to a fixed header.
While going through the full profile of a user, we expect to find
that specific user's in-depth details. Thus, we should have a fixed
title displaying the name at the top of the modal to establish the
connection of the profile data with the user.

We also fix the tab switcher between "Profile/Streams/User groups" to
the top of the modal, for the added convinience of switching across
the three options at any point of time.
2022-10-20 11:19:02 -07:00
Akarsh Jain b2cf822fc4 settings: Reorganize organization settings sidebar
Fixes: #23233
2022-10-20 10:40:32 -07:00
Yogesh Sirsat b28efaae76 tippy: Wrap overflowing content of tippy tooltips. 2022-10-20 10:35:11 -07:00
Yogesh Sirsat 0b0a8f4659 user_info_popover: Fix overflow of bot owner list item. 2022-10-20 10:35:11 -07:00
Noble Mittal a2f3c1812d stream_settings: Remove extraneous heading from message retention section 2022-10-20 10:27:53 -07:00
Aman Agrawal e3f22a9907 recent_topics: Add mention indicator in row for unread topics.
Fixes #22984

Add an `@` icon in unread topics where user is mentioned.

We track a new set of `stream_id:topic` pairs for the unread mentions
so that recent topics instantly knows if a topic is unread and mentioned
or not.
2022-10-19 16:26:42 -07:00
Tim Abbott 228ec4bde4 unread: Fix recent topics exception when marking as unread.
This simple regression was introduced in
550a32bb20.
2022-10-19 16:26:42 -07:00
Aman Agrawal f2f4bed85c recent_topics: Set focus to first/last row on page up/down at ends.
This change is to match the behaviour of page up/down on messages.
So, If you hit PageUp/Down while there's no additional pace to scroll,
we move the selected topic to the first/last topic as appropriate.
2022-10-19 14:52:54 -07:00
Aman Agrawal eb1c3bc293 recent_topics: Check if at last row before moving down.
This looks a regression from some of the recent additions to
recent topics.
2022-10-19 14:52:54 -07:00
Aman Agrawal 198f31fbea recent_topics_ui: Use topics_widget to get number of current rows.
I think this should be more reliable and faster.
2022-10-19 14:52:54 -07:00
Aman Agrawal ed2ea4c8cc integrations: Increase font size of logo disclaimer.
Increased font size from 11px to 13px. This text was unreadable
on mobile as per Google report at 11px font size.
2022-10-19 12:03:16 -07:00
Sahil Batra b8a70c71f0 popovers: Rename "Move message" option to "Move messages".
This commit renames "Move message" option to "Move messages"
to make it more clear that the user can move multiple messages.
2022-10-19 12:02:22 -07:00
Sahil Batra cde4377789 message_edit: Allow editing "no topic" message from modal in all cases.
Previously, we allowed editing topic of "no topic" message, when other
conditions were not met, only from recipient bar but it is allowed
irrespective of other condtions. This commit fixes it to show the
"Move message" option and icon for "no topic" messages irrespective
of other conditions.
2022-10-19 12:02:22 -07:00
Sahil Batra 2451002e3b popovers: Use can_move_message function.
We can now directly use `can_move_message` function instead
of checking topic and stream edit permission. This helps us
in avoid duplication of code.
2022-10-19 12:02:22 -07:00
Sahil Batra ad3fe2c0db keyboard_shortcuts: Fix description for "e" shortcut.
This commit updates the description for "e" shortcut so
that it at least fits in one line in english.

Fixes #23112.
2022-10-19 12:02:22 -07:00
Sahil Batra 693a36d680 popovers: Add "(e)" shortcut to "View message source" option. 2022-10-19 12:02:22 -07:00
Sahil Batra eed728fb59 hotkey: Use "m" hotkey for moving messages.
Fixes #23113.
2022-10-19 12:02:22 -07:00
Sahil Batra 10668b080e message_edit: Remove NO_LONGER from editability_types.
Previously, NO_LONGER type was just used to display
the text in the bottom-right of message edit form
which we have removed now, so we can remove `NO_LONGER`
type now.
2022-10-19 12:02:22 -07:00
rixant 3c238c7b19 portico: Change deafult width of dropdowns to fit-content.
We seem to override this setting for most of the dropdowns, so this
common CSS only applies to the smaller dropdown shown to logged-in
users, where it was weirdly wide.
2022-10-19 11:59:34 -07:00
David Rosa 64c31b7cb9 help: Rename "Add custom profile fields" -> "Custom profile fields".
Renames the help article on custom profile fields to reflect that
its content is not just about adding fields.

Adds a redirect from the old URL to the new URL and updates internal
links, linking to #add-a-custom-profile-field where appropriate.

Fixes #23170.
2022-10-19 11:58:00 -07:00
Aman Agrawal eec294b257 css: Fix color of filter buttons being changed on hover for spectators.
We don't want the color to change at all on hover since these buttons are
disabled. This only needed a fix for the dark theme.
2022-10-19 06:42:11 -07:00
Aman Agrawal 169f777b36 use_info_popover: Fix long words overflowing out of container.
The text will now break at the overflowing points. A hyphen maybe
inserted but is dependent on language and browser support.
2022-10-18 22:13:04 -07:00
Aman Agrawal a29009b4d9 realm_user_settings: Fix user status with emoji preview.
Fixed to reflect how user status with emoji will be displayed
in the right sidebar.
2022-10-18 22:13:04 -07:00
Aman Agrawal 5a5ec5518c right_sidebar: Fix full name overflowing its container.
User's name with status emoji was overflowing its container,
resulting in overflown text to not be converted into ellipsis
and pushing status emoji out of visible area.
2022-10-18 22:13:04 -07:00
Aman Agrawal 8883b64388 recent_topics: Handle page up/down manually.
Fixes #23078.

Instead of relying on browser, we handle the page up/down keys
to ensure we take care of some rows being hidden due to compose
box and table header.
2022-10-18 17:34:42 -07:00
Joseph Ho 551c6899be
compose: Stop selecting compose box content after topic change.
Previously, the on_topic_change handler for the compose system would
focus the compose box after a topic change, and also select all content in 
the compose box. Selecting that content makes sense if we think the user's
intent is likely to be deleting that content; but there's no clear reason we
should expect that intent, and it's not particularly consistent with our drafts
model to risk accidentally losing partially composed message content this way.

After some discussion, we've concluded that in both cases reaching this code path
(either the previous topic being "" or the compose box content being entry), it'd
be better to skip the `.select()`.

Fixes #23146.
2022-10-18 17:20:52 -07:00
Lauryn Menard 8089910dcb narrow: Update browser title when in a narrow search view.
Sets a default value of "Search results" for complicated narrow search
views and updates logic to use `filter.get_title` as a helper to
generate better titles for some common search views.

Does not update the existing behavior for narrow searches that have
"pm-with" or "group-pm-with" operators.

Note as of this change, the default search title and titles generated
from `filter.get_title` will be translated into the user's preferred
language.

Fixes #22952.
2022-10-18 17:13:51 -07:00
Lauryn Menard 857324a164 filter: Return 'undefined' title for narrows with search operator.
Updates `filter.get_title` to return 'undefined' for any narrow
with a search operator. Previously it would return a title if
the search operator was paired with a common narrow, but those
results were not being used when building the message view
header and will not be used for setting the browser title.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 099acc3c60 narrow: Split out logic for `group-pm-with` in `update_narrow_title`.
Fixes a subtle bug in the browswer title that occured if the user
input a keyword or another vaild search operator before `pm-with`
or `group-pm-with`.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 107fdc8955 narrow: Translate browser title for default views.
Translates browser titles for "All messages" and "Recent topics"
views.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard f3e118f241 filter: Add stream name that was searched for to unknown stream title.
When the narrow/search for a stream is undefined because either the
stream does not exist or the user is not subscribed to the private
stream, format the title that's used in the message view header to
include the stream name that was searched for.

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard 5f42425982 filter: Update default title for `streams:public` narrow.
Updates default title for `streams:public` narrow to be
"Messages in all public streams".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Lauryn Menard c1b430d602 filter: Add titles for messages with alerts and unread messages.
In `filter.get_title`, add cases for the two missing "is" operators,
"alerted" and "unread".

Prep commit for rewriting `update_narrow_title` to use
`filter.get_title` as a helper for setting browser title text.
2022-10-18 17:13:51 -07:00
Aman Agrawal abec99fe0c tippy: Check if reaction still exists in DOM before showing tooltip.
This avoids an error being triggered if `instance.reference` gets
remvoed from the DOM and `rows.get_message_id` is called on it in
`onShow` later.

This is an untested bug fix since I was not able to reproduce
this on live server or locally.
2022-10-18 16:04:55 -07:00
Aman Agrawal 59e7741055 recent_topics: Fix typo.
This was an unintentional change in #20890, which resulted in
reply to topics not working.
2022-10-18 12:26:20 -07:00
Rixant Rokaha 24f344dc40 settings_ui: Change org profile icon to same as custom profile fields. 2022-10-18 08:25:13 -07:00
rixant c15e202155 settings_ui: Change icons in organization settings sidebar. 2022-10-18 08:25:13 -07:00
Alex Vandiver 0fc8c6c16f message_fetch: Switch to exponential backoff with jitter. 2022-10-18 08:20:22 -07:00
Alex Vandiver 3bb13a1f58 message_fetch: Switch to using show_error, which is equivalent. 2022-10-18 08:20:22 -07:00
Alex Vandiver 2d406aa9d0 message_fetch: Improve retry logic for matches_narrow re-checks.
Previously, we retried all failed requests to
`/json/messages/matches_narrow` forever, with a fixed 5s retry.  This
meant infinite retries even on 4xx responses, for instance on invalid
narrows -- and _each_ new message would add another infinite every-5s
retry.

Skip retries on 400 responses, and put an upper limit on the number of
retries.  At the same time, change the retries to be
exponential-backoff with full jitter, to be more responsive in the
event of a one-off failure, and more forgiving in response to a longer
outage.

Failures that exhaust the 5 attempts are silent to the user -- since
this is likely an uncommon edge case (requiring Tornado to be serving
events to the client, Django to be unresponsive, and the client to be
narrowed to a filter it cannot apply locally), and the failure mode is
not bad (it will simply fail to live-update with new matching
messages).

Fixes: #20165.
2022-10-18 08:20:22 -07:00
madrix01 550a32bb20 recent_topics: Add Private message to recent_topics.
This commit adds private messages to the Recent topics view, to make
it an all-encompassing overview of recent activity visible to the user.

We add a filter "Include PM" to toggle whether PMs should be shown in
recent topics.

Fixes #19449.
2022-10-17 15:02:01 -07:00
Lauryn Menard a3f6220fe4 analytics: Add summary statistic for guest users in realm.
Adds the count of users with the role of guest to the stats view
`page_params` via a database query. This information is then added
to the summary statistics section of the analytics page after being
formatted by `stats.js`.

Creates Bassanio as a guest user in the database for the analytics
realm.

Fixes #20162.
2022-10-17 11:53:59 -07:00
Aman Agrawal a351d34462 portico_signin: Fix signup text overflowing to icon in Russian.
This is not the right fix for this, but a temporary adjustment
to make it look good with minimal impact on other languages and
other pages.

Right fix would require changing the structure of the button, which
was not easy to do and make it look similar to how it looks now.
2022-10-17 11:09:16 -07:00
Sahil Batra cebf43903c settings: Fix height of left sidebar for short screens.
It was not possible to scroll to the bottom of the list on
narrow-width when only single column was displayed on the
settings overlay. This commit fixes the height of the sidebar
and set to "100% - height of header - height of tab-container"
which fixes the scroll behavior.

This is not a issue for two-column overlay where height is set
to "100% - height of header" (the tab-container is already
inside the header).

This duplicates some CSS to avoid using "!important". While doing
this duplication, we remove "margin: 0" and "display: block" since
these are already set as default values.

Fixes #22876.
2022-10-16 19:16:53 -07:00
evykassirer 84aeb3a59a compose: Use consistent hover color for buttons in dark mode.
There is some old CSS that was only being applied to some buttons
and not others. This deletes those lines so that only the opacity
changes on hover and not also the color.

Following up from #23059.
2022-10-16 19:05:25 -07:00
Yogesh Sirsat e0838ecf93 user_info_popover: Change text of "View private messages to myself". 2022-10-14 13:08:34 -07:00
Mateusz Mandera 9ee7ed7ce3 portico_signin: Tweak .alert to add a bit of bottom space.
That looks a bit better with extra space.
2022-10-14 13:07:58 -07:00
Lauryn Menard 171da34546 events: Send empty list for custom_profile_fields in spectator view.
Send an empty list of `custom_profile_fields` in `page_params` for
spectators, rather than not sending the field at all.

Also, updates the user info popover to not show the manage user
three-dot menu when in a spectator view.
2022-10-14 13:05:35 -07:00
Ganesh Pawar 4df8c6610f gear menu: Add organization info.
Fixes #22205
2022-10-13 23:45:25 -07:00
Sahil Batra de257d434f settings: Set min width of role column.
We set minimum width for role column in users list,
deactivated users list and bots list such that role
value always fits in one line.

Fixes #23218.
2022-10-13 10:05:20 -07:00
Tim Abbott ad90157ec0 Revert "modal: Make the modal content scrollable instead of the whole modal."
This reverts commit c439b9d3af.
2022-10-12 17:20:33 -07:00
Tim Abbott eb60e30c9a Revert "modals: Add `data-simplebar` to `login` and `api key` modal."
This reverts commit 4c32972274.
2022-10-12 17:20:33 -07:00
Julia Bichler 97fd4436da stream settings: Show stream header in narrow view.
This changes the streams overlay so that the header with the stream name or
with 'Create stream' is also visible in a narrow window.

Resolves #22963
2022-10-12 17:01:04 -07:00
Sahil Batra 6b59c3242d settings_panel_menu: Open first section if hash is invalid.
When trying to open settings overlay with invalid hash or
hash of a section which the user cannot view, for example
non-admins cannot view custom profile field section, then
we open the first section by default.

While if a user changes to a invalid hash by typing when
the overlay is already opened, then the previous section
remains open.

Fixes #23163.
2022-10-12 11:07:28 -07:00
Sahil Batra 6867235011 message_edit: Show error, if any, in move topic modal itself. 2022-10-12 10:50:05 -07:00