This was introduced in #28767 with the intention to skip scrolling
the selected message.
So, the actual bug that the PR fixed would have been just fixed
by opening the compose box early.
(cherry picked from commit aa76919ddb)
The update_selection function name was rather misleading, since that
function call is in fact what renders the message list object for the
view.
Also add comments about a few subtle/confusing details that I noticed
while debugging this code path today.
(cherry picked from commit 61ff8f2bef)
As discussed in the new comments, we had a bug where the
system-initiated animated scroll that happens when the compose box
opens as a result of narrowing would race with the internal
rerendering that occurs when the message_fetch request asking the
server for additional data returns.
The correct fix for this is just to open the compose box, if we're
going to do so, before setting the user's scroll position in the
narrowing/rendering process.
This ends up being a UI improvement (in that the compose box is
available for typing a bit earlier) as well as avoiding both the risk
of this race as well as the bad UX of adjusting the user's scroll
position multiple times as part of entering the view.
This does not address an as-yet-unknown bug wherein the animated
scroll that occurs when opening the compose box, when racing with a
background rerender, results in a bogus ending scroll position, though
it's easy to see how that might occur given that rerendering does
clear the DOM briefly.
(cherry picked from commit 4e2a282a1b)
There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.
This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.
(cherry picked from commit c6be850fb9)
This commit fixes the bug in browser back button behavior when
opening the groups overlay from gear menu. The bug was caused
due to browser history containing both "#groups" and "#groups/your"
entries, which essentially resulted in a "#groups/your" -> "#groups"
-> "#groups/your" cycle and thus nothing happend on clicking
browser back button.
The case for a user manually typing "#groups" url would be handled
in next commit.
(cherry picked from commit eced3d9d6a)
The behavior to replace existing message content was leftover code
from a previous version of the mechanism, and not intended.
(cherry picked from commit 85ee5255bc)
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.
(cherry picked from commit 60afdc45eb)
Earlier, the tests for compose formatting were verbose, hard to read as
well as extend, and overly granular, without even having the ability to
test the final text selection or the cursor position.
Now, new test helpers, `init_textarea_state` and `get_textarea_state`,
have been added, enabling the tests to be more concise and readable,
while also being more powerful. A representative string alone now
describes the textarea state (the text and the selection / cursor),
making each test case as easy as defining the initial state as a string
and comparing the expected state post formatting with another string.
These new tests helped surface a couple bugs which have been fixed in
preceding commits.
(cherry picked from commit 179e9374b4)
In cases where either the description or the URL, or both were empty,
there would be an unneeded space, originally intended to space out the
description and URL, lingering even when the description and/or URL was
missing. The resulting highlight would also be off at times.
Now we only add in a space if both the description and URL are present,
and the highlight too is as intended.
(cherry picked from commit a5889bc3af)
Earlier, when a selection not starting at the beginning of a line was
formatted as a spoiler, the spoiler would not start on a new line, and
so would not be rendered as a spoiler. The `Header` highlighting too
was off by one character.
Now, the spoiler starts on a new line, and the `Header` highlighting
works as expected too.
(cherry picked from commit c46375f6fc)
use flex display justify-content for vertical alignment
instead of using offsets like "top". for horizontal
alignment of smiley-icon use text-align center.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
(cherry picked from commit c1b8e45216)
When you click "Plan management", the desktop app opens
/self-hosted-billing/ in your browser immediately. So that works badly
if you're already logged into another account in the browser, since that
session will be used and it may be for a different user account than in
the desktop app, causing unintended behavior.
The solution is to replace the on click behavior for "Plan management"
in the desktop app case, to instead make a request to a new endpoint
/json/self-hosted-billing, which provides the billing access url in a
json response. The desktop app takes that URL and window.open()s it (in
the browser). And so a remote billing session for the intended user will
be obtained.
This commit fixes "Automatically follow topics where I'm mentioned"
setting label click functionality so that the setting is toggled
on clicking the label .
(cherry picked from commit 1c286a6835)
We previously allowed adding pills for inaccessible user by typing
the email manually. This commit updates it to handle inaccessible
users like we handle invalid emails.
(cherry picked from commit 9197a2c3e2)
Now we clear the stream id from the compose state on opening the stream
selection dropdown when no stream is specified.
This fixes the bug where the compose box placeholder text would refer to
the previously selected stream, even when the open stream dropdown had
no stream selected.
(cherry picked from commit 48d0d49fde)
We now do not remove the user group row immediately from "Your groups"
panel when user is removed from the group, if the user can join that
group again by themselves. This makes the behavior similar to what
we have for streams.
(cherry picked from commit 377df9e4db)
This commit fixes the bug about not showing the tooltip about push
notifications not being enabled on the server on checkbox in stream
specific notification row.
(cherry picked from commit 415fb2014b)
We previously showed tooltips about push notifictions not being
enabled on server on the checkboxes in "Notification triggers"
section incorrectly when server had push notifications enabled.
This bug was present as realm_push_notifications_enabled was
not passed to the template correctly. This commit fixes it by
instead using "is_disabled" in the "if" condition as we only
expect it to be true when push notifications are not enabled
on server.
(cherry picked from commit 99f29983a1)
This fixes a bug in #26717 where the hash would flash to #personal
before #subscribers. Sometimes `setup_toggler` is called after
the hash change, and it needs to know which tab to show.
Ideally in the future we'd clean up this code so that the hash
changing function isn't called multiple times.
Some files already were using `noop` in place of `() => {}`.
It's both clearer what it means and is easier to type.
This updates all test files to fully use `noop`, and
adds a shared import from the test lib file.
Also avoid prompting for full name time more than once.
Adds TOS version field to Remote server user.
Co-authored-by: Karl Stolley <karl@zulip.com>
Co-authored-by: Aman Agrawal <amanagr@zulip.com>
Currently, given that the compose box is already open, it stays open
when the user navigates to the inbox/recent view, even when there is
no modifications to the message or recipients.
This commit adds conditions to close the compose box when navigating
to the inbox/recent view, except when we can reasonably infer that it
was the intended action.