Commit Graph

994 Commits

Author SHA1 Message Date
sujal shah d7936fe576 stream_overlay: Change the subscribed_only to show_subscribed.
This commit changes the variable and function name from
"subscribed_only" to "show_subscribed" and
"set_subscribed_only" to "set_show_subscribed"
so that in the next commit, when the "not subscribed" tab is added,
we can use a similar variable named "show_unsubscribed" and function
named "set_show_unsubscribed".
2024-06-04 09:49:50 -07:00
evykassirer 9a3263ec5d messages: Rename convert_raw_message_to_message_with_booleans. 2024-06-03 15:42:41 -07:00
Anders Kaseorg 48d3601649 echo: Use newly created MessageWithBooleans in insert_local_message.
Commit 50f5cf9ad8 (#30227) changed
message_helper.process_new_message (called by
message_events.insert_new_messages) to return a newly created message
object rather than mutating the object it was passed.  So
echo.insert_local_message needs to use this new object, fixing a
regression where we’d fail to replace a locally echoed message when
the server-rendered message came in.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-03 12:25:08 -07:00
Vector73 88df01bee5 web: Replace `realm_uri` with `realm_url` in frontend files.
Replaces `realm_uri` with `realm_url` in some frontend files and a js test.
2024-06-03 10:07:10 -07:00
Prakhar Pratyush 32391c3d06 ui_init: Don't store onboarding_steps state_data as current_user_param.
Earlier, onboarding_steps field of state_data was stored as
current_user_params.

Now, we store it separately in a data structure initialized in
onboarding_steps.ts

Reason: All the other state_data fields stored in current_user_params
are attributes of UserProfile. So, it makes sense to store it
separately.

Fixes part of #30043.
2024-06-03 08:53:28 -07:00
afeefuddin 9cf9cec43a compose_call_ui: Convert module to TypeScript. 2024-06-02 21:49:49 -07:00
Anders Kaseorg 6c0c19addb upload: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Aman Agrawal 817bffe6b1 message_list: Rename `narrowed` property.
We rename it for clarity so that someone new to the codebase
knows instantly what it is checking.
2024-05-30 11:41:13 -07:00
Varun Singh 50e0f336f0 settings_streams: Fix error thrown when adding 'default-channels'.
The 'Select channel' dropdown in 'Add default channels' modal is
the LAST dropdown element on the modal and it does not contain
`data-stream-id` attribute.

.attr('data-stream-id') would return undefined for this element
and as a result the returned `Set` would have its last element a
`NaN` --- passing a `NaN` inside 'data' field of 'channel.post' threw
an error.

We tweaked the selector string to selectively map over the elements with
'data-stream-id' attribute.
Also we removed '.toString()' converting stream-id to a string (stream-id is a
'number' type).
2024-05-30 10:53:19 -07:00
evykassirer 48fc0bc750 message_helper: Convert module to typescript. 2024-05-29 16:45:36 -07:00
evykassirer 7364c02ed6 message_helper: Set clean reactions when processing the raw message. 2024-05-29 16:45:36 -07:00
evykassirer 28107eb913 message_helper: Be more explicit about converting subject to topic. 2024-05-29 16:45:36 -07:00
evykassirer 50f5cf9ad8 message booleans: Return new message instead of mutating a raw message. 2024-05-29 16:45:36 -07:00
evykassirer bab1dc5d9c message tests: Don't assume process_new_message mutates the message.
We already changed callsites in the codebase to use the message
returned from `process_new_message` instead of assuming the raw
message passed in will be mutated. This fixes a few remaining tests.
2024-05-29 16:45:36 -07:00
sanchi-t 8ef4ee6845 user_profile: Update the profile tab after editing.
Use user events to update profile tab for a
synchronized experience across all users.

Fixes #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
Prakhar Pratyush 95be5db08b narrow: Add 'more topics' state to browser history.
When navigating "back" or "forward", the left sidebar state
should be restored.

Earlier, "more topics" expanded was not considered a distinct
state.

This commit makes it possible to correctly place you in the
"more topics" view or not, depending on where you were.

Fixes #29548.
2024-05-28 12:09:57 -07:00
Anders Kaseorg 4019ccecbb eslint: Outsmart formatjs/enforce-default-message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:20:10 -07:00
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Anders Kaseorg 9cee037f2a message_list: Remove nth_most_recent_id.
It’s unused since commit 748e5b6da6.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 18:56:59 -07:00
Aman Agrawal b22adc1d5f filter: Fix combined feed navigating to muted unread message.
Some we didn't have a check for if topic is muted here which
resulted in combined feed trying to navigate user to muted
unread message if it was the first unread in the narrow.
2024-05-23 09:17:40 -07:00
Aman Agrawal cd41e5f4fa narrow: Rename save_narrow. 2024-05-20 15:01:48 -07:00
Anders Kaseorg b545abe1e2 typos: Fix typos caught by mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-20 13:55:00 -07:00
afeefuddin 64d8a18b76 settings_profile_fields: Convert Module to TypeScript. 2024-05-20 11:17:58 -07:00
Lalit 5ea98cba54 input_pill: Add test for `input` event handler. 2024-05-20 09:13:26 -07:00
Sayam Samal dae9b6b9ed popovers: Rename actions_popover.hbs. 2024-05-20 09:10:36 -07:00
PieterCK 3b46d0e53c settings: Refactor UserGroupPill to improve consistency.
Changed UserGroupPill's 'id' key to 'group_id' because
UserPill uses 'user_id' instead of only id.
2024-05-17 10:47:22 -07:00
PieterCK d882d90857 hash_parser: Add utility function to dynamically detect hash.
Added new utility function to hash_parser to dynamically
detect the hash category of an URL. This is intended to
reduce the need of adding more adhoc hash_parser utility
functions.
2024-05-17 10:47:22 -07:00
evykassirer 96c9950115 composebox_typeahead: Convert module to typescript. 2024-05-16 14:53:26 -07:00
evykassirer 7f9361a865 composebox_typeahead: Filter and sort candidates within get_candidates.
This simplifies some of the logic and will make it easier to
convert to TypeScript.
2024-05-16 14:51:28 -07:00
evykassirer 96abc52d97 composebox_typeahead: Return mentions from get_candidates. 2024-05-16 14:51:28 -07:00
evykassirer 19a4810d53 composebox_typeahead: Remove DM blur handler.
Since #private_message_recipient is a <div contenteditable>,
not an <input> or <textarea>, it doesn’t make sense to call
.val() (it will always give the empty string).

It looks like this line is from over 10 years ago
(09deef9611 (diff-f2b22549dc2fb4824b37e787d964a2c9f4f580e767f86b6d7ded1d0ff37d5a62R291))
and probably before we had pills here. We can just remove this
whole block.
2024-05-16 14:51:28 -07:00
evykassirer e08c7548af composebox_typeahead tests: Create user_or_mention items directly. 2024-05-16 14:51:28 -07:00
evykassirer 7a9a445088 emoji: Restrict reaction_type for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
Aman Agrawal b2dc6f4039 people: Split search terms inside the search function.
This helps other views calling this function to not do a separate
split of the terms.
2024-05-16 09:20:43 -07:00
Aman Agrawal 2a8174baa3 recent_view: Rename filters_should_hide_topic.
Since we also filter DMs using this function, the name is
misleading.
2024-05-16 09:20:43 -07:00
Aman Agrawal aa31f9ae8d server_events: Fix infinite loading indicator on page load.
Hiding the loading indicator was based on us adding some messages
into the view which was no always the case.
2024-05-16 09:10:07 -07:00
AfonsoOrmonde b42cd1022b
streams: Close color picker when scrolling stream settings.
Fixes #17451.
2024-05-15 17:22:03 -07:00
Anders Kaseorg fba81d1cd5 upload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 97b0fd424d upload: Replace get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 60545fb475 upload: Reimplement get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 25b29b5cd4 upload: Centralize config object construction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg d9f05121d9 upload: Fix @uppy/xhr-upload locale configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg b132fc50b3 compose_reply: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 4d407c6b8d copy_and_paste: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:12:05 -07:00
Aman Agrawal a30029c8ad upload: Don't render upload button instead of hiding.
Doesn't make sense to hide the upload button button later when
we can just not show it if the browser doesn't has support for
it.
2024-05-14 12:21:49 -07:00
nimishmedatwal 941c5daf36 navbar: Describe views in top navbar.
Adds description in views styled like stream descriptions also adds a
help center link to the appropriate page at the end of each
description.

Fixes #29769.
2024-05-13 17:56:30 -07:00
evykassirer 724306df10 recent_view_ui: Convert module to typescript. 2024-05-13 12:51:00 -07:00
evykassirer 28c13f6d0e message_store: Modify get_pm_full_names to only take user ids.
This will let us properly call it from compose_closed_ui without
a full message object, which we need to convert it to typescript.
2024-05-12 17:41:22 -07:00
Aman Agrawal d4ea7e251b narrow: Fix browser back not navigation to previous selected message.
Reproducer:
* Go to a stream narrow.
* Scroll up to select a previous message.
* Click on a different stream in the left sidebar.
* Click browser back button, you land at first unread message instead
  of your selected message.

Fixed by updating the hash before we render the new message list.
2024-05-10 16:03:45 -07:00
Prakhar Pratyush bf2360bcf2 onboarding_steps: Remove hotspot as an onboarding_step.
Earlier, hotspots and one-time notices were the valid
type of onboarding step.

Now, one-time notice is the only valid type.

Fixes #29296.
2024-05-10 12:30:22 -07:00
N-Shar-ma cb58752909 widgets: Cache event handler instead of entire jquery for each widget.
In 61b3c698af we stopped restoring widgets
from the cache, so the only purpose of the cache remaining was to access
the event handler patched onto the widget jquery.

Now instead of the entire jquery object, we cache just the event handler
since that's the only thing we need from the cache, and do not patch it
onto the widget jquery object.
2024-05-08 16:47:07 -07:00
Aman Agrawal d1050376e1 bootstrap_typeahead: Fix compose typeahead overflowing when expanded.
When compose box is expanded, typeahead overlfows the top of the window.
We move the typeahead to the bottom of the screen and let
preventOverflow shift it into the visible area.
2024-05-08 10:05:27 -07:00
Aman Agrawal 689489573a bootstrap_typeahead: Remove fixed argument.
Tippy uses a different strategy for positioning items, so this
will not be required.
2024-05-08 10:05:27 -07:00
N-Shar-ma 61b3c698af widgets: Always render and activate widgets in the current view.
Earlier we did not activate widgets if their rendered HTML was cached,
and also when narrowing to the combined feed view. This caused bugs with
widgets not being activated, and so not responding to any interactions.

Now we unconditionally render and activate widgets in the current view,
irrespective of the cached HTML or the view being narrowed to.
2024-05-07 12:59:47 -07:00
Anders Kaseorg 49e1c919c3 drafts: Convert .data("draft-id") to a module variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-07 12:57:14 -07:00
evykassirer 3cad639a82 typeahead: Add textarea input type for the composebox. 2024-05-07 11:12:01 -07:00
evykassirer 9cb9733f71 composebox_typeahead: Remove unused second argument to caret(). 2024-05-07 11:12:01 -07:00
nimishmedatwal acf13e49cf rendered_markdown: Fix code getting copied when visiting playground.
Fixes #29844.
2024-05-06 15:50:39 -07:00
Anders Kaseorg 7360fd2a67 bootstrap_typeahead: Remove create and lookup API.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-06 15:02:45 -07:00
Anders Kaseorg 40440248e6 support: Fix implicit use of any.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 15:39:55 -07:00
Anders Kaseorg 2be5cb0223 settings_user_topics: Fix implicit use of any.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 15:39:55 -07:00
Anders Kaseorg 939b88b9a7 settings_realm_domains: Fix implicit use of any.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 15:39:55 -07:00
Anders Kaseorg fe6744ae54 input_pill: Fix implicit use of any.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 15:39:55 -07:00
Anders Kaseorg ffd1a80ef4 common: Remove copy_data_attribute_value.
Commit 90d0531e20 (#23721) removed
envelope-link and data-admin-emails.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg eb45eca57b support: Replace common.copy_data_attribute_value with clipboard.js.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg 252b0f193e password_quality: Convert .data("minLength") et al. to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg 7a5e68161a list_widget: Convert .data("sort"), .data("sort-prop") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg 64c2d442ac web: Convert .data("user-id") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg 455f8a9c53 web: Convert .data("stream-id") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg bc9a7ef274 components: Convert .data("tab-id") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg 153847d617 web: Convert .data("search-results-empty") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Anders Kaseorg abee323c77 web: Convert .data("code-language") to .attr.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-03 12:45:46 -07:00
Aman Agrawal 240f7b53b2 message_lists: Remove `save_pre_narrow_offset_for_reload`.
This is no longer required since narrow state is restored by
`reload` library and narrow history restores the narrow pointer
and offset when going back to a view.

Only regression here is we will no longer restore the pointer when
user navigates to the combined feed view without using browser back
button and combined feed view is the default view. This is fixed
in the next commit.
2024-05-03 12:42:22 -07:00
Aman Agrawal 2eb216f1da message_list: Only update selected id and banner for current list. 2024-05-03 12:42:22 -07:00
N-Shar-ma 5d468ddef8 left_sidebar: Add colon `:` to the list of stream word separators. 2024-05-03 09:20:53 -07:00
Prakhar Pratyush d7a9523170 compose_banner: Replace the close button with "Got it" button.
For onboarding banners, we replace the close button with
"Got it" button.

Also, the banner is marked as read for the user only after
the "Got it" button is clicked. Earlier it was marked as read
as soon as it was displayed.
2024-05-02 12:48:22 -07:00
Lalit 0a66fada64 input_pill: Use "input" event handler for `textInputHook`.
Register our `onTextInputHook` to be called on "input" events so that
the hook receives the updated text content of the input unlike the "keydown"
event which does not update the text content before running the hook.
2024-05-02 12:01:30 -07:00
Lauryn Menard 141e1d4c90 streams-settings: Update ID of overlay container element.
This commit renames ID of the container element of streams settings
overlay to channels_overlay_container for the stream to channel
rename.
2024-04-30 14:44:12 -07:00
Lauryn Menard ee84b277ec hash-util: Rename stream_edit_url to channels_settings_edit_url.
Renames the hash_util.stream_edit_url function so that it's clearer
this is for the settings overlay hash and for the stream to channel
rename.
2024-04-30 14:44:12 -07:00
Lauryn Menard 8e953d9896 streams-settings-overlay: Update hash for stream to channel rename.
Updates the base hash for the streams setting overlay to be
"channels" instead of "streams".

Because there are Welcome Bot and Notification Bot messages that
would have been sent with the "/#streams" hash, we will need to
support parsing those overlay hashes as an alias for "/#channels"
permanently.

Part of the stream to channels rename project.
2024-04-30 14:44:12 -07:00
Lauryn Menard 00b572b808 compose-typeahead-test: Update confusing test string.
Replaces test string that used "#streams", but was not referring to
or testing anything related to the streams settings overlay.
2024-04-30 14:44:12 -07:00
N-Shar-ma b36cdfda0a compose: Remove the `message_too_long` banner.
Since the banner only repeated what the disabled Send button's and the
limit indicator's tooltips already said, it was redundant and has been
removed.
2024-04-30 14:16:10 -07:00
N-Shar-ma bfbf4f6f68 compose: Redesign limit indicator to show remaining characters count.
Additionally, the text colors have been updated for both light and dark
themes, it starts showing when 900 or less characters are left, as 999
was too soon, and has a tooltip to show the maximum characters limit.

Fixes: #28706.
2024-04-30 14:16:10 -07:00
Karl Stolley c5027e6bca message_row: Assign inner .date_row span a class. 2024-04-30 12:42:41 -07:00
PieterCK 2457a8b655 stream_settings: Fix stream row switching behavior.
Add a rule to the switch_rows(event) function to avoid
switching stream row when pressing up/down key by checking
the current URL hash and the add_subscribers_pill focus state.
Add a utility function to hash_parser to help implement new
switch_rows behavior mentioned above.

Fixes #29690.
2024-04-29 18:57:29 -07:00
Aman Agrawal d79e84726a sidebar_ui: Fix flickering of invite users button when showing sidebar. 2024-04-29 16:54:15 -07:00
nimishmedatwal b141c28855 hashchange: Change #all-messages to #feed.
This commit changes the hash for the combined feed view from the
legacy #all-messages to #feed.

Fixes #27802.
2024-04-26 14:28:13 -07:00
Karl Stolley 0cfd4c8eed settings: Hyphenate dense-mode classes. 2024-04-25 16:58:39 -07:00
Aman Agrawal 103c37f23a message_list: Don't always cache "Combined feed" view.
Important changes in this commit:
* We only cache message list for "Combined feed" if it is the
  default view.

* We modify existing handling of home message list code so that
  it can be used to for any message list that we want to cache
  using a new `preserve_rendered_state` variable.

* narrow_state.filter() returns the filter of combined feed view  list
  instead of `undefined`.

* We start fetching messages from the latest message on app load.

* Messages in all messages data and Recent view are always synced.

* If combined feed view list is not cached, we don't track it's
  last pointer, effectively sending user to the latest unread
  message always .
2024-04-25 09:20:43 -07:00
CIC4DA d7b9c2c21c typehead_list_item: Change the groups icon to zulip-triple-user-icon.
Fixes: zulip#28756
In this commit, we are changing the icon for groups in typehead from fontawesome-group to triple-user-icon.
2024-04-24 17:37:38 -07:00
Lauryn Menard e2732d95c2 all-wildcards: Update for "channel" wildcard as preferred to "stream".
Updates the logic for adding a wildcard mention syntax in a message
to use the "channel" wildcard instead of the "stream" wildcard.

Adds some TODO notes for eventually removing the "stream" wildcard
from the typeahead suggestions in the web app.

Part of stream to channel rename project.
2024-04-24 17:04:33 -07:00
Lauryn Menard 58b91202f4 web-narrow: Update operators to use channel and channels.
Updates operators used for narrow.activate and sent as narrow
parameters to the server to use channel and channels.

Part of stream to channel rename project.
2024-04-24 17:03:36 -07:00
Lauryn Menard 8d102cf12f web-search-suggestions: Update to use channel and channels.
Updates the search suggestions in the web app to use the modern
convention of "channel" and "channels".

Also, updates the "from" search suggestions to use the modern
canonical convention of "sender".

Part of stream to channel rename project.
2024-04-24 17:03:36 -07:00
Lauryn Menard 36e00308b8 web-compose-warnings: Update banners for stream rename channel.
Updates warning string when linking to a private stream/channel when
composing a message in the web app to use channel instead of stream.

Updates error banner when using a stream/channel wildcard mention
when composing a message in the web app to use channel instead of
stream.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard ff98758ed0 web-compose-typeahead: Update wildcard string for stream rename channel.
Updates "Notify stream" string in the stream wildcard typeahead to
be "Notify channel" instead.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard c874183ea8 web-filter: Update translated strings for stream rename channel.
Updates the translated strings in filter.ts to use channel instead
of stream.

The updates to the untranslated search streams will be done in a
separate commit.

Part of the stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard d7f9f8333e web-stream-settings: Update strings for stream rename channel.
Updates a chunk of translated strings that overlap between files,
with the streams settings overlay being the starting point for
finding these strings, to use channel instead of stream.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 13299577da web-empty-narrow: Update translated banners for stream rename channel.
Updates the translated empty narrow messages in the web app to use
channel instead of stream.

Updates the message view header that has the same text as the empty
narrow when a stream/channel does not exist or the user does not
have access to the stream/channel because it is private.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 8bc183e16e web-i18n-test: Update translation data for stream rename channel.
Updates the page_params.translation_data that's set in this test
for renaming stream to channel.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 556629add0 web-hash-util: Decode URL with channel and encoded stream ID.
Updates hash_util.decode_operand to handle a URL with channel and
the stream name and ID encoded in the URL.

For example "/#narrow/channel/12-test" where 12 is the ID of the
stream named "test".

Part of stream to channel rename project.
2024-04-24 14:33:57 -07:00