This commit will enable us to use the API we developed for Tippy
popovers, allowing us to integrate them into any external modules
that require a Tippy popover.
This avoids a bug where during a browser initiated hashchange
(via back/forward/manually typed URL) browser sets the scroll
position of the current hash based on its memory of the scroll
position of the new hash.
This commit addresses the issue of relying on `compose_state` for
retrieving the `stream_id` to display warning banners. Previously,
warnings were shown for syntax in the message edit box based on
whether that syntax would trigger a warning for the draft content (if
any) currently in the compose box.
We fix this by using a new `get_stream_id_for_textarea` function to
obtain the correct `stream_id` value for the check being done.
Fixes: #25410.
Previously, hovering over the disabled subscribe button
would not display any tooltip due to an undefined object
being passed to the function that created the tooltip.
Animating `box-shadow` and `top` is slow since the browser
drops frames when animating them. We can fix it by using `will-change`
property but it is just better to not animate them and instead
use transform.
zulip-mobile currently requires Android ≥ 7 and iOS ≥ 14, both of
which support replaceAll. The code change was in commit
54f90e41c0 (#25554).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Previously, if the user closes the settings modal by pressing
the "Esc" key and if any date-pickers were open then they would
remain on the screen. This commit fixes that and now date-pickers
are closed when the settings modal is closed.
Also added a puppeteer test to verify the said behavior.
Fixes part of #25097.
The nav bar's bottom border was being hidden by the search
bar. This makes the search bar slightly less high to fix this
issue.
Soon this code will be replaced with the changes in #24345.
This just ensures that the mention-pill color selectors are children
of `rendered_markdown`, which class appears both in the message-
preview area as well as individual message rows.
Fixes#25720.
This commit adds bootstrap CSS rules for number type inputs
in billing and upgrade page to billing.css as we will be
removing them from bootstrap.css in further commits.
This commit adds bootstrap CSS rules for number type inputs
in activity page to activity.css as we will be removing them
from bootstrap.css in further commits.
We use "submit" type inputs in dev login page. Only "cursor"
CSS was applied to those elements from bootstrap and this
commit adds it to those elements in portico_signin.css and
removes the CSS in bootstrap.css and bootstrap-btn.css.
We use "input-xxlarge" class for search box in activity
support page only. This commit adds the width property
in activity.css for the search box and rest of the CSS
applied using this class was redundant and can be removed
safely.
We had the `3px 0 1px` padding before migration to use grid,
then I switched it to use `4px 0 1px` since we were planning to
use blue box border which seemed to have helped that case.
Since we switched to using outline for blue box, it makes sense
to just use equal padding.
Backend incorrectly renders @everyone and @stream as `user-mention`
while they are clearly `group_mention`. To fix this, we use
`data-user-id` property of @everyone and @stream which are
set to `*` for them.
Removed the sorting functions which were sorting under the assumption that
our comparison items were a list instead I used the generic sort functions
functionality of our `list_widget` module.
When there are only muted unread mentions in a stream, show `@` icon
and unread count in faded style, also align the `@` on more topics
with no unead counter on it.
If there are only muted unread messages without mentions don't show
the unread counter on the stream.
Fixes#25382.
The "Mark as unread" event handler was not passing through the
mentioned_me_directly value, which is now important to left sidebar
rendering.
See the extended comment for how this solution is incorrect/incomplete
and has to fall back to guessing a potentially incorrect value in rare
situations.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
We need to append the `version` parameter when constructing the urls for
medium-sized images so that the browser updates the image in real time when
the user uploads a new avatar.
Fixes#25558.
This commit updates the Help Center links in all relevant empty message
list views to open in a new tab by default. This prevents users from being
navigated away from the app.
Fixes#25337.
The use of named areas with `grid-area` make it unnecessary to
declare `grid-row` or `grid-column` values. (Note also that
grid areas must not be presented in quotation marks.)
Additionally, because `.unread_marker` is no longer placed on the
grid by itself (i.e., it always accompanies `.date_unread_marker`
or `.message_unread_marker`), it does not need any manual grid
placement, `grid-area` or otherwise.
This change enables the unread marker to participate as a grid item,
rather than the product of various absolute/relative positioning
hacks. The intention is to therefore prevent the blue active-message
box from disappearing on browsers that have zoomed out (~80% zoom).
With grid in place, this also makes for a more robust presentation
of each message row, and named grid areas should make it possible to
modify and extend the grid into the future.
Finally, this change removes styles that are no longer necessary in
the context of CSS Grid.
Added styling to show no outline around the copy to clipboard button on click.
Previously, when clicking this button, a rectangular outline appeared around
the button, which didn't look good, since a 'Copied!' message was already displayed.
Fixes#25533.
This commit fixes a typo in the selector used to
validate registration, support, realm creation,
password reset and terms of service forms. This
typo also resulted in a bug where "This field is
required" error message was shown at incorrect
position and this change fixes it.
This commit also fixes the client side error
handling of these forms which did not work
perfectly due to the selector being wrong.
If the spectator registration call fails, properly log the error and
call `reject` with an error object, not the xhr that `channel.post`
calls its error callback with.
This does nothing to address the UI question of what to do should this
request fail.
These changes ensure that only headings targeted by URL fragments are
highlighted in full. Div elements will have their immediate first
child element highlighted instead (e.g., the first element of an API
parameter box).
This commit moves `maybe_get_stream_name` function from `stream_data` to `sub_store`
as it didn't had any dependency on `stream_data` and it also helps us to cut off
dependency on `stream_data` for some of the modules including `user_topics`.
Fixes#25413.
The old code was disabling the save button wrong by using
`.addClass("disabled")` instead of `prop()`.
Added tooltip for the disabled save button as per issue #25413 and changed
"Times up!" color to red.
The textbox readonly logic was changed to no longer becoming readonly. Reason
being there are edge cases involving the compose buttons such that simply
marking the textbox as readonly is not sufficient.
E.g. using the compose buttons after readonly still modifies the content.
One solution might be to just hide the compose buttons visually. However, there
are edge cases for that too. If preview mode was previously active, then
perhaps that state needs to be reverted. If any modal is open, such as the emoji
picker, then that needs to be closed. Solving these edge cases doesn't
improve the user experience. Keeping the textbox editable allows an easier way
for user to copy the text and don't have weird cases.
Zulip's select widgets have a 30px height; this comes from Bootstrap
but is also generally nice for visual consistency.
In modals, we use a 15px font-size, instead of the 14px used in the
rest of the app, and in that context, the 4px vertical padding plus
30px fixed height resulted in the text not being vertically aligned.
Fix this by removing that vertical padding; all of our select elements
with these classes appear to position the text in the center of the
dropdown through other CSS mechanisms.
We now allow users to change email address visibility setting
on the "Terms of service" page during first login. This page is
not shown for users creating account using normal registration
process, but is useful for imported users and users created
through API, LDAP, SCIM and management commands.
This removes the previous "or forward" text from the message
actions popover, and keeps the documentation in sync with the
new text. Internationalization tests are updated, too.
Fixes#25603.
Prior this commit, changing the message type from a stream (where posting
was not allowed) to a direct message using the compose box dropdown, did not
changed the state of the send button from disabled to enabled even though
direct messages were allowed in the organization.
This was happening because `check_stream_posting_policy_for_compose_box` was
only for streams.
Now, function is updated to check for both streams and direct
messages, as it checks if direct messages are allowed or not, and depending on
that, it updates the send button's state, tooltip and displays a relevant banner.
When hovering over another user's message, the emoji reaction
icon is already present. This commit removes the "Add emoji
reaction" menu item from the popover menu in this case, to
avoid redundancy.
Fixes#25602.
This likely needs further refactoring to switch to using stream IDs
rather than names in this code path, but this change fixes an
exception that would be throw when opening the compose box while
viewing a narrow to an invalid stream name/ID.
In #22524, we have updated the compose banner to the new, updated design
while the unread banners have remained the same. When comparing them side
by side, they look rather old and outdated. We should apply the updated
design to the unread banners as well.
Fixes: #25551.
Previously, the close buttons on the unread banners used "x" as the icon.
This unfortunately doesn't scale well as we increase the font-size. To fix
this, we should update the button to use zulip icons instead of a character
as the button.
This commit assigns a `.scroll-target` class to preserve any URL
fragment whose corresponding ID is on the self-same page as the
activating link.
This accommodates a side-effect of the fetch-based page-loading
logic, which seems to lose the `:target` reference once a load
or reload is complete.
One caveat: While the approach here works fine when loading a new
docs page whose URL includes a fragment, there appears to be something
about `simplebar` that clears out the `:target` reference. If you
click a heading link on a help page, for example, you might
momentarily see the highlighted style appear before it disappears.
Keyboard navigation has been added to the scheduled messages modal
in this commit. The solution is based on the `modals_handle_events`
function from the `messages_overlay_ui.js` module, as well as some
helpful functions from the same module.
Fixes: #25181.
This is a preparatory commit to implement keyboard navigation in the
message scheduling modal. The main goal is to make the
`modals_handle_events` function reusable. To achieve this, we have
extracted all the context-related variables and replaced all
mentions of "draft" with the more neutral term "item". The
`modals_handle_events` function now also has a context parameter,
which contains all the necessary methods and properties to work in
different modal contexts.
This commit disables the field used for adding other subscribers
in stream creation box for users who are not allowed to add
other users to streams because of realm level setting
"Who can add users to streams".
Fixes#24900.
This commit disables the field used for adding other subscribers
to existing streams for users who are not allowed to add other users
to streams because of realm level setting "Who can add users to streams".
Earlier the field used for adding subscribers to existing
streams was not properly disabled.
This commit properly disables the field and also adds a new function
for enabling and disabling add subscribers container.
Since tippy relies on the `blur` event of `target` to hide
the toolips, it is important that the tooltip is triggered
by the element that receives that focus in keyboard navigation which
is `a` tag for left sidebar elements.
These can come fast and furious, and are not worth reporting all of.
Like presence reporting, we leave a small percentage of them for
network and endpoint latency information.
Instead of dropping all of these spans, downsample them heavily (1% of
expected sampling rate). These are some of the most frequent requests
to the server, and the high volumes do not add much information. We
leave a small percent of requests, since it is a useful measure of
overall client network latency.
This changes to not report any `call POST /json/users/me/presence`
spans, which we previously reported despite not including the inner
auto-instrumented HTTP spans.
This PR ensure that all elements targeted by URL fragments will
remain visible below the portico's menu bar at all viewport
sizes and also when a user zooms in, provided the target is on a
page with the menu bar, which will have the `portico-landing`
class.
Whether a quirk or a bug, Chrome appears to ignore the padding on
ancestral containing elements when calculating the offset for
`scroll-margin-top`, which is why padding has been moved to
`.inner-content` for `.why-page` and `.case-studies-page`, which
are the two unique class names for portico pages where the targeted-
element scrolling behavior is used.
This commit ensures that the Attribution, Jobs, and Team pages all
share a uniform structure to match those of other pages. This will
simplify styling and should ensure greater confidence when modifying
portico landing-page styles.
The one CSS modification here, for the jobs page, maintains the space
at the top of the "How we work" section.
Use update_submit_disabled_state_on_change parameter of dialog_widget
instead of setting up input handlers in show_edit_bot_info_modal.
Added new hidden input field to store value of current selected option
in edit_bot_form.hbs whose value is updated by item_click_callback
function of in settings_bots.js.
Also, called $(".edit_bot_avatar_file_input").trigger("input") on
clearing avatar so input event handler gets called and compare the
values to disable the submit button again.
Fixes#24568
Updated `get_current_values` function to not include undefined keys
in current_values object and if the input field is of type file and
a file is selected then set the value equal to file object.
This commit addresses `#stream-creation .modal-footer` becoming
transparent after an error in creating a stream due to overlapping
with `.stream-creation-body`. Instead of adding data-simplebar on
.stream-creation-body, added it to a new div
`stream-creation-simplebar-container` which contains 3 divs:
stream_create_info,stream_creating_indicator and stream-creation-body.
Additionally, fixed the border-radius of the modal footer on the
bottom left side for device width > $md_min.
Fixes#25526
Previously, when a user enters a empty dm-including view, they'll notice
the "Why not start the conversation" action line and click on the link.
When this happens, the compose box would open but the receipent box is
never populated.
Since the dm-including view is a search view, we should drop that phrase
from dm-including views altogether. It also isn't super natural to
have a button that starts the conversation with the user anyways.
Fixes: #25524.
Simplebar introduces a bunch of intermediate divs, and we want to be
clearing the content element, not the entire container including the
simplebars divs.
`update_or_append_banner` abstracts the logic for not creating another compose
banner if one is already present in the DOM, it just replaces the content of the
old banner with the new one.
When the user has a wildcard @-mention we show a warning if the stream has more than
15 members. When the user clicks "Yes, schedule" and confirms the intend to schedule
the message we open the send later modal to let user choose scheduling time.
Fixes#25426.
Extracted opening send later menu code in its own function `open_send_later_menu`
so that we can reuse to directly open the modal from different parts of code.
Added a new param `scheduling_message` which is passed down to the `show_wildcard_warnings`
this argument will help us to do logic relevant to when we are doing validation on scheduling
a message.
In ab0c5f3092, it was missed that this
code depended on the sender_info_hover CSS class, which is no longer
an empty element on messages without a message sender avatar/name
element.
The logic is still hacky, as it relies on the position of an invisible
element, but we're rewriting the positioning logic using Tippy anyway,
so it's not worth doing much to make it nicer.
Fixes#25496.
This is a preparatory commit that will help to render the options
for the send-later modal separately. This is necessary to have
actual sending options if the user keeps the modal open.
Fixes#25462.
hotkey.js is the file that handles the 'e' keyboard shortcut. It maps to the
'edit_message' event and will simply call message_edit.start().
message_edit.start() doesn't check whether it's already been opened previously,
so it will go through and try to register handler for the clipboard button
again. When the clipboard button gets clicked, the handler will be called
twice. Once with a properly target element, and once with null.
Fix this issue by checking if message_edit.start() has already operated on
the given $row.
Currently, we are in the process of removing bootstrap out of the current
Zulip codebase. A quick git grep on btn-info shows that the class is only
used in `templates/corporate/billing.html`. But it doesn't take advantage
or use most of the styling rules that are set.
We should get rid of those rules as it's not being used and help simplify
the process in removing bootstrap.
I didn't want to use JS for it since calculating height based on
item height before rendering the dropdown is expensive and after
rendering the dropdown will cause it jump.
After `ArrowDown` on the last visible, don't jump the next item
into the center of the view, instead align the bottom of the item,
to the bottom of the visible container.