Commit Graph

2827 Commits

Author SHA1 Message Date
Tim Abbott d505a3c8b7 hashchange: Fix duplicate hides of inbox/recent views.
Since at least 6ef0753a51, it's been the
case that narrow.activate already hides the inbox/recent views if
open, and the same is true for all messages.

Fixing the duplicate call is important in show_home_view, because
show_all_message_view relies on having an accurate value for whether the
recent/inbox views were already open in order to correctly update the
left sidebar.
2023-11-15 17:33:21 -08:00
Tim Abbott a3842584dd hashchange: Fix flicker when navigating to all messages.
Testing experimentally, removing the setTimeout seems to fix a visible
flicker when using Esc to navigate to "All messages" from the Inbox
view. That setTimeout has been moved around without real examination
since 5d79bb6a20 from early 2013; I
don't see any good reason why it would make be necessary only in the
"All messages" code path, and not when narrowing to any other view.
2023-11-15 17:33:21 -08: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
Tim Abbott 0f01eae655 narrow: Simplify actively_scrolling data flow.
There's no good reason to have the caller of deactivate pass this
parameter in.

This effectively reverts a18b1662cb,
which did this as part of trying to avoid an import cycle, with a more
appropriate solution using the existing message_scroll_state module.

Importantly, it also means that we again wait for scrolls longer than
50ms to finish before opening All messages; I think this might fix a
regression.
2023-11-15 17:33:21 -08:00
Tim Abbott 03f3e17a40 narrow: Clarify first parameter to deactivate.
This previous parameter name was inaccurate, since that's not what the
caller is actually asserting for us.
2023-11-15 17:33:21 -08:00
Karl Stolley f17e4e7198 left_sidebar: Group view-highlight code together. 2023-11-15 17:33:21 -08:00
Anders Kaseorg 2fc327b775 compose_ui: Fall back to comma join when Intl.ListFormat is missing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-15 15:51:33 -08:00
Karl Stolley dd938911f7 compose_box: Set auto height on textarea in full screen. 2023-11-15 15:23:48 -08:00
Karl Stolley 4493ee346d reactions: Set more explicit reaction-text setting. 2023-11-15 14:02:45 -06:00
Karl Stolley b374b21171 reactions: Set interactive hover delay on reaction Tippies.
This introduces a new INTERACTIVE_HOVER_DELAY of 425 milliseconds.
It's meant to be short enough that the tooltip's contents are
displayed without too much of a lag, but long enough that a quick
interaction--like +1'ing an existing emoji--happens without the
quick flash of the tooltip itself.
2023-11-15 14:02:45 -06:00
Karl Stolley 6fe49f93ad reactions: Redesign reaction button colors and style.
See CZO discussion:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Reactions.20background.20color/near/1632171

Also:
https://github.com/zulip/zulip/pull/26580#issuecomment-1705734770

Co-Authored-By: Vlad Korobov <terpimost@gmail.com>
2023-11-15 14:02:45 -06:00
Karl Stolley ff9c931366 reactions: Nuke overwrought inherit declaration.
This is made unnecessary thanks to CSS variables.
2023-11-15 14:02:45 -06:00
Karl Stolley 534683a3ff reactions: Express reaction button colors as CSS vars. 2023-11-15 14:02:45 -06:00
Karl Stolley 474dcf60a2 reactions: Unify stream and DM colors, express as CSS vars. 2023-11-15 14:02:45 -06:00
Karl Stolley a929220d3c message_edit: Add styles for Save and Cancel buttons. 2023-11-15 10:41:51 -08:00
Karl Stolley 8bc12a4ee2 modal_buttons: Make exit button colors in to CSS variables. 2023-11-15 10:41:51 -08:00
Karl Stolley f1a79085eb message_edit: Build basic multi-line layout for message editing. 2023-11-15 10:41:51 -08:00
Karl Stolley 6890c9d171 left_sidebar: Place unread count right of All DMs icon.
Also set a CSS variable for header-icon widths in the left sidebar.

Fixes: #27559
2023-11-15 10:07:04 -08:00
Karl Stolley 614abd58be left_sidebar: Place unread count right of stream controls.
Fixes: #27380
2023-11-15 10:07:04 -08:00
Karl Stolley 335790dae8 left_sidebar: Add unread streams count to Streams header. 2023-11-15 10:07:04 -08:00
Karl Stolley 5accf36115 recent_view: Correct icon alignment within rows. 2023-11-15 09:05:47 -08:00
Karl Stolley 17e87c9a20 compose_box: Fix regression on full-screen Preview areas. 2023-11-15 09:04:54 -08:00
Karl Stolley c5b7432cf2 compose_box: Maintain top alignment in Preview mode. 2023-11-15 09:04:54 -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
Aman Agrawal 27ffcc6576 bililng: Fix incorrect price per license on billing page.
There is a discrepancy between price per license shown on billing
and upgrade page for annual billing frequency due to difference
in methods used to calculate the amount.

To fix it, we use the same method on both the pages.

I didn't use the helpers.format_money directly here since that would
create a visual delay in showing the price per license which will
not be nice considering that will be the only thing on this page
being updated that way.

The stripe fixture used is same as
free_trial_upgrade_by_card--Customer.retrieve.3.json
2023-11-15 15:59:26 +05:30
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
Karl Stolley b2c2afe374 left_sidebar: Keep all DM container rows to same right margin. 2023-11-14 16:43:28 -08:00
N-Shar-ma 76a8c80b63 compose: Pass in stream_id to compose when editing scheduled message.
Earlier, we only passed in the stream name which isn't considered in
`compose_actions.start` when populating the recipient.

There was no visible bug since we first narrow to the correct stream and
then call `compose_actions.start`, but this was brittle since it would
not work if we open the compose box before narrowing.
2023-11-14 16:36:50 -08:00
Sayam Samal 06600028a5 send_later_popover: Use `.navigate-link-on-enter` for scheduled msgs.
We need to use the `navigate-link-on-enter` class for the scheduled
messages link in the popover, since it's a popover menu item with a
`href` attribute. The reason for using this class has been documented
in 246c1d7b4e.
2023-11-14 16:33:44 -08:00
Sayam Samal 0a487e4f92 popovers: Focus first option in send later popover when opened with kbd.
While opening the send later popover via the keyboard, we want to focus
the first text option, which is "Schedule message" at present. When the
popover is opened via mouse click, we want to keep the original behavior
of not focusing on any option.

Note: This is similar to the behavior of the message actions popover,
and hence this commit follows a similar pattern to add the focus.

Fixes: #27701.
2023-11-14 16:33:44 -08:00
Karl Stolley 6f8cac8077 compose_box: Better align and maintain alignment of topic marker. 2023-11-14 13:14:40 -08:00
Aman Agrawal d45a2bf35b stream_color: Increase contrast of stream icon color and background. 2023-11-14 12:23:10 -08:00
Aman Agrawal bbd49d4634 stream_color: Extract function to get corrected color. 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
Karl Stolley 5797381ea2 compose_box: Suppress send-area tooltips when vdots popover is open. 2023-11-14 12:10:38 -08:00
Karl Stolley fd8711023d compose_box: Move send-control-button Tippy logic to compose file. 2023-11-14 12:10:38 -08:00
Karl Stolley e82c875bc3 compose_box: Remove unreachable enter_sends cruft. 2023-11-14 12:10:38 -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
N-Shar-ma e18c180414 reload: Fix bug where stream input is unexpectedly cleared on reload.
Earlier, we preserved the stream name across reloads, and to restore the
compose state, passed that to `compose_actions.start`, which since
c3fe96a, considers the stream id, and not its name.

This caused a bug where on server initiated reload, the stream input
would not retain its value and be unexpectedly cleared.

This is fixed by preserving the stream id across reloads, instead of its
name, and passing that to `compose_actions.start` instead.
2023-11-14 12:05:14 -08:00
N-Shar-ma 4e35c78fd5 left-sidebar: Fix "New topic" button in stream popover.
Now we pass in the stream's id to `compose_actions.start()` (not its
name), so that the compose box opens with the correct stream selected.
2023-11-14 11:29:54 -08:00
Karl Stolley 994e29e1fc compose_box: Hide send icon when load spinner is showing. 2023-11-14 09:21:11 -08:00
Karl Stolley 0c95772f4e compose_box: Maximize clickable area on send-later vdots. 2023-11-14 09:21:11 -08:00
Karl Stolley 3201c7dfb5 compose_box: Extend use of send-control-button.
This uses `.send-control-button` to handle Tippies on those
elements (currently vdots and Drafts), and removes a confusing
compose-formatting class.
2023-11-14 09:21:11 -08:00
Karl Stolley 5bedbb14b4 compose_box: Rename message-control-button to send-control-button. 2023-11-14 09:21:11 -08:00
Karl Stolley 41b61cfb3e compose_box: Don't fill Topic line on restored draft. 2023-11-13 12:45:13 -08:00
Karl Stolley 93d6bcef0e compose_box: Properly present Drafts button in all languages. 2023-11-13 12:45:13 -08:00
Karl Stolley be34c4c2ef compose_box: Improve Drafts and button alignment in smaller views. 2023-11-13 12:45:13 -08:00
Karl Stolley 71468492b7 compose_box: Restore purple color to Send button. 2023-11-13 12:45:13 -08:00
Karl Stolley d92a1e7ca8 compose_box: Update vdots tooltip to 'Send options'. 2023-11-13 12:45:13 -08:00
Karl Stolley 4fe9e4e715 compose_box: Handle delay, radio selection on Enter-sends elements. 2023-11-13 12:45:13 -08:00
Karl Stolley 7209476b18 compose_box: Integrate Drafts, Enter-to-send in send-later popover. 2023-11-13 12:45:13 -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 601faf8548 compose_box: Handle responsive layouts on send column.
Fixes #27576.
2023-11-13 12:45:13 -08:00
Karl Stolley a6b3e74f7d compose_box: Sensibly style disabled Send/vdots buttons. 2023-11-13 12:45:13 -08:00
Karl Stolley 609106e2d0 compose_box: Implement redesigned vdots-button styles. 2023-11-13 12:45:13 -08:00
Karl Stolley bf0e806fed compose_box: Implement redesigned send-button styles. 2023-11-13 12:45:13 -08:00
Karl Stolley f8fa47fa02 compose_box: Use columnar flex to position Drafts, limit, Send button. 2023-11-13 12:45:13 -08:00
Karl Stolley a3c1399924 compose_box: Handle compose and preview expansion. 2023-11-13 12:45:13 -08:00
Karl Stolley ec38c7b5be compose_box: Establish basic message box grid geography. 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
Karl Stolley e608a389af compose_box: Improve structures around send controls. 2023-11-13 12:45:13 -08:00
Karl Stolley b4b71880e1 compose_box: Prepare redesign send and draft structures. 2023-11-13 12:45:13 -08:00
Aman Agrawal 637e9c11ee billing: Show success text after plan change on top after reload. 2023-11-13 10:35:39 -08:00
Aman Agrawal 67bddb3d72 billing: Show success message for license change after page reload. 2023-11-13 10:35:39 -08:00
Aman Agrawal c2e01f06a3 billing: Show message for users without access to page in a white box. 2023-11-13 10:35:39 -08:00
Aman Agrawal 17573cd1fb billing: Don't show license update buttons until valid change in value. 2023-11-13 10:35:39 -08:00
Aman Agrawal 0772f8011c billing: Don't reduce button width when loading. 2023-11-13 10:35:39 -08:00
Aman Agrawal 7dc4983898 billing: Wait 300ms before updating disabled status in buttons. 2023-11-13 10:35:39 -08:00
Aman Agrawal 5429582892 billing: Don't allow negative input. 2023-11-13 10:35:39 -08:00
Aman Agrawal 2a70143050 upgrade: Show user/month plurals based on their count. 2023-11-13 10:35:39 -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
Aman Agrawal 874d4a7026 upgrade: Improve styles for free trial upgrade. 2023-11-13 10:35:39 -08:00
Aman Agrawal 2ffae56efa upgrade: Improve styles for onboarding free trial orgs. 2023-11-13 10:35:39 -08:00
Aman Agrawal a04204e47d billing: Style go to your org better. 2023-11-13 10:35:39 -08:00
Aman Agrawal 7d10b3dcf7 upgrade: Add required fields to upgrade a realm. 2023-11-13 10:35:39 -08:00
Aman Agrawal 2f9a48cce7 upgrade: Show payment amount based on user input.
Write script to make payment amount vary with payment schedule
and number of licenses.
2023-11-13 10:35:39 -08:00
Aman Agrawal e3f20cdb8a billing: Reduce clickable area to visible button area.
Clicking outside the button also used to work for cancel plan and
other buttons in that area which can deceiving for the user.
2023-11-13 10:35:39 -08:00
Aman Agrawal f5ba6fe03c upgrade: Fix HTML structure and styles. 2023-11-13 10:35:39 -08:00
Aman Agrawal 6cadf333fb upgrade: Remove invoice payment instructions. 2023-11-13 10:35:39 -08:00
Aman Agrawal f273229b01 upgrade: Add payment button and info style with fake text. 2023-11-13 10:35:39 -08:00
Aman Agrawal 4638f67e4e upgrade: Use style similar to /billing page. 2023-11-13 10:35:39 -08:00
Aman Agrawal d3363bab96 upgrade: Add a dropdown to select billing cycle. 2023-11-13 10:35:39 -08:00
Aman Agrawal 2570f7ce23 upgrade: Control automatic / manual license management via URL. 2023-11-13 10:35:39 -08:00
Karl Stolley 690b4efca8 left_sidebar: Explicitly handle clicks on collapsible Views targets. 2023-11-13 09:33:21 -08:00
Tim Abbott 8ad2e10cfe typeahead: Fix exception trying to mention @all in DMs.
Fixes a regression in 4d1ade1f88.
2023-11-13 09:07:36 -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
Aman Agrawal 1b804cd0dd sponsorship: Don't preserve scroll position on reload. 2023-11-13 08:52:13 -08:00
Aman Agrawal 395cafcf46 sponsorship: Add extra input fields to get more org info.
Fixes #27600
2023-11-13 08:52:13 -08:00
Aman Agrawal bf53c70dd9 sponsorship: Update discount description on page load.
Fixes part of #27645.
2023-11-13 08:52:13 -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
Tim Abbott 07769aec4b rows: Fix logic for finding drafts rows. 2023-11-13 08:29:16 -08:00
Karl Stolley 554f33d033 left_sidebar: Set shared right margin on DM section. 2023-11-13 08:27:28 -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
Sahil Batra d1113b5371 invite: Use ICU plural syntax for invite success message.
The message shown on successful invitation included "User(s)"
previously. This commit updates it to include "User" or "Users"
according to the number of users invited.
2023-11-13 08:07:12 -08:00
Aman Agrawal 060b94b71f inbox: Fix search icon position on narrow widths.
Due to filters dropdown's variable width, the search icon was
incorrectly positioned, we fix it by positioning it relative to
the filter dropdown.
2023-11-10 18:20:26 -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 e15f518ccc compose: Always retain `ul` tag when pasting content enclosed by it.
This functionally makes no difference, but we add it along with `ol`
for consistency.
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
N-Shar-ma 602d1d7323 compose: Do not paste formatted markdown when inside a code block.
We usually default to pasting formatted markdown (unless the Shift key
is used to paste plainly instead), but when we're inside a code block,
we always want to paste plainly.
2023-11-10 13:56:51 -08:00
N-Shar-ma f5bcf5d608 compose: Add a function checking whether the cursor is in a code block.
This is a prep commit for the following 2 commits, so we can opt out of
the formatted paste and automatic bulleting / numbering behaviors when
inside a code block.
2023-11-10 13:56:51 -08:00
Prakhar Pratyush 2f469ff830 hotkey: Give feedback when no unreads left in followed topics.
When navigating to the next unread followed topic using
the Shift+N hotkey, we notify the user when there are no more
unread messages in followed topics.

Earlier, the hotkey simply did nothing in such a case.

We use feedback_widget to do so.

Fixes #27604.
2023-11-10 13:33:13 -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
Aman Agrawal a7f02c89d7 inbox_view: Move filters dropdown to the left of search box. 2023-11-10 10:22:18 -08:00
Aman Agrawal 69d59acc5a inbox: Focus currently selected option in dropdown. 2023-11-10 10:22:18 -08:00
Aman Agrawal f191efce1b inbox: Add dropdown to filter topics.
Fixes #27522

Replace `Include muted` checkbox with a dropdown to filter displayed
topics.

Also, adds a new filter to display only followed topics.
2023-11-10 10:22:18 -08:00
Aman Agrawal 03dcb9c0e4 dropdown_widget: Add option to hide search box. 2023-11-10 10:22:18 -08:00
Karl Stolley 2557f90c01 left_sidebar: Set extra-long hover delay for Views, DMs tooltips. 2023-11-10 09:22:07 -08:00
Karl Stolley f3887f1fa7 left_sidebar: Add a Views expand/collapse tooltip. 2023-11-10 09:22:07 -08:00
Karl Stolley f8ce278e76 left_sidebar: Include DM expand/collapse tooltip on arrow. 2023-11-10 09:22:07 -08:00
Karl Stolley 5f1c9ca107 left_sidebar: Center Streams tooltip over heading text. 2023-11-10 09:22:07 -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
Karl Stolley f2e8d2dc07 left_sidebar: Set border radius on rows for all states. 2023-11-09 17:39:26 -08:00
Karl Stolley 34475bf867 left_sidebar: Establish filter-handling grid on Streams, DM headers.
Fixes part of #27559.
2023-11-09 17:39:26 -08:00
Karl Stolley 2235413c15 left_sidebar: Establish grid on Direct Messages header. 2023-11-09 17:39:26 -08:00
Karl Stolley 12bf754a8a left_sidebar: Consolidate left-sidebar-title styles. 2023-11-09 17:39:26 -08:00
Karl Stolley 3f36c52f41 sidebars: Structurally separate left- and right-sidebar headings. 2023-11-09 17:39:26 -08:00
Karl Stolley ee32654723 sidebars: Express heading colors as CSS variables. 2023-11-09 17:39:26 -08:00
Aman Agrawal df703f847c billing: Fix free trial billing page end plan button not working. 2023-11-10 05:17:52 +05:30
Aman Agrawal bb557d5193 billing: Add different modals for increasing / decreasing licenses. 2023-11-10 05:17:52 +05:30
Aman Agrawal 3d45e7ca64 billing: Make plan cancel/renew work. 2023-11-10 05:17:52 +05:30
Aman Agrawal e185e91581 billing: Redirect to stripe card change page on clicking change card. 2023-11-10 05:17:52 +05:30
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
Aman Agrawal cce5666e5d billing: Make changing current and next cycle licenses work. 2023-11-10 05:17:52 +05:30
Aman Agrawal 9d7e10950f billing: Fix style of cancel button and adjust app margins. 2023-11-10 05:17:52 +05:30
Aman Agrawal d79b59d3b1 billing: Make payment method look nice. 2023-11-10 05:17:52 +05:30
Aman Agrawal f9aba9ba33 billing: Make license count management buttons look nicer. 2023-11-10 05:17:52 +05:30
Aman Agrawal a75afe1462 bililng: Style similar to sponsorship page. 2023-11-10 05:17:52 +05:30
Aman Agrawal a4425d26d2 billing: Add plan change buttons, modals and notices. 2023-11-10 05:17:52 +05:30
Aman Agrawal 2f532e49d1 billing: Add field to show billing frequency. 2023-11-10 05:17:52 +05:30
Aman Agrawal c41a8317cf billing: Convert plan name to new style. 2023-11-10 05:17:52 +05:30
Aman Agrawal b5b7fc9957 billing: Use navbar used in login/help pages. 2023-11-10 05:17:52 +05:30
Aman Agrawal 757675db80 rows: Use message under / next to sticky header for narrowing / info.
Fixes #27489

For sticky message headers, we should not use the `first_message_in_group`
for narrowing to the topic since can be out of view for the user.
2023-11-09 10:04:58 -08:00
Anders Kaseorg 9b83dc1b79 stylelint: Fix declaration-block-no-redundant-longhand-properties.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-11-08 16:11:15 -08:00
roanster007 273081d0a6 lightbox_view: Fix media title update on change in title.
Presently in a session when an image or video title is updated,
the same change is not reflected in the lightbox view of
them, until a new session is made.

This is because the metadata of the media is stored in Map
for the session with the preview_src as keys, and hence,
when title is changed the preview_src being same, the title
change is not reflected inside lightbox view.

This is fixed by modifing the asset_map (cache map) keys
from preview_src to an array of preview_src, and the media
title. Hence, when title is modified now, the keys won't map
to the existing value, and hence new metadata would be
shown.
A new function get_asset_map_key_for_media() introduced
to get the corresponing metadata from this asset_map
by passing in the prview_src and media elements.

Fixes #21311
2023-11-08 14:10:51 -08:00
Karl Stolley e8fe6f873e left_sidebar: Register mark-all-read handlers on all home views. 2023-11-08 14:04:58 -08:00
Aman Agrawal f6516cba89 personal_menu: Add opacity hover effect on clear status button. 2023-11-08 10:19:24 -08:00
Aman Agrawal 66276d88ef personal_menu: Add different colors for status text. 2023-11-08 10:19:24 -08:00
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
evykassirer c3bee2038a message edit: Use a default error message for failed edits.
Bug reported here:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20The.20partial.20.40partial-block.20could.20not.20be.20found/near/1673466

The reported issue was for a message edit request, and it was
happening because `channel.xhr_error_message` can return the
empty string sometimes, and `render_compose_banner` shows the
banner text if it exists and otherwise tries to render a
`@partial-block`. Unfortunately the empty string acts as falsy
in the template, leading to the partial block error.

This commit adds a default error message that was removed
in 96680e95fb.

It also adds a check to not show an error banner at all if
`readyState` is 0, which means the request was cancelled.
2023-11-08 09:47:32 -08:00
Aman Agrawal 3a7ce432e5 popovers: Fix topic visibility popover in sticky header not working.
The popover didn't open since sticky_header is part of message feed
and we were hiding popovers if `elements_at_reference_position`
had `sticky_header`. Now, we just don't do that check if the
reference is part of sticky_header.
2023-11-08 09:17:25 -08:00
ecxtacy f2deb8da46 settings-ui: Change `<select>` style using custom chevron-down icon.
Align the `dropdown-widget` and `<select>` UIs.
Removed default `<select>` tag styles with `appearance: none` css.
Added custom chevron-down icon with `background-image` attribute
to the `<select>` tag.

The svg icon is used in a CSS variable with a data URI.
The CSS variable is used to set different colors for dark and light
theme.

Tweaked by tabbott to scope selectors appropriately and also delete a
10px font-size in one settings dropdown widget.

Fixes #26859.
2023-11-07 16:55:34 -08:00
ecxtacy 0c1f340934 settings-ui: Replace chevron-down fa-icon with svg icon.
Fixes part of #26859.
2023-11-07 16:55:34 -08:00
ecxtacy 952c5e1865 icons: Add chevron-down svg icon for dropdowns. 2023-11-07 16:55:34 -08:00
Pratik 137505e2ad settings_notifications: Enable muted stream notification settings.
This commit allow the users to modify notification settings for muted
streams through the 'notification' section located in the personal
settings.

Fixes #27272.
2023-11-07 13:46:19 -08:00
Aman Agrawal ebd0dcd5d2 actions_popover: Fix copy link not working on `enter` keypress. 2023-11-07 13:31:53 -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
Joelute 76024e479d alerts: Fix improper copied tooltip location in About Zulip Modal.
Previously when a user tries to click on the clipboard to copy the merge
base version info, the copied tooltip would appear in the wrong location
where the Zulip version is instead. This is caused by both clipboard
icon using the same Clipboard instance where the success event would only
display the tooltip at the Zulip version. These changes fixes this and
allows the clipboards to be independent of each other.
2023-11-07 13:17:55 -08:00
David Rosa b5351285b6 help: Document "Jitsi server URL" setting.
- Updates "Start a call", documents the "Jitsi server URL" setting,
  and links to it in a (?) from the relevant admin UI.
- Fixes misplaced include block for opening the compose box.

Fixes #26907.
2023-11-07 13:09:52 -08:00
N-Shar-ma ff5e389e9b compose: Allow pasting plainly, when Shift is held down, for Firefox.
We introduce a state variable `shift_pressed` for the purpose of
detecting whether the Shift key is pressed when pasting content. Only if
it is not, do we proceed with the default formatted paste behavior.

In Chrome, plain paste works out of the box for `Ctrl+Shift+V`, but in
Firefox, we need to handle it ourselves.
2023-11-07 11:39:06 -08:00
N-Shar-ma dac56b4d08 compose: Paste content into the compose box without adding any space.
We replace the call to `insert_syntax_and_focus` with a direct call to
`insert_and_scroll_into_view` when pasting content into the compose box,
which fixes the bug where leading and trailing spaces were added to any
pasted content.
2023-11-07 11:39:06 -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
Aman Agrawal 25877114cf popover_menus: Move popoover to top if focused on text field.
Fixes #11448

Tested on Chrome, Firefox (iOS, Android) and Safari (iOS).
2023-11-07 11:31:10 -08:00
Aman Agrawal 75960bba16 emoji_picker: Don't autofocus search input on mobile.
Since focus on input elements on mobile opens keyboard which
changes window height, emoji popover can hide or scroll out of
view. To fix it, we don't focus on search input unless user
wants to when emoji popover is open.
2023-11-07 11:31:10 -08:00
Aman Agrawal 6e9da8ab2a popover_menus: Only take special care of references in message feed.
If the popover reference is in an overlay, the below check:
```js
elements_at_reference_position.some(
    (element) =>
        element.id === "navbar-fixed-container" ||
        element.id === "compose-content" ||
        element.classList.contains("sticky_header"),
)
```
would make the popover not appear if the reference was above them.

To make things simpler for us to check, we only handle popover
references inside message list which we know for sure will
always be below the elements checked above in stacking context.

Hiding popovers for other view is done good enough by
`data-reference-hidden` check that we don't need to manually
handle them.
2023-11-07 09:23:48 -08:00
Aman Agrawal a4b4b0ad38 popover_menus: Fix popovers not shown if reference is beside compose.
Since `#compose` occupies full width of the window, it is a
part of `elements_at_reference_position` if the reference is
under it.

Since `#compose-content` only occupies the part of window where
compose box is actually visible, we use it decide if the
popover should be hidden.
2023-11-07 09:23:48 -08:00
evykassirer 8cf436370c stream search: Always close search on Escape.
Fixes #27491.
2023-11-06 15:10:23 -08:00
evykassirer b51da3bb9a hotkey: Close text fields before closing sidebar.
Before this change, we'd try to close the sidebar before
closing text fields. This means if the user sidebar was
open with a text search in progress, pressing Escape
would close the full sidebar instead of closing search.

This change deprioritizes closing the sidebar, in favor
of closing input fields like search.

This also helps with #26717, because the sidebar seems to
be marked as open even when it's not an overlay, which
means pressing Escape will first "close" it (no visual
changes), before a second Escape would trigger closing
the search field. Ideally we differentiate between
situations where we are showing the sidebar as an
overlay and when we aren't, but that might be a more
involved change.
2023-11-06 15:10:23 -08:00
evykassirer ac0e03fe89 user search: Always close widget on escape instead of clearing first.
Fixes part of #27491
2023-11-06 15:10:23 -08:00
evykassirer a764a3e66f more topics: Escape clears input when input is focused.
Fixes part of #27491

We don't immediatley remove the input box, because there's
no existing UI for reopening the input box. (The input box
is always visible when the more topics view is visible.)

This commit makes the change of blurring and clearing the
input, instead of only blurring.
2023-11-06 15:10:23 -08:00
Aman Agrawal 1c03d5e5ce gear_menu: Don't show sponsorship link for orgs on paid plan. 2023-11-06 14:55:14 -08:00
Aman Agrawal 48c907e1a2 gear_menu: Show Zulip Cloud Plus for orgs on that plan.
Fixes #27525
2023-11-06 14:55:14 -08:00
Aman Agrawal e8c70a71d9 gear_menu: Show options based on sponsorship status.
Includes some additional tweaks for when to show various
billing related options.

Fixes #27524
2023-11-06 14:55:14 -08:00
Aman Agrawal 4fef63de52 sponsorship: Show error message for the field under the field. 2023-11-06 14:55:14 -08:00
Aman Agrawal b5fd5f2f5e sponsorship: Minor changes.
Wrap sponsored / sponsorship pending message in a white box.
Remove green heart.
2023-11-06 14:55:14 -08:00
Aman Agrawal ff5e1c3aee sponsorsihp: Make submitting the form work.
Includes various changes to make submitting the sponsorship form work.
2023-11-06 14:55:14 -08:00
Aman Agrawal 2466101fe1 sponsorship: Set width of elements like on support page. 2023-11-06 14:55:14 -08:00
Aman Agrawal 349f6f8ab8 sponsorship: Use new style for existing input fields. 2023-11-06 14:55:14 -08:00
Aman Agrawal 00df9c6c18 urls: Show sponsorship page on a new URL.
Fixes #27377

Replaced #sponsorship links with sponsorship/ links and in other
places liking gear menu.
2023-11-06 14:55:14 -08:00
Aman Agrawal 3ba0fe4349 sponsorship: Remove from billing and upgrade pages. 2023-11-06 14:55:14 -08:00
Aman Agrawal 48d0bedda9 left_sidebar_popovers: Show sidebar icon when visible.
Fixes #27508

Show sidebar icon when sidebar popover is visible so that
it tells users for which row popover is visible and also helps
tippy track when the reference of the popover so that it
can apply [data-reference-hidden] property appropriately.
2023-11-06 14:20:48 -08:00
Aman Agrawal 1a1c5863e4 ui_util: Import entire ui_util module. 2023-11-06 14:20:48 -08:00
Aman Agrawal 6dc17fab57 stream_popover: Extract functions to show sidebar menu icon. 2023-11-06 14:20:48 -08:00
Aman Agrawal eaf69dc9d5 left_sidebar: Employ existing left_sidebar_menu_icon_visible.
Seems like `left_sidebar_menu_icon_visible` had a regression where
its CSS was removed.

We use it show stream row icon when stream popover is visible.
2023-11-06 14:20:48 -08:00
Prakhar Pratyush 5697084832 css: Improve the css of popover used to change visibility policy.
This commit improves the CSS of popovers in the recipient bar,
recent conversations, and Inbox, which are used to change the
visibility policy.
2023-11-06 10:16:53 -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
roanster007 cf4b46d6f7 compose: Fix re-upload of files when upload fails.
Previously, when uploading of a file fails, the same file
couldn't be re-uploaded again without re opening the
compose box. This is because, the default behaviour of
uppy is that it won't allow re-upload of same files.

This could be fixed by removing the uploaded file when
the upload-error event is invoked for it.

Fixes #27495
2023-11-06 08:53:56 -08:00
Karl Stolley a2ae715226 left_sidebar: Align no-alpha variable for light mode unreads. 2023-11-04 12:50:46 -07:00
Aman Agrawal ac8ad111de recent_view: Handle topics_widget being undefined.
update_load_more_banner can still be called from message_fetch
before topics_widget is defined.
2023-11-04 12:23:48 -07:00
Aman Agrawal 8ea49aa5b5 recent_view: Remove unnecessary call to update_load_more_banner.
Since we are already updating load more banner after each
render in ListWidget, we don't need to call it separately.
2023-11-04 12:23:48 -07:00
N-Shar-ma 5c73744aca compose: Fix bug where pasted content would only go to the compose box.
This commits ensures that we pass in the correct context (compose box
or a message being edited) when pasting content.
2023-11-03 14:49:58 -07:00
Aman Agrawal 826f25744d scroll_bar: Hook to window resize event instead of ResizeObserver.
ResizeObserver isn't supported for Safari iOS versions we support.

We support iOS Safari ≥ 12.2 but ResizeObserver support requires
iOS Safari >=13.4. So if they're on iOS Safari >= 12.2 and < 13.4,
it crashes.
2023-11-03 10:24:36 -07:00
Karl Stolley 322b06b364 left_sidebar: Ensure mark as read vdots follows home view.
Regardless of which home view a user selects, it will have a
hoverable vdots menu and the option to mark all as read.
2023-11-03 10:08:37 -07:00
Karl Stolley 2e4bd4639f left_sidebar: Update order and unreads when switching home views. 2023-11-03 10:08:37 -07:00
Karl Stolley 9226e8bdca left_sidebar: Use grid or flexbox to order selected home view. 2023-11-03 10:08:37 -07: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
Karl Stolley 4759fc9f69 left_sidebar: Prepare home views with selection logic, unread counts. 2023-11-03 10:08:37 -07:00
Aman Agrawal 00d00036fe recent_view: Don't show load more banner until all rows are rendered.
Fixes #27365
2023-11-03 10:02:17 -07:00
Aman Agrawal 556b61d778 list_widget: Add method to check if all items are rendered. 2023-11-03 10:02:17 -07:00
Aman Agrawal 339f85c308 compose_tooltips: Don't show tooltip on focus.
Fixes #27383
2023-11-03 10:01:21 -07:00
Karl Stolley 14ef3a5464 left_sidebar: Display dark-mode condensed unreads without alpha. 2023-11-03 09:33:06 -07:00
Aman Agrawal 666ac2c445 user_card_popover: Fix reactivate user button not working.
Fixes #27459
2023-11-03 08:47:04 -07:00
Aman Agrawal c2d45e4cf7 emoji_picker: Stop propagating enter keypress to message.
Similar to emoji_picker.process_keypress, process_enter_while_filtering
should have a stopPropagation.
2023-11-03 08:46:15 -07:00
Aman Agrawal 8b5110d218 popover_menus: Hide popover for which the reference element is hidden. 2023-11-02 16:27:18 -07:00
Aman Agrawal c3eb17a411 popover_menus: Do early return if possible. 2023-11-02 16:27:18 -07:00
Aman Agrawal 434d156cbc personal_menu_popover: Don't make clear status tooltip interactive.
There is no need for that tooltip to be interactive.
2023-11-02 16:27:18 -07:00