Commit Graph

2682 Commits

Author SHA1 Message Date
Sahil Batra 432001656e streams: Remove "email_address" field from Subscription objects.
This commit removes "email_address" field from Subscription objects
and we would instead a new endpoint in next commit to get email
address for stream with proper access check.

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

Note that the unsubscribed user can still send message to the stream
if the user had noted down the email before being unsubscribed
and the stream token is not changed after unsubscribing the user.
2023-11-16 13:25:33 -05:00
Tim Abbott e6102af351 Revert "lightbox_view: Fix media title update on change in title."
This reverts commit 273081d0a6.

This change broken the arrow key navigation in the lightbox.
2023-11-16 10:19:05 -08:00
Karl Stolley b04dd62f8a left_sidebar: Preserve DM layout when zoomed into more conversations. 2023-11-16 09:21:48 -08:00
Tim Abbott 7a6f288fab narrow: Move maybe_scroll_to_selected call.
This should now happen at the same time it did prior to this change,
without requiring the show_all_message_view wrapper to have any
business logic.

This fixes a potential scroll position bug in the event that
narrow.deactivate in fact calls itself recursively after a timeout.
2023-11-15 17:33:21 -08:00
Tim Abbott eabab840e9 narrow: Hide inbox/recent views inside deactivate.
We already do a very parallel construction in narrow.activate, so this
moves us towards being able to unify those code paths, while also just
being more readable by avoiding a small-but-important wrapper function
in hashchange.js.

I believe this fixes a bug where we were not saving scroll position in
browser history when navigating to "All messages" from another view.
2023-11-15 17:33:21 -08:00
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