Commit Graph

3637 Commits

Author SHA1 Message Date
roanster007 61f6ec0829 narrow_operators: Add `with` operator to `filter.is_conversation_view`.
This commit updates "filter.is_conversation_view" to be true for
"with" operator. This is important because essentially, the "with"
operator lands you in the same view as the channel-topic narrow
or the "dm" narrow i.e., the last unread message of the narrow.

Hence, the "with" narrow should be handled in a similar way
while determining whether to allow automatically marking
messages as read, or displaying the unread banner, etc.

Fixes #30863
2024-07-16 16:46:39 -07:00
sujal shah b5e215824b organization_settings: Convert name to pills.
Display pills Using user_display_only_pill.hbs template
before users are displayed as links after this commit
convert them to pills.

Fixes #24229.
2024-07-16 14:52:17 -07:00
Sahil Batra f937669ba1 user_pill: Show deactivated icon in user_display_only_pill.
This commit adds code to show the deactivated icon for
deactivated users.
2024-07-16 14:52:17 -07:00
Sahil Batra 5b1326668f settings: Control showing custom font size and line height settings. 2024-07-16 14:04:19 -07:00
Sahil Batra b6905777d0 settings: Use checkbox setting to toggle between 14/122 and 16/140.
The "Dense mode" checkbox is renamed to "Compact mode" and is used
to toggle between changing the font-size and line-height settings
between 14/122 and 16/140 configurations.
2024-07-16 14:04:19 -07:00
Prakhar Pratyush df7ed437c2 compose: Show banner to explain interleaved view messages fading.
In an interleaved view when composing a message we fade messages
which the user is not replying to, to reduce the chance they send
a message to a recipient they didn't intend to.
Also, it reduces the visual/cognitive processing required
to figure out where their message is going to go.

But, it's not necessarily clear to users that what the
fading means, so this commit adds a one-time compose banner
to explain what's going on the first time this comes up.

Fixes part of #29076.
2024-07-16 13:52:30 -07:00
Prakhar Pratyush 35380b095f compose: Show banner to explain non interleaved view messages fading.
In a non interleaved view when composing a message to another
conversation we fade messages which the user is not replying to,
to reduce the chance they send a message to a recipient they didn't
intend to. Also, it reduces the visual/cognitive processing required
to figure out where their message is going to go.

But, it's not necessarily clear to users that what the
fading means, so this commit adds a one-time compose banner
to explain what's going on the first time this comes up.

Fixes part of #29076.
2024-07-16 13:52:29 -07:00
Alex Vandiver 556b92810b thumbnail: Advertize the thumbnail formats at client registration. 2024-07-16 13:22:15 -07:00
Pratik Chanda f7c3f1414d search_suggestion: Change suggestion string for has: operator.
Earlier in search suggestion, has: operator returned two different
suggestion string which were `messages with one or more links` and
`messages that contain links`.

This commit changes this to a consistent suggestion string.

Fixes: zulip#30908
2024-07-16 11:03:08 -07:00
Kislay Verma 42a7b7e982 compose: Support `channel` in transforming stream-topic links.
This commit extends the work in #29302 to support the new
"channel" operator, which is synonymous to the "stream" operator
in transforming stream-topic links to the #**stream>topic** syntax.
2024-07-15 14:41:50 -07:00
roanster007 5f3de977d9 narrow_state: Fix `_possible_unread_message_ids` when `with` operator.
This commit removes the unnecessary conditionality that used
to check if the channel and topic of the filter operands in the
"_possible_unread_message_ids" method while checking for
"can_bucket_by("channel", "topic", "with")".

This conditionality is unnecessary essentially because the code path
is executed only when "requires_adjustment_for_moved_with_target"
is false, which happens only after the narrow containing the "with"
operator is adjusted to the correct narrow. Else, it remains true.
2024-07-15 14:00:59 -07:00
roanster007 522f6cfaf9 filter: Fix `adjusted_terms_if_moved` handling for non stream messages.
Previously, when "adjusted_terms_if_moved" was called for non stream
messages, it used to return "null" for adjusted terms. This is true
for some extent since the non stream messages can not be moved.

However, in case of narrow containing "with" operator, this would
be buggy since there, we want the narrow terms to be adjusted
according to the "with" operand to point to the current narrow,
rather than returning null.

This commit updates the method to return null only if  the "raw_terms"
dont contain "with" operator. Else, adjust the "raw_terms" according
to the message.
2024-07-15 14:00:59 -07:00
Varun Singh 884317e407 server_message: Create zod schema to parse message recieved from server.
The commit creates a `server_message.ts` module which
will home our `zod` schema for the messages received
from server. We can then import the schema to parse
the data in needed modules at the API boundaries.
This will also help us write better tests.
2024-07-15 13:55:13 -07:00
evykassirer df23ab32e0 search pills: Always pass quiet=true to clear().
I missed one call.

Followup to https://github.com/zulip/zulip/pull/30889#issuecomment-2229106232
2024-07-15 13:08:39 -07:00
evykassirer ff99a6a04e search: Update narrow when search bar contents change.
further discussion on this change here:
https://chat.zulip.org/#narrow/stream/101-design/topic/.F0.9F.8E.AF.20search.20pills.20.2326803/near/1884358
2024-07-15 12:38:22 -07:00
evykassirer 6510330003 input_pill: Allow removeAllPills to be called with quiet=true. 2024-07-15 12:38:22 -07:00
evykassirer 56149a5a6c message_view: Fix bug in no-operator alias.
`is:home` is invalid, `in:home` is the correct term.
2024-07-15 12:38:22 -07:00
Aman Agrawal b91b643448 dropdown: Fix dropdown partially hidden at small heights.
We generalize the approach used for compose box to apply it for
all the dropdowns.
2024-07-15 12:33:00 -07:00
Aman Agrawal bef8f36518 message_fetch: Don't let recent view errors interrupt msg insertion.
We catch any errors in recent view during message insertion to avoid
it from failing.
2024-07-15 11:35:00 -07:00
Aman Agrawal 7b9d10ae5d message_events: Fix moved messages not rendered if they are not cached.
We used to just drop moved messages from the list of messages to
update if we didn't have them cached. So, if the user is in the
narrow where messages were moved to, user will not see the moved
message if they were not cached locally.

To fix this, we re-render the narrow after fetching messages from
the server.

We don't want to use `fast_track_current_msg_list_to_anchor` here
since that function assumes that current rendered state of the
message list is correct which is not the case here.
2024-07-15 06:48:52 -07:00
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 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 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
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
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
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 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 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 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 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 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
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 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
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 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
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
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
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
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
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 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
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 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