We are doing this to avoid annoying behavior, when
"enter sends" is enabled, and the user accidentally hits
"Enter" and has to deal with the error message.
Fixes#19182
We improved it in the following ways:
* Show the error message with the maximum character
limit.
* Disable the send button.
* When the user tries to send the message via hotkeys
i.e, When "Press enter to send" is enabled or the user
uses "Shift" + "Enter" shortcut, Flash the red border
around the compose box.
Also renamed `check_and_set_overflow_text` to
`check_overflow_text` for better clarity.
We use subs as a common variable name for a collection of stream
data structure used in settings, in lot of modules. So this
rename clears a bunch of related shadowed variables.
We move away from a single scrollable page to have a tabs settings
structure instead.
This commit consists of the minimal changes required to set up toggler
component. And the subsequent commits would include all the UI UX
changes required for updating the layouts.
Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
We extract the code for checking night mode setting on
the basis of color_scheme value and using matchMedia when
color_scheme is set to automatic. This is currently used
in rendering the correct logo only.
This is a prep commit for fixing loading indicator not
visible on message-edit button in night-mode.
This commit makes a working toggler in compose_actions that adds the
compose-fullscreen class to the compose that removes the max-height
from the compose textarea and adds flex elements above so that the
height automatically adjust with the device height. This results in
making the compose box full screen sized.
The compose_height.js maintains the state of the height of the compose
box. Also, when the compose box is closed, the compose box is reset to
it's default behaviour and original height. So, everytime user need
not toggle off the compose full size and only for specific message
it is used.
It also adds destroy autosize on compose_height state change.
It destroys the autosize of textarea when the full
screen sized compose box is toggled on. And everytime when it is
turned off, it reinitialises the autosize. This also adds a
condition in autosize_textarea to only autosize when composebox
is not in full height state.
Fixes#17660
This change ensures that we pop up the typeahead when one
has entered just `@`. This will make clear to the user
about the @-mentions feature in Zulip.
This also makes us consistent with expectations from other
chatting apps like Slack, Discord, etc.
Added few test cases and modified the present ones.
Fixes: #19142.
Fix a bug where the compose box cut the message without warning the user
the message pasted was longer than the allowed. It was fixed by stopping
cutting the message off and showing an indicator whenever the limit exceeds
and removing the indicator as soon as message gets less than that.
The cut off for showing the indicator is set as 90% of the limit.
Fixes#15909
Co-authored-by: João Maurício <carvalho.joaomauricio@gmail.com>
Since do_create_realm also creates general and core team streams,
we rename general to verona right after the realm is created. Mostly
because we dont really want two additional streams and this might
probably make it easy to review things.
There are puppeteer test changes because, we have a new "core team"
stream in tests as well as there is a new default notification stream
"Verona". Because of this tests in message-basics for example have
to be changed since the newly added core team affects the order in
which we navigate through the streams using arrow keys.
The extra await for selector was added in subscriptions test to make
the tests wait. Without the await the tests were passing ocassionally
and failing in some other times.
Fixes#6967
Right now, on clicking `quote and reply` on any message, the quoted
message is always inserted at the top of compose-box irrespective of
the current cursor position. Also, after insertion of the quoted
message, the cursor is shifted at the end of the compose box.
This commit changes this behaviour to insertion of quoted message
at the current cursor position with a newline at the end of quote
and moving the cursor position to that newline after insertion.
A newline is added at the beginning of quoted message only if there
was some content already present in compose box before the previous
cursor position.
Tested on Google Chrome and Firefox browsers on Ubuntu dev environment.
Fixes: #16836
This commit renames confirm_dialog_yes_button class to
confirm_dialog_submit_button. This will help in keeping
a general class name when deduplicating the code for
confirm_dialog and edit_fields_modal.
This commit first moves the compose.validate() function out
with the functions that are needed by it. Then one by one
checked for which function is now not needed in compose.js.
This moves all validation related functions out of "compose.js"
to "compose_validate.js".
Splitting compose announce variables out of compose.js.
This commit moves the "user_acknowledged_all_everyone" and
"user_acknowledged_announce" out of compose.js to reduce
cyclic dependency of compose_validate on compose.js.
Moving wildcard mentions to compose_validate.
The wildcard mention settings are mostly used while validating.
Also to reduce the cyclic dependence of compose in
compose_validate, the related wildcard mentions are moved out to
compose_vaidate.js.
This also converts reset_acknowledged functions to set values
by passing values.
We currently have the resolved topics prefix shown as part of
the topic name in the left sidebar. However this causes inconsistency
while showing topic names. Hence this adds support for showing the
prefix in the cutter to the left of the topic name.
Fixes#18989.
The current system to change stream information like Stream name and
description isn't consistent with what we use everywhere else. It's
also slightly difficult to maintain.
Co-authored-by: Pragati Agrawal <pragati22066@gmail.com>
This commit adds a new trigger for compose.start that is
"new private message". It will clear the message recipients
whenever compose.start is called with this trigger.
This solves the bug, when a person is in a PM narrow and
clicks the new private message button, it opens the
composebox with the recipients filled out with whoever
you're narrowed to, rather than opening a new, blank PM.
CZO link for the issue
https://chat.zulip.org/#narrow/stream/9-issues/topic/.22New.20private.20message.22.20isn't/near/1222712
This shortcut now renarrows to an empty topic, rather than to the
stream, as long as the topic input is nonempty.
This was debated in the original implementation of this feature:
https://github.com/zulip/zulip/pull/9511#discussion_r190323319
Having seen the experience in practice, the current behavior is
surprising and we should migrate to the other option originally
considered. In particular, the argument that "narrowing to the stream
would still tell you the topic is empty" turns out to be inaccurate,
since the history within the stream may not be in the most recent
messages in the stream.
Fixes#19122.
I also remove a conditional here that's not necessary. For
anything that's obviously a template in static/templates,
we now create a stub implementation that behaves according
to whether we're stubbed or being included as a partial.
d779a1c tweaked `get_full_datetime` to return a string instead
of a {date, time} object. This function is used for recent topics
too but wasn't fixed to use the string.
This resulted in showing 'undefined undefined' in tooltip.
Previously, we showed a `Copied!` alert on copying link to a message
irrespective of the fact that the link was copied or not.
Hence add an event listener that shows the `Copied!` tooltip only
if the action was successful.
Fixes#19019.
We separate "Your account" section to two different sections -
"Profile" section for user name, custom profile fields, and avatar
and "Account & Security" section for email, password, role, api-key
and deactivating button.
Another important change here is that the modal for changing name
is removed and now the name has a simple input text box and it
behaves similar to inputs for custom-profile-fields.
Fixes#18848.
We rename `stream_subscription_info.hbs` and its related
variables and functions to `stream_subscription_request_info.hbs`.
So that its clear that it is used for displaying info about
requests sent for stream subscriptions.
This is a follow-up for #18957.
We add disabled prop on buttons only and we add the css for
buttons (and some specific class elements) when disabled as
'cursor: not-allowed' or 'pointer-events: none' which means
the user cannot use these buttons when disabled.
This is not the case for the avatar widget as we use a div
element there and not button and neither those specific
classes which has appropriate styles defined.
We use the avatar image block in two ways - for showing image
and as a clickable target (which is actually a div element)
for uploading, so instead of adding 'disabled' prop we are
hiding (adding display: none) the div such that it is not
visible on hover and also cannot be clicked.
This commit extracts the logic in can_edit_topic_of_any_message test
in a separate function test_message_policy. This change will help in
avoiding duplication while adding test for can_delete_own_message.