Calling settings_data.user_can_access_all_other_users on every call to
this function could be expensive when using this function in loops
over every user in the organization.
After the previous commit, those calls are still somewhat expensive
for guest users.
This fixes an important issue where this function being called in a
loop can consume as much as 1ms per iteration for users who are in a
lot of groups.
This commit removes the deprecated `keypress` event.
Now, we use the `keydown` event.
Earlier, we used `keypress` because it allowed us to distinguish
between lowercase and uppercase characters using `event.which`.
For example:
* For 'r':
* keypress.which = 114
* keydown.which = 82
* For 'R':
* keypress.which = 82
* keydown.which = 82
As shown, `keydown.which` cannot distinguish between 'r' and 'R',
which is why `keypress` was helpful.
Now, modern browsers support `event.key` on `keydown`, which directly
gives 'r' or 'R' as needed. This makes `keypress` unnecessary, and
we can safely rely on `keydown` with `event.key` to get the exact
character.
An earlier commit in this PR #34825, in which we replaced
the `event.which` with `event.key` plays a major role as a prep
commit to help removing `keypress` event in this commit.
The `keydown` and `keypress` event handlers defined in
`emoji_picker.ts` were using `event.which`, which is deprecated.
This commit makes changes to use `event.key` instead.
With this we introduce selection expansion when
the selection spans across multiple inline expressions
or expressions within mutliple math blocks.
This makes the selection consistent with what is pasted
while also fixing some bugs encountered in cases such as:
1. Focus present in an inline math expression and
anchor present in a different inline math expression
and vice-versa.
2. Focus present in a math block and anchor present
in a different math expression outside that math block
and vice-versa.
3. When selecting expressions within a math block, the
first expression wasn't retained in the past because
of the selection not containing <annotation>.
Fixes#33676.
Also fixes
https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20pasting.20LaTeX/near/2159869
and other related issues.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
This commit adds a "Alphabetize choices" button for SELECT also known as
"List of options" type custom profile fields. The
options themselves can get out of order from either user text input, or
from list modifications like addition or drag.
We follow case-insensitive alphabetization such that "vim" comes before
"VS Code". This is similar to how we alphabetize elsewhere like stream
lists.
Fixes: #28607.
Co-authored-by: Tanmay Kumar <tnmdotkr@gmail.com>
Previously, the placeholder text displayed incorrectly after
applying filters.
This commit refactors `list_widget` to check if combinations of
filters applied, such as role and search filters. It ensures that the
correct placeholder message is displayed.
Fixes: #32971.
In get_raw_unread_data, 1:1 or self messages are added to pm_dict.
However, if a DirectMessageGroup is the recipient, the message is
added to huddle_dict by default.
To keep API compatibility, we override this behavior to populate
pm_dict for 1:1 and self DMs when a DirectMessageGroup exists.
This ensures clients relying on pm_dict continue to work during
and after the migration.
This PR fixes part of issue #25713.
Previously, the export_search command only supported the legacy
Personal recipient type for 1:1 direct messages. With this change,
the command first checks for a DirectMessageGroup for the two users
and uses it if present. If not, we fall back to the legacy logic. This
keeps compatibility as we migrate 1:1 DMs to use DirectMessageGroup.
Earlier, we were appending view all subscribers link using
JQuery.append, which leaves open the possibility for the component to
be appended multiple times if the function calling it gets called
multiple times.
It is better to have the link div in right_sidebar.hbs
and then insert the html when required.
Searching e.g. "NASA" would put "nasa" in the search bar if you
selected "search for NASA" in the typeahead. This probably looks
weird to users, so let's not lowercase search operands.
Previously, the "Forgot password" action was bit difficult to
locate due to its position. This commit adjusts its placement
to enhance discoverability and improve the user experience.
Fixes#33654
Set the inbox search input width to 100% to prevent overflow on small
devices. This Ensures the search box stays within its container for a cleaner
layout. Setting the element's width to 100% overrides the default width.
When the override-topic checkbox becomes checked, and the topic-input
gets its "hide" class removed, place the cursor inside the textbox.
Close the stream dropdown before processing the selected option, to
prevent it overriding the focus.
Previously, deleting drafts was too easy, which could result in
accidentally losing important information.
This commit adds a green confirmation banner showing "N drafts were
deleted" and "Undo" button to restore deleted drafts.
Fixes: #32995.
This commit laying the groundwork for dynamic re-rendering of
drafts.
Previously, the draft list was rendered once with the overlay,
and re-rendering wasn't needed. However, to support features like
"undo," we now need to re-render the draft list dynamically.
This commit splits `setup_bulk_actions_handlers` from
`setup_event_handlers` as prep for drafts undo functionality.
By isolating bulk actions, it reduces redundancy when reusing
`setup_event_handlers` for re-rendering after undoing deletions.
Previously, these functions were nested inside `launch`, limiting their
accessibility. This commit moves them outside, making them accessible
for draft restoration in the draft undo feature.
4ab77e519b trimmed the msgid for translation blocks in templates;
however, this marked the translations as "fuzzy", which makes them not
used by gettext, by default.
For all "fuzzy" translations where the recorded previous `msgid`
differs from the current one only by the trimming normalization,
perform the same normalization on the `msgstr` and mark the string as
non-fuzzy, allowing it to be used.
It was reported that there was no option to mark messages as read
when only unread messages in muted streams and topics remained.
This happened because the logic to show or hide the sidebar menu
icon relied solely on the home view count, which excludes unread
messages in muted streams and topics.
This commit fixes the issue by including the count of unread
messages in muted streams and topics when determining whether to
show or hide the sidebar menu icon.
Fixes: #34682