Fixes: #20956.
Recent topics and all messages have empty search query, so it is
important to clear the search query when switching to them, otherwise
search text from previous query is displayed.
Earlier the todo and poll widgets' UI differed a lot, especially in the
font size and weight, and the color and shape of the checkbox and vote
count box.
Now the font weights and sizes are consistent in both the widgets and
the todo widget's checkboxes and poll widget's vote count boxes are
styled similarly.
This is the rebased and cleaned version of #21006, and is visually near
identical.
Fixes: #20283.
The `focus_in_empty_compose` function used for hotkeys, now checks if
the compose box is truly empty by considering it's untrimmed value. If
there are just spaces in the focused compose box, `focus_in_empty_compose`
returns false now.
This fixes the bug where using the left key among just spaces did not move
back the cursor as expected, and may unexpectedly trigger edit state for
the last sent message.
For `up` hotkeys, message navigation is also triggered if the cursor is
at the start of the composebox with just whitespace. A new helper
function is added for this check.
This commit removes the margin-bottom CSS added for
select elements to override the margin added by bootstrap.
Since we have removed the bootstrap CSS rules for
select elements in previous commits, we can remove
the overridden CSS in this commit.
This commit also removes margin-bottom CSS for input
element in one case, because CSS in app_components.css
already overrides the current bootstrap CSS for input
element.
This commit removes the bootstrap CSS rules for select elements in
bootstrap.css. The requried rules are already added to specific
elements in previous commits to keep the existing design.
Fixes part of #23635.
This commit adds "bootstrap-focus-style" class to the select
elements such that we can add CSS rule for focusing a select
element at single place only using this class.
This commit adds bootstrap CSS rules used for select elements
used in different modals in modal.css.
This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
This commit also changes the CSS for propagate mode select
element in "Move messages" modal to use ID as selector
instead of class such that the width property can be
overridden correctly.
This commit adds bootstrap CSS rules used for select
elements in settings page in settings.css.
This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
Due to this change, a couple of settings have lesser
margin at the bottom than before, but they look fine
with lesser margins and anyways had unnecessarily
larger margin before.
We also update the selector used to set width of
desktop-icon-count-display setting such that the
default of 220px is correctly overridden by the
specific CSS for this element.
This commit adds bootstrap CSS rules used for select
elements in stream settings to existing CSS in
subscriptions.css.
This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
This commit adds bootstrap CSS rules used for select elements in
invite UI in zulip.css.
This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.
This commit also adds class to a couple of select elements in invite
UI such that we can use those class to write CSS as using IDs would
lead to the dark-theme background not being applied correctly.
This commit adds bootstrap CSS rules used for select elements in
activity support page in activity.css.
This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.
This commit adds bootstrap CSS rules used for org type select
element in sponsorship page in billing.css.
This change is done so we can safely remove select CSS rules
from bootstrap.css as a part of our process to remove bootstrap.
We also remove inline style for this element and instead add
it with other CSS in billing.css.
This commit adds bootstrap CSS rules used for select elements in
devtools integrations panel in integerations_dev_panel.css.
This change is done so we can safely remove select CSS rules from
bootstrap.css as a part of our process to remove bootstrap.
This commit adds bootstrap CSS rules used for select
elements in realm creation form to the existing CSS
in portico_signin.css.
This change is done so we can safely remove select CSS
rules from bootstrap.css as a part of our process to
remove bootstrap.
This commit adds bootstrap CSS rules used for select element
in dev login form in portico_signin.css.
This change is done so we can safely remove select CSS rules
from bootstrap.css as a part of our process to remove bootstrap.
This commit refactors the template code for source-realm
select element to have same structure as other inputs
and select element in the page. Thus this change also
makes the styling of source-realm select element consistent
with other select element in the page.
The upgrade banner was being clipped for narrow width screens
and was only partially visible. This commit changes it to instead
wrap the content such that complete content is visible on the
screen.
We also decrease the right margin for icon in the banner such
that the text of the banner fits in one line for at least normal
screen size and zoom in stream settings overlay.
Removes the special naming of the organization settings gear menu
item for admins so that it lines up with how we refer to the
"Organization settings" UI itself in the help center documentation.
Draft messages containing attachments, polls, or other items that cannot be locally
echoed would not be deleted after sending the message.
The explanation is simple: We only cleared the draft associated with a message in the
`reify_message_id` local echo code path.
Fixes#24063.
Removes the info icon with the tooltip information and replaces
it with a question help link icon to the help center article on
deactivating an organization.
Also, when the button is disabled, adds a tooltip on hover that
explains only organization owners can deactivate an organization.
If the current user's owner role is changed, then the button and
tooltip are live updated.
Part of #22892.
Since we want to use `accounts/new/send_confirm` to know how many
users actually register after visiting the register page, we
added it to Google Tag Manager, but GTM tracks every user
registration separately due <email> in the URL
making it harder to track.
To solve this, we want to pass <email> as a GET parameter which
can be easily filtered inside GTM using a RegEx and all the
registrations can be tracked as one.
When I changed the padding for message content in the PR which
converted the message row to a grid, I forgot to adjust
the position of edited and time elements.
The suggestion box was not being repositioned correctly when the window
was resized. This commit adds a resizeHandler() function to handle
window resizing properly and reposition the suggestion box to its
current position.
Fixes: #23681.
The logic for hash redirects for stream settings did not check
for deleted or non-existent streams. Thus a hash of the form
`/#streams/{invalid_stream_id}/*` gave gave a blueslip error.
This change fixes that logic to treat such hashes equivalent to
streams whose settings cannot be accessed by that user and
redirects such invalid hashes to `/#streams/subscribed/`.
Since emojis can have multiple aliases, an emoji was often suggested
under multiple names (like `smiling devil` / `smiling imp`), crowding
typeahead suggestions redundantly, and taking up the place of other
potentially relevant emoji suggestions.
Now such duplicates are removed post the sorting of suggested emojis,
and only the most relevantly named (highest sorted) copy is retained.
Uptil now, the compose box's state was retained across narrows only if
the compose box had any content in it. Else it was reset to match the
current narrow.
To not lose any changes made to the recipient fields only, the compose
box will now retain its state also if the recipient (stream, topic or
PMs) has been manually edited.
This is achieved by having a variable in `compose_state` track if the
recipient fields were changed, and checking it before resetting the
compose box on narrowing. This variable is reset when the compose box's
context is changed by clicking on a message, or when a message is sent.
Fixes: #23064.
This commit adds code to disable save button when the value
in custom input box is too large for an integer. Note that
since the value for message edit, message delete and email
notification batching settings are in minutes in the custom
input but are sent to API in seconds, we make sure that the
seconds value should be inside the range.
This commit adds code to convert $custom_input.val() to Number
in get_message_retention_setting_value such that values like
"48aa" are treated as NaN and we correctly show save-discard
widget with save button disabled. If we not convert it to Number,
Number.parseInt will just convert "48aa" to 48.
This commit is similar to 711536f53a.
This commit disables the "Save changes" button when there is
an invalid value in custom input of message retention setting.
This commit includes changes for both realm and stream message
retention setting.
This commit renames admin-realm-time-limit-input class to
time-limit-custom-input such that there is no confusion
when it is used for stream settings also.
This commit refactors code for realm waiting period setting
to be similar to other time-based inputs. We also add the
code to disable the save button when custom inputs have
invalid values.
This commit renames custom_days option for realm waiting
threshold setting dropdown to custom_period such that we
can reuse existing code for similar time-limit settings.
Moved the "Retention period (days):" under the dropdown "Custom".
This is consistent with similar date window inputs elsewhere, and
conveniently just requires changing a single class.
Fixes: #23532
Replaced the "Retain for N days after posting" option with "Custom".
Only show the spot for entering the time if that option is selected.
Labeled the custom time like we do for message editing:
"Retention period (days): [ ]".
This is now consistent with similar settings.
Fixes part of #23532.
This commit removes form-horizontal class from various modal
templates. We add CSS for margin-bottom property for select
and input elements to keep the design same as before. Most
of the added CSS can be removed once we remove bootstrap
CSS completely for these elements.
We can safely remove this class since vertical-align property
is already present due to other bootstrap CSS. And
margin-bottom property for checkbox inputs are added by
bootstrap and for text inputs inside ".new-style" element it
is handled in app_components.css. For other inputs, this commit
adds CSS as mentioned above.
The display property for inputs other than checkbox and select
elements is set to inline-block by other bootstrap CSS.
For checkbox-type inputs browser sets display property to
inline-block but it is eventually computed to "block" as the
float property is set to left and so it is not required to
set display property for checkbox type inputs.
This commit removes form-horizontal class from form elements
in user profile, org profile, org settings and org permission
pages. We also add margin-bottom property for select elements
in this page.
We can safely remove this class since vertical-align property
is already present due to other bootstrap CSS.
And margin-bottom property for checkbox inputs are added by
bootstrap and for text inputs it is handled in
app_components.css.
The display property for inputs other than checkbox and select
elements is set to inline-block by other bootstrap CSS.
For checkbox-type inputs browser sets display property to
inline-block but it is eventually computed to "block" as the
float property is set to left and so it is not required to
set display property for checkbox type inputs.
We have added CSS for select elements in settings.css which can
be removed later once we remove bootstrap for select elements
completely.
This commit removes form-horizontal class from time-limit-setting
div in notfication_settings.hbs. We can safely remove this class
since display and vertical-align properties are applied for select
and input elements by other bootstrap CSS, the margin-bottom
property for custom input is applied by existing CSS in
app_components.css and this commit adds margin-bottom property for
select elements.
The CSS added in this commit will probably be removed once we
remove bootstrap CSS rules for select elements completely.
This commit removes form-horizontal class from form elements
in custom-emoji, linkifiers, playgrounds, default-streams,
default-user-settings, auth-methods and user privacy settings
templates.
We can safely remove this class because vertical-align property
for input elements is set by other bootstrap CSS and margin
property for text inputs is set in app_components.css and for
checkbox inputs it is set by bootstrap itself.
The display property for inputs other than checkbox and select
elements is set to inline-block by other bootstrap CSS.
For checkbox-type inputs browser sets display property to
inline-block but it is eventually computed to "block" as the
float property is set to left.
This commit removes form-horizontal class from form
elements in alert-words, realm-exports and user-privacy
pages.
We can safely remove this class since there is no select,
input, help-inline or input-append child elements for these
and thus this class is not used for applying any CSS rules.
This commit removes form-horizontal class from form element
of inline topic edit form. We can safely remove this class,
since all properties applied by bootstrap using this class
are already overridden by specific CSS for the input element
in zulip.css.
This commit removes form-horizontal class from invite_user
template. We can safely remove this class as vertical-align
property is already handled for input and select elements
by other bootstrap CSS.
For checkbox type inputs, the display property is already
set to inline-block by browser for all input elements but
it is eventually computed to "block" since float property
for this element is set to left. So, setting display
property is not necessary for checkbox input.
We add margin-bottom property CSS for now and that can
eventually be removed when we remove bootstrap CSS for
these elements completely.
This commit removes form-horizontal class from form elements
in social_auth_select_email.html. There is no visible input
element in the form element so the bootstrap CSS using
"form-horizontal" class does not apply to any of the elments
in the page, so removing this class does not have any affect.
The "form-horizontal" class is used in portico-signin.css for
adding hover behavior, so we add a new class "select-email-form"
and use it to add the hover behavior.
This makes it easier to browse details on users and bots when
interacting with them in the settings interface.
While the original issue was about just the bots panel, this is
clearly useful for all users.
Fixes: #23970.
We used to make message failed button (retry / cancel) invisible
when the message is successfully send instead of not rendering them.
This resulted in them being accessible via keyboard when they are not
visible. I couldn't find a reason for retry and cancel buttons to
use `visibility` to be hidden instead of just being not rendered via
`display: none`.
The focus rectangle would spin along with the arrows, which looked bad.
We do want to allow focus rectangles on this element for keyboard interaction,
so we just disable the focus rectangle during the animation.
Fixes#24110.
Since fbe9a9e539, the top_navbar element
unconditionally has the rightside_userlist class. There's some CSS
associated with this class NOT being present, which can be deleted as having
no effect, and then we can remove the class as having no effect as well,
Messages sent by muted users are hidden. To make sure they are
displayed properly, we provide them a HTML structure similar to
that of a normal message so that any CSS applied to a normal
message also applied to it.
This fixes message controls being misaligned in hidden message.
This commit adds a warning to the confirmation modal displayed when
the last user of a private stream attempts to unsubscribe. The warning
explains that, as the only subscriber, unsubscribing will result in the
stream being automatically archived. This change helps ensure that users
are aware of the consequences of their actions and can make informed
decisions.
Fixes: #23954
It is possible to send the message twice by clicking send button
very quickly twice or by pressing enter and send button simultaneously.
This can be easily reproduced for large messages sent in a stream
narrow. Hard to reproduce for small messages or in PM narrows.
I was not able to reproduce locally, but was able to reproduce on
chat.zulip.org. So, this is an untested bug fix.
Fixes#22562
Uptil now when composing PMs, only for @-mentions was the stream / topic
being viewed taken into consideration. The PM recipient suggestions were
unaffected by the current view.
Now this context has been added to the PM recipient suggestions as well,
ensuring consistent sorting of options across both typeahead menus, with
subscribers and recent posters to that stream / view getting priority.
When the view is not narrowed to a stream / topic, the PM suggestions
are sorted the same as before.
This PR has the same code changes discussed and made in #22630, with an
added test suite.
Fixes: #21645.
Moves the tooltip when name changes are disabled to be shown on
hovering over the full name input field. Removes the question icon
that previously showed the tooltip on hover.
If the personal / organization settings overlay has not been
loaded to the DOM in the user's session, then there's no need
to update the overlay display for changes to the user's
permissions to update their name, email or avatar.
So we check for the relevant element ids before updating the
overlay display when the user's role or these organization
settings change, and return early if they are not present in
the DOM.
This transpiles the JavaScript and (future) TypeScript in
`static/shared/js` to `static/shared/lib`. It also compiles away
ES2020 syntax that’s not supported by the oldest JS engines targeted
by zulip-mobile.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Uptil now, on typing "<time" after some other autocompleteable token
like a mention or emoji, the timezone aware time typeahead would not
get triggered since the time syntax was checked after the earlier syntax
had been mistakenly used to (wrongly) tokenize the precursor text.
Now the code has been fixed to detect the time syntax the same way as
the rest: checking each character in the precursor text from end to
start, and tokenize it correctly.
Fixes: #23998.
The color of "x" icon in "Discard" button flickers when hovering
over the button. This commit fixes it by just adding the hover
color to the text and not icon which was anyways set to original
color using different selector which was the cause of flickering.
This commit fixes the hover behavior of save-discard button
in dark theme. We change the text to be slightly brighter
on hover and keep the icon color same.
The background-color property is removed from hover CSS. This
change is safe because for save-button, we already define
different hover behavior below which takes precedence. And
for light-theme, the discard button already has the same
background-color without hovering, so this property was only
affecting discard button in dark-theme.
The correct background-color for buttons of save-discard widget
was not being applied and instead almost transparent color was
applied to dark-theme CSS rules. This commit adds ID to the
selector such that CSS in app_components.css is preferred over
dark-theme CSS.
We do not use "#bot_table_error" element to show any errors
anymore. It was previously used to show the error if bot
creation failed but since 6db88f0d39 moved bot creation
to a modal, we now show error, if any, inside the modal
itself. This commit also removes the hide_errors function
since the error element itself is removed.
This commit removes bot_error function in settings_bots.js
since it is not used now. It was added in d90d1a04 and was
used in error handling, but since we changed the design to
show dialog for reactivation and deactivation of bots and
errors are shown inside the dialog and errors are handled
differently and thus the function's usage was removed in
a9893fb654.
This commit also removes get_bot_info_div which was only
used by bot_error function.
We already have "inline-block" class for the h3 element
in profile_settings.hbs, so the display property is set
as "inline-block" and the CSS set by "hide" class is
overridden. We should not have "hide" class for this
element, since we want to show that element and not
hide it.
This was probably added while picking code of some
other element in bb816e199.
Removes the `btn-direct` class in `portico.css` that was only
being used for dev login buttons.
Adds `dev-button` class for general CSS rules for buttons on the
dev login page. Adds `dev-login-button` and `dev-create-button`
classes for CSS rules specific to the two types of buttons on the
page.
Removes `#find_account .btn` and `#find_account .form-control`
rules in `static/styles/portico/portico.css`.
The last use of these rules was removed in commit 7afbc9ddd6
when the login and registration pages were redesigned.
This commit moves the upgrade text for message retention
setting below the label so that it is clear that the text
is present for message retention setting. This change is
done for both stream creation form and stream edit panel.
The upgrade text shown for message retention setting for realms
on limited plans should mention about sponsorship only for
non-business orgs. In the stream edit panel, the sponsorship
text was present even for non-business orgs because the
is_business_type_org parameter was not being passed to the
template, so this commit fixes the code to pass the
is_busines_type_org parameter correctly to the template.
The message retention setting is only visible to owners in the
stream creation form, so the jquery code to hide the custom
input, set the default value for dropdown and listener to
show and hide the custom input should be called only for owners.
The `next_is_same_sender` has no effect on the CSS of the message
displayed and the JS changes seem to have no effect too.
See cc8021a742 for more details.
The English word "at" was manually appended to the string output of
datetime-related functions to generate the string shown in the tooltip
when hovering over the timestamp of a message. Use the translated form
"{date} at {time}" instead, as found elsewhere in the codebase.
Disables the deactivate account button in the user's account and
privacy settings tab if they are the only active organization owner.
Adds a tooltip when hovering on the deactivated button to let the
user know why the button is disabled.
The backend already returns an error for self account deactivation
requests if the user is the only organization owner.
Adds `avatar.build_user_avatar_widget` to the updates done in
`settings_account.update_avatar_change_display` when the user
has permission to change/delete their avatar.
For the case where a user has their personal account profile
settings open while the organization or user's permissions are
changed, `user_avatar_widget_created` boolean is added to
`settings_account.js` to track whether the widget and handlers
have been created so that live updates don't rebuild the
existing widget and handlers.
Also, updates `avatar.build_user_avatar_widget` to return early if
the user cannot change their avatar. This pattern better matches
the other instances where we use the direct upload widget for the
organization icon and logos.
The "day" and "night" color scheme names were updated in #20371,
but the organization profile settings tab still has had the old
names for the two types of wide logos.
Updates "Day logo" to be "Light theme logo" and "Night logo" to
be "Dark theme logo".
Adds hiding any elements with the `image_upload_button` class in
the organization profile (icon and logos) to the live updates in
`settings_org.maybe_disable_widgets`, so that any role changes
that remove admin permissions will update these images so that
they no longer appear able to be updated / deleted.
The `settings-info-icon` with the tooltip for the user avatar
section was removed in commit 103db2afaf. This removes the changes
to that tooltip in `settings_account.update_avatar_change_display`.
Instead of hiding or showing the `image_upload_button` in that same
live update function, we now add or remove the `hide` class, which
in the previous commit has a specific CSS hover rule for the image
upload widget.
Also adds test coverage for the `is_admin` case for this setting
because administrators can always change their own avatar even if
the organization has disabled avatar changes.
If there is no `disabled_text` provided for the image upload widget,
then there is no need to have the `image_disabled` div rendered in
the template. This allows the hover CSS rules to be more general for
the image upload widget in general.
Adds a check for `disabled_text` around the `image_disabled` div
element in `image_upload_widget.hbs`.
Also, changes `image_upload_background` class to
`image_hover_background` so that it more accurately describes what
the CSS rule is for and why it's used in both the `image_disabled`
div and the `image_upload_button` div.
The `hide` CSS rule in `app_components.css` was being overwritten
by the more specific rules in `image_upload_widget.css`, which
meant that when changing the inage was disabled the hover text for
updating or deleting the image was still visible.
Adds `hide` class (and therefore more specific rule) to
`image_upload_widget.css` for when this text should be display
none.
Fixes#23844.
This only set the last_message CSS class, which is no longer used for
styling or JavaScript code.
(The calculation was also wrong, in that new messages arriving would
not cause it to be removed from the previous message with the
last_message class).
The last_message CSS class didn't mean what it said it did, due to
issues with live update.
Further, this logic was poorly written, with `$message` changing types
from a .message_row to a .recipient_row for now apparent reason.
I was able to reproduce at least one bug where the `v` shortcut would
not correctly open the lightbox that is fixed by this rewrite.
Fixes zulip#19759
Before grid, there was overlap of action buttons and text (photo 1).
With grid, there was just very little space for messages (photo 2).
With this commit, the message gets a bit more space (photo 3).
This helps us add more width to the content column of message
on narrow widths. Note that it will still always be less than
before grid, since we are explicitly preventing overlap.
Using grid layout moves us away from fixed widths
and position for items where possible, which will
make it easier to make messagebox changes without
breaking formatting.
Visual changes expected in this commit:
- When the action buttons overlap the message content,
it will no longer visually overlap but completely cut off
the content — which is good, but means the messages can’t
be as wide on narrow width views. There’s a slight improvement
to this in an upcoming commit.
Also removes the `last_message` CSS, which was busted due to the
`last_message` calculation not correctly being updated for new
messages arriving, and didn't improve styling.
Having the class at the top of message DOM structure when the
user is editing a message, helps apply css when user is editing
a message.
Short prep commit for the next commit; no visible changes