There's still a bug when opening the search bar where the input
isn't selected. But I'm not worrying too much about that because
that text is about to be replaced with pills.
This is needed for us to support "search for..."
(i.e. operand = "search") terms being displayed
as text instead of search pills, once we convert
search to search pills.
This is useful for complicated typeaheads that have custom logic
for setting their element's contents after an item is selected.
Specifically, we're adding this to support a feature of search
pills, where selecting "Direct messages with" will add the text
"dm:" in the search bar and then trigger a lookup, and in
contrast selecting "Search for foo" will add "foo" in the search
bar and *not* trigger a lookup. In both cases, we won't want
to set the input element's text to the empty string, and we'll
want custom control over which situations to hide after select.
These two options make that possible.
See #26803 for more context on when this was introduced for
search pills, and this conversation on CZO for the conversation
that led to this decision:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/search.20pills/near/1726228
This new section was added in ea2d92d934.
This bug caused settings in this section to not be disabled even when
the user lacked permissions to be able to change these settings.
The multiuse invites data from server does not include
notify_referrer_on_join fields since we do not allow
configure that for multiuse invites. This commit fixes
the zod schema accordingly.
Since we more space now in info overlay after recent width increase
and 40 / 60 split between columns, we have the space to show the
poll header at its normal font size of `18px` without making it wrap
to the next line at even medium width.
Clicking on the name of a stream in the left sidebar
now navigates to the top topic in the left sidebar
view of that stream, rather than an interleaved view.
Added an "interleaved" button to the stream popover row in the
left sidebar that appears only when the user hovers over it.
Fixes#26937.
Co-authored-by: Aman Agrawal <amanagr@zulip.com>
We expose `is_zoomed_in` from `pm_list` in this PR.
We also explicitly trigger a `blur` now on clearing search.
Before, clicking on the `x` button was automatically removing
the focus from the input field, but pressing the `Esc` key was
not doing that and that's why the explicit blur.
Fixes#22113.
The search will only be visible when in the `more conversations`
view. Once we click `back to channels` and close the
`more conversations` view, the search will clear and the search
box will disappear.
We've chosen `pm_list_data.get_conversations` as the function
to which we will pass our search term. We could have technically
found the value of the filter element via JQuery in pm_list_data,
but pm_list_data does not handle any JQuery and we should keep
it that way.
`pm_list_data.get_list_info` also accepts the search_string so that
the info it returns in expanded view is accurate.
We've also added some code to `click_handlers` to make sure that
clicking the search input does not bring us into the DM narrow.
This function does not respect `,` (commas) in the search term and will
treat a comma as any other character. We can decide how to treat comma
separated terms in future iterations. That is also the reason that we
introduce this 2 line function instead of just using the person matcher
directly in future commits. This function still supports search terms
with diacritics because of using person matcher.
In a2ef1d7e93, we made changes so
that when you send a message, your view jumps to the conversation
where you sent it.
For some users it was an improvement, few reported that it
disrupts their workflows.
This commit updates the logic to NOT jump to the conversation
where you sent message if the setting
'Automatically go to conversation where you sent a message' is
disabled in 'SETTINGS / PREFERENCES > Advanced'.
We restore the old behaviour for the setting disabled case.
Fixes#30600.
In a2ef1d7e93, we made changes so
that when you send a message, your view jumps to the conversation
where you sent it.
For some users it was an improvement, few reported that it
disrupts their workflows.
This prep commit adds a setting which will be used to allow users
to decide whether to automatically go to conversation where they
sent a message.
We clean up unnecessary nesting in this commit and replace one
usage of `#direct-messages-sticky-header` with
`#direct-messages-section-header`. Since `.direct-messages-container`
was being used along with `#direct-messages-sticky-header` at multiple
places, just removing the nesting would break those selectors. For those
selectors, they have been refactored to just look for
`#direct-messages-section-header` instead. `.direct-messages-container`
specific selectors still exist but they apply to both instances of
`.direct-messages-container`, the DM header and the DM list.
Earlier `focus_submit_on_open` was set to `false` so even when the
`confirm_dialog` is open the `topic_edit_save` button is still in focus.
Therefore pressing enter causes the `topic_edit_save` button to be
pressed causing multiple `confirm_dialog` modals to be created.
This commit sets `focus_submit_on_open` to `true` so that the
`confirm_dialog` is in focus when it is opened and pressing enter
will cause the `confirm_dialog` to be closed.
This has been unused since it was introduced in
5bb10036b57bca36d531a74e8b03188d43ec7862; presumably leftover from a
previous version of the original PR.
Previously, when a referrer's invitation to Zulip was accepted,
they got a notification from notification-bot indicating
their invitation has been accepted.
This commit adds an option for referrer to decide
whether he wants to receive the direct notification
from the notification-bot.
Fixes: #20398
Earlier, in left sidebar, clicking on followed topic icon would narrow
to the topic.
This commit introduces the ability to open topic status menu from
left sidebar from followed topic icon.
Fixes: zulip#28941.
Earlier, in recents view and inbox view, hovering over
`topic status button` didnot show `click to change notifications for this
topic` tooltip as it was supposed to.
This commit fixes the behaviour of tooltip not showing by adding a
tooltip for `recent_view` and `inbox-view` elements.
This commit refactors the `message_list_tooltip` for `recipient_bar_icon`
tooltip in message feed and scope it to `message_feed_container` class.
This is a preparatory commit for PR #30313.
Earlier in typeaheads, empty query suggestions would highlight all
the available suggestions for person name and channel name.
This commit changes the behaviour so that empty query doesn't give
highlighted suggestions.
Fixed by updating bookend after stream data is deleted.
When a stream is deleted and user is narrowed to the stream,
stream archived bookend is now displayed correctly.
We rerender message list to update the stream privacy icon in
recipient bar, bookends or any other places it might be displayed
as part of the message list.
We move the condition to render `update_trailing_bookend` inside
the function to ensure we are only showing it when required.
This also fixes a bug where we render trailing bookend when
stream privacy is changed regardless of if the bookend is required.
This commit removes the `href` attribute from the external code button
when multiple code playground links are present for a language. This
prevents the bug where the external code button would always link to
the previously set code playground link, even when multiple links are
added and the expected behavior is to show the popover.
This commit fixes a bug where the popover doesn't reopen after it's
closed. The bug was caused since `playground_links_popover_instance`
wasn't being set to `null` after the popover was closed, which led
the `is_open` function to return `true` even when the popover was
closed.
As part of the popover menu redesign, this redesigns the playground
links popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.
Fixes part of #28699.
Before calling `on_enter_send`, we checked if the
`compose-send-button` is disabled, but never actually
set it to disabled, rather we updated its container
(.message-send-controls) with that state.
This commit fixes that by correctly checking the button's
container for the class .disabled-message-send-controls
which is set to indicate that the user cannot send messages
at the moment.
Fixes#30620
Adds `has_conversation` function in
`pm_conversation.RecentDirectMessages` for checking whether we have in
cache evidence of previous messages in a direct message conversation.
Preparation for #28470.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
Fixes#29921.
Before this, we used to initialize only 1 typeahead resulting in the bug
of only the first field updating even when trying to change values in the
others.
Co-authored-by: Ngadou Yopa <ngadou.y@turing.com>
Previously the `maybe_change_focus_emoji` was being triggered
on `mouseenter` event instead of `mousemove` event.
Because `mouseenter` events occur when a popover opens underneath
the mouse, without the mouse actually moving, this could result in
the wrong emoji being picked when user tried to choose emoji
through the keyboard.
Fixes#30559.
This commit adds new functions which will be used to discard
changes for all the settings in a subsection when clicking
on discard button. This change will help in avoiding code
duplication when they will be used to discard changes in
a subsection if some other user changed a setting in the
same subsection.
If the filter was changed due to topic move, the hash was not updated
due to `browser_history.state.changing_hash` being true. To bypass
it, we set trigger as `retarget message location`.
If the topic was renamed but the `near` link contains the name
of the old topic and we have the `near` message in the current
list, we can still narrow without re-rendering.
Fixes#29825.
Clicking on remove button will not delete the row anymore. We will
add a strikethrough to the user pill and email text. `Remove` button
will change to `Add` on click to undo this action.
Re-adding a user explicitly should will not undo the soft remove on
their row. e.g If `Iago` was added as part of a group and crossed out.
Now, adding another group with Iago as part of it should not undo the
soft remove.
We maintain a seperate set of soft removed users, but we will not
remove those users from the main user list on clicking `Remove`.
That list can only be modified by actions with the input pills.
We will subtract the soft removed user ids from main user id list
when sending the request to add subscribers to the new channel.
I've not added extra puppetteer tests, since adding users was
not part of the existing tests.
Instead of displaying contextual options in the message buttons popover
based on the message type, we instead abstract the logic behind the
scenes and instead just show the "Start new conversation" with the
relevant hotkey hint.
This also removes the `is_in_private_narrow` parameter which now serves
no purpose in the popover template, as we display the
"New direct message" option in all cases.
As part of the popover menu redesign, this redesigns the mobile message
buttons popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.
Fixes part of #28699.
Earlier, new users were narrowed to the interleaved
DMs view on the first visit.
This commit updates the behavior to narrow new users
in DMs with Welcome Bot.
Reason for the change:
It makes more sense overall as an interleaved DMs view
is a power user view and it would also prevent the
message fading banner #29076 from showing up if the
user DMs Welcome Bot right away.
When posting a message in an empty resolved
topic, the `Unresolve topic` button in the
compose banner unresolves the topic
and then renarrows to the unresolved topic
if currently viewing the old (resolved) topic.
This commit standardizes the naming of the day and night themes to light
and dark, respectively. This makes the codebase more consistent with
the naming used in the settings and the user interface.
As a follow-up to the previous commit renaming the `dark_theme.ts`
module to `theme.ts`, this commit renames the following functions:
- `enable` -> `set_dark_theme`
- `disable` -> `set_light_theme`
- `default_preference_checker` -> `set_automatic_theme`
This commit centralizes the logic for setting a user's theme preference,
both for regular users and spectators, into the `dark_theme.ts` module.
This simplifies theme handling throughout the codebase and ensures that
the theme is set consistently across all modules.
Instead of relying on various call sites to update the recipient bar's
background color and switch between the light/dark realm logo after a
theme change, this commit modifies the `set_theme_and_update` function
to include these calls after every theme change. Before this commit,
some modules used to update the realm logo after a theme change, while
others did not. This led to inconsistencies in the UI depending on
which method was used to change the theme.
Standardize theme selection across the web app by replacing separate
light/dark theme menu options being used in the spectator view with the
new 3-way theme switcher.
Fixes#30318.
Before this, the realm logo was not being updated instantly when the
theme was changed through the gear menu, and instead required a page
reload to take effect.
Similar to the light/dark theme support for the spectators, this adds
the automatic color scheme support by storing the user's preference
in the local storage.
Fixes#27500
It is hard to reproduce the bug but this should fix any bugs
involving topic order when moving messages since we are updating
the data again from the server.
It is hard to maintain the concept of `historical` topics locally,
thus, we remove them entirely to simplify what we can do here.
This commit can introduce bugs when are addressed in the next commit.
We did not remove the deleted messages from message_store
previously. This commit adds the code to remove the deleted
messages from message_store.
Co-authored-by: Sahil Batra <sahil@zulip.com>
Apart from the normal (collapsed) and full screen sizes, a new expanded
state with the same size as the maximum a normal compose box can stretch
to when full (40% of the screen height) is now available. Now a user can
expand the compose box without it covering the full screen with a click.
The vertical resize icon in the bottom right corner of the compose box
is rendered useless so has been removed.
All three states can be cycled through by clicking the compose resize
button in the order: collapsed -> 40% of the screen -> full screen. When
a message naturally causes the compose box in its normal state to expand
up to 40% of the screen, clicking the resize button will take it to full
screen state.
Fixes: #29966.
We divide functionality into that for "full_size" and "expanded", which
are identical for now.
This is a prep commit for adding an intermediate expanded screen size.
When narrowing to a DM with their own user pill in recipient, a
duplicate DM row gets rendered.
This commit fixes this behaviour and doesn't render a separate row
when one's own email is included in recipient.
Fixes regression from zulip#29175.
When narrowing to an existing topic name with different casing, left
sidebar renders duplicate topic rows for the existing topic name and
one with the different casing. Since topic names are case insensitive,
it should narrow to the existing row only.
Fixes regression from #29175.
Tabbing through the navbar elements, `Hide user list` tooltip
stays visible even if focus is moved away from it.
We move tooltip to the element receiving focus and blur event
to fix it. See previous commit for more details.
The elements which received focus didn't have tooltips attached to
them, thus when blur was triggered on `a`, the tooltip didn't hide
as it was not listening on it for the blur event.
We move the toolip to `a` elements so that when focus and blur
are triggered tippy is able to capture them.
This commit refactors code such that we do not add separate
if condition block for each realm group based settings using
the new API format to send the request accordingly. We now
use a single if-block to update the request data for realm
group permission settings using new API format.
The #**stream>topic** syntax generates broken links for
topics containing two backticks or ending with *, because of
architectural flaws in the backend markdown processor.
So we avoid generating the syntax for such topics and instead
generate the normal link syntax in markdown.
Fixes#19873
The generic argument of InputPillContainer should not be
InputPillItem<…>, as InputPillContainer already uses InputPillItem
where applicable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
If the new narrow has the same terms except `near` message id,
then we select the message if it is already rendered in the
current message list.
Tested by sending link to two different messages in a narrow and
clicking to ensure we don't have any loading indicators active.
Tested we are scrolling to target message too if it was not in the
visible viewport but is rendered above.
Before commit fd253539e0 (#30519), each
part of state_data was removed by pop_fields, to ensure that it was
only used by its associated module and not manipulated directly.
Restore this guarantee by removing page_params.state_data itself.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
The row of buttons is placed using CSS grid template areas so that
visually it is now inside the bottom edge of the textbox. The color of
the buttons row and individual buttons is changed to match the color of
the textbox. All textbox border / box shadow properties are now applied
to its parent instead which is extended under the buttons' row, so that
its border snuggly fits around the buttons row too.
Notable side effects:
- In dark mode the textbox in focused state now has a light border which
does not match the recipient input's current border which doesn't change
when focused. Likely, the recipient input should be updated to match the
textbox's border color.
- The dividers in the formatting buttons row are not vertically centered
now. This should be figured out soon.
Fixes: #28702.
The variable is renamed to is_target_element_editable. This makes it
explicit that this variable is referring to HTML structure and not a
property of the field.
This is a prep commit for #22883 which allows admins to restrict users
from modifying field values.
Earlier the `data-conversation-type` attribute of the new conversation
button was being set to `direct` only if dms were enabled. As a result a
stale tooltip was being shown when dms were disabled.
This commit updates the attribute to `direct` reagardless of dms being
enabled or not.
Fixes#29916.
As per the new presence API, we don't get presence info for
users if they went offline after `last_update_id`. This results
in webapp not updating presence info for them.
To fix it, we loop over all the active / idle status users and
update presence status for them as per the latest server time.
If `disable_for_spectators` is true, the widget text is greyed out
but the tippy instance is still delegated, causing it to appear
on click/enter.
This commit fixes that by not delegating tippy if the
`disable_for_spectators` is true.
This bug was surfaced when it was found that the
topic type filter in Recent conversations has disabled
styling for spectators, but a spectator could still click on it to
open the dropdown.
Fixes#30461
Fixes#30403.
Having tabIndex set to 0 led to keyboard focus being put on
a scrollbar container, which led to users having to tab twice
to skip a container.
This commit also removes instances of tabIndex being set to
-1 programatically for certain cases, since it is -1 by default now.
This commit also removes `outline: none` for simplebar since
that property is not needed anymore because the wrapper is
not focusable anymore.
Rename `show_all_private_messages` to `show-all-direct-messages`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
Rename `toggle_private_messages_section_icon` to
`toggle-direct-messages-section-icon`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
Rename `private_messages_section_header` to
`direct-messages-section-header`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
Rename `private_messages_section` to `direct-messages-section`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.