Commit Graph

3417 Commits

Author SHA1 Message Date
evykassirer d969ac3764 reactions: Rename reaction_info to rendering_details.
When we convert to typescript, these variables
will be of type EmojiRenderingDetails. This is
a more clear name.
2024-01-28 14:17:15 -08:00
evykassirer 3208235e79 emoji: Remove number as possible type for emoji_code.
More details here:
https://github.com/zulip/zulip/pull/28375#issuecomment-1878073956
2024-01-28 14:17:15 -08:00
evykassirer 0e358b9f85 reactions: Always call update_user_fields with should_display_reactors.
This was wrong before. `update_user_fields` is called with
`should_display_reactors` everywhere else.
2024-01-28 14:17:15 -08:00
evykassirer 84038a9984 reactions: Fix typo. 2024-01-28 14:17:15 -08:00
evykassirer fc1bd590b6 reactions: Remove view namespace.
This will make a migration to typescript easier,
and was unnecessary extra complexity.
2024-01-28 14:17:15 -08:00
Sahil Batra 3fc2bccc21 bootstrap: Remove css for btn-link elements.
We currently use btn-link class only in buttons used for
changing email and password in account settings panel and
for we already bootstrap CSS rules for those so we can
safely remove the CSS rules in bootstrap-btn.css.
2024-01-26 09:10:09 -08:00
Sahil Batra 6b459c0ea4 invite: Re-add bootstrap CSS rules for btn-link elements.
This commit re-adds the bootstrap CSS rules for the specific
btn-link elements in invite modal to zulip.css. This is part
of the bootstrap removal project.
2024-01-26 09:10:09 -08:00
Lauryn Menard bfd9eec4b3 activity: Add totals row as sticky footer to activity charts.
Updates the total row for the installation and remote activity
charts to be in the table footer. Makes the footer class sticky
to the bottom of the view so that it is always visible on the
chart.

Also, updates the installation activity column for revenue to
be formatted as a dollar string, since this formatting was being
applied in the updated total row.
2024-01-26 09:04:39 -08:00
Tim Abbott 371dea3f0d css: Remove unused btn-info styles. 2024-01-25 18:35:38 -08:00
Tim Abbott ee9a9bfa98 css: Remove unused btn-block styles.
The (unfinished) two-factor UI isn't designed at all, so we can just
remove the classes from it.
2024-01-25 18:35:38 -08:00
Tim Abbott f04b54ff47 css: Remove unused boostrap nav-header styles. 2024-01-25 18:35:38 -08:00
Tim Abbott 4b6b1da83c bootstrap: Remove now-unused tabs JS component.
This was the last bootstrap.js feature, so we finally get to remove
the whole module.
2024-01-25 18:35:38 -08:00
Tim Abbott f105c6b12e css: Remove unused Bootstrap nav-tabs styles. 2024-01-25 18:35:38 -08:00
vighneshbhat9945 642cce1a30 settings: Remove extraneous background for export button.
Removed the div along it's css rules which was
responsible for extraneous background around the
'start export of public data' button.

Fixes: #28625.
2024-01-25 18:24:06 -08:00
Sayam Samal 222364733f emoji_picker: Restructure CSS related to the emoji picker.
This commit tries to improve the CSS related to the emoji picker by
restructuring relevant parts of `reactions.css` and `dark_theme.css`.

Via this commit, the redundant classes -- "reaction", "status-emoji",
"composition" are also removed from `emoji_popover_emoji.hbs`.

If needed, specific styling -- according to the type of emoji picker,
can now be applied using the `data-emoji-destination` attribute of the
`.emoji-picker-popover`.
2024-01-25 18:15:45 -08:00
Sayam Samal d0c111c809 emoji_picker: Fix status emoji picker inconsistencies.
Due to a logical bug in the `process_enter_while_filtering` function,
the `toggle_reaction` was being called when pressing enter while
filtering the emojis in the status emoji picker.

This commit fixes the above bug, while also adding some cleanups to the
`emoji_picker.js` by combining multiple click handlers and aggregating
all the logic related to an emoji being selected into a common function.

Fixes #28464.
2024-01-25 18:15:45 -08:00
vighneshbhat9945 6d6fa145cc
css: Make the height of compose buttons steady.
When any stream name includes some other language's letters is scrolled down in 
the recent views, the height of compose-controls bar would change.

Fix this by setting a precise line-height for these elements.

Fixes: #27837.
2024-01-25 15:16:00 -08:00
Sahil Batra 6781d06988 settings: Remove extraneous divider in account settings. 2024-01-25 14:28:48 -08:00
Sahil Batra 3d56f65df3 settings: Show the text about downloading config in "Active bots".
This commit moves the "Download config of all active outgoing
webhook bots in Zulip Botserver format." text to be shown in the
"Active bots" section since the text is relevant for active bots
only. This commit also updates the code to show the text only
if user has atleast one active outgoing webhook bot since the
text is relavant only for outgoing webhook bots.
2024-01-25 14:28:48 -08:00
Sahil Batra a6370fda68 settings: Do not use bootstrap tabs in bots panel.
This commit replaces the boostrap tabs with our own
tabs implementation from components.ts. This is part
of the bootstrap removal project.
2024-01-25 14:28:48 -08:00
N-Shar-ma 0003c3c1ef typeahead: Fix bug where typeahead showed momentarily on shift + tab.
Since the keyup event for keys including shift triggers the typeahead,
shift tabbing into the topic recipient field would show the typeahead
momentarily, which is distracting.

As we need typeahead to trigger on shift for certain use cases in the
compose box, but not in the topic recipient field, we now do not trigger
typeahead on shift keyup events in the topic recipient field.

Fixes: #24152.
2024-01-25 11:12:26 -08:00
N-Shar-ma e4258b56d5 hotkey: Introduce hotkey Alt+P to toggle preview for compose box.
On Mac, it's Option+P.

Fixes: #18471.
2024-01-25 10:51:25 -08:00
N-Shar-ma 972b4de7c4 hotkey: Correct Mac equivalent of Alt and handle exceptions separately.
Though the correct mapping for Alt in Mac is Option, we had so far been
mapping it to Command, since for the 2 pre-existing shortcuts that used
Alt, Command was the only key that worked on Mac. However, these are
exceptions.

Now we map Alt to Option, and handle the 2 exceptions separately, using
data attributes on those shortcut elements.

This is a prep commit for introducing a hotkey that uses Alt / Option.
2024-01-25 10:51:25 -08:00
N-Shar-ma 536ab78587 refactor: Extract new function `show_preview_area` for the compose box.
The code responsible for switching from edit mode to preview mode from
`compose_setup.js` is now extracted into a new function in `compose.js`,
to facilitate reuse.

This is a prep commit for introducing a hotkey to toggle between edit
and preview mode for the compose box.
2024-01-25 10:51:25 -08:00
Anders Kaseorg 118cfbea65 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
Anders Kaseorg 5348bee0eb settings_playgrounds: Fix HTML injection in language typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 17:46:56 -08:00
evykassirer d7b02a699c pygments_data: Move data to typescript. 2024-01-24 17:06:03 -08:00
evykassirer bd6471f0e3 page_params: Add custom_profile_field_types. 2024-01-24 17:06:03 -08:00
evykassirer ebb1105e2f typeahead: Fix type of sorting_comparator. 2024-01-24 17:06:03 -08:00
Sahil Batra 866a610664 group_settings: Empty right panel based on the url hash.
This commit adds code to empty the right panel if hash is
changed to "#groups/your" or "#groups/all".
2024-01-24 14:01:47 -08:00
Sahil Batra a87de19aa7 groups_settings: Fix browser back button for groups overlay.
There is no problem in behavior of browser back button if we open
the group settings overlay using "#groups/your", "#groups/all" or
"#groups/new" url hash, but someone can directly go to a link with
"#groups" and in this case we want to fix the browser back button.

This commit replaces "#groups" entry with "#groups/your" which is the
default section opened, such that pressing back when on "#groups/your"
does not go to "#groups", which will then a form a cycle and instead
go back actually.
2024-01-24 14:01:47 -08:00
Sahil Batra 6e61077ab4 gear_menu: Open group settings overlay with "#groups/your" hash.
This commit fixes the bug in browser back button behavior when
opening the groups overlay from gear menu. The bug was caused
due to browser history containing both "#groups" and "#groups/your"
entries, which essentially resulted in a "#groups/your" -> "#groups"
-> "#groups/your" cycle and thus nothing happend on clicking
browser back button.

The case for a user manually typing "#groups" url would be handled
in next commit.
2024-01-24 14:01:47 -08:00
Sahil Batra baad78aafd groups_settings: Make "Cancel" button work in group creation form. 2024-01-24 14:01:47 -08:00
Pratik Chanda 8559032d3a help_menu: Fix help_menu message formatting overlay not opening.
This commit fixes the behaviour of message formatting overlay in
help menu not opening due to assertion error in rendered markdown
after changes from #28418.
2024-01-23 18:09:57 -08:00
Anders Kaseorg e9ea4280ab vdom: Fix types to avoid relying on unsound bivariance.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-23 12:13:41 -08:00
Aditya Kumar Kasaudhan 19f315cf4f settings: Rename 'display_settings' to 'preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 6cd165386a settings: Rename 'emoji-display-settings' to 'emoji-preferences'.
Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Aditya Kumar Kasaudhan 61a10dfca0 settings: Rename 'display-settings' to 'preferences'.
This commit renames "display-settings-radio-choice-label" to "preferences-radio-choice-label".

Fixes part of #26874.
2024-01-23 10:11:44 -08:00
Lauryn Menard ccfcb34bea activity-css: Make activity charts header row sticky.
This will be applied to both the overall installation activity chart
as well as the associated remote, client, realm and user views.

Co-authored-by: Karl Stolley <karl@zulip.com>
2024-01-23 09:31:05 -08:00
Sahil Batra 9fa39ce71d stream_edit_subscribers: Remove unnecessary logging.
There is no need to log if the stream edit UI is not opened
when an event for updating subscribers list is received and
we should just return because this is not a bug.
We do the same in other places where we just return early
without logging because we do not need to make any updates.
2024-01-22 22:08:10 -08:00
Anders Kaseorg cacdae5a10 message_viewport: Remove needlessly complex make_dimen_wrapper.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-22 18:21:53 -08:00
Lalit 6f6795f607 ts: Migrate `message_viewport` to typescript.
Used function overloading for methods - `make_dimen_wrapper`
and `scrollTop`.
2024-01-22 16:29:23 -08:00
Lalit f2c700b6e1 message_viewport: Refactor `message_viewport_info` method.
Refactoring to avoid having an object of incomplete type i.e. `res`.
2024-01-22 16:29:23 -08:00
Lalit 82841a7b5f message_viewport: Remove unused parameter from `in_view` function. 2024-01-22 16:29:23 -08:00
Lalit d4a4e2df3a message_viewport: Modify parameters for dimension wrapper functions.
JQuery's `height` and `width` methods only takes one argument in case
we want to set height or width. The argument is of type `string` or
`number` or a function.

Refrence: https://api.jquery.com/height/#height-value.

Therefore, we can get rid of argument array and just accept a single
argument in the inner function in `make_dim_wrapper`.
2024-01-22 16:29:23 -08:00
Lalit 530f4fc763 message_viewport: Avoid having unbound methods.
Passing class methods such as `$.fn.height` as values is dangereous
because it removes type safety by failing to capture `this`.
eslint-rule: @typescript-eslint/unbound-method.

Hence, I fixed this rule by directly binding `$scroll_container`
to these methods before passing them as values to wrapper function.
2024-01-22 16:29:23 -08:00
Lalit 69294d5baf message_lists: Add type for `opts` parameter of `select_id` method. 2024-01-22 16:29:23 -08:00
ColeBurch 9917ffa220 settings: Rename four custom profile fields types.
This commit renames four custom profile fields types.

Fixes part of #28511.
2024-01-21 12:51:53 -08:00
Aman Agrawal abe6e5b807 personal_menu: Fix clicking on `Set status` not working.
Use `tabindex` instead of `href` to set focus on `a` tag.

Ideally, we should use `button` for these elements but since
we want to keep the pattern for these dropdowns same where some
`a` elements do have a valid `href`.
2024-01-21 12:06:53 -08:00
Varun Singh c0a0c0e834 scheduled_messages: Convert module to TypeScript. 2024-01-21 08:54:20 -08:00
Varun Singh ac42de07eb scheduled_messages_data: Convert object to Map. 2024-01-21 08:54:20 -08:00
Aditya Kumar Kasaudhan 80ea965408 settings: Rename display_settings_labels to preferences_settings_labels.
Fixes part of #26874.
2024-01-19 17:55:13 -08:00
evykassirer 1948cf15a4 rendered markdown: Assert data-user-group-id is always defined. 2024-01-19 17:54:07 -08:00
evykassirer 8473b9dd48 rendered_markdown: Throw error if stream_id_string is undefined. 2024-01-19 17:54:07 -08:00
evykassirer 1de36ec743 rendered_markdown: Convert module to typescript. 2024-01-19 17:54:07 -08:00
evykassirer 4c5f115a6e people: Remove string type for user_id.
Further discussion here:
https://github.com/zulip/zulip/pull/28418#discussion_r1442220867
2024-01-19 17:54:07 -08:00
evykassirer e4ba07dcf2 message_store: Only allow number for message_id. 2024-01-19 17:54:07 -08:00
evykassirer e986813943 emoji_picker: Don't allow toggling of user status emoji. 2024-01-19 17:54:06 -08:00
Tim Abbott e32468e97f compose: Simplify convert_mentions_to_silent_in_direct_messages.
The behavior to replace existing message content was leftover code
from a previous version of the mechanism, and not intended.
2024-01-19 14:56:55 -08:00
Tim Abbott ca591b49ca compose: Don't convert bot mentions to silent mentions.
This fixes an unintended consequence of the silent mention conversion
logic added in 4d1ade1f88, where bots
that looked for personal mentions would not process mentions in 1:1
DMs.
2024-01-19 14:56:55 -08:00
vighneshbhat9945 d9865e960d emoji_picker: Avoid exception in emoji_picker.
Added if-else condition to check whether the
'section_head_offsets[]' is empty or not.
If it is empty then 'currently_selected' is
coded as 'Popular' else it is assigned with
'section_head_offsets[0].section'.

Fixes #24776.
2024-01-19 11:17:09 -08:00
sayyedarib 9f509d4ab2 status_emoji_selector: Replace fa-smile with custom zulip-smile-icon.
Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
sayyedarib d41ee3d3d8 user_status: Fix alignment of select-emoji icon of user-status modal.
use flex display justify-content for vertical alignment
instead of using offsets like "top". for horizontal
alignment of smiley-icon use text-align center.

Signed-off-by: sayyedarib <sayyedaribhussain4321@gmail.com>
2024-01-19 09:48:02 -08:00
Aman Agrawal a17f18f155 narrow: Fix message row partially visible on narrow.
This will prevent any message we want to select after narrowing
from being offscreen entirely or partially.

Steps to reproduce the bug:
* `./manage.py populate_db -n 3000 --max-topics=2`
* Narrow to a stream and scroll high up.
* Align two recipient bars together with nothing between them.
* Click on the first recipient bar after keeping the selected message
  on the second recipient bar.
* You will see that the selected message is not in view.
2024-01-19 09:36:19 -08:00
Aman Agrawal db10cca4a2 Revert "desktop_app: Close popover when clicking on "Plan management"."
This reverts commit 1f79e6294f.
No longer required after
70ba7cc042
2024-01-19 08:42:25 -08:00
Aman Agrawal febeeb5dac popover_menu: Fix popover not closed on clicking external links.
For example, gear menu was not closed after `Integrations` button
was clicked since we don't have an event handler which opens
`/integrations` in a new tab but we let the browser navigate user
to `/integrations` after clicking on `a href='/integrations'`.

There was no handler for hiding the popover after clicking on such
links, so this commit adds one.
2024-01-19 08:42:25 -08:00
Mateusz Mandera 1f79e6294f desktop_app: Close popover when clicking on "Plan management". 2024-01-18 15:57:51 -08:00
Aditya Kumar Kasaudhan 1ab4520c4e settings: Rename display-settings-form to preferences-settings-form.
Fixes part of #26874.
2024-01-18 13:39:57 -08:00
Shubham Padia afac26e3e9 refactor: Don't use today arg from render_now in timerender tests.
We cannot remove the today argument for render_now since it is being
used in one other place: timerender.update_timestamps .
2024-01-18 08:32:30 -08:00
Shubham Padia a43a898e12 refactor: Remove today arg from absolute_time.
The today argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3d2110be51 refactor: Remove current_date arg from last_seen_status_from_date.
The current_date argument was only used in tests and now we're using
and now we're using MockDate in tests.
2024-01-18 08:32:30 -08:00
Shubham Padia d5de26ff3b refactor: Remove current_date arg from relative_time_string_from_date.
The current_date argument was only used in tests and now we're using
MockDate to set the current date.
2024-01-18 08:32:30 -08:00
Shubham Padia 3a233d73c1 refactor: Remove today arg from render_date and use MockDate for tests.
Fixes #26774.
We don't need the today argument anymore since every value passed to
it was a new Date() except the tests where we are using MockDate now.
2024-01-18 08:32:30 -08:00
Aman Agrawal a15d4e2be7 narrow: Extract common methods around setting current list.
This will help us combine activate and deactivate.
2024-01-18 08:31:48 -08:00
Aman Agrawal 9aa8c1f156 lightbox: Use rows module to query message_row elements. 2024-01-18 08:31:48 -08:00
Aman Agrawal 07cc079c8d narrow: Remove unused `narrowed_view` class. 2024-01-18 08:31:48 -08:00
Aman Agrawal 514075329b pm_list: Remove not needed narrow_state mock. 2024-01-18 08:31:48 -08:00
Aman Agrawal 1f1749ffb1 actions_popover: Remove unused parameter `narrowed`. 2024-01-18 08:31:48 -08:00
Aman Agrawal df180f7bd5 single_message: Use data-message-id instead of zid. 2024-01-18 08:31:48 -08:00
Aman Agrawal 633f64a79e narrow: Use message list id to track message lists in DOM.
This removes use of zfilt and zhome from codebase.
2024-01-18 08:31:48 -08:00
Alya Abbott 8272210b47 notifications: Add # to stream name in desktop notifications.
Follows the general pattern of always using a stream marker.
2024-01-17 16:39:41 -08:00
CIC4DA c7fc82727f inbox_ui: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA ea6b3b84c4 settings_org: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA caa2dbbba4 filter: Use Intl.ListFormat rather than .join(", "). 2024-01-17 13:43:17 -08:00
CIC4DA cd91bc3d71 compose_ui: Use Intl.ListFormat rather than .join(", ") 2024-01-17 13:43:17 -08:00
CIC4DA efb2a5a38d util: Defining common formatter function 2024-01-17 13:43:17 -08:00
Aman Agrawal e2520da24d event_status: Avoid ever-increasing calls to start_status_polling.
In case, we have an error and `completed` is `false`, we start
two loops of `start_status_polling` which keep increasing with
each call.
2024-01-17 12:46:44 -08:00
Aman Agrawal 6d50a3b2db billing: Fix `Update card` from billing page not working.
Since we don't provide `tier` info to session on billing page,
it was not working.
2024-01-17 12:46:44 -08:00
vighneshbhat9945 59a7a2e11d
settings: Use correct tooltips for deactivated bots.
Added handlebars if-else conditions to display
'User is deactivated' tooltip for deactivated users
and 'Bot is deactivated' tooltip for deactivated bots.

Fixes #28593.
2024-01-17 12:45:03 -08:00
Vidhi Agrawal b21dc465b8 billing: Change background color of reactivate subscription.
Fixes #28428
2024-01-17 12:43:01 -08:00
Aman Agrawal 781473414f drafts: Fix flaky drafts tests.
There were two typeahead displayed while we were testing
create_private_message_draft. One was topic typeahead from previous
create_stream_message_draft test and the other was cordelia
DM typeahead. So, when clicking on the typeahead, we clicked
the topic typeahead when we really wanted to select the cordelia
typeahead. This resulted in drafts test failing.
2024-01-16 09:31:10 -08:00
Aditya Kumar Kasaudhan 8f39b6f905
e2e-tests: Rename display_settings_section to preferences_section.
Fixes part of #26874.
2024-01-16 09:29:40 -08:00
Karl Stolley 906559c2b5 portico: Extend proper background gradients to /plans. 2024-01-15 18:43:33 -08:00
Karl Stolley cc4bb3493a portico: Scope pricing-plans styles to pages that need it. 2024-01-15 18:43:33 -08:00
Karl Stolley f5245285b4 portico: Isolate global plans-page styles in own file. 2024-01-15 18:43:33 -08:00
Mateusz Mandera fc247cba3f remote_billing: Fix /self-hosted-billing/ handling for desktop app.
When you click "Plan management", the desktop app opens
/self-hosted-billing/ in your browser immediately. So that works badly
if you're already logged into another account in the browser, since that
session will be used and it may be for a different user account than in
the desktop app, causing unintended behavior.

The solution is to replace the on click behavior for "Plan management"
in the desktop app case, to instead make a request to a new endpoint
/json/self-hosted-billing, which provides the billing access url in a
json response. The desktop app takes that URL and window.open()s it (in
the browser). And so a remote billing session for the intended user will
be obtained.
2024-01-15 16:50:48 -08:00
shashank-23002 dcec36b824 typeaheads: Fix mention typeaheads spill width.
Fixes: #27825
2024-01-15 16:17:11 -08:00
Aman Agrawal 272337f0f9 filter: Remove incorrect check for `All messages` view.
All message view has `in-home` filter and is not empty.
If there are no terms provided, we set filter to display
all messages (including muted streams/topics).

We make it mandatory to provide terms to Filter.
2024-01-15 12:26:24 -08:00
Aman Agrawal 5357b9814e search: Check for narrow_state.filter being undefined. 2024-01-15 12:26:24 -08:00
Aman Agrawal b36163dd8f typing_events: Handle search_terms() being an empty list. 2024-01-15 12:26:24 -08:00
Aman Agrawal a217138788 message_list: Check filters to decide if list is narrowed.
All messages list always has the "in-home" filter. We are in the
process of removing "zhome/zfilt" from message list, so this would
help in that process.
2024-01-15 12:26:24 -08:00
Aman Agrawal 2f8b82d808 upload: Fix drag drop not working for edit message in `All messages`.
Instead of `zfilt`, we should use table name of the current
message list.
2024-01-15 12:26:24 -08:00
Aman Agrawal 2fdd43a917 filter: Fix tests for guest user without indicator. 2024-01-15 12:26:24 -08:00
Aman Agrawal 5b0d346dd9 filter: Don't modify original terms when testing. 2024-01-15 12:26:24 -08:00
Aman Agrawal d7cbe17773 message_list: Remove unused variable. 2024-01-15 12:26:24 -08:00
Aman Agrawal d52cce9c3a message_list: Cleanup use of zhome to check for all message list.
Add a simple method to check for in-home filter.
2024-01-15 12:26:24 -08:00
N-Shar-ma 2952f0f44f refactor: Initialise state variables to undefined instead of false.
For compose state variables `last_focused_compose_type_input` and
`message_type` that are assigned non-boolean values on user interaction,
`undefined` is the semantically better choice than `false` for
initialisation, to avoid incorrect boolean implications.
2024-01-14 18:11:26 -08:00
N-Shar-ma 79ec61b373 turndown: Paste single line of code as inline code in markdown.
When pasting any code without any newlines, whether from a code block or
a code span, it will always be pasted as inline code.

That is, a line of code copied from within a code span will retain code
span formatting on paste, and a line of code copied from within a code
block will be pasted as inline code, instead of a 1 line code block.
2024-01-14 15:36:38 -08:00
sanchi-t 446ba4d6df message_edit: Fix cursor style on hover in edit area.
Fixes #3938.
2024-01-14 15:34:28 -08:00
shubham 664f29b4f1 unread_ops: Use /messages/flags/narrow to mark stream/topic as read.
This commit refactors the original mark_all_as_read in unread_ops to
bulk_mark_mesages_as_read to include marking stream/topic as read.
The unread_ops API reamins the same to mark stream/topic as read but the
underlying implementation now uses a different endpoint. A new function
mark_all_as_read has been added so that the unread_ops API remains the
same.

Fixes #27372.
2024-01-14 15:32:03 -08:00
Sahil Batra af7cfb677f stream_edit_toggler: Remove setup_stream_subscriptions_hash.
We only update the url hash in one place, i.e. in callback for
toggler, so there is no need to have a separate function and it
also prevents in someone using that function incorrectly in future.
2024-01-14 15:30:46 -08:00
Sahil Batra f3add07280 stream_settings: Make the right panel empty according to the URL hash.
We now make the right panel empty if the URL hash is changed to
"#streams/all" or "#streams/subscribed" either manually or by
using the browser back button.

We call the function to make the right panel empty in change_state
and not in the callback function for toggler.goto because the right
panel empty becomes empty due to change in hash and not due to
toggling between subscribed and all streams.
2024-01-14 15:30:46 -08:00
Sahil Batra 332d61f820 stream-settings: Do not toggle right section in switch_to_stream_row.
We handle showing the correct section in right panel by calling
set_up_right_panel_section from show_settings_for, so there is
no need to call stream_edit_toggler.goto from switch_to_stream_row.
2024-01-14 15:30:46 -08:00
Sahil Batra e26ca5a547 stream-settings: Refactor code used to update url hash.
This commit refactors code to not try to update the hash multiple
times.

We now update the url hash only in the callback function for
toggler.goto and remove the call to setup_subscriptions_stream_hash
in open_edit_panel_for_row. This change works as the hash depends
on the section being opened in right panel, so it seems better to
handle the hash update while toggling to the correct section.

A couple of more changes we need to do to make this work correctly
are -

- We extract the code to call "toggler.goto" for the correct section
outside the update_toggler_for_sub to a new function
set_up_right_panel_section. This is changed as update_toggler_for_sub
returns early without doing anything if the url hash is not the one
we have when settings panel for a particular stream is opened and
now the hash is updated after that check as a callback from
toggler.goto.

- set_up_right_panel_section uses stream_edit_toggler.select_tab
to toggle to the correct section in right panel so we now need
to set stream_edit_toggler.select_tab in change_state.
2024-01-14 15:30:46 -08:00
Sahil Batra a03e3ddc5a stream-settings: Don't change tab when navigating between streams.
This commit fixes the bug of tab in right side being changed to
"general" when navigating between streams through keyboard instead
of opening the tab which was opened for previous stream.

Fixes #28422.
2024-01-14 15:30:46 -08:00
evykassirer 572844f257 typeahead: Maybe stop advance for keypress always.
We don't want to process the key if `suppressKeyPressRepeat`
is true, but we always want to check to see if we should
stop propagation, or else characters typed into the input
field can be processed as hotkeys.
2024-01-14 15:07:24 -08:00
evykassirer 177dfade9d typeahead: Create helper function for stopping propagation.
No functional changes, only a refactor. This is about to be
used in a third place.
2024-01-14 15:07:24 -08:00
evykassirer cf2f0d88c3 search: Add setter and getter for search bar text.
The search bar input is about to get more complicated,
and an upcoming commit will be switching the element
from `input` to a contenteditable div, which means
we'll be accessing the text with text() instead of
val(). To make that change easier, and reduce future
bugs of using the wrong text/val, this commit
makes setter and getter functions so that the text/val
is isolated to one spot.
2024-01-14 15:07:24 -08:00
evykassirer 128c12d0e2 search: Nest pill styling under the typeahead styles.
This is needed for adding pills to search, so that these
styles don't get applied to the search pills.
2024-01-14 15:07:24 -08:00
evykassirer ec0ef35f3c search: Remove unnecessary export of narrow_or_search_for_term. 2024-01-14 15:07:24 -08:00
evykassirer 33e4c9b25c topic_list_data: Convert module to typescript. 2024-01-14 14:50:49 -08:00
N-Shar-ma a4fad5dda1 compose: Revamp and improve test suite for compose formatting buttons.
Earlier, the tests for compose formatting were verbose, hard to read as
well as extend, and overly granular, without even having the ability to
test the final text selection or the cursor position.

Now, new test helpers, `init_textarea_state` and `get_textarea_state`,
have been added, enabling the tests to be more concise and readable,
while also being more powerful. A representative string alone now
describes the textarea state (the text and the selection / cursor),
making each test case as easy as defining the initial state as a string
and comparing the expected state post formatting with another string.

These new tests helped surface a couple bugs which have been fixed in
preceding commits.
2024-01-12 15:48:53 -08:00
N-Shar-ma aba5997557 compose: Fix bug where toggling off link formatting left extra spaces.
In cases where either the description or the URL, or both were empty,
there would be an unneeded space, originally intended to space out the
description and URL, lingering even when the description and/or URL was
missing. The resulting highlight would also be off at times.

Now we only add in a space if both the description and URL are present,
and the highlight too is as intended.
2024-01-12 15:48:53 -08:00
N-Shar-ma b686f97a71 compose: Fix bug where spoiler would not always start on a new line.
Earlier, when a selection not starting at the beginning of a line was
formatted as a spoiler, the spoiler would not start on a new line, and
so would not be rendered as a spoiler. The `Header` highlighting too
was off by one character.

Now, the spoiler starts on a new line, and the `Header` highlighting
works as expected too.
2024-01-12 15:48:53 -08:00
Aditya Kumar Kasaudhan 49a9954413 settings: Rename settings_display to settings_preferences.
This commit renames "settings_display.js" file to
"settings_preferences.js".

Fixes part of #26874.
2024-01-12 15:33:16 -08:00
Tim Abbott 40f99d0990 Revert "portico: Extend proper background gradients to /plans."
This reverts commit 536d2f4e7f.

Apparently pricing_plans.css is included in many unrelated pages.
2024-01-12 14:43:28 -08:00
Aman Agrawal 03254bea5b billing: Change how flat discount on billing/upgrade page is displayed. 2024-01-12 08:50:51 -08:00
Aman Agrawal c9a4660911 header: Avoid using `.dropdown` for class name.
This is avoid conflict with styles defined for `.dropdown` in
bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 9d1e977e2a portico: Don't use `dropdown-toggle` class.
We want to avoid using `dropdown-toggle` class to avoid
properties leaking from bootstrap.
2024-01-12 08:40:51 -08:00
Aman Agrawal 70ecdf2add helpers: Remove dead bootstrap tabs code. 2024-01-12 08:40:51 -08:00
Anders Kaseorg be13557ead playground_links_popover: Remove wrong $ prefix for non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 18:15:59 -05:00
Anders Kaseorg 43e53d9b9d user_status: Fix parsing of partial user_status events.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-11 14:06:11 -08:00
Alex Vandiver e0bd169c77 docs: Fix other help pages that were renamed or moved, to save a redirect. 2024-01-11 13:52:12 -08:00
Vector73 ed97420ffc
settings: Fix setting label click functionality.
This commit fixes "Automatically follow topics where I'm mentioned"
setting label click functionality so that the setting is toggled
on clicking the label.
2024-01-11 13:34:46 -08:00
Karl Stolley fd559495ab message_row: Remove unnecessary .sender-status-controls style and structure. 2024-01-11 12:53:31 -08:00
Karl Stolley 272b62138e message_row: Remove styles and JS for nonexistant .sender-status. 2024-01-11 12:53:29 -08:00
Karl Stolley 09ae717fee message_edit: Lay out edit buttons with flexbox. 2024-01-11 12:51:02 -08:00
Karl Stolley f0f8d6a42d message_edit: Remove styles with no associated structure. 2024-01-11 12:51:02 -08:00
Karl Stolley fd5fe64a33 message_edit: Consolidate styles into message row CSS. 2024-01-11 12:51:02 -08:00
evykassirer 4b14f0efad stream_topic_history_util: Convert module to typescript. 2024-01-11 12:45:39 -08:00
evykassirer 8bd9a91216 stream_list_sort: Convert module to typescript. 2024-01-10 17:43:08 -08:00
evykassirer a75253cdba stream_list_sort: Use more accurate stream_id name. 2024-01-10 17:43:08 -08:00
evykassirer 426e345e65 stream_list_sort: Use a flag instead of checking for undefined list. 2024-01-10 17:43:08 -08:00
Aman Agrawal c58c12911c typing_events: Show typing notification in a proper topic narrow.
It is possible to have multiple topic / stream terms if user
is searching or if the URL is malformed. So, we should check
if the user is in a proper topic narrow before showing
typing notifications.

This fixes the error of topic being undefined due to there
being multiple topic terms in narrow when trying to display
notifications.
2024-01-10 09:08:38 -08:00
evykassirer cd58655a4b stream_topic_history: Convert module to typescript. 2024-01-10 09:02:17 -08:00
evykassirer 8a1fa8b161 stream_topic_history: Simplify add_or_update params. 2024-01-10 09:02:17 -08:00
Sahil Batra dcac272afc user_group_popover: Convert module to typescript. 2024-01-09 16:47:37 -08:00
afeefuddin d0deaff7fd portico-header: Dropped find accounts link for smaller windows.
Fixes #27477
2024-01-09 16:46:24 -08:00
Karl Stolley 5c0e37844b plans: Reduce font-size of text comparison elements. 2024-01-09 16:00:16 -08:00
Karl Stolley f71c7458a7 plans: Consolidate positioning on comparison values. 2024-01-09 16:00:16 -08:00