Commit Graph

5505 Commits

Author SHA1 Message Date
afeefuddin 9a57505f63 help: Convert module to TypeScript. 2024-07-14 22:34:23 -07:00
afeefuddin c138082eb3 help: Remove unnecessary onClick event listener.
ClipboardJS attaches event listener to the object when an
instance is created. We don't need to add an additional onClick
event listener to invoke it's functionality.
2024-07-14 22:34:23 -07:00
Vector73 d21ee6fa23 api: Deprecate uri and add url parameter in "/user_uploads" endpoint. 2024-07-14 22:32:36 -07:00
Vector73 28ce2684bb user_groups: Add `is_empty_group` function to check for nobody group.
Removes hardcoded checks for "role:nobody" by checking if the given group
is empty.
2024-07-14 22:29:18 -07:00
Shubham Padia c40698b6b3 display_settings: Extract out different sections into their own file.
The file has becoming longer over time, it would be good to separate it
into different files for better readability.
2024-07-14 22:15:03 -07:00
Shubham Padia ada92f502e display_settings: Split `Advanced` into `Information` and `Navigation`.
Fixes #30776.
`.advanced-settings-status` was being used at a few places for User list
status, that's why it's been replaced with
`.information-settings-status`.
2024-07-14 22:15:03 -07:00
Shubham Padia e1186f8256 display_settings: Remove unnecessary advanced-settings-status hide.
This was introduced in 87635b9e32 and kept
getting renamed over time and did not get deleted. Other statuses'
`.hide()` got deleted over time. I'm not sure why we were using the hide
in the first place, but manual testing shows no behaviour change when
removing it.
2024-07-14 22:15:03 -07:00
Shubham Padia b44fd5365c display_settings: Rename `get_all_preferences`.
We've renamed `get_all_preferences` to
`information_section_checkbox_group`. We've also converted it from a
function into a dictionary since it doesn't contain any page_params
variables anymore. This is a preparatory commit for adding a new
`Information section` as part of a layout change for this page.
2024-07-14 22:15:03 -07:00
Shubham Padia 39af05f475 display_settings: Move out `high_contrast_mode` from checkbox group.
`high_contrast_mode` was part of the checkbox group obtained by calling
`get_all_preferences`. For the new layout change, it will not be a part
of that group and this is a preparatory commit seperating it out from
that group. We will also rename that checkbox group in future commits.
2024-07-14 22:15:03 -07:00
Shubham Padia 554e9f7e29 settings: Move Information density setting to the General section. 2024-07-14 22:15:03 -07:00
Shubham Padia 60fda072e6 settings: Move dense mode setting to the General section. 2024-07-14 22:15:03 -07:00
Shubham Padia cfd46ac44e settings: Move render_only settings to their own dictionary.
These values were only a part of `DisplaySettings` type objects. We're
moving them out of these type of objects to be a standalone object of
its own. This will make it easier to reference in the next few commits
when those `DisplaySettings` objects would be broken down into different
sections.
We've excluded the new function from coverage since there's not much to
be tested there and similar settings functions do the same.
2024-07-14 22:15:03 -07:00
evykassirer 23e7363850 input pills: Focus input after removing a pill with x button.
We decided this is more likely to be where the user wants the
focus to be after exiting a pill with the x button.

CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20message.20search.20'x'.2Fdelete/near/1886757
2024-07-14 22:10:24 -07:00
Aman Agrawal c82c0715ca personal_menu: Don't show user local time.
Fixes #30044
2024-07-14 22:09:20 -07:00
evykassirer f23fdede67 search pills: Align icons on top row.
This reverts #30804. We need a followup PR to address the
issue that PR was trying to solve without breaking icon
alignment.
2024-07-13 11:38:11 -07:00
Vector73 d895ca287f tooltips: Make size of tooltips consistent.
Uses a variable for defining font-size on tooltips instead of `1em`.
2024-07-13 07:34:21 -07:00
Tim Abbott b747bd4487 narrow_state: Disable coverage requirement for unlikely case.
I'm not actually sure if this is possible; it's been copy/pasted from
the channel/topic code path, but even with that one, it seems like the
topic being `undefined` is impossible (that's not how operators work),
and the channel being undefined might be something that should fail in
`Filter` initialization, not here.
2024-07-13 07:28:52 -07:00
Aman Agrawal 70be9e8c51 narrow: Implement rendering of `with` narrow operators.
Adds server and web app support for processing the new `with`
search operator.

Fixes part of #21505.

Co-authored-by: roanster007 <rohan.gudimetla07@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-07-13 07:18:24 -07:00
Vector73 e9b796c0be group_settings: Change tooltip on add members input box. 2024-07-13 07:04:08 -07:00
Aman Agrawal b5b3391d0d typeahead: Fix alignment of secondary text of typeahead. 2024-07-13 07:03:46 -07:00
Aman Agrawal a46b075e0e typeahead: Restore line height to original value.
e5e5ba6cea reduce the line height
of the typeaheads, which doesn't look for stream typeaheads. We
restore it back to original value.
2024-07-13 07:03:46 -07:00
Shubham Padia 054f08c6df user_group_pill: Exclude inactive members from pill.
While using the pill in `stream_create`, it was noticed that deactivated
users were also part of the user_ids returned by the user_group_pill,
which we do not want to do.
This pill is used in two areas: compose box and stream create/edit.
This commit will only affect stream create/edit since compose box was
just using the typeahead data from user_group_pill and nothing else.
Stream and user pill handle inactive users already, so no change is
needed there.
2024-07-12 15:22:50 -07:00
Shubham Padia e9166fe6f7 user_group_pill: Internationalize display_pill string. 2024-07-12 15:22:50 -07:00
Shubham Padia 5b57ed959e user_pill: Use group pills to add all users.
Fixes #30690.

Before this, we were adding all users to subscriber list without adding
any pill. But, since we want pills to be the source of truth for adding
the subscribers, we will just add the `role:everyone` pill from now on
whenever `Add all users` is clicked.

While we can just directly call `pill_widget.appendValue` in
`stream_create_subscribers`, it's better to expose an API from
`add_subscribers_pill` and use that. This lets us control how appending
an item would work for subscriber pill in a single place.
2024-07-12 15:22:50 -07:00
Shubham Padia 2b572628d0 user_group_popover: Don't show group settings link for system groups.
System groups are immutable and that's why we should remove the group
settings link from the group popover for system groups.
2024-07-12 15:22:50 -07:00
Shubham Padia 20f83b944f user_group_popover: Add support for displaying subgroup members.
We list all the members of a group including recursive subgroup members
in the user group popover.

We also add another change in this commit to show `Everyone` if the
group name is `role:everyone` by using
`user_groups.get_display_group_name`.
2024-07-12 15:22:50 -07:00
Shubham Padia be5e0d4648 user_group_pill: Hardcode `Everyone` in display name.
For system groups, the directive is that we should use the description
as the display name. But in case of `role:everyone`, the description is
`Admins, moderators, members and guests`, while for the
`user_group_pill`, we want to display a simpler and succinct message:
`Everyone`. We've only hardcoded this for user_group_pill since we don't
want to display the name as `Everyone` anywhere else yet.

We've also exposed a method called `get_display_group_name` which will
be used in later commits to get the group display name.
2024-07-12 15:22:50 -07:00
Shubham Padia 458038b384 user_group_pill: Add support for subgroups.
While the support to include all members of a subgroup is needed only in
the `stream_create` context for now, we have added the support for
subgroups to `user_group_pill` for all cases. We have done this because
that is still going to be the correct behaviour if we add similar
support to other pill inputs.

In terms of calculating and populating the recursive member list, it was
decided not to do it when initializing the user_groups data. One reason
for that was it would introduce a lot more complexity when adding or
removing members from any of the subgroups to keep the recursive member
list updated. Keeping in line with the general pattern of calculating
recursive subgroups on the fly too, it was decided to calculate the
recursive list of members on the fly too.

Also changes the `get_group_ids` tests to make sure that subgroup ids
are not part of the result of `get_group_ids`. Since it is used to
calculated taken_groups, we don't want to filter out subgroups as part
of taken_groups and their typeahead should still be visible.
2024-07-12 15:22:50 -07:00
Shubham Padia 9f7dc596f8 user_groups: Add get_recursive_group_members.
This function goes through all subgroups recursively and returns the
resultant set of the members of those subgroups in addition to the
members of our target_group.

This function is required in order to add the `everyone` pill to create
channel flow.

For the tests written in this commit, it uses the same pattern as the
`get_recursive_subgroups` test.

`is_user_in_group` could have been technically refactored to use
`get_recursive_group_members`, but since the former returns early for
direct members, I've let it be for now.
2024-07-12 15:22:50 -07:00
Shubham Padia c7e59ed761 user_group_pill: Remove unnecessary truthy filter on user_ids.
The filter was not doing anything to the user_id array, not sure why it
was introduced in ce4cf66f3f.
2024-07-12 15:22:50 -07:00
Kislay Verma ffd49ac35b compose: Transform stream/topic urls on paste.
Transforming valid stream/topic urls  to the #**stream>topic**
syntax.
- A valid url contains a stream and optionally a topic
 but nothing else, and in that order.
 It must belong to the same origin as the Zulip server.
 The stream id present in the pasted url should
  correspond to an actual stream in the current
  server.
- `near` links are not transformed.
- Use-mention distinction is respected by
  not transforming a valid url if pasted using
  `Ctrl+Shift+V`.
- No transformation occurs inside a code block.
-  On pressing `Ctrl+Z` after pasting,
  the actual pasted link is restored.
- No transformation occurs if the url is pasted over an
 existing url in a markdown link syntax.
- No transformation occurs if the stream or topic name
contained in the pasted url is known to produce broken
 stream/topic syntax links (as per #30071).

Fixes #29136
2024-07-12 15:15:10 -07:00
evykassirer 2e3f11134e search: Fix bug where exit button jumps when clicked. 2024-07-12 15:14:05 -07:00
adnan-td 6f4d14ddde stream_pill: Add channel privacy icons in input_pill.
Modify stream pills to add channel privacy decorations inside
input pills for areas eg: the UI for adding members to a channel.

Partly fixes: #25257.
2024-07-12 15:00:02 -07:00
evykassirer 9e096382cd search pills: Fix bug closing multiple pills on fresh open.
`on_search_contents_changed` resets the search bar on input
change in the "freshly opened" state. We shouldn't be calling
this when removing pills, since removing pills should always
remove the freshly opened state, not reset the search bar.

This bug was reported on CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20message.20search.20'x'.2Fdelete/near/1883828
2024-07-12 14:59:03 -07:00
evykassirer 31ed5d597b search: Enlargen x button in search bar. 2024-07-12 13:36:42 -07:00
evykassirer 57cb4321b1 search pills: Align typeahead text with pills. 2024-07-12 13:25:36 -07:00
Tim Abbott 4b6393955b buddy_list: Rename total_subscriber_count for clarity. 2024-07-12 13:10:44 -07:00
Tim Abbott 4228d32639 buddy_list: Rewrite total_subscriber_count.
This much more simply does what it sounds like it does.
2024-07-12 13:10:44 -07:00
Pratik Chanda 503b66f52a buddy_list: Fix incorrect user count in sidebar with bot as recipient.
Earlier in right sidebar user count, it would show less user count
when a bot was present as a recipient in the conversation. Since the
sidebar shows active human users only, user count should not
consider bots in the conversation.

This commit fixes the behaviour by adding all the subtracted bots
in from user count.
2024-07-12 13:10:44 -07:00
Sayam Samal 757bb8c68d user_card_popover: Update `max-width` to scale UI with font size.
This commit updates the `max-width` of popovers to relative length units
to allow the UI to scale with the font-size.

The `max-width` of `97vw` still applies to the popover, and ensures
that the UI does not overflow the viewport.
2024-07-12 13:03:40 -07:00
Sayam Samal 724c91d127 user_card_popover: Add user-card-specific class to the email field. 2024-07-12 13:03:40 -07:00
Sayam Samal 50645ffd7e user_card_popover: Use different selector for clear status tooltip. 2024-07-12 13:03:40 -07:00
Sayam Samal a20ac9a831 user_card_popover: Fix keyboard nav for right sidebar popovers. 2024-07-12 13:03:40 -07:00
Sayam Samal 97f84b4aae user_card_popover: Scope related css inside a common class. 2024-07-12 13:03:40 -07:00
Sayam Samal ad121335e3 user_card_popover: Add medium avatar back on mount. 2024-07-12 13:03:40 -07:00
Tim Abbott df1fc71685 user_card_popover: Skip copy icon for keyboard focus.
It's invisible unless the email is cropped, and even if it weren't,
the menu is more likely of interest to a keyboard user.
2024-07-12 13:03:40 -07:00
Tim Abbott 94a0941b0c user_card_popover: Fix on_mount hooks not being called.
The extra undefined parameter appears to be a bug introduced in
5142f1279a45d00320904b369b092f0c9c116b90; when the show_as_overlay
parmater was dropped, the other callers to show_user_card_popover did
not have their extra argument removed.

This had the effect of not setting initial keyboard focus when opening
the popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 6ee491697f user_card_popover: Improve outline styling for focused elements.
- Adds focus outline to the custom profile field links.
- Replaces the grey outline of the copy and status buttons with the
  blue one used across the popover options.
- Adds hover state styling to the focus state styling for the copy
  buttons.
2024-07-12 13:03:40 -07:00
Sayam Samal 7232ff68f8 user_card_popover: Enable keyboard nav for custom field copy buttons. 2024-07-12 13:03:40 -07:00
Sayam Samal 8ead2035bf user_card_popover: Enable keyboard navigation for email copy button. 2024-07-12 13:03:40 -07:00
Sayam Samal 2ee9d80c7f user_card_popover: Add tooltip for status clear button.
Previously, the tooltip for the status clear button was scoped to only
the personal menu popover. This commit moves that logic to `tippyjs.ts`
and adds support for the status clear button in the user card popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 1f6fcb81e8 user_card_popover: Cleanup user card popover after redesign.
As a follow-up to the user card popover redesign, this commit removes
the unused code and styles from the user card popover.

- Removed tooltip logic for user name and user type, since we now
  display them in full without any ellipses.

- Removed unused css whose class names are no longer used in the
  user card popover.

- Removed additional styling needed to handle font awesome and zulip
  custom icons, used in the older design.
2024-07-12 13:03:40 -07:00
Sayam Samal 5a123e57ce user_card_popover: Align user info to popover header's vertical center.
This commit aligns the user info, which contains the user's full name
and type, to the vertical center of the user card popover's header.

With this, the user info is aligned in the center of the popover header
for short names, and then for the longer names, the user info eventually
aligns to the top and the rest of the content are pushed down.
2024-07-12 13:03:40 -07:00
Sayam Samal dd2739a7e1 user_card_popover: Update the hover and active colors of copy button.
Using the new color palette defined in the previous commit, this commit
updates the hover and active colors of the copy button in the user card
popover.

This also adds a background to the copy icon on hover and active states.
2024-07-12 13:03:40 -07:00
Sayam Samal 84bf694257 css: Add Zulip color palette to app_variables.css.
This commit adds the new Zulip color palette, as css custom properties
to the app_variables.css file. Defining it in the app_variables.css file
allows us to visualize the colors in the editor's autocomplete dropdown
when we use these color values for defining other component based css
variables.

Since hex color values are used in defining the color palette, we
disable the `color-no-hex` stylelint rule for that part of the file.
2024-07-12 13:03:40 -07:00
Sayam Samal d707c9f779 user_card_popover: Change success behavior of the email copy button.
Previously, when the email was successfully copied via the email copy
button, the email in the user card popover was replaced with a "Email
copied!" message.

This commit replaces this behavior with a more subtle approach, where
only the tooltip of the email copy button changes to "Copied!".
2024-07-12 13:03:40 -07:00
Sayam Samal eb5bef8ff5 user_card_popover: Redesign user card popover for unknown user.
This commit extends the user card popover redesign to the case where
the guest is not allowed access to view some of the other users'
profiles due to a change in the
"Who can view all other users in the organization" permission.

Fixes #27338.
2024-07-12 13:03:40 -07:00
Sayam Samal 9bd8a0c72c user_card_popover: Move manage user menu options to user card popover.
This commit removes the manage user menu popover and moves the
options contained within it directly to the parent user card popover.
2024-07-12 13:03:40 -07:00
Sayam Samal 7a903e6336 user_card_popover: Align status emoji to the top for multi-line status. 2024-07-12 13:03:40 -07:00
Sayam Samal 258e2a7297 user_card_popover: Fix clear status icon padding.
The clear status icon was not properly aligned with the text in the user
card popover, due to additional padding on the icon. The reason for this
padding was to ensure correct focus ring offset, so to fix this issue,
without breaking the focus ring, this commit sets the `outline-offset`
to `0`.
2024-07-12 13:03:40 -07:00
Sayam Samal 58357dfd75 user_card_popover: Fix user avatar shrinking on long status text. 2024-07-12 13:03:40 -07:00
Sayam Samal 60d1993ed8 user_card_popover: Redesign popover using the new `popover-menu` theme.
As part of the popover menu redesign, this commit redesigns the user
card popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.
2024-07-12 13:03:40 -07:00
Shubham Padia c5d70cdc1d settings: Do not execute hotkey inside any users tab filter input.
We changed the scope of the selector to just the switcher. This means
that the hotkeys will only run when the user focuses on that element.
This follows the same pattern as the `Personal` and `Organization` tab
switchers which limit the hotkey area to their tab list and not the
content. If we want to use hotkeys inside the content, just filtering
out INPUT elements in keydown_util might be better.
Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20Org.20settings.20user.20search.20does.20not.20work.20with.20vim.20hotkeys.2E/near/1882313
2024-07-12 11:51:40 -07:00
Shubham Padia a2f2b52c2d left_sidebar: Stop event propagation on DM filter click.
Before this, in the onclick event for
`#direct-messages-section-header.zoom-in`, we were filtering out the
class for the direct messages filter, and not activating a narrow on
trying to input on the filter. This was fragile, so we've added an
onclick listener to the direct messages filter which will do nothing
else than stopping the event propagation upto direct messages section
header.
Fixes https://github.com/zulip/zulip/pull/30332#discussion_r1669198527.
2024-07-12 11:32:49 -07:00
Shubham Padia 6c3707f484 left_sidebar: Move DM section header id to top level in css file.
This is a refactor and should not introduce any visual changes.
Fixes https://github.com/zulip/zulip/pull/30707#discussion_r1669110661.
2024-07-12 11:32:49 -07:00
Aman Agrawal 135f31468f bootstrap_typeahead: Fix not being displayed on mobile.
`$container` was not mounted when `show` called on mobile, likely
due to slower processing on mobile compared to web, so we ensure
$container is mounted to fix the `show` call having no effect.
2024-07-12 11:08:47 -07:00
Aman Agrawal e75ac2bfd1 dropdown_widget: Fix dropdown not displayed on mobile.
This was due to reference being hidden by keyboard or scrolled
offscreen. We fix it by showing the dropdown even if the reference
is hidden for mobile devices.
2024-07-12 11:08:47 -07:00
Sahil Batra ebf9105a51 settings: Make sure sorting arrows are visible correctly.
This commit adds right padding, approximately equal to the
size of the sorting arrow, to the table headers which show
sorting arrows to make sure that arrows are visible clearly
at different font sizes and in different text languages.
2024-07-12 10:35:22 -07:00
Sahil Batra 5e5633b5ee settings: Remove user_role class from bot owner column.
We do not allow wrapping text randomly for user role values,
but since bot owner names can be long we do not want to do
that for bot owner column. So, this commit removes the
user_role class which is responsible for adding the required
CSS rule for role values.
2024-07-12 10:35:22 -07:00
Sahil Batra 91cf69f6a1 settings: Set min-width of table columns for narrow screens.
This commit adds minimum width property for different columns
such that the columns do not get too small for narrow screens
and the tables can be scrolled horizontally to view the content.
2024-07-12 10:35:22 -07:00
Sahil Batra 42a5ae76bb settings: Do not allow table headers to wrap randomly. 2024-07-12 10:35:22 -07:00
Sahil Batra 9c9c8dc058 settings: Do not allow text to wrap randomly in some columns.
There are some columns where the text is not user dependent
and we know how long the text can be like user role, bot type
and custom profile field type. In such cases, we can just avoid
wrapping the text randomly.
2024-07-12 10:35:22 -07:00
Sahil Batra 9fab65f4b0 settings: Do not restrict width for table columns.
This commit removes width or min-width properties set for
different table columns so that the column width can adjust
themselves based on the text in different font sizes.

We still have the width property set on "actions" column
though to keep it at the right when a table has only 2/3
columns.

Further commits would be added to handle wrapping of
text in some columns and also to make sure that sort
arrows are visible correctly.
2024-07-12 10:35:22 -07:00
Sahil Batra 19cc948573 settings: Fix custom profile fields UI for narrow screens.
This commit adds "progressive-table-wrapper" class so that
the width property is correctly set and UI is correct for
narrow screens. Also, other properties added by that class
are fine.
2024-07-12 10:35:22 -07:00
Sahil Batra 025d4cc288 settings: Remove unused admin-table-wrapper class.
This class is not used anywhere, so there is no need for
this.
2024-07-12 10:35:22 -07:00
Sahil Batra 3f5fa70223 user_groups: Show only system groups in setting dropdowns in prod.
This commit adds code to show only system groups in the dropdowns
for group permission settings in production for now. We continue
showing user defined groups for the settings that allow them in
development environment.

"can_mention_group" setting can be set to user defined groups
because some of the realms already do that in production.
2024-07-12 09:51:49 -07:00
Anders Kaseorg 4d34a902c9 ui_init: Initialize timerender before information_density.
information_density.initialize uses timerender.stringify_time, and
thus requires timerender.initialize to have been called first.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-11 17:23:30 -07:00
Lauryn Menard b50cd3a75f invite-users: Use "invitation" instead of "invite" for strings.
Updates strings in the user invite modal to use invitation as the
noun/adjective in strings, instead of invite.

Also use "…" rather than three "." characters for ellipses.
2024-07-11 16:50:02 -07:00
N-Shar-ma 82c2da8aae typeahead: Make menu scrollable with up to 50 options.
To increase the number of options available for the user to pick from,
we increase the limit of options shown to 50 for all typeaheads, and
make the menu scrollable. The max height is set to original height of
the composebox typeahead menu, which fit 8 options or to 95% of the
window height, whichever is smaller.

Fixes: #20620.
2024-07-11 16:05:30 -07:00
adnan-td 4cb925a9c8 typeahead: Fix typeahead position using carets.
Utilize textarea-caret package to offset the typeahead position.
Now typeahead is close to the cursor.

Fixes: #29974
2024-07-11 16:04:15 -07:00
Shubham Padia 2becb41931 settings_users: Reactivated user should not get un-greyed on sort.
On reactivate or deactivate, we add appropriate class through JQuery.
But that class only remains there until sort, on sort any of these added
classes will be removed. We did not face the problem of un-greying for
active users page, because deactivated_users class was added to the HTML
always if `is_active` was false for the user.
In this commit, we rename `reactivated_user` to `active-user` and this
class will be present for all active users, even on the active users
table. For the deactivated users table, we will have scoped css that
will grey out the row with `active-user` class.
2024-07-11 12:16:12 -07:00
dhruv-goyal-10 0dc8402221 settings: Don't show last active in deactivated users table.
Fixed #29894.
We were using `is_active` to determine whether to show that column or
not. In case of deactivated table, on reactivating a user, `is_active`
will become true for that user, but we still don't want to show that
column and mess up our layout. Same would happen in the active users
table when a user was deactivated and the `is_active` would become
false. It is better to control the column to be shown on a per-table
basis and we introduced `display_last_active_column` to control that.

Co-authored-by: shubham-padia <shubham@zulip.com>
2024-07-11 12:16:12 -07:00
Aman Agrawal 13f2e7b7be help: Fix help center loading scrolled down.
We were trying scroll the highlighted element but it also scrolls
the parent elements leading to scrolling of the help doc.

We don't need to scroll here at all actually since focused element
is scrolled to be visible by default. Tested in chrome, firefox
and safari on mac.
2024-07-11 10:01:04 -07:00
Prakhar Pratyush 909a2efb43 channel: Don't show "You subscribed to" bookend on channel creation.
Three events i.e. 'stream create', 'subscription add', and
'message' event are received by client on channel creation.

Earlier, we were narrowing to channel while processing the
'stream create' event. This was resulting in fetching messages
for that narrow even before adding subscription. This resulted
in a bug where "You subscribed to" bookend was visible in the
message feed after the "channel events" message.

This commit updates the logic to narrow ONLY after adding
subscription i.e. while processing "subscription add" event.

Note: A channel creator who is not going to subscribe to the
channel themselves is NOT narrowed to the channel view.

This fixes the incorrect behavior.
2024-07-11 09:51:55 -07:00
Shubham Padia 6c152b3adc account_settings: Make change password similar to other setting buttons.
Fixes #30691.
We've removed the pencil icon and renamed the button to `Change your
password`. We've also removed the `.small` and `.btn-link` classes.
We also changed the `Password` label to use the `.settings-field-label`
class, same as the other labels for settings.
2024-07-11 09:49:27 -07:00
Shubham Padia 73e9d9da64 account_settings: Make change email similar to other settings buttons.
We removed the pencil icon, `.btn-link` and `.small` classes.
We also changed the `Email` label to use the `.settings-field-label`
class, same as the other labels for settings.
2024-07-11 09:49:27 -07:00
Shubham Padia 6085212574 settings: Make change language button similar to other settings buttons.
We've removed the pencil icon and removed the `.small` class from the
button.
This setting button is being used in two places: Changing your personal
language and changing the org-wide language for emails. That is why
we have used the `Change the language` generic tooltip instead of
`Change your language` tooltip.
2024-07-11 09:49:27 -07:00
Shubham Padia 08ee4be121 account_settings: Remove unused id and classes for password field.
`.change_password_button` and `#pw_change_link` were unused.
I've not checked for any other unused classes in this page, only
the password field. This was noticed when trying to make a layout
change for the password field and the change was moved to a preparatory
commit for the same.
2024-07-11 09:49:27 -07:00
Sayam Samal 6b5618b9d8 stream_popover: Link to channel settings' "Personal" tab conditionally.
This commit adds a link to the "Personal" tab of the channel settings
modal from the "Channel settings" link in the channel actions popover
when the user doesn't have the permission to change the channel
permissions.

Fixes #30529.
2024-07-11 09:44:57 -07:00
Sayam Samal 15e26b9f32 stream_popover: Enable popover for spectators.
This enables the stream popover for spectators, by unhiding the triple
vertical dots button in the stream sidebar row.

In the spectators' version of the popover, we only show the
"Copy link to channel" option.

Fixes part of #30529.
2024-07-11 09:44:57 -07:00
Sayam Samal 2c604666f9 stream_popover: Add menu option to copy channel link to clipboard.
Now that the channel name in the left sidebar links to the topmost
topic, we add a new menu option that lets us copy the channel feed link
to the clipboard.

Fixes part of #30529.
2024-07-11 09:44:57 -07:00
Sayam Samal b3be4150d9 stream_popover: Reorganize the menu options in the channel popover.
This commit reorganizes the channel actions popover to group related
actions together.

As noted by Alya Abbott in CZO, the logic behind the grouping is as
follows:
* The top section is things you might do as part of your workflow for
  using Zulip.
* The second section is for managing the channel itself.
* "Change color" is kept independently in the last section because of
  how the color picker takes over a big chunk of the menu when opened.

Fixes part of #30529.
2024-07-11 09:44:57 -07:00
Sahil Batra c313a85e25 stream-settings: Fix stream privacy update event handling.
There was a bug when updating stream privacy with message list
not narrowed to a stream as 'narrow_state.stream_sub().stream_id',
added in 933195f7a5, tried to access stream_id field even when
`narrow_state.stream_sub()` returned undefined.
2024-07-11 09:27:59 -07:00
Alex Vandiver 4bc563128e thumbnail: Use a consistent set of supported image types. 2024-07-11 07:31:39 -07:00
iks1 10c15de0c6 popovers: Simplify instructions for moving topics/messages.
Modified the `Select a channel below or change topic name.`
instruction in `move topics/move messages` modal.
It's not necessary and can be confusing when user does not
have permissions to change the channel and topic name.

1) On the `Move topic` modal, dropped the line
2) On the `Move messages` modal, replaced the
   line with `Move messages to:`

Fixes #30055.
2024-07-10 20:35:40 -07:00
evykassirer 4280524904 search pills: Expand group DM pill vertically when it overflows. 2024-07-10 17:44:04 -07:00
evykassirer 9c45e43706 search pills: Prevent overflow in the typeahead for very long pills. 2024-07-10 17:44:04 -07:00
evykassirer 7cb00d171e search pills: Prevent overflow for very long pills. 2024-07-10 17:44:04 -07:00
roanster007 dc1fb85cf0 popovers: Fix page reload on enter in move message modal.
Previously, when enter was pressed in the move messages
modal, it used to trigger page reload because the enter
event of the modal was not handled.

This commit fixes it by adding the "form_id" field while
launching the dialog_widget.

Fixes #29655
2024-07-10 16:20:25 -07:00
N-Shar-ma 9a8f1c9b5d css: Exclude lock icons in dropdowns from being unnecessarily pulled up.
This fixes the issue where the lock icon, most noticeably in the compose
recipient stream dropdown, was placed too high.
2024-07-10 15:13:08 -07:00
Sayam Samal 98c825ebfe send_later_popover: Rename "Drafts" -> "View drafts".
This makes the drafts option more consistent with the rest of the menu
options, which use the imperative mood.
2024-07-10 15:05:37 -07:00
Sayam Samal e0ec522f70 send_later_popover: Redesign popover and add accessibility improvements.
As part of the popover menu redesign, this redesigns the compose send
options popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.

Fixes #25117.
2024-07-10 15:05:37 -07:00
Aman Agrawal e5e5ba6cea css: Scale typeaheads / dropdowns with font size.
Fixes #30780

Adjusted both width and line height of typeaheads and dropdown widgets
to scale font size.
2024-07-10 12:56:58 -07:00
Aman Agrawal a5c922a99f search: Remove unintentional propagation of CSS properties.
This doesn't introduce any bugs yet but it can if left unchecked.
2024-07-10 12:56:58 -07:00
Aman Agrawal b3e0cc61e5 css: Remove old typeahead css.
We already have the behaviour for this that we want in typeahead.css.
This CSS produces problems for rendered markdown as it propagates
to it.
2024-07-10 12:56:58 -07:00
Sayam Samal 1b1f2411d8 user_group_popover: Redesign popover using the new "popover-menu" theme.
As part of the popover menu redesign, this commit redesigns the user
group info popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.

Fixes part of #28699.
2024-07-10 12:54:05 -07:00
Kislay Verma cc7df6d85b presence: Sync presence indicators across the frontend.
User circles indicating their presence are now synced across
all the places they appear, except for:
- navbar_personal_menu_popover - since the status
   there will never change.
- typeahead_ist_item - because it is short-lived.

Fixes #30536
2024-07-10 11:01:44 -07:00
Prakhar Pratyush b0dbfc96a3 stream_settings_ui: Fix a stale comment.
In 30d15d58fb, we made the
change to redirect to the newly created stream interleaved
view instead of "stream events" topic of that stream.

The comment related to it was not updated accordingly.

This commit updates the comment.
2024-07-10 10:50:37 -07:00
evykassirer 992ae6fdaf search: Vertically center search pills in search bar. 2024-07-09 18:37:05 -07:00
Kislay Verma 825590dde2 copy_and_paste: Refactor `is_safe_url_paste_target`.
This commit separates the checking of whether the cursor is
at markdown link marker into its own function, which will be
used in #29136 to decide whether to format pasted urls or not.
2024-07-09 17:24:52 -07:00
Sahil Batra bdcab71a4d stream-settings: Allow tabs to be wider.
This commit changes the width of tabs in stream and
group settings to be set as per the text inside it
with the previous width being set as minimum width
to avoid tabs being too small.

Fixes #30672.
2024-07-09 17:12:47 -07:00
Sahil Batra c4d84d1e5c settings: Allow tabs in bots list to be wider.
This commit changes the width of tabs in bots panel
to be set as per the text inside it with the previous
width being set as minimum width to avoid tabs being
too small.
2024-07-09 17:12:47 -07:00
Sahil Batra 5f0cd901fc settings: Allow group based dropdown widget menu to be wider.
This commit updates the dropdown menu width to be set such that
the menu is wide enough to have options in a single line.

This change is only for group-based setting dropdowns in
organization, stream and group settigs.

Fixes #30673.
2024-07-09 17:11:15 -07:00
Sahil Batra 5704bf72e0 settings: Increase width of setting dropdown widget buttons.
We now do not restrict the width of dropdown widget buttons
so that the width can be increased when the font size increases
and also if the option selected is long due to langauge.

We have similar behavior for the select element except that
the width of select element is set according to the longest
option while for dropdown widgets the button width is set
as per the current selected value.

This change is only for group-based setting dropdowns in
organization, stream and group settigs.
2024-07-09 17:11:15 -07:00
evykassirer ec2d280b7b filter: Remove unused parts of is_valid_search_term. 2024-07-09 17:08:45 -07:00
evykassirer 55ddf170a5 typeahead: Remove naturalSearch option.
This was only relevant for search, which doesn't need
it anymore now that it's moved to pills.
2024-07-09 17:08:45 -07:00
evykassirer 991c8451cd search pills: Allow typing new query just after opening search.
This simulates the user experience of a text input with the existing
content selected/highlighted.
2024-07-09 17:08:45 -07:00
evykassirer d655ab8570 search pills: Rework pills sizes and layout. 2024-07-09 17:08:45 -07:00
evykassirer be09d751fa search pills: Keep search terms as free text instead of pills.
We want to do this to make it clearer to the user that they're
searching for separate words and not a continuous phrase.
2024-07-09 17:08:45 -07:00
evykassirer 5463f641e4 search pills: Don't show invalid terms in search suggestions.
This commit hides invalid terms, since we don't want to be suggesting
invalid options to the user. We had already hidden invalid has and is
in the past, but this will also hide things like invalid channels or
user suggestions.

In the future it would be helpful to do two followups:

(1) Update the text for invalid is and has in search_description.hbs
    since it looks a bit strange (though not introduced here). This
    only shows up if you typed an invalid is/has and then start
    typing a term beside it, so it's not very likely to happen.

(2) Don't auto-highlight the first typeahead result when there are
    no valid suggestions for the last text term. This seems hard
    to implement, so I'm leaving that out for now.
2024-07-09 17:08:45 -07:00
evykassirer c3786223e5 search pills: Validate pills with shake animation when invalid. 2024-07-09 17:08:45 -07:00
evykassirer fc95987b8d search pills: Add space before the colon and remove +.
The + is HTML-encoding of the search operator for submission to the
server, and shouldn't appear visibly to users.
2024-07-09 17:08:45 -07:00
evykassirer 11bb44c7cc search pills: Direct message group pill support.
This supports adding users to DM pills by simply typing
a user's name in the text input directly after a complete
dm pill. It only works for DM pills at the end of search
input.

Clicking the X button removes a user from its user pill
container, and if that user was the last user left in the
container, then the whole container is also removed.
2024-07-09 17:08:45 -07:00
evykassirer 278edb1b3f search pills: Make partial search terms text instead of pills.
When the user has selected e.g. "dm:" from the typeahead, we want
to keep this as text, and let them type the search term in full
before it's pill-ified.
2024-07-09 17:08:45 -07:00
evykassirer 16e1387924 search pills: Differentiate between pill and text search query.
Most search suggestions are determined using the "last" search
input term, and the "rest" of the terms. Previously the "last"
term was whatever was at the end of the search query, and we
didn't differentiate between a completed term or an in-progress
term.

Now that there are search pills, we can differentiate between
completed and in-progress search terms, which clarifies some of
the search suggestion logic, and which we'll need to support
group pills and adding users to existing group pills.
2024-07-09 17:08:45 -07:00
evykassirer a39fe910d8 search pills: Use grid to support pill overflow styling.
Previously, search pill overflow was broken (sticking out of the
search box to the right) and now the search bar extends vertically to
allow pills to wrap when there are too many pills for one line.
2024-07-09 17:08:45 -07:00
evykassirer e3f85e5cfe search pills: Fix high cursor and no placeholder for empty input. 2024-07-09 17:08:45 -07:00
evykassirer 38e58ea3d6 search: Use pills in the search bar.
This initial commit is fairly bare-bones, and does not have the full
contemplated functionality.
2024-07-09 17:08:45 -07:00
evykassirer 0ab4f84561 search: Move search from input field to contenteditable div for pills.
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.
2024-07-09 17:08:45 -07:00
evykassirer 5211488b9c input pill: Add convert_to_pill_on_enter option.
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.
2024-07-09 17:08:45 -07:00
evykassirer 141e08f587 input pill: Add option for splitting input text on comma.
This will be important for search pills, which can have
values that contain commas.
2024-07-09 17:08:45 -07:00
evykassirer da15cf61b8 typeahead: Add updateElementContent and hideAfterSelect options.
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
2024-07-09 17:08:45 -07:00
evykassirer 787af0aa5d typeahead: Add allowNoHighlight option. 2024-07-09 17:08:45 -07:00
evykassirer 60b056617d recent conversations: Prevent navigation when search is in focus.
We don't want left/right arrow while in the search bar to move
focus into recent conversations. Adding this check prevents
will prevent that from happening when we let left/right arrow
events propagate (in an upcoming commit for search pills).

More context:
https://chat.zulip.org/#narrow/stream/101-design/topic/search.20pills.20left-arrow.20recent.20view.20.2326803/near/1838399
2024-07-09 17:08:45 -07:00
evykassirer 7a160d45bd filter: Add channels/streams to valid search operators. 2024-07-09 17:08:45 -07:00
Tim Abbott 6b5847dbf7 timerender: Fix should_display_profile_incomplete_alert.
new Date requires timestamps in milliseconds.
2024-07-09 16:42:23 -07:00
Tim Abbott f7c9c0753b invite_user: Streams => Channels in placeholder.
The PR adding this stream was written before the streams/channels
transition.
2024-07-09 16:42:23 -07:00
Alya Abbott 2b4715e7ea mentions view: Rename stream -> channel in empty view placeholder. 2024-07-09 16:18:17 -07:00
Alya Abbott df578e9264 onboarding: Update introductions to Inbox and Recent conversations.
- Make more succinct; don't over-describe UI the user can't see yet.
- Remove links (there are help links in view descriptions now).
- Explain where topics come from.
2024-07-09 15:55:50 -07:00
Tim Abbott cda201176c popovers: Disable autocomplete on popover filter widgets. 2024-07-09 15:46:49 -07:00
N-Shar-ma b4ccde42ce compose: Remove dividers and reduce button width at narrow mobile sizes.
At widths under 400px, buttons in the popover were running off the edge,
which is fixed by removing the dividers between them.

For the new info density, buttons in the original row, even despite
removing the dividers, were still not fitting, so their width has been
slightly reduced.
2024-07-09 13:38:44 -07:00
N-Shar-ma c7a3623b30 compose: Adjust media queries for the buttons row as per info density. 2024-07-09 13:38:44 -07:00
Karl Stolley c76fc2e942 compose_box: Scale send buttons with info density.
Because the formatting buttons are integrated with the message box,
the send button and its accompanying vdots now share the same
button dimensions.
2024-07-09 13:38:44 -07:00
Karl Stolley 7b5f0e4d89 compose_box: Scale formatting buttons with info density. 2024-07-09 13:38:44 -07:00
Aman Agrawal 153f983b01 settings: Allow tab switcher text to expand to show full text.
Instead of showing ellipsis if the content of the tab switcher is
more than the width, we now allow it to take more width to show
full text.

If we don't have enough space to show the full text to show on
small screen sizes, we use ellipsis for overflowing text.

Increased sidebar width by 5px to accomodate full tab switcher
at both 14px and 16px font sizes.
2024-07-09 13:18:03 -07:00
tnmkr 6613efeca3 org_settings: Fix dropdown color in `Organization settings` section.
This fixes the text color for .dropdown-widget-button dropdowns both in
enabled and disabled state.
2024-07-09 13:11:53 -07:00
tnmkr fcade635f8 org_settings: Fix repeated css for `Organization permissions` section.
These `background-color` and `cursor` rules are not needed here as the
`.dropdown-widget-button` base class already defines these properties
for `:disabled` pseudo-selector and there is no need to repeat here
again.
2024-07-09 13:11:53 -07:00
tnmkr 92f5b7d86a app_components: Fix opacity for disabled .dropdown-widget-button.
This is a follow up to previous commit
fe0a068ee5. We want
`.dropdown-widget-button` dropdowns to look same as `select` dropdowns.

This commit fixes opacity for all `.dropdown-widget-button`, which then
makes repetition in `settings.css` unnecessary.
2024-07-09 13:11:53 -07:00
tnmkr 13c4f281ab css: Normalize opacity on `select:disabled` elements.
We are setting the opacity to Chrome's 0.7 because that is what most
select fields in Organization settings are styled for.
2024-07-09 13:11:53 -07:00
tnmkr f94c55229f stream_settings: Fix .dropdown-widget-button color.
Fixes "Who can unsubscribe others from this channel?" dropdown to match
other dropdowns.
2024-07-09 13:11:53 -07:00
tnmkr 4563fe07bc stream_settings: Fix "Advanced configurations" always enabled.
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.
2024-07-09 13:11:53 -07:00
tnmkr 58d91de1d6 stream_settings: Fix blue color on hover for creator pill.
These pills were added in b524a2c1ea.
2024-07-09 13:11:53 -07:00
shashank-23002 d6146d77c1 tooltips: Use tippy to display tooltips.
Fixes: #27817
Co-Authored-By: linn.peterson <linn@pajp.net>
Co-Authored-By: Aman Agrawal <amanagr@zulip.com>
2024-07-09 13:09:56 -07:00
Sahil Batra 9ecaa6338d invites: Fix zod schema for multiuse invites.
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.
2024-07-09 10:32:45 -07:00
Aman Agrawal ad4a1a316d typeahead: Fix typeahead items wrapping to next line. 2024-07-09 09:42:10 -07:00
Aman Agrawal 495c83eb46 typeahead: Fix unintentional propagation of CSS properties. 2024-07-09 09:42:10 -07:00
Aman Agrawal 84f22440dd rendered_markdown: Fix text wrapping in message view header.
For elements that can wrap in a rendered markdown, we don't want them
to in places like message view header.
2024-07-09 09:42:10 -07:00
Aman Agrawal 2a0dbd22a5 search: Allow typeahead item in search to occupy full width. 2024-07-09 09:42:10 -07:00
Aman Agrawal df542e9a9b css: Keep typeahead CSS together.
Also removed the comment which is no longer useful.
2024-07-09 09:42:10 -07:00
Aman Agrawal d14104cc5d css: Keep typeahead CSS together. 2024-07-09 09:42:10 -07:00
Aman Agrawal bb440e0a7a typeahead: Move CSS file with other styles.
We want to keep typeaheads CSS together to make it easy to reason
about changes and this looks like the right file to keep the
CSS in.
2024-07-09 09:42:10 -07:00
Aman Agrawal e3baac1ba0 css: Remove unused `pointer` class.
We don't have an element with class pointer on it.
2024-07-09 09:42:10 -07:00
Aman Agrawal a66bd21a5b css: Remove stale `actual-dropdown-menu` code.
Removed in bc3d48616e.
2024-07-09 09:42:10 -07:00
Aman Agrawal 3ad2f5e85b info_overlay: Render poll widget header without font size reduction.
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.
2024-07-08 23:53:55 -07:00
Vector73 121043b6f2 settings: Remove private_message_policy setting.
Removes `private_message_policy` field from both the API and
the backend.
2024-07-08 19:34:17 -07:00
Vector73 6098c2cebe settings: Add two realm settings to restrict direct messages.
Fixes #24467.
2024-07-08 19:34:17 -07:00
Alya Abbott cd7ee31acf help: Consistently refer to interleaved channel view as "channel feed". 2024-07-08 16:17:13 -07:00
adnan-td c6d975f44d compose: Align multi-line text in dropdowns.
Using flexbox to left-align icon with the text
on the first line.

Fixes part of #30469.
2024-07-08 13:58:17 -07:00
Aman Agrawal 3e16d61015 stream_sidebar_row: Show stream sidebar menu icon for spectators.
Fixes #30565

Allow spectators to access stream sidebar popover so that they can
select go to channel feed.
2024-07-08 13:56:13 -07:00
sujal 6589720424 stream_sidebar: Implement stream navigation behavior.
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>
2024-07-08 13:56:13 -07:00
Aman Agrawal 9fc6b93347 user_settings: Add option to configure channel click behavior.
This commit does not implement the setting's behavior, just the API
change and settings UI.
2024-07-08 13:56:13 -07:00
Aman Agrawal 7e9a01ea7f ui_init: Remove duplicate user sidebar build call.
`message_view.show` already calls and ideally should call
activity_ui.build_user_sidebar, so this call is not needed here.
2024-07-08 13:56:13 -07:00
Shubham Padia 682a214d65 pm_list: Esc should clear search input if focused.
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.
2024-07-08 13:17:05 -07:00
Shubham Padia 76e8ec114a pm_list: Add search to direct message section.
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.
2024-07-08 13:17:05 -07:00
Shubham Padia 188dd87eec people: Add dm_matches_search_string for DM filter.
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.
2024-07-08 13:17:05 -07:00
Prakhar Pratyush ab13b7f6fa compose: Don't jump to sent message conversation if setting disabled.
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.
2024-07-08 13:00:12 -07:00
Prakhar Pratyush 83414db72e settings: Add 'web_navigate_to_sent_message' setting.
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.
2024-07-08 13:00:12 -07:00
Shubham Padia 8782625f07 left_sidebar: Remove `#direct-messages-sticky-header`.
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.
2024-07-08 11:43:02 -07:00
Shubham Padia 737e075cc3 left_sidebar: Remove unnecessary nested `#direct-messages-section`.
`#direct-messages-section-header` will take over existing behaviour of
`#direct-messages-section`.
2024-07-08 11:43:02 -07:00
Shubham Padia 847ff6ee21 left_sidebar: Rewrite `back to channels` to use css grid.
While the TODO comment we deleted in left_sidebar.css says we need to
rewrite both show more and show less button to grids; show more was
already a grid.
There have been some very slight changes in the actual size of the back
to channels row; those changes make the row more consistent with the
rest of the left sidebar rows in terms of sizing.

We've introduced a new class called `.hide-more-direct-messages-text`
that applies the same properties as the `span` selector used to. We are
using a class because of better performance when selecting, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more info on the why,
The `font-size` was moved inside the above class, so that when setting
the line-height of the anchor component, the `em` refers to the normal
font size and not the smaller font size for `back to channels`.

We've moved the link inside `.direct-messages-section-header` and most
of the grid properties are inherited from that element.

This is a preparatory commit to introduce DM filter in #30332.
2024-07-08 11:43:02 -07:00
Alya Abbott 939b28c35b portico: Add subtitle (for distributed teams).
The CSS had been removed in bb6e6ecaa5.
2024-07-07 22:44:04 -07:00
Kenneth Rodrigues 07b54e986b topic: Focus on confirm dialog when merging topics.
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.
2024-07-07 21:34:52 -07:00
adnan-td 54be4443ae typeahead: Fix typeahead position not updating on pill remove.
Calls popper instance update method to refresh the position
of the typeahead menu.
2024-07-07 12:50:40 -07:00
Varun Singh 8236ed8205 emoji_picker: Convert module to TypeScript. 2024-07-07 11:36:38 -07:00
Tim Abbott eee7c8a436 emoji_picker: Remove unused parameter to toggle_emoji_reaction.
This has been unused since it was introduced in
5bb10036b57bca36d531a74e8b03188d43ec7862; presumably leftover from a
previous version of the original PR.
2024-07-07 11:34:13 -07:00
Varun Singh a7b3dbfdd7 typeahead: Rework `sort_emojis` function.
When `sort_emojis` function was called from emoji_picker
module, the passed arguments did not contain `reaction_type`
field. As a result the first conditional of `is_popular` function
inside `sort_emojis` always failed -- hence the array
`popular_emoji_matches` was always empty`[]`. This compromised
search especially the order of filtered emojis.

Instead of checking for `reaction_type` === "unicode_emoji" -- we
check `is_realm_emoji` field is false. Since `is_realm_emoji`
field in always present and also results in easier types, this
should be prefered over adding `reaction_type` field to the passed
arguments.

Fixes zulip#30439
2024-07-07 11:33:41 -07:00
roanster007 99a80639f4 recipient_row: Remove extra whitespace around recipient full name.
This commit removes the whitespaces between "You and" and the
user full names, thus fixing the puppeteer flake.
2024-07-06 21:20:09 -07:00
Shashank Singh 4cce94b667 invites: Add option to receive notification on accepted invitations.
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
2024-07-05 17:14:45 -07:00
Pratik Chanda a7703e9f5f left_sidebar: Open topic menu when clicking on follow topic icon.
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.
2024-07-05 16:36:49 -07:00
Pratik Chanda 72f0695e34 tooltip: Fix topic status tooltip not showing on hovering.
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.
2024-07-05 16:36:49 -07:00
Pratik Chanda 3d8fac370e tooltip: Refactor recipient_bar_icon tooltip tooltip in message feed.
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.
2024-07-05 16:36:49 -07:00
afeefuddin 5ff32c7ad0 user_group_create: Convert module to TypeScript. 2024-07-05 16:17:59 -07:00
afeefuddin 549e7db551 user_group_create: Don't return unused channel request object. 2024-07-05 16:17:59 -07:00
afeefuddin a01fcd3d94 user_group_components: Fix inaccurate parameter types in functions. 2024-07-05 16:17:59 -07:00
Varun Singh 48360291b0 user_group_edit_members: Initialise `users` data as empty arrays. 2024-07-05 16:15:17 -07:00
Varun Singh e03778141d stream_edit_subscribers: Initialise `users` data as empty arrays. 2024-07-05 16:15:17 -07:00
Pratik Chanda 897852f130 typeahead: Remove highlight for suggestions with empty query.
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.
2024-07-05 16:13:58 -07:00
Karl Stolley d3b13cf15c message_controls: Reduce control button width to match padded icon. 2024-07-05 15:53:50 -07:00
Karl Stolley 79a2e0a1c4 message_controls: Scale on :active without disturbing clickable space. 2024-07-05 15:53:50 -07:00
Vector73 e699825296 compose_typeahead: Fix position of unsubscribed icon.
Fixes position of unsubscribed icon so that it appears in the same line
as the list item of the typeahead and prevent typeahead to increase in
width when the icon is shown.
2024-07-05 15:26:36 -07:00
Vector73 67d85508be compose_typeahead: Show emojis in stream description typeahead.
Uses markdown rendered version of description instead of plain description
text in stream typeahead.
2024-07-05 15:26:36 -07:00
N-Shar-ma b85e41df47 compose: Make compose close cross button smaller and add active state.
The background color's opacity is reduced for the button's active state.
2024-07-05 15:21:34 -07:00
N-Shar-ma 29be4236d0 compose: Rework paddings for the compose content for more symmetry.
The space above and to the left of the recipient area is now matched
to the space below it, and this is also the space above and on the sides
of a collapsed compose row.
2024-07-05 15:21:34 -07:00
afeefuddin 2217eededc user_profile: Pass correct element to toggle_submit_button. 2024-07-05 15:14:24 -07:00
Aman Agrawal 8f0a0af588 server_events_dispatch: Fix stream archived booked not displayed.
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.
2024-07-05 14:59:32 -07:00
Aman Agrawal 933195f7a5 stream_settings_ui: Fix stream privacy icon not updated in msg list.
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.
2024-07-05 14:59:32 -07:00
Aman Agrawal 9b561212d3 message_list: Show `subscribed` bookend on subscribing a stream.
This fixes a bug where no bookend was displayed when user subscribed
to a stream but a bookend was displayed when a new message is sent
in the stream.
2024-07-05 14:59:32 -07:00
Aman Agrawal 6f0fdef80d message_list: Move condition to render update_trailing_bookend.
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.
2024-07-05 14:59:30 -07:00
N-Shar-ma 6099364183 compose: Fix flashing effect on trying to send message that's too long.
Due to a wrong CSS selector, the expected red outline flashing effect
was not being applied to the compose box when the user tried to send a
message that was longer than the maximum allowed length. Also, the
iteration count is set to 3 instead of relying on the duration the CSS
class is applied, to ensure exactly 3 flashes without any glitches.
2024-07-05 14:44:13 -07:00
Karl Stolley e42f9a1efd right_sidebar: Calculate margin-top on shortcuts. 2024-07-05 14:38:28 -07:00
Karl Stolley 97d401a0a1 left_sidebar: Calculate bottom scrolling buffer. 2024-07-05 14:38:28 -07:00
Aman Agrawal 41b431de70 info-overlay: Adjust width of overlay and columns.
Objectives are to make the width of overlay scale with font size and
reduce too much gap between text end of first column and
text start of the other column.
2024-07-05 11:36:35 -07:00
Aman Agrawal 676ddf8c30 information_overlays: Inline poll question and edit icon. 2024-07-05 11:36:35 -07:00
Karl Stolley 1410a0acb3 message_box: Ensure emoji display correctly on messages with senders. 2024-07-05 10:25:59 -07:00
Sahil Batra d9da6d17e0 settings: Remove max-height for bots box container.
This helps us in avoiding the scrollbar inside the box
if the information density setting is set to 16/140 by
allowing the box to set its height as per the content.

There is no need for max-height since the height of the
box was anyways less than the max-height value set before
at normal font size and screen widths.

For narrow screens, the max-height property was set to unset,
so removing the max-height property does not have any effect
on how the bots are shown on narrow screens.

Fixes #30669.
2024-07-04 07:57:32 -07:00
N-Shar-ma fa2f86ff80 compose: Fix the calculation of the compose box's max height.
This is a follow up to #30396, to remove consideration of the text box's
margin after it's removal in #29953.
2024-07-03 18:54:15 -07:00
Sayam Samal 3fda65c37d playground_popover: Update external code btn behavior on setting change.
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.
2024-07-03 17:01:46 -07:00
Sayam Samal 5191a80a3a playground_popover: Fix bug where the playground popover doesn't reopen.
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.
2024-07-03 17:01:46 -07:00
Sayam Samal fe1f8afb1b playground_popover: Redesign popover using the new "popover-menu" theme.
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.
2024-07-03 17:01:46 -07:00
Aman Agrawal 621ae91c70 settings: Use box buttons for download and delete.
Co-authored-by: Shashank Singh <shashanksingh@Shashanks-Air.mshome.net>
2024-07-03 16:53:39 -07:00
Kislay Verma 4bd9a8ce50 composebox_typeahead: Fix checking whether messages can be sent.
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
2024-07-03 16:24:10 -07:00
Karl Stolley 9fb6b4d016 left_sidebar: More carefully generate auto rows for expanded nav. 2024-07-03 16:18:45 -07:00
Karl Stolley 35642cb941 recent_view: Set a shared column for filter icons. 2024-07-03 16:15:46 -07:00
Aman Agrawal aed809dd7c 5xx: Remove duplicate `error_page` class applied on page.
We only want to apply this class on the actual content of the page.
2024-07-03 13:35:12 -07:00
Varun Singh 2823e732de user_group_edit_members: Remove redundant conditionals. 2024-07-03 12:34:30 -07:00
Varun Singh 8409a04c03 user_group_edit_members: Convert module to TypeScript. 2024-07-03 12:34:30 -07:00
Karl Stolley 2c7e264480 tippy: Ensure a normal font-weight on Tippies. 2024-07-03 10:43:25 -07:00
Karl Stolley 46f5854185 tippy: Initialize maxWidth in em units. 2024-07-03 10:43:25 -07:00
Karl Stolley cbdfdf06b4 tippy: Allow Tippy tooltips to scale with UI. 2024-07-03 10:43:25 -07:00
Aman Agrawal 59e9a1ac90 recipient_row: Remove extra whitespace around recipient full name.
Might fix the CI errors due to extra space between `You and` and
the user full name.
2024-07-03 10:38:35 -07:00
Aman Agrawal ef49c29ddf recent_view_ui: Update if all msgs in topic were deleted. 2024-07-02 23:01:16 -07:00
Aman Agrawal b99ff8f34c recent_view_ui: Do single update instead of doing multiple rerenders. 2024-07-02 23:01:16 -07:00
Vector73 b306233cab pm_conversation: Add new has_conversation helper.
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>
2024-07-02 19:02:41 -07:00
evykassirer 9dd36b4727 filter: Add validation function for search pill terms. 2024-07-02 16:25:45 -07:00
Tim Abbott da6c2e0c3c settings: Rename Deactivated users settings subtab.
Includes help center updates to better link to the tab.

Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/deactivated.20users.20tab/near/1843114
2024-07-02 13:53:31 -07:00
Shubham Padia ba05e8eeac custom_profile_fields: Initialize typeahead for every pronoun field.
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>
2024-07-02 13:30:40 -07:00
Karl Stolley 58b40fb6c7 privacy_icon: Raise lock icon throughout UI for better visual centering. 2024-07-02 13:24:16 -07:00
Shubham Padia e539d2226b stream_create: Move `Add all users` beside `Choose subscribers`.
Fixes part of #30690.
We also drop the `Do you want to add everyone?` text.
2024-07-02 12:54:52 -07:00
Shubham Padia 49f6fc5a40 scroll: Set outline as none for `.simplebar-content-wrapper`.
We're reverting removing `outline: none` from commit
fe11f3be7c. While we set tabIndex to -1 in
that commit, which makes sure that it does not get focus when navigating
via a keyboard. But it does not prevent us from programmatically focusing
on the element. In this case, we don't want to see the outline.

Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20weird.20left.20sidebar.20outline/near/1834137
2024-07-02 12:47:44 -07:00
Kenneth Rodrigues 57167b2e2e reactions view: Add narrow title.
Earlier the narrow title for `sender:me` was being displayed.
Instead, display the narrow title for `has:reaction sender:me`.
2024-07-02 12:18:55 -07:00
nikhil singh b75bdc129b
emoji: Change event trigger for emoji_picker.js.
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.
2024-07-02 12:09:55 -07:00
Karl Stolley 51d25bad09 message_row: Only set bottom margin on avatar for me-messages. 2024-07-02 11:45:30 -07:00
Karl Stolley 47430ac719 message_row: Allow user avatar to scale with UI. 2024-07-02 11:45:30 -07:00
Karl Stolley 0f05c67c88 message_box: Set same vertical space below reactions, length toggles. 2024-07-02 11:45:30 -07:00
Karl Stolley 8697c0c63e message_box: Base sender line-height on single-line message. 2024-07-02 11:45:30 -07:00
Karl Stolley 8556e098fb message_box: Set vertical margin to interelement space. 2024-07-02 11:45:30 -07:00
PieterCK b2515e8214 subscription css: Add new app variable for bottom border color.
This commit add a new css variable for subscription lists bottom
border color.

Fixes #30677.
2024-07-02 11:16:51 -07:00
PieterCK 7556414337 subscription css: Refactor subscriber list bottom border.
This commit refactors the css for subscriber list in channel
settings and group settings by moving the css rules that were
initially used to format the bottom border of the table to
the wrapper div (.subscriber_list_container) around the table.

On specific screen height, this wrapper div will overlap the
actual bottom border of the table and make it look like it's
cut-off. This commit makes it look like the table have consistent
bottom border accross all screen sizes.
2024-07-02 11:16:51 -07:00
Karl Stolley 3cb4bb830a left_sidebar: Refactor nav rows for low-resolution screens. 2024-07-02 10:24:20 -07:00
Aman Agrawal ce9c9ddf12 typeahead: Fix search typeahead open on `near` narrows.
This css accidentally got removed in #29882. This bug fix was
originally part of #30514.
2024-07-01 22:33:36 -07:00