Commit Graph

632 Commits

Author SHA1 Message Date
Julia Bichler f74721d926 compose: Allow un-toggle for links.
When toggling off link formatting, it is assumed that the description
does not contain [ and ] characters, and the url does not contain ( and
) characters.

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-11-21 21:01:17 -08:00
Julia Bichler 2db8563a7e compose: Format button for spoilers.
Note that toggling off spoiler formatting works if either all the
content inside, or the header (if it exists) or both are selected.

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-11-21 21:01:17 -08:00
Julia Bichler df143137ef compose: Format button for code.
Note that toggling off, only works for code blocks without a specified
language. So toggling formatting off only works for code blocks like:
```
code
```
and not:
```javascript
code
```

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-11-21 21:01:17 -08:00
Julia Bichler a872ab2a1a compose: Format button for quotes.
Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-11-21 21:01:17 -08:00
Julia Bichler c83af7c304 compose: Format button for latex.
Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-11-21 21:01:17 -08:00
Julia Bichler 63e5e05643 compose: Format button for strikethrough. 2023-11-21 21:01:17 -08:00
Aman Agrawal 3471e84d7f hotkey: Fix emoji popover not triggered in a narrow width range.
We don't show emoji icon on message on width range even if the
logged in user is not the sender, which causes popover to not
be displayed since the reference is not visible.

To avoid such case in future, we just check if the emoji icon is
visible and if not fallback to the ellipsis icon for reference.
2023-11-21 20:56:31 -08:00
N-Shar-ma 2c318b680b compose: When editing message/s, quote into the last focused edit box.
Until now, when a user quoted and replied to a message, even while
editing another, the quote would be inserted into the compose box. There
was no way to quote into the edit box.

Detecting the edit box to add content too was tricky, since on opening
the message actions popover, that message would be selected, while the
edit box would lose focus.

Now we don't shift focus on opening the message actions popover, keep
track of the last focused textarea and add the quote content to it if
if it's still in the DOM (if the user has not cancelled the editing).

Fixes: #20380.
2023-11-21 11:20:13 -08:00
N-Shar-ma 0d4a74b2c2 compose: Allow `message_id` to be passed into `quote_and_reply`.
Up until now, the currently selected message was the one that was always
quoted. Now if there's a message_id passed in, we'll quote that message
instead, otherwise we'll fall back on the selected message.

This is a prep commit for allowing quoting and replying while editing a
message sent earlier.
2023-11-21 11:20:13 -08:00
N-Shar-ma 5ba178a54f compose: Allow `message_id` to be passed to `respond_to_message`.
Up until now, the currently selected message was the one that was always
responded to. Now if there's a message_id passed in, we'll use that
message instead, otherwise we'll fall back to the selected message.

This is a prep commit for allowing quoting and replying while editing
a message sent earlier.
2023-11-21 11:20:13 -08:00
Prakhar Pratyush 768be7d46d topic_mentions: Fix the incorrect large @-mention notification warning.
Earlier, a 'large @-mention notification' warning that pops up
for stream wildcard mentions was shown for topic wildcard mentions
too, which is incorrect.

This commit fixes the incorrect behavior. We no longer show the
banner for @-topic mentions.

We don't need a banner for @-topic mentions, as those are much less
likely to be used without thinking about it and would rarely be spammy
for a lot of people.

Fixes #27767.
2023-11-21 09:20:56 -08:00
Karl Stolley ae146c3df7 left_sidebar: Grid 'Back to streams' with unread count.
This also hides the usual STREAMS header when zoomed in to more
topics.
2023-11-21 09:16:43 -08:00
evykassirer 02845a1d59 buddy list: Rename key to more accurate user_id. 2023-11-21 08:49:52 -08:00
evykassirer 6481771301 activity_ui: Pass narrow_by_email during initialization.
Like with the left sidebar, this helps avoid circular imports when we
make this module's behavior dependant on narrowing state.
2023-11-21 08:49:10 -08:00
evykassirer 74e66b71ac buddy list: Rename sel variables to selector to avoid abbreviations. 2023-11-20 15:40:42 -08:00
evykassirer aa9d69c728 stream settings: Include section for right panel in the URL.
Fixes #21017.
2023-11-20 15:32:29 -08:00
Aman Agrawal 09009ab03a upgrade: Separate add card and purchase upgrade flow.
We now let user add / update card in a separate session and then
charge users after clicking on the purchase button.
2023-11-20 12:04:56 -08:00
Tim Abbott 08b5bcbdb1 message_list: Remove stale group_date_html calculation.
This has been dead code since b746823e2e
and consumed nontrivial resources.
2023-11-20 08:33:29 -08:00
Anders Kaseorg 8a875b119f people: Remove final use of date-fns-tz.
date-fns-tz does not handle daylight saving time correctly, and can be
replaced with modern browser APIs.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-19 15:21:34 -08:00
Anders Kaseorg 100f91e1c9 timerender: Remove unnecessary get_user_locale function.
Subscripting an empty array does not throw an exception in JavaScript,
"default" is not a valid locale, and the browser APIs already fall
back on unrecognized locales anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-19 15:21:34 -08:00
Prakhar Pratyush c539b8ee46 watchdog: Handle exception in `callback`.
Earlier, in the 'check_for_unsuspend' function, we didn't
handle the exception, if any, during callback execution,
resulting in 'watchdog_time' not always being updated.

This commit handles the exception using the try/catch block.

Fixes #27723.
2023-11-19 15:04:58 -08:00
Karl Stolley 4740a58318 top_navbar: Match navbar icons to left sidebar navigation. 2023-11-17 17:28:54 -08:00
Prakhar Pratyush cc934429fe settings: Add option for followed topics to unread count badge setting.
This commit adds a new option 'DMs, mentions, and followed topics'
to 'desktop_icon_count_display' setting.

The total unread count of DMs, mentions, and followed topics appears
in desktop sidebar and browser tab when this option is configured.

Some existing options are relabeled and renumbered. We finally have:
* All unread messages
* DMs, mentions, and followed topics
* DMs and mentions
* None

Fixes #27503.
2023-11-17 14:07:20 -08:00
N-Shar-ma cec11be7c1 compose: Disable send button when upload/s are in progress.
Earlier, the send button's state was determined independently by the
message length and the upload status, and its containing `div`'s state
was separately determined on recipient change by whether the user had
permission to post in that stream, or if direct messages were allowed
in the organisation. The main problem was that as the message length
check was run on each character input, it often overrode the upload
status check.

Now for consistency, the code has been refactored to always disable the
send button by accordingly styling its containing `div`; and using the
observer pattern we update it anytime the message length, upload status,
or the recipient changes, considering **all** of them together.

(The Save button when editing a message still works like before -- only
dependent on upload status.)

Fixes: #21135.
2023-11-17 10:31:58 -08:00
N-Shar-ma 6bc9092786 compose: Fix bug where extra line breaks were pasted between blocks.
Due to the way turndown pads every block element with 2 new lines, and
makes `br` double space by default, we would get 3 blank lines pasted
when there's just 1 line break between 2 paragraphs.

Now we set `br` to an empty string, and since turndown collapses
sequences of multiple new lines to `\n\n` (1 blank line), so any 2 block
elements will now always have 1 blank line between them, irrespective of
if and how many line breaks there are between them in the copied HTML.
2023-11-17 08:55:55 -08:00
Tim Abbott 3cfe4b720c Revert "linkifiers: Match JS implementation to server implementation."
This reverts commit 091e2f177b.

This version of python_to_js_linkifier fails for at least some real
linkifiers. We'll likely re-introduce this after a bit more debugging.
2023-11-16 14:59:48 -08:00
Sahil Batra 3c8701ee36 streams: Add API endpoint to get stream email.
This commit adds new API endpoint to get stream email which is
used by the web-app as well to get the email when a user tries
to open the stream email modal.

The stream email is returned only to the users who have access
to it. Specifically for private streams only subscribed users
have access to its email. And for public streams, all non-guest
users and only subscribed guests have access to its email.
All users can access email of web-public streams.
2023-11-16 13:25:33 -05:00
Sahil Batra 432001656e streams: Remove "email_address" field from Subscription objects.
This commit removes "email_address" field from Subscription objects
and we would instead a new endpoint in next commit to get email
address for stream with proper access check.

This change also fixes the bug where we would include email address
for the unsubscribed private stream as well when user did not have
permission to send message to the stream, and having email allowed
the unsubscribed user to send message to the stream.

Note that the unsubscribed user can still send message to the stream
if the user had noted down the email before being unsubscribed
and the stream token is not changed after unsubscribing the user.
2023-11-16 13:25:33 -05:00
Karl Stolley 62f5806f42 left_sidebar: Ensure All messages highlight on reload.
Co-Authored-By: Tim Abbott <tabbott@zulip.com>
2023-11-15 17:33:21 -08:00
Karl Stolley 335790dae8 left_sidebar: Add unread streams count to Streams header. 2023-11-15 10:07:04 -08:00
N-Shar-ma bdba280c3d typeahead: Include wildcard mentions in typeahead for small streams.
We refactor the code checking if wildcard mentions are allowed by
renaming the pre-existing function `wildcard_mention_allowed` to
`wildcard_mention_allowed_in_large_stream`, adding a new function
`is_recipient_large_stream`, then redefining `wildcard_mention_allowed`
to combine these two functions.

Fixes: #27248.
2023-11-15 09:02:34 -08:00
Alex Vandiver 091e2f177b linkifiers: Match JS implementation to server implementation.
Since the server-side implementation no longer uses look-ahead
or (more importantly) look-behind, it is possible to exactly implement
in Javascript.  This removes a common class which would prevent local
echo.

This requires reworking the topic linking algorithm, to march the
server's as well.  The tests and behaviour are adjusted in so doing --
previously, the JS implementation would have linked `#foo` with a
`foo` regex on the linkifier, but the server implementation would not
have.
2023-11-14 20:43:39 -08:00
Aman Agrawal d45a2bf35b stream_color: Increase contrast of stream icon color and background. 2023-11-14 12:23:10 -08:00
kraktus 3de6ec0a59 sort_emojis: Prioritize perfect matches above all.
Currently we prioritize (even partial) realm emojis above all.
Including over perfect matches if the emoji is **not** a realm emoji.
The commit changes this behavior to prioritize perfect matches above all,
regardless of emoji category.

close https://github.com/zulip/zulip/issues/27545
2023-11-14 12:13:22 -08:00
Prakhar Pratyush c76b3acce7 typeahead: Fix '@topic' not present when stream wildcard suggested.
Earlier, we suggested only the first matching wildcard mention,
irrespective of how many equivalent wildcard mentions match.

That logic leads to the exclusion of '@topic' suggestion whenever
a stream wildcard is suggested, which is not correct as
stream wildcards and topic wildcard are not equivalent.

This commit updates the logic to make the behavior of suggesting
only the first match valid for stream wildcard mentions only.
2023-11-14 12:09:16 -08:00
Karl Stolley 4fee51fc99 compose_box: Render limit indicator as template with zero-width space. 2023-11-13 12:45:13 -08:00
Karl Stolley 9f00b513f7 compose_box: Improve structures around compose buttons. 2023-11-13 12:45:13 -08:00
Aman Agrawal b516ae75db upgrade: Remove tests temporarily as they need to be rewritten. 2023-11-13 10:35:39 -08:00
Aman Agrawal 067d820a8a billing_helpers: Delete temporarily.
This needs to be re-written entirely.
2023-11-13 10:35:39 -08:00
Prakhar Pratyush 1f91db1d43 topic_mentions: Add @topic mention typeahead.
This commit adds a @topic mention typeahead that appears
only in stream messages and not in private messages.

Fixes part of #22829.
2023-11-13 09:07:36 -08:00
Prakhar Pratyush 5ec26c6542 typeahead: Fix message_type to correctly test stream mention typeahead.
This commit sets the 'message_type' to "stream" in the beginning
of the test to properly verify wildcard mentions typeahead for
stream messages.

Earlier, 'message_type' was set to "False", and the test was passing
falsely because in the 'broadcast_mentions' function, the 'else' block
gets executed for 'message_type' having a value of either
'stream' or 'False'.

```
if (compose_state.get_message_type() === "private") {
    wildcard_string = $t({defaultMessage: "Notify recipients"});
} else {
    wildcard_string = $t({defaultMessage: "Notify stream"});
    wildcard_mention_array.push("stream");
}
```

We don't need to explicitly change the condition to:
```
else if (compose_state.get_message_type() === "stream")
```
because in practise, the 'message_type' is either set to 'stream'
or 'private' when the user types a message.

Only changing the 'message_type' in the test to simulate the
actual behaviour fulfils our purpose.

This should have been included in 5bddd8f.
2023-11-13 09:07:36 -08:00
Prakhar Pratyush 64005c03b6 topic_mentions: Highlight the @topic mention for topic participants.
This commit adds support to highlight the '@topic' wildcard
mention text for the users having 'topic_wildcard_mentioned'
flag set.

Fixes #27497.
2023-11-13 08:29:16 -08:00
N-Shar-ma ed59316ff6 refactor: Rename `is_search` to `is_keyword_search` for clarity.
For more clarity, the 3 related functions `is_search` in `filter.js`,
`message_list.js` and `message_list_data.js` are all renamed to
`is_keyword_search`.
2023-11-13 08:09:03 -08:00
Lalit b86022ea52 ts: Convert `activity.js` module to TypeScript. 2023-11-10 16:37:44 -08:00
BrandonAWong 6edf24b0f7 search: Remove "All messages" typeahead
Previously, the "All messages" typeahead would be shown whenever
the search bar had an empty input. This change removes that typeahead
completely in favor of using other filters such as -is:muted.

Fixes #27358

Co-authored-by: Heran Zhang & Wei-Cheng Sung
2023-11-10 16:27:32 -08:00
N-Shar-ma c3c72cda6d compose: Completely remove style elements when pasting HTML as markdown.
Turndown would strip `<style>` tags, but retain the content enclosed.
This resulted in unwanted content being pasted, like the comment nodes
inside the `<style>` tag when pasting cell/s copied from Google Sheets.
2023-11-10 13:56:51 -08:00
N-Shar-ma db9ac4b674 commit: Disable automatic numbering / bulleting when inside code block. 2023-11-10 13:56:51 -08:00
Joelute 4d1ade1f88 compose: Automatically change @ mentions to silent mentions in 1:1 DMs.
It is common for users in other chat tools to start off a direct message
with @ mentioning the addressee. However, this results in potentially
unexpected behavior in Zulip, where the message is highlighted and shows
up in @ mentions in addition to DMs. We want to prevent this behaviour by
automatically changing the @ mentions to silent @ mentions for the user.
These changes only apply to 1:1 DMs and not group chats.

Fixes: #17998.
2023-11-10 12:59:44 -08:00
Prakhar Pratyush c597de6a1d topic_mentions: Rename wildcard_mentioned to stream_wildcard_mentioned.
Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.

The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.

We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.

* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`

The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
2023-11-10 11:06:26 -08:00
Akarsh Jain d8d70d9e43 compose_banner: Display time for messages with < 5 mins scheduled time.
This commit addresses the issue where scheduling a message for a
time less than 5 minutes in the future resulted in the confirmation
banner not displaying the scheduled time, which should have actually
been 5 minutes in the future, as enforced at the UI level by the
MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS variable.

We remove the `is_send_later_timestamp_missing_or_expired` method along
with it's tests since `selected_send_later_timestamp` is already set to
the minimum of 5 minutes in the future through the `minDate` option of
the flatpickr.

Fixes: #26784.

Co-authored-by: Sayam Samal <samal.sayam@gmail.com>
2023-11-10 09:20:15 -08:00
Aman Agrawal 8c4ef3e9aa billing: Temporarily remove tests.
These seem important to have but will have to be rewritten.
2023-11-10 05:17:52 +05:30
N-Shar-ma eca6738b00 compose: Always retain link formatting when pasting just a link.
We add anchors to the list of enclosing elements we don't strip away.
2023-11-08 09:51:33 -08:00
Rahul 4dfb04d501 compose_ui: Use Intl.ListFormat rather than .join(", ").
This commit changes .join(",") to Int1.ListFormat.
This produces more accurate translations.

Refactor compose_ui.test to update the testcase for Alice and Bob.
The previous test case output of "Alice,Bob"  modify to "Alice and Bob"
to align with the behavior of Int1.ListFormat,
which joins lists using ',' & 'and'.
2023-11-07 13:18:57 -08:00
N-Shar-ma 24e8119350 compose: Always retain `ol` tag when pasting content enclosed by it. 2023-11-07 11:39:06 -08:00
evykassirer 8cf436370c stream search: Always close search on Escape.
Fixes #27491.
2023-11-06 15:10:23 -08:00
Aman Agrawal 3ba0fe4349 sponsorship: Remove from billing and upgrade pages. 2023-11-06 14:55:14 -08:00
N-Shar-ma 3a8aac8c67 compose: Remove formatting enclosing entire selection when pasting.
If the selection copied, is entirely within a single element, like text
within a heading (like `h1`) we discard this outermost element and only
convert the inner HTML to markdown.

However, we retain `pre` so a code block within it stays as is and does
not change into inline code, losing all its linebreaks.
2023-11-06 09:07:50 -08:00
Karl Stolley 5d2d8f9215 left_sidebar: Add logic and styles to show unreads on selected home view. 2023-11-03 10:08:37 -07:00
Anders Kaseorg 2e3a8afe2a tests: Add missing $ prefix to jQuery object parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
Anders Kaseorg b3fa7b15fc compose_state: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
Anders Kaseorg d6be353299 compose_state: Make get_or_set accept a full selector.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-02 14:06:04 -07:00
N-Shar-ma a01d670fb2 turndown: Improve pasting experience, focused on pasting Zulip messages.
Turned off and tested escaping with `/` (for now).

Added support + tests for:
- headings.
- strikethrough.
- nested lists.
- code blocks.

Improved handling of:
- links (custom and raw, ignored when wrapping a single image).
- images (now pasted in Zulip's link like syntax).
- custom emojis.
- LaTeX (no garbage symbols, unformatted plain text is pasted)

Added tests for emojis.

Known concerns:
- External images aren't handled anymore by upload.js -- is this a bug?
- Tables lose their formatting on paste.
2023-11-02 13:52:30 -07:00
Sahil Batra bb15b2d708 users: Send "update" events when deactivating or reactivating users.
We now send "realm_user/update" (and "realm_bot/update" for bots)
events with "is_active" field when deactivating and reactivating
users, including bots.

We would want to use "remove" event for a user losing access
to another user for #10970, so it is better to use "update"
event for deactivation as we only update "is_active" field
in the user objects and the clients still have the data for
deactivated users.

Previously, we used to send "add" event for reactivation along
with complete user objects, but clients should have the data
for deactivated users as well, so an "update" event is enough
like we do when deactivating users.
2023-11-02 08:31:12 -07:00
Prakhar Pratyush 8e2264b585 hotkey: Add 'narrow to next unread followed topic' hotkey.
This commit adds a 'Shift + N' keyboard shortcut, which is
used to narrow to the next unread followed topic.

Fixes part of #27323.
2023-11-01 17:37:41 -07:00
Sahil Batra c756259094 settings: Use server_supported_permission_settings in webapp.
Since we now get the configuration for group permission settings
from server, we can directly use that in webapp instead of
defining it again.
2023-11-01 10:42:56 -07:00
evykassirer 1f8db236f5 buddy list: Rename user_presences to buddy-list-users-matching-view.
This switches to our preferred dash-separated classnames
instead of underscore-separated, and also updates the
classname to be differentiable from users that aren't
part of the current narrow.

Until the next commit that splits the buddy list, the
name is a bit inaccurate since it still contains all
the users.
2023-10-31 16:06:07 -07:00
evykassirer beead8e614 lazy set: Increase code coverage.
This was pvreviously covered by tests for the buddy list.

We shouldn't rely on other code to complete code coverage
for this module. In the future it would be good to add
more tests to the lazy set tests to directly cover lazy
set functionality.
2023-10-31 16:06:07 -07:00
N-Shar-ma ad26247247 compose: Add a placeholder "is …" for the `/me` slash command.
Fixes: #27399.
2023-10-31 12:32:03 -07:00
evykassirer 2f6d3605d9 recent view: Rename topic to conversation. 2023-10-31 10:28:55 -07:00
evykassirer 83e0f8bd33 recent view data: Rename get to get_topics. 2023-10-31 10:28:55 -07:00
Lalit Kumar Singh dcf45da09c ts: Migrate `user_status` module to TypeScript.
Also removed an defensive if check from `emoji.ts` since it is not
needed now that we have `emoji.ts` converted to TypeScript.
2023-10-30 11:10:47 -07:00
Karl Stolley dcd891a176 left_sidebar: Use dm-list class. 2023-10-30 10:14:28 -07:00
Karl Stolley 01ca3e119b left_sidebar: Use DM identifiers on DM containers. 2023-10-30 10:14:28 -07:00
xoldyckk 8b3f8d77b0 zform validation: Migrate validation logic to zod.
Migrated zform validation logic to make use of zod schema.
2023-10-27 16:14:51 -07:00
Lalit 151d51acfa input_pill: Remove over defensive if checks for `create` function.
We should remove this overly defensive code and remove the `undefined`
type from the return type of this function to avoid handling unexpected
`undefined` values in the downstream code.
2023-10-27 13:11:37 -07:00
evykassirer 0a33598f65 compose fade: Add test for want_normal_display. 2023-10-26 18:33:53 -07:00
evykassirer 6563e621fd buddy list: Simplify argument to get_data_from_keys. 2023-10-26 18:33:53 -07:00
Tim Abbott a379fbe442 portico: Inline common.autofocus.
This was only called from a single code path.
2023-10-26 16:27:35 -07:00
Sahil Batra c9fccf476a settings: Rename default_view and escape_navigates_to_default_view.
This commit renames default_view and escape_navigates_to_default_view
settings to web_home_view and web_escape_navigates_to_home_view in
database and API to match with our recent renaming of user facing
strings related to this.

We also rename the variables, functions, comments in code and class
names and IDs for elements related to this.
2023-10-26 11:00:12 -07:00
Anders Kaseorg 2f95c55df4 list_widget: Fix unsafe unchecked casts in generic comparators.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-26 09:54:30 -07:00
Anders Kaseorg 31db313a46 list_widget: Add missing CSS escaping and remove unchecked cast.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 13:08:36 -07:00
Anders Kaseorg 9c9c453d5a web: Remove unchecked casts of event objects.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 13:08:36 -07:00
Anders Kaseorg 1da729e49f web: Remove unchecked casts of jQuery .val().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-25 13:08:36 -07:00
Aman Agrawal 2f33fad5df left_sidebar: Add popover to make different views default.
Fixes #27324
2023-10-24 16:16:56 -07:00
Aman Agrawal a210006ecd popovers: Hide when starting certain actions.
These are actions which can be called when a popover is open and
it is better to close the popover when these actions are
initiated.
2023-10-23 14:15:13 -07:00
Prakhar Pratyush 3f2ab44f94 follow_topics: Remove the 'development' guard.
This commit removes the 'development' guard and makes
the UI changes related to the 'Follow Topics' project visible
outside the development environment.

Cleans up the older UI elements related to mute and unmute topics.
2023-10-22 14:24:22 -07:00
Aman Agrawal bc3d48616e gear_menu: Migrate to use tippy. 2023-10-20 12:36:39 -07:00
Sayam Samal 24d74f68ee compose: Show pronouns in compose typeaheads.
This commit adds the pronouns custom profile field to the typeaheads in
the composebox along with the necessary node tests.

Details of the implementation:
- Added logic to display pronouns in ( ) next to the user's name when
  the user has a non-empty pronoun-type custom profile field.
- If multiple pronoun fields exist in the organization, the
  implementation selects the one earlier in the list of custom profile
  fields.
- No pronouns are displayed if the selected pronoun field is empty.

Fixes #26924.
2023-10-20 12:30:21 -07:00
Aman Agrawal 61bf72d30e empty_feed_notice: Style empty message feed similar to other views. 2023-10-20 12:29:45 -07:00
Prakhar Pratyush d1f82c47fd compose_banner: Show banner when automatically follow or unmute topic.
When we send a message and that causes a topic to be automatically
followed or unmuted due to the automatic visibility policy settings,
we tell the user via a post-send-message compose banner.

The "notify_unmute" banner is not shown when the topic has already
been unmuted or followed due to these policies.

Fixes part of #26900.
2023-10-19 10:13:04 -07:00
Aman Agrawal f91236f917 gear_menu: Extract version_display_string into a util library.
This will keep changes to a minimum when we migrate gear menu
to use tippy module.
2023-10-18 22:02:38 -07:00
Sahil Batra 180ed2e50f user_profile: Show streams to subscribe for user's own profile.
We did not show the streams to subscribe in dropdown in user
profile modal when user is not allowed to subscribe others
even in the user's own profile modal which is not correct.

This commit fixes it to show the streams in dropdown for
user's own profile irrespective of whether user is allowed
to subscribe others or not.
2023-10-18 15:28:46 -07:00
Karl Stolley 383466eaff compose_box: Change 'audio' references to 'voice'. 2023-10-18 14:04:00 -07:00
evykassirer 34ceafadd5 recent view: Add button to fetch more conversations.
We add a new timerender format for this context, where there's plenty
of space.

Fixes: #18461
2023-10-13 16:14:55 -07:00
Hardik Dharmani 49f7f02a0a personal_menu: Add tippy personal_menu dropdown.
Add a personal menu dropdown that opens on clicking user avatar icon
in navbar added in previous commit.

The args passed to render_personal_menu() in onShow() are returned by
get_personal_menu_content_context() in popover_menus_data.js so that
they can be unit tested.

Additionally, added CSS to get a custom arrow for dropdown menu.

Added a `?` hotkey in keyboard shortcuts option in personal_menu
dropdown in a style similar to our tooltip's hotkey by adding
? in a span with class .tooltip-hotkey-hint and adding some CSS.

Fixes part of #22802.
2023-10-12 15:31:01 -07:00
Joelute c7ef2555fd compose_typeahead: Add new indicator to topic items in typeahead.
With the autocomplete dropdown, some users face trouble or uncertainty
while selecting topics. These changes adds a new indicator to the topic
typeahead dropdown while typing to the topic box. This ensures users
that they are on track and they are doing the right things. We also
suggest the current query even if it doesn't match a topic to continue
providing the new indicator.

Fixes: #23296.
2023-10-12 14:44:40 -07:00
lapaz 417b29638c messages: Add support to allow bot-owners to delete messages.
This commit adds support to allow bot-owners to delete messages
sent by their bots if they are allowed to delete their own messages
as per "delete_own_message_policy" setting and the message delete
time limit has not passed.
2023-10-12 12:13:39 -07:00
Sahil Batra 59d025c570 people: Add "(guest)" for muted users as well.
This commit adds code to show "(guest)" for muted users
as well if the muted user is guest and the realm setting
is enabled.
2023-10-12 12:06:10 -07:00
Sahil Batra 7d7698930a compose_ui: Add "(guest)" to user names in compose box placeholder.
This commit adds "(guest)" indicator to guest user names in
compose box placeholder if enable_guest_user_indicator setting
is enabled in the organization.
2023-10-12 12:06:10 -07:00
Sahil Batra 127378f0ec users: Add "(guest)" to user name at various places.
This commit adds code to get_display_full_name function
to add "(guest)" indicator to guest user names if
enable_guest_user_indicator setting is enabled in the
organization.

The get_display_full_name function is used in many parts
of the code and thus this commit adds the indicator in
following places -
- Message recipient row for DMs including the messages
shown in scheduled messages overlay.
- DMs list in left sidebar and its tooltips.
- DMs info recent conversations view.
- "other senders" tooltip in recent conversations view.
- Compose button text.
- User names shown on reaction element and its tooltip.
- Desktop notifications and the browser title.
- Results for a poll.
2023-10-12 12:06:10 -07:00