This commit breaks the trivial import cycle between `input_pill` and
`compose_recipient.js` by manually triggering an on-change event when we remove
a pill which makes sure to run the `update_on_recipient_change` as
the event callback without us having to import it inside `input_pill`
and manually calling it.
Fixes: #25022
Refactored `payload` object such that when we migrate this module to typescript,
we will not have to write an incomplete type definition for this object.
This is a prep commit for preparing this module for typescript
migration. We should consistently use `.bind` and bind the funcs
in the final prototype correctly.
Documents narrows now have support for new filters for direct messages:
`is:dm`, `dm`, and `dm-including`. Also documents that `is:private`,
`pm-with` and `group-pm-with` are now legacy aliases for these three
new filters respectively.
Note that API documentation references the help center documentation
for search/narrow filters.
Fixes#24806.
Adds support in the web app for `dm-including` operator.
This will deprecate the `group-pm-with` operator, but any changes
to that narrow operator will be in a separate commit since it
returns a different message query. The `group-pm-with` operator
only returned group direct messages, while the new `dm-including`
operator returns both group and 1-on-1 direct messages.
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
In a previous commit, the frontend of the web app was updated for
URLs with `#narrow/dm/...` for direct messages (group and 1-on-1).
Updates the URLs generated for email notifications and outgoing
webhook notification messages to use the new `/dm/...` format.
Adds support in the web app for `dm` operator. This will deprecate
the `pm-with` operator, but existing links/URLs are still supported
for backwards-compatilibity.
This commit updates the web app default behaviors to default to
the new narrow/URLs `dm/...` and `/#narrow/dm/...` when navigating
and searching in the app.
There is some general clean up of references to private messages
or PMs to be either direct messages or DMs in these changes.
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
Adds support in the web app for `is` operator with the `dm` operand.
This will deprecate the `is` operator with the `private` operand,
but we keep support for backwards-compatibility with links/URLs.
This commit updates the web app default behaviors to default to
the new narrow/URLs `is:dm` and `/#narrow/is/dm` when navigating
and searching in the app.
There is some general clean up of references to private messages
or PMs to be either direct messages or DMs in these changes.
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
Adds backend support for `dm-including` operator. This will
deprecate the `group-pm-with` operator, but we keep support
for backwards-compatibility.
For testing updates, because the messages returned by these
two operators are different, most of the tests for `group-pm-with`
remain unchanged, but added comments about deprecated state.
Also, cleans up remaining instance of "PM" in `narrow.py` to
be "DM".
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
Adds backend support for `dm` operator. This will deprecate the
`pm-with` operator, but we keep support for backwards-compatibility.
For testing updates, updates the existing tests for `pm-with` to
use `dm`, and adds one basic test for `pm-with` in the `add_term`
tests as the two operators refer to the same `by_*` method.
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
Adds backend support for `is` operator with the `dm` operand. This
will deprecate the `is` operator with the `private` operand, but we
keep support for backwards-compatibility.
Note that there is some clean up of references to private messages
in the updated backend test. In commit 43ec7ed, the documentation
for `build_narrow_filter` wasn't updated for the rename of
`BuildNarrowFilterTest` to `NarrowLibraryTest`, so that's also
corrected in these changes.
The general API changelog and documentation updates will be done
in a final commit in the series of commits that adds support for
the various new direct message narrows.
Incresase the max number of conversations shown when not zoomed
into the direct messages in the left sidebar to be 8 when there
are no unread conversations and 15 when there are unread
conversations.
Adds the `account-creation` class to `<div>` tag in template so that
the associated CSS styles for `white-box p:last-of-type` and the
font-weight are applied.
This commit changes the assignee info to the correct one.
Earlier, the current assignee info of the issue was used
to create the message but when an issue was unassigned
this would give incorrect information if there are still
assignees left on the issue. Now, it uses the details of
the user who has been unassigned from the issue.
This commit removes the description from the Issue Assigned
event message that is sent by the Github Integration.
Previously when an issue was assigned, the message also had the
description of the issue, which is redundant as the description
has been already sent through the issue created event. After
this commit, the description no longer appears in the message.
Fixes#24554
When search bar is empty and we've reached that state
by using the `backspace` key. There are no suggestions
as there are when you select an empty search bar.
The cause of this was an explicit prevention of this
suggestion box in `typeahead.js` so that the
`backspace` key is free to interact with the other
elements.
The fix here is to add an optional `hideOnEmpty` option
so that if we want this suggestion box to appear we can
set this option to `false` and this behavior will be
prevented.
This option is enabled for the search input when pills are not
enabled.
Fixes: #25062.
Previously the typeahead container was being created at the bottom
of `body`, and its width (and `top` and `left`) were being set to
move it to the right position.
Now it sits in the search box container, which gives it the correct
position and width by default. This is better for DOM readability,
and is also better for the new 100% width (which is part of the
search bar redesign) because it can change width more smoothly
with the search bar when the page changes width.
This commit adds custom functionality to the bootstrap typeahead
to allow the typehead to be placed in the search box container
(whereas previously, it could only be appended to `body`).
Until now, the typeahead was hidden on clicking outside only if the last
click was not on the header. This happened because clicking the header would
blur the input, and any other click then would not trigger the blur event
(which is responsible for hiding the typeahead).
Now we refocus the input after clicking the header, so that clicking
elsewhere blurs the input and hides the typeahead.
This commit make changes in create stream panel by moving
announce stream option below stream description and adds a
"Stream permissions" section heading just above
"Who can access the stream?" and also rewords the text
"Announce stream".
Also now announce stream option is only shown if the user creating
stream have access to the announcement stream name. When option
is not shown, default behaviour is to announce public and
web-public streams.
Fixes#23327.
Modal that were used as dialog boxes for editing info
had issues with long heading text int .modal__title,
This commit add word-break to break words and avoid
abrupt ui in such cases.
This commit does following improvements in #streams and #groups overlay.
* Adds word break in the title in the right pane to handle long stream
and group names.
* Fix positioning of edit (pencil) button to the right end and provide
maximum available space for stream/group name.
Co-authored-by: Hardik Dharmani <Ddharmani99@gmail.com>
Previously, when adding a task to a /todo list, after pressing "Add
task", the cursor would move to the "Description" field, which is
not the desired behavior. This commit fixes this issue by ensuring
that the cursor moves to the "New task" field after a task is created.
The core bug was introduced in
68dcdcd28e, which added the incorrect
.focus().
Also tighten the selectors while we're at it.
Fixes#25064.
This commit fixes the text overflow bug for pill values by adding a
maximum width of 100% for the pill along with the ellipsis property on
text overflow.
Fixes: #21807.
If a user is editing a message or viewing the message source, they'll notice that clicking on the messsage doesn't move the blue box to it while the keyboard works just fine. We want to allow the message to be selected while not triggering the reply function.
As a follow up to #24309, we want to add a new tab with desktop/web
instructionsto the "Configure whether messages are automatically marked as
read" section.The paragraph has also been tweaked to accommodate the new
feature.
Local storage is an untyped interface external to the frontend code
itself. The `data` field after `JSON.parse`'d from `raw_data` can be
further validated using `zod`'s schema `formDataSchema`.
The test case `server_upgrade_alert hide_duration_expired` in
`navbar_alerts.test.js` has a bug at `start_time`, which is fixed in
this commit. `start_time` is a mock value of `Date.now()` used in
`localstorage.ts`, which will concatenate with a number `expires`.
So `start_time` was supposed to be an integer value. Before fix, `new
Date(1620327447050)` returns a `Date` object which is wrongly
concatenated with `expires`.
Fixes#24997.
Added function parameter types, return type, and types of local
varaibles. Added a `null` check for `raw_data` before `JSON.parse`.
Created a type `FormData` and an export type `LocalStorage` to
imporve conciseness and clearity.
Type `LocalStorage` is exported because it might be used in other
files based on an observation that many files have imported `localstorage`.
This commit converts the dynamic closed_compose_box
tooltip to template-based tippy.js tooltips. The functions in
the compose_closed_ui.js file are refactored to dynamically change
the 'data-tooltip-template-id' attribute according to the situation.
The title parameter is removed from the functions in
compose_closed_ui.js so that we can change the tooltip within the
caller functions themselves, according to the situation. Since there
is no way to match the title in existing functions with different
languages to change the tooltip attribute dynamically, it is better
to change the tooltip attribute within the caller function according
to the situation, rather than passing the title as a parameter.
In the case of the reply button, we disable it when direct messages
are not allowed. However, tippy.js tooltips do not appear in the
case of disabled elements, so we have to use the container element
around it to show the tooltip. This approach is used in the case of
the reply button, where the span element wraps the button.
We used to have two titles for the reply button: one is the usual
'Reply to selected message', and the other is for the disabled state.
However, in the case of recent conversations, it makes more sense
to have a new tooltip title: 'Reply to selected conversation'.
To ensure that the tooltip content changes dynamically, it is
required to destroy the tooltip instance and then reinitialize it
every time.
Fixes: #25096
If there are unread_mentions in unmuted topic in muted stream then,
show `.subscription_block unread_mention` in regular font not faded.
An additional parameter is passed to the update_count_in_dom function
to add or remove the "has-unmuted-mentions" class from the
.subscription_block, allowing for the relevant CSS to be applied to
display the unread mentions in regular font.
Fixes part of #24243.
This commit implements a new logic to display unread messages count
in muted streams. If there are any unread messages in unmuted topics
within a muted stream, the unread counter for the stream will display
the total count of all the unread messages in the unmuted topics.
The counter will be shown in regular font (not faded).
Fixes part of #24243.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
Add class unmuted_topic to li.bottom_left_row element if topic is
unmuted. Add relevant CSS for .unmuted_topic to display unmuted
topics in regular font.
Fixes part of #24243.
Previously, muted streams in the left sidebar were faded using
opacity: 0.5, and on hover, the opacity was increased to 0.75.
This opacity was applied to all elements within the muted stream,
including the stream-privacy icon, names of the stream and topics
within, and the unread_count.
In this PR, we changed this behavior to handle opacity for each
element separately. We changed the opacity of the stream-privacy icon
and unread_count, while for the text (names of stream and topics),
we changed the alpha factor for the hsla color property.
The reason for this change is that we can have different opacity levels
for the unread_count and other elements. This will allow us to add
feature in next commits in this PR to set the opacity of unread_count
to 1 while keeping it at 0.5/0.75 for other elements in the case of
muted streams with unread messages in unmuted topics.
Fixes part of #24243
We should trigger click event to open up the dropdown popup instead of using
`.dropdown("toggle")` because we want to clear the search state when opening up
the popup and the logic for that is registered in `on-click` handler defined in
`dropdown_list_widget`.
Fixes: #25218