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.
Rename `private_messages_sticky_header` to
`direct-messages-sticky-header`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
This bug can be reproduced by scrolling anywhere where list widget
is used except recent view.
`$scroll_container` was used before
371cd0da6c
to listen to scroll events which was incorrectly replaced by
`opts.$simplebar_container` in the above commit. To fix this,
we use the same function `scroll_util.get_scroll_element` to
get the correct scroll element.
This fixes half of #23665. It shows all user pills when making
a group suggestions as the active new suggestion, but still
doesn't show user pills for the first parts of suggestion lines.
Rename `active_private_messages_section` to
`active-direct-messages-section`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
The `get_all_rows` call should be scoped inside `#inbox-main` otherwise
it used to query all the elements in the DOM which is quite expensive.
Also, we don't need to handle scroll events in Inbox view if it
is not visible.
As reported in a bug report, the tooltip on the DM collapse/expand
toggle was reappearing after switching in and out of the browser window.
This commit destroys the current instance of the tooltip when it is
hidden. This clean up ensures that the tooltip does not appear again
unless the triggered explicitly by the user.
We now right align recipient input (even at very narrow widths) and
banners to the textbox, and move the close button to the absolute top
right corner of the compose box, updating the icon to be slimmer, bigger
and purplish, and adding a background highlight on hover.
This involved refactoring the send control area width into a responsive
css variable, and simplifying the html structure of the compose box.
Fixes: #28792.
Previously, the typing notifications used to appear between the
message list and the mark as read banner in a thread. This would
cause the banner to shift down whenever someone starts typing,
and shift back up if everyone stops typing.
This frequent bouncing of the banner could be distracting, and hence,
is fixed by moving the typing notifications to below the mark as
read banner.
This commit refactors the "update_unread_banner", so that
the "mark_read_on_scroll_state_banner" innerHtml is
set using a separate method by passing the necessary
template.
This is a preparatory commit.
Owing to logic added in #30050, which accounts for the legacy line-
height value, toggling dense mode requires recalculating the
typography vars--otherwise, a non-legacy line-height value will
not be picked up until a refresh.
When left sidebar is hidden between 1200px and 768px, we show
smaller realm icon logo instead of the full realm logo. Also,
we use the new space to expand the middle column to better show
the narrow description.
As a follow-up to the previous commits redesigning the left sidebar
popovers using the new `popover-menu` theme, this moves the `theme`
prop from all the individual left sidebar popovers to the shared
`left_sidebar_tippy_options` object.
This commit also sets all popover labels to flex grow into the remaining
available space. This allows us to align the unread counters, if any
to the rightmost corner of the menu option. This change, however, does
not lead to visual changes in any popover.
Fixes part of #28699.
Create the is:followed search operator.
Fetch all messages that are from followed topics
using exists.
Update API documentation and changelog.
Co-authored-by: Kenneth Rodrigues <kenneth.nrk123@gmail.com>
Fixes#27309.
Previously we generated the search_string and display_html as we
generated suggestions. This commit changes the way Attacher works
to generate these strings once we want the final result. This gives
more flexibility, and will let us replace the last item of `result`,
which will be required for implementing search pills.
This is preparation for search pills.
The X button for user pills will be a click target
that disappears from the DOM. We don't want to
look for the parent of a click element that might
not exist, since that would give us a false positive
and lead us to reset the search bar when removing a
user pill. This commit brings this click handler to
a more stable state.
This commit also adds an extra $elem argument to
`settings_panel_menu.set_key_handlers` which defaults to $mail.elem.
This argument helps us specify a specific element to attach the key handlers
to, instead of the entire settings panel.
We will redraw the list on every deactivation or reactivation.
While that might seem expensive to redraw on each user, the other
option we have is to have some logic run each time the tab is selected
and redraw if the user list has changed.
Since deactivation and reactivation is not something that an admin
would do multiple times a day, redrawing on each user should be fine
for now.
We will continue displaying the reactivated/deactivated users in a
greyed out column after the live-update, since it is weird for a user
to disappear suddenly from the list.
Previously, there were three different sections for managing active
users, deactivated users and invitations.
This commit combines users section has into a single tabbed panel.
Fixes: #26949.
Co-authored-by: shashank-23002 <21bec103@iiitdmj.ac.in>
This is a preparatory commit to combine user settings panels into
one. We need to re-register event handlers since they get destroyed
when the settings modal is closed. After re-opening the modal,
clicking the tabs would not do anything unless we re-register our
event handlers.
When the organization settings are launched, there
is a duplicate function call to the 'activate_section_or_default'
function to render the correct section.
This commit adds a field to store the section name,
which is then used to render the correct section.
Co-authored-by: shashank-23002 <21bec103@iiitdmj.ac.in>
Previously, is: searches as a spectator would suggest "Direct messages", even though
DMs aren't accessible for spectators. Fix this by moving the is:dm suggestion
logic to `get_is_filter_suggestions`, which is not used for spectators.
Fixes#30320.
Changed the title of the first panel to
"Create channel: configure settings" and title of second panel to
"Create channel: add subscribers".
Implement logic in stream_create.js to show and hide both the panels.
Add two buttons to facilitate switching between the tabs or panels.
Added new descriptions to 'stream type descriptions'.
Removed the "Stream permissions" heading to simplify the panel.
Moved the "Announce new stream in {stream}" option just above
"Default stream for new users".
Implement a collapsible "Advanced configurations" section,
collapsed by default, to accommodate less commonly changed settings.
This allows for future expansion of stream permission configurations.
Fixes part of #29403.
Fixes#14971
Instead of taking user to top / end of fetched history, we take
user to the first / last message of the narrow.
We simply check our cached history if we have the data for the
jump, if not, we ask server for the data.
Tested by simply pressing `fn + left / right arrow` on mac in
combined feed and topic narrows. Also, reduced message_fetch
constant values to be all single digital to check if the -
data not in cache -> fetch data -> select message logic works well.
The URL bar in iOS shrinks / expands on scrolling causing change
in height. This triggers our resize handler and forces user to
jump to the selected message. This jump triggers before our
keep pointer in view logic kicks in which means user scrolls back
to the previous selected message instead of scrolling forward.
To fix this, we only do this jump when width changes on mobile
devices.
Note that modern devices support resizeable windows of all forms but
for most use cases where app is full expanded, this seems like the
right fix.
This commit renames "huddle" to "direct_message_group" in the
web codebase. It also renames the file - "huddle_data.ts" to
"direct_message_group_data.ts"
Fixes part of #28640
This commit renames the file "huddle_data.ts" to
"direct_message_group_data.ts" in the web codespace.
This is a part of the migration of huddle to direct_message_group
of #28640.
Instead of current_user.user_id we use page_params.is_spectator
field to check the spectator cases as it makes it more clear
to the reader about what is the condition checking.
Instead of using different variables to store dropdown setting
widgets, we now store them in a map with setting name as key
and avoid duplicate switch cases in functions to get and set
the widget value.
Earlier, autosize wasn't updated for the compose box after resetting its
`max-height`, so in cases where the older `max-height` was more than the
height, and the current max-height was less than the height, the compose
box would not be scrollable.
We now always update the autosize after resetting the max-height.
If a user popover is open in stream settings, and user presses
`down/up` arrow to view settings for a different stream, the user
popover stay open.
Why we need to explicitly hide it?
We have click handlers to hide the popover and `data-reference-hidden`
to hide the popover if the reference goes offscreen via scrolling.
In this case, those events don't fire, there is no reason for tippy
to check if reference is visible and thus show / hide the popover.
The compose expand / collapse button is moved from the top right of the
compose area to the top right corner inside the compose textarea /
preview.
The textarea / preview and the button area shares the same grid parent.
25px extra padding is added to and margin is subtracted from the right
of the element so the button is visually inside it. It appears only on
hovering the compose area, and uses a new custom icon.
Fixes: #28791.
Sentry reporting discovered that if the user was viewing the channels
tab for a bot when the bot's owner was changed (or various other
live-updates), we'd throw an exception trying to access the
original_values object for the manage-user/bot tab.
This code is fragile and messy, but probably a framework change is the
most expedient path to fixing it.
This check doesn't work with the `me` user, because that
user is always at the top of the all users list, and
therefore `new_pos_in_all_users` will always be 0 and
never `render_count`. It's possible this was already
broken before the split buddy list change.
We can remove this check because `insert_new_html` is only
called when we definitely want to insert html. It's only
called from `insert_or_move`, and for moves we always
remove the user we're moving/replacing before the insert.
We now add a new function to set up the dropdown widget for
settings using new dropdown_widget.DropdownWidget instead of
calling dropdown_widget.DropdownWidget multiple times to
reduce code duplication.
Instead of having different functions to set values of dropdown widget
variables, we now use a single function to set their values by passing
the setting name to the function.
Updates all the https://chat.zulip.org/#narrow/stream/ links in the
docs and comments to use the new /channel/ path. All these links are
for documentation/reference purposes only and thus, can be bulk-updated.
This commit is a part of the effort to rename stream to channel.
As part of the popover menu redesign, this updates the topic visibility
popover to use the new "popover-menu" popover theme and improves
accessibility by using appropriate ARIA attributes.
This also moves the `:focus-visible` CSS rule to apply to any tab
picker in a popover, removing the need to explicitly add it to each
tab picker.
Fixes part of #28699.
Earlier, when a user was in /near/ topic or dm view, on sending
message in the same conversation we were incorrectly displaying
the 'jump to sent message' banner.
This commit fixes the incorrect behavior.
Fixes#30341.
Earlier, when a user was in /near/ topic or dm view, the scheduled
message indicator was missing in the conversation.
This commit fixes the incorrect behavior.
Create has:reaction search operator and search suggestions.
Create sidebar view for the user to view their messages that
have reactions using has:reaction sender:me operators.
Add custom heading for the view and tooltip in the sidebar.
Add documentation for the new operator.
Fixes: #27328.
Note: This involves adding presence info of unknown users to the
presence data.
With some small tweaks, we can just add the info to the presence data
structures, just making sure the buddy list correctly skips those
entries and that we redraw the user in the case where the user creation
event arrives after the presence polling loop.
Fixes#17933, #27517
Instead of `recent_view_table`, we make `html` as our scroll container.
This fixes an important bug for us where filters sometimes disappear
due to them scrolling under navbar which is unexpected. Since we are
now using separate containers to display rows and
filter (while includes table headers), where filters use sticky
positioning, this bug will be fixed.
If recent view load more banner is at the center as a result of
`document.elementFromPoint(topic_center_x, topic_center_y)`,
there is no `tr` to focus, resulting in first row to be focused
as the closest element as per previous logic.
To fix it, we just focus the last row which is just above the
load more banner and is visible.
We blur the focused element when an overlay opens, and refocus
it when the overlay is closed, to prevent side effects.
What motivated this change was that opening a lightbox overlay
from preview content while editing a message caused the escape
key to close the message edit form instead of closing the overlay.
Commit 33484e7ac3 (#29200) added a cache
for remove_diacritics, but this caching was rendered ineffective by
commit 45e9c046d8 (#29650) because it
relied on mutating a direct reference to the User object. Fix the
cache by rearranging the types to preserve that direct reference.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This can happen when the user’s configured language is less than 5%
translated. Fixes an assertion failure introduced by commit
6a429603ad (#30261).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
We immediately navigate the user to the conversation they just
sent a message to if they are not already in the appropriate
conversation view.
This commit adds a first-time banner to explain the same.
Fixes#29575.
Removes two 'narrow_to_recipient' banners which were
shown after sending a message to a different conversation.
Now, the sender is narrowed to the conversation where
message was sent.
Fixes#29186.
The chevron arrow icon before the topic / dm user field now also acts as
a go to conversation button. Whenever the functionality is available,
the plain icon changes to look and behave like a button. The old go to
conversation button on the right of the field is removed.
Fixes: #28697.
When a topic is muted, it is removed from the view in some cases.
This can lead to the popover being force closed since the popover is
anchored to the reference element.
We add a delay to all the methods that contribute to hiding the topic,
on mute, to allow the relevant animations to be completed before the
topic is hidden from view and the popover is closed.
Commit 3f2ab44f94 removed the 'development' guard and cleaned the
older UI of the previous topic visibility options implementation,
but it missed the related JS logic.
This commit removes this redundant code, which was now present in
`web/src/topic_popover.js`.
This commit updates the sidebar topic actions popover to use the new
sliding tab switcher for the topics visibility policy switcher.
This also includes changes such as hiding the popover only on
successful request completion, and adds error feedback by indicating
it via the sliding animation.
This hides the visibility policy popover only when the request to
change the topic visibility policy is successful.
This allows a user to retry changing the policy in case of a request
failure, without having to open the popover again from the start.
Fixes how the confirmation modal title is generated for translation
for deleting an option or multiple options from a customer profile
field that's a list of options.
In the "not-subscribed" tab, when there are no channels to show, we
display a text message saying "No channels to show. View all channels"
along with a link that redirects the user to the "All channels" tab
(All channels(#channels/all)).
Updated the update_empty_left_panel_message function in
stream_settings_ui.js to modify and determine which banner to display
when no channels are available to show, modified that function to also
display the banner of the "not-subscribed" tab using a new classname
called 'not_subscribed_streams_tab_empty_text'.
This commit adds a new tab to the stream settings overlay called
"Not subscribed" which lists all the streams the user is not
subscribed to. This tab is disabled if the user is a guest.
Introduced a new variable called "show_not_subscribed" to replicate
a similar model to how the subscribed tab is working. Currently,
there are only two tabs: "subscribed" and "all streams" so we can
use an if-else condition.
Refactored the 'update_stream_row_in_settings_tab' function inside
stream_ui_updates.js to include the case of a 'Not-subscribed' tab,
so that the tab is immediately updated in any add/remove subscription
event.
Fixed and added the node tests for these changes.
This commit changes the variable and function name from
"subscribed_only" to "show_subscribed" and
"set_subscribed_only" to "set_show_subscribed"
so that in the next commit, when the "not subscribed" tab is added,
we can use a similar variable named "show_unsubscribed" and function
named "set_show_unsubscribed".
Before this commit the `user_settings_panel` object was declared as
a `const` and assigned an initial value of `{}`. Later, inside the
initialize function the object was mutated with three fields (`container`,
`settings_object`, `for_realm_settings`).
TypeScript does not allow this.Hence,we have removed the initial
value(`{}`) and changed the object to be a `let` var. This means,
when the `initialize` function is called `user_settings_panel` object is
undefined and hence `user_settings_panel.foo` will throw an exception.
To avoid this we have refactored the function by changing the way
`user_settings_panel` object is assigned value.
Commit 50f5cf9ad8 (#30227) changed
message_helper.process_new_message (called by
message_events.insert_new_messages) to return a newly created message
object rather than mutating the object it was passed. So
echo.insert_local_message needs to use this new object, fixing a
regression where we’d fail to replace a locally echoed message when
the server-rendered message came in.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Earlier, onboarding_steps field of state_data was stored as
current_user_params.
Now, we store it separately in a data structure initialized in
onboarding_steps.ts
Reason: All the other state_data fields stored in current_user_params
are attributes of UserProfile. So, it makes sense to store it
separately.
Fixes part of #30043.
This commit renames the function 'update_notice_to_display' to
'update_onboarding_steps_to_display' as it can be used for
onboarding step of any type.
Currently, we have only one type i.e. 'one_time_notice'.
We completely rerender recent view when we receive a new message,
which is not ideal since it is flashes recent view frequently
during the initial fetch.
Since later parts of initial fetch which trigger the flash, only
load old messages, they cannot change the latest message of
rendered rows in recent view. That means we can just inplace
rerender the rendered rows which got updated and don't have
to worry about order of rows being changed.
Since scroll event is always fired at root level, we don't have
control over capturing the event and containing it to the popover
if scroll happened inside the popover.
This can lead to unintentional moving of selected message since
we try to move the selected message to rendered top / bottom if
we receive a scroll event when top / bottom ends are rendered.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).
Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
offering a list of choices.
- `role="menuitem"`, `role="menuitemcheckbox"`,
or`role="menuitemradio"` to child elements based on their function.
- `role="group"` to the topic visibility picker, identifying it as a
container for related menu items.
- `role="none"` to `<li>` elements, removing the implied `listitem`
role that conflicts with the parent menu structure.
If the selection stays inside a message header and there
are messages before the message header, our logic thinks `end_id`
is message before the header while `start_id` and `end_id` should
be that same.
It is best to just let browser handle the copy paste in this case.
Names like “delegate”, “Instance”, “Placement”, “Props”, and
“ReferenceElement” are much too generic to make sense as named
imports.
The downside is that we now need to write tippy.default(…) instead of
tippy(…) (because ES module namespace objects cannot be callable), but
that cost is worthwhile.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit extracts various methods called post the current
message list is updated in "narrow.js" such as update_unread_banner,
handle_post_view_change, etc. into a separate method --
"handle_post_message_list_change".
This allows us to be able to call these methods independently
in case we need to update the filter and the corresponding
message lists.
This is a preparatory commit to #30114.
The 'Select channel' dropdown in 'Add default channels' modal is
the LAST dropdown element on the modal and it does not contain
`data-stream-id` attribute.
.attr('data-stream-id') would return undefined for this element
and as a result the returned `Set` would have its last element a
`NaN` --- passing a `NaN` inside 'data' field of 'channel.post' threw
an error.
We tweaked the selector string to selectively map over the elements with
'data-stream-id' attribute.
Also we removed '.toString()' converting stream-id to a string (stream-id is a
'number' type).
There was a stale comment here saying we needed to do this for
private messages too, but `convert_message_topic` only modifies
`message` if its type is "stream".