Commit Graph

1701 Commits

Author SHA1 Message Date
Lauryn Menard
edc9853a3e narrow_state: Refactor get_first_unread_info to take a defined filter.
This function is called when entering a message feed view. Therefore,
it should always have a defined MessateListData filter.

Follow-up clean up from reworking the home view to use a Filter
object.
2025-03-06 17:42:50 -08:00
Lauryn Menard
c78d5acddd narrow-state: Refactor and rename is_for_stream_id.
Renames is_for_stream_id to narrowed_to_stream_id, and updates it
to use narrow_state.stream_id for the comparison check instead of
getting the full StreamSubscription object.
2025-03-06 17:42:50 -08:00
whilstsomebody
9b0477d771 search_query: Prevent overflow of long search queries.
Previously, when searching for extremely long queries,
they would overflow beyond the screen.

This commit fixes the bug by ensuring that long
search queries do not overflow.

Fixes: #29568
2025-03-06 13:13:38 -08:00
Kislay Verma
86643f3406 composebox_typeahead: Show topic suggestions for markdown stream links.
This commit enables topic suggestions for
channel links of the format
[#channel name](path)>some topic.
Previously no typeahead suggestion was shown
for above format.

Selecting a topic will result in link of format
[#stream name > topic name](topic path)

Typing `>` after the fallback md stream link also
shows topic suggestions, parallel to the standard

Fixes #32556
2025-03-06 13:04:18 -08:00
Kislay Verma
10995ded0e topic_link_util: Add function to unescape html characters.
Co-authored-by: getmeapencil@gmail.com
2025-03-06 13:04:18 -08:00
Tim Abbott
be0bc77300 people: Remove is_current_user legacy helper.
This does lookups by email address, which is very much a legacy way to
do things, and could throw exceptions if trying to lookup details on
an unknown user ID.
2025-03-05 15:56:57 -08:00
Karl Stolley
80dcd53b59 youtube: Request medium-quality preview images. 2025-03-05 13:59:58 -08:00
whilstsomebody
b9c037e0ee realm_playground: Use Intl.ListFormat rather than .join(",").
Fixes: #26936

Co-authored by: CIC4DA <dhruv.jain9100@gmail.com>
2025-03-04 16:58:23 -08:00
whilstsomebody
6c6d5fbb6a people: Use Intl.ListFormat rather than .join(",").
Fixes: #26936

Co-authored by: CIC4DA <dhruv.jain9100@gmail.com>
2025-03-04 16:58:23 -08:00
whilstsomebody
cface068cb util: Add function to format array output based on "and" preference.
This is a pre-commit to add the function
"format_array_output_based_on_and_preference()" which will take
two parameters- string array and a boolean whether we want and
based output or not. This function return a string formatted
using Intl.ListFormat.
2025-03-04 16:58:23 -08:00
Harsh
411fd9c4fe navbar: Show "Muted user" instead of muted user's name.
This commit shows the string "Muted user" instead of
muted user's name in DM's navbar.

fixes: #33673
2025-03-04 15:43:25 -08:00
Lauryn Menard
cb8e67a0e6 narrow-banner: Pass filter for showing/picking an empty narrow banner.
We expect to have a message list and therefore a filter when we show
or pick an empty narrow banner.
2025-03-04 15:35:18 -08:00
apoorvapendse
b5e123a613 user_groups: Disable actions for deactivated groups.
Joining/leaving the group as well as
adding or removing others is disabled.
2025-03-04 13:36:30 -08:00
opmkumar
1d33214b55 narrow: Allow spectators to use is:resolved.
Fixes #33568.
2025-03-04 11:37:21 -08:00
opmkumar
85eb8e554f hash: Fix navigation issue with negated operators.
Previously, for spectators, when a negated search operator was
present, navigating forward or backward triggered the "signup/login"
modal.
This commit fixes this issue.
2025-03-04 11:37:21 -08:00
Aman Agrawal
5c7a774026 typeahead_helper: Place bots under group matches.
Fixes #32987

We separate bots from the users list and place them under group
matches so that typeahead suggestions show more relevant matches.
2025-03-03 16:48:06 -08:00
Maneesh Shukla
11e334fa8a presence_data: Fetch presence data when user card is opened.
This commit adds a new function to fetch presence data when the user
card is opened. This data is then used to display the user's presence
status in the card.

Fixes: #31037.
2025-03-03 16:11:30 -08:00
Sahil Batra
118eaffd3a groups: Update how we show members count in group pills.
Instead of showing count as "N users", we just show the
count in parentheses now.

Fixes #33628.
2025-03-03 10:38:10 -08:00
Aman Agrawal
f7a6d6467b presence: Fix exception on trying to get user from ID.
We don't always know about every user id. So, our code should
reflect the same.

Fixed by refactoring the function to use User object a function
parameter and let the called get the user object if possible.
This reduces duplicate calculation to get user object too.
2025-03-03 10:06:04 -08:00
evykassirer
9ad3159e48 buddy_list: Don't show most sections with no users in them.
Instead of showing the "None" empty message, just hide the whole section
instead. Notably this uses the total user counts and not the number of users
rendered, so it's possible we'll still show the sections when they're partially
loaded or if they have inactive users (in which case we'd show the "view more"
links).

The exception is the "THIS CHANNEL" section which we always want to show,
since it can be confusing to see other sections without this section
present. More conversation on that here:
https://chat.zulip.org/#narrow/channel/101-design/topic/right.20sidebar.20design.20tweaks/near/2099241
2025-02-28 17:41:47 -08:00
Anders Kaseorg
b3e0253eec eslint: Unify JavaScript and TypeScript configs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-27 13:29:41 -08:00
Sayam Samal
196fcd5c0a inline_topic_edit: Show invalid input error visually on empty topic.
This commit adds the `invalid-input` class to the inline topic edit
input element when the new topic name is considered empty as a result
of realm_mandatory_topics property being set to True. This adds the
red glow borders to the invalid input field, which visually
communicates that some thing is wrong with the new topic name.
2025-02-26 17:26:35 -08:00
Anders Kaseorg
37c9505a46 tests: Remove unusual ‘this’ usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-26 16:20:47 -08:00
Prakhar Pratyush
087abb4314 composebox: Show 'Enter a topic (skip for general chat)' placeholder.
Use a more instructive placeholder instead of "Topic" when
topic is not mandatory in a realm.

Updated placeholder:
'Enter a topic (skip for general chat)'.
2025-02-26 14:03:24 -08:00
Karl Stolley
a3a43c2f8b compose: Handle fading with general chat.
This commit also attempts to fix a bug, present in main, where a
draft restored directly to the compose box loses its original topic
upon switching to other topic narrows.

Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
2025-02-26 13:59:03 -08:00
Karl Stolley
30b1ae7111 compose: Correctly focus when replying to general chat. 2025-02-26 13:59:03 -08:00
Prakhar Pratyush
29fb5ff934 compose: Update textarea placeholder with general chat. 2025-02-26 13:59:02 -08:00
Karl Stolley
cae48d3faa compose: Rename placeholder update function for clarity. 2025-02-26 13:59:02 -08:00
apoorvapendse
ea3e89cdd9 composebox_typeahead: Add support for empty string topic in textarea.
This commit adds support for empty string topic in compose textarea
typeahead.
2025-02-26 13:59:02 -08:00
apoorvapendse
8b9ba36465 copy_and_paste: Split copy and paste.
Note that the puppeteer tests only tested
copying whereas the node tests only tested
pasting, which is why the puppeteer tests
for pasting and node tests for copying are
absent after this split.
2025-02-26 13:15:50 -08:00
Maneesh Shukla
606d1e9691 presence_data: Fix last_active_time for users with no last_active_time.
There's a rare possibility for a user to have no last_active_time. In
such a case, we always want to fall back to date_joined for displaying
"Last active" in the UI.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-02-26 12:51:57 -08:00
Tim Abbott
2c8d74735a postprocess_content: Drop invalid inline image elements.
These shouldn't exist without bugs in the Markdown processor, but at
least some ancient messages in chat.zulip.org seem to have them.
2025-02-25 22:40:36 -08:00
Saubhagya Patel
f9825142c8 settings: Add frontend to change allow_edit_history to integer field.
This commit implements the frontend of migrating the
`allow_edit_history` setting to `message_edit_history_visibility`.
This allows organizations, to have an intermediate setting to
view only the "Moves" history of the messages.

Fixes #21398.

Co-authored-by: Shlok Patel <shlokcpatel2001@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-02-25 18:18:23 -08:00
Sahil Batra
166d9282b8 streams: Use can_subscribe_group setting for checking permission.
This commit adds code to use can_subscribe_group setting in webapp.

Fixes part of #33417.
2025-02-25 13:17:15 -08:00
Kislay Verma
766467c5e3 composebox_typeahead: Allow easily linking to topics in same channel.
This commit makes it easier to link to topics in the same channel.
Typing `#>` in the compose box replaces it with `#**channel_name>`
and opens the topic_list typeahead.

Channel names producing broken link syntax
are handled by generating a fallback md link
syntax when the topic is chosen.

Fixes #31420
2025-02-25 09:51:49 -08:00
Kislay Verma
676fbb6d99 composebox_typeahead: Fix bug in generating link syntax.
A minor bug was introduced in #32184 where we didn't check if the
channel name would cause a broken link syntax (and hence should
generate a fallback md link).  This would cause problems when
implementing a shortcut syntax to link to current channel.

Fixes part of #31420.
2025-02-25 09:51:49 -08:00
Aman Agrawal
19b96ce9a8 composebox_typeahead: Fix failing tests.
Fixing test failure from
6d30b10b60.
2025-02-24 22:14:31 -08:00
Aman Agrawal
6d30b10b60 composebox_typeahead: Fix topic completion broken for long stream names.
Previous value of `40` didn't account for full length of stream name
which results in topic completion not working for stream names bigger
than that.
2025-02-24 21:55:11 -08:00
Vishesh Singh
c8983c0d31 popovers: Add x-gfm content type for copied Zulip links.
Copying links to a Zulip element now generate 3 content types:
- plain url, pasteable in address bar and non rich text editor
- HTML, for rich text editors.
- x-gfm, for pasting into GitHub and other services that support
  Markdown, new in this PR.

Fixes: #31813.
2025-02-24 11:18:01 -08:00
Vishesh Singh
6619b3b589 topic_link_util: Extract get_topic_link_content and helpers.
Refactors the get_fallback_markdown_link to generate some reusable
functions.
2025-02-24 11:07:37 -08:00
Maneesh Shukla
28cbc498d7 combined-feed-ui: Add placeholder text to empty combined feed.
Also, added live update behaviour to the combined feed narrow.

Fixes #31602.
2025-02-24 11:06:29 -08:00
Maneesh Shukla
d8f609d088 unresolved: Add support for searching for unresolved topics.
Fixes: #31725.
2025-02-24 09:59:30 -08:00
Maneesh Shukla
3f88fe5903 resolved: Rename "Topics marked as resolved" -> "Resolved topics".
Fixes part of #31725.
2025-02-24 09:59:21 -08:00
apoorvapendse
0b12c51771 compose: Add tooltip support for invalid messages.
This commit adds tooltip support for various
invalid conditions mentioned in issue 32115.

A `show_banner` positional argument is added
in the `validate` method which has a default
value of true.

The reason behind introducing this is to
not trigger banners on hovering the disabled
send button, since the tooltip message is also
determined using the same validate method.

We want to only disable the button on hover,
which is why the update_send_button_status() method
is called only on "mouseenter" event, which is
added to the send button in compose_setup.js

To incorporate this change a new param is
introduced which determines whether to enable/disable
send_button by running update_send_button_status

Earlier, typing something in the textarea or
recipient box would also trigger
`update_send_button_status` which doesn't
work well since we've introduced a lot of
new booleans which determine whether send
button gets disabled causing send button to
get disabled while typing instead while hovering
Hence this change.
2025-02-23 23:11:18 -08:00
Apoorva Pendse
8496a40564 compose_banner: Assign banner priority.
Assigns priority to banner errors as
mentioned in #32115.
2025-02-23 23:11:18 -08:00
Apoorva Pendse
2b250e7e64 compose_validate: Refactor conditionals for existing errors.
Pre commit for #32115.
2025-02-23 23:11:18 -08:00
Apoorva Pendse
979b4203c7 compose_banner: Reword no channel selected banner error.
Preparatory commit for #32115.
2025-02-23 23:11:18 -08:00
apoorvapendse
6a443c0418 compose_banner: Update message for no private recipient.
This commit updates the error banner message when no
private recipient is specified.
2025-02-23 23:11:18 -08:00
apoorvapendse
fb5730a8fb copy_and_paste: Use parse instead of fixtures for inline cases.
Fixes: https://chat.zulip.org/#narrow/channel/6-frontend/topic/Use.20original.20markup.20to.20generate.20HTML.20for.20katex.20tests/near/2097702
2025-02-23 17:04:48 -08:00
Maneesh Shukla
3db2104fe9 drafts: Add a copy draft button.
This adds a button to the draft overlay that allows the user to copy
the draft to the clipboard.
2025-02-23 15:54:07 -08:00