This introduces a function that checks for both the existence and the
expiration of the `selected_send_later_timestamp`.
The logic it supports prevents users from scheduling a message to send
in the past or less than five minutes into the future at the level of
the UI (specifically the popover on the \vdots component of the Send
button). That can happen if a user attempts to edit a previously
scheduled message.
Fixes#25439.
In the "mentions" test, an additional unread message with the type
"private" and directly mentioning me has been added. This test case
checks for the scenario when the stream_id is null during the
reverse_lookup, which would have caused the test to fail before the
bug fix was implemented which now passes after the fix is applied.
This commit ensures that user-locale and 24-hour preferences are
respected in the message-scheduling modal. It also simplifies the
translation of text strings in the scheduling modal.
Available scheduling options and their time values, including whether
the options are allowed, are now calculated every time a user opens
the scheduling modal.
In order to achieve those things, additional interrelated fixes here
accomplish the following:
1. Modal-scheduling opts now have data- attributes containing
timestamps for the time a message will be scheduled to send.
2. With those timestamps in place, the logic for setting the
scheduled send-time is simplified.
3. There are no more `send_later_xxx` global variables in the
`schedule_send` module.
Fixes#25403.
This commit extracts date-based logic from the popover menu file and
puts it in with the scheduled-messages logic.
The aim is for greater testability, with some initial tests now
presented on the date-based logic.
This function will allow us to adjust the codebase to write what it
means semantically -- whether a check is for the message list being
visibly empty, or completely empty.
In this commit, we leave the .empty() method incorrect, because
several other adjustments need to be made atomically with fixing it.
Apparently some past refactor caused the animation for new mentions to
be triggered when initialization the app.
(This seems pretty clearly unintentional: A user loading the app
doesn't need their attention specifically drawn to the @-mentions view
in the same way that a user who is using the app and receives a
mention right now does.)
Fixes#24641
When the user clicks on a link which has `stopPropagation`
and doesn't trigger `scroll`, then we don't hide any existing
popovers if the element being clicked doesn't hide popovers
explicitly.
To fix this, we hide all popovers on change in hash which makes sense
on its own given how we use hashes.
This commit introduces structures and logic to hide the Scheduled
messages item from the left sidebar if there are no messages
scheduled to be sent.
Test coverage has been added for counts and visibility, too.
Fixes: #25101
This commit introduces logic to present a message count with the
Scheduled messages item in the left sidebar.
The count is present on the initial load, and is updated as a user
adds or removes scheduled messages.
Previously, the unread banner templates just rendered on the contents of
the unread banner. This works fine if we don't want to make changes towards
the parent/container of the contents.
This change introduces a new container to each unread banner templates and
a rename. Thus, we can make unique styling changes to the unread banners
while also bring the structure closer to how it is for compose banners.
This commit deletes `/fixed-width` and `/fluid-width` slash commands
from the typeahead and also hides the slash commands `/light` and
`/dark` in production.
Fixes#25374.
When all the unread messages in a muted stream are in specifically
muted topics, this ensures that the total unread count for the stream
that the user sees before clicking "more topics" will match the total
unreads number for the stream itself.
This behavior is limited to muted streams, since in a normal / not
muted stream, we don't display a "muted topics only" faded unread
count by the stream's summary line to avoid distracting the user with
it, we match that behavior for the "more topics" line.
We also now display the `@` , again to ensure the stream's summary
line never displays an `@` without some topic row having one.
Earlier, the `s` hotkey just narrowed to the stream of the selected
message (to a topic), while `shift+s` narrowed to the conversation view
(topic / dm) of the selected message.
Now, the `shift+s` hotkey has been removed (but retained for toggling
subscription to a stream when the stream overlay is active), and the `s`
hotkey takes on double duty: if the current view is not topic / dm, it
narrows to that, else when in topic view, it switches to stream view. It
has no effect when in dm view. Documentation has been updated for this
both in the help center, and the in-app `Keyboard shortcuts` menu.
A deprecation notice has been added for `shift+s` as well.
Fixes: #24226.
As discussed in the comment, this resulted in the many inactive users
in chat.zulip.org with "Tim" as their full display name from being
incorrectly prioritized over me in a stream where I've been active;
and this class of problem seems like it will be common in large open
communities.
This reverts a portion of 4dc1b2f812,
with explanatory comments for why this behavior is preferred.
The stream name changes in the original PR remain very helpful.
Separating these concepts allows us to provide a much nicer format for
contexts where ultra-specific clarification is not a priority.
This new variant is currently only used in the scheduled messages UI.
Previously this dropdown was only for selecting streams, but
soon it will also be for switching to a private message. This
name helps it be clearer that the dropdown is more general
purpose.
We refactor the triage function to optionally take in a comparator
function, and use this to sort the results, except any exact match,
which is placed highest. Now we don't need to sort the results of triage
for streams, languages and slash commands since we just pass in the
comparator function. The overall effect is same as before, except that
exact matches are always shown first.
For users, we can't use the new triage feature to achieve this goal
without sorting `rest` and breaking a key optimization, so we just add
a bit of manual code for the job.
Fixes: #25123.
We now show a banner on opening the compose box and changing the
stream in dropdown, if a user is not allowed to post in a stream.
The "Send" button is also disabled if user is not allowed to post
in the stream.
This commit also moved the CSS for disabled modal button in dark
theme below after the other CSS for modals as we are using the
same CSS for the "Send" button as well in disabled state.
This commit moves mainly two functions from `ui.js` to `message_live_update`,
`update_message_in_all_views` and `update_starred_view`. This is done in favor of
eliminating `ui.js` and also these functions are more closely related to
`message_live_update` module than to `ui` module.
We also move `show_message_failed` and `show_failed_message_success` to `echo.js`
for cleaner seperation of responsibilities.
This commit adds code to colorize the stream privacy icons in
dropdown list widget. Both the selected option in button and
options in the menu are colorized as per the stream color.
Fixes#25282.
We add a new banner informing the user if and when they send a message
to a muted topic / stream. It also has a button to unmute the topic.
Fixes: #24246.
This commit refactors show_compose_spinner and hide_compose_spinner
functions to use class of the button instead of ID to select the
appropriate elements such that we can use the same function to show
and hide spinner in "Schedule" button in further commits. For this
purpose, we add a new class compose-submit-button to the "Send"
button and this class will be added to "Schedule" button as well
in the next commit.
This commit renames 'settings_muted_topics.js'
to 'settings_user_topics.js' because the file now
supports the settings for topics with any visibility_policy,
not just MUTED.
It also renames the corresponding test file.
This commit updates the existing 'Muted topics'
settings UI to add support for other visibility
policies.
Changes:
Settings sidebar:
1. Rename 'Muted topics' to 'Topics'.
2. Change icon.
Main panel:
3. Rename 'Muted topics' header to 'Topic settings'.
Topics table:
4. Rename 'Date muted' to 'Date updated'.
5. Update the search bar placeholder text to 'Filter topics'.
6. Drop the 'Actions' column.
7. Add a status column with a dropdown set of options.
(Muted, Unmuted, Default for stream)
Fixes#25081.
This prep commit updates the function
'get_user_topics_for_visibility_policy' to include 'visibility_policy'
as one of the keys in the user_topic objects.
Migrated input_pill subsystem to TypeScript, used generics to make
it a generic module so that it works with different implementations
like stream_pill or user_pill.
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.
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.