Commit Graph

5728 Commits

Author SHA1 Message Date
Shubham Padia ddef232c42 user_card_popover: Remove redundant message_user_card.is_open() check.
Even without the check, mutliple message_user_cards will not be opened
by the app.
2024-08-15 16:23:26 -07:00
Aman Agrawal aac75f87f9 message_view: Update narrow title after change in narrow filter.
This needs to be done to update narrow title for different
`near` message targets or no `near` topic narrows.
2024-08-15 16:17:46 -07:00
Prakhar Pratyush 52a9846cdf user_profile: Remove 'tutorial_status' field.
The 'tutorial_status' field on 'UserProfile' model is
no longer used to show onboarding tutorial.

This commit removes the 'tutorial_status' field,
'POST users/me/tutorial_status' endpoint, and
'needs_tutorial' parameter in 'page_params'.

Fixes part of zulip#30043.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush ee806c49b9 ui_init: Use OnboardingStep for narrowing on first web app load.
We plan to remove the 'tutorial_status' field from UserProfile
table as it is no longer used to show tutorial.

The field is also used to narrow a new user in DM with
welcome bot on the first load.

This prep commit updates the logic to use a new OnboardingStep
for the narrowing behaviour on the first load. This will help
in removing the 'tutorial_status' field.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush 13c0571183 message_fetch: Use email as operand for 'dm' operator.
In our web client code we use email as the operand for
'dm' operator. Later user_ids_array is set as operand
in 'handle_operators_supporting_id_based_api' before
making the API call.

Earlier, using user_id as the operand was resulting in
the following error during user signup:
data=b'{"result":"error","msg":"Invalid narrow[0]: Value error,
operand is missing","code":"BAD_REQUEST"}

This commit replaces user_id with email as operand.
2024-08-15 13:31:40 -07:00
Vector73 80969a62e6 settings: Add `can_delete_any_message_group` setting.
Fixes #30717.
2024-08-15 12:03:49 -07:00
evykassirer dc938768ca message_edit: Avoid use of e.target.
This commit changes some event handlers to pass in relevant
JQuery objects instead of using `e.target`. This will be
necessary for converting message_edit to typescript.
2024-08-15 10:08:07 -07:00
evykassirer b0c90c0ba2 message_edit: Remove unused topic edit code.
`message_edit_topic_propagate` is only used in the template for
moving messages, separate from the message edit template, and
`message_edit_topic` doesn't show up anywhere anymore. Editing
the topic of a message used to be part of the message edit file,
and was removed in 0fc19732bc (diff-c68d68d71e21a4d22f39212a43e4f66ecc774bd17109963fe017d9878aace9bf)
2024-08-15 10:08:07 -07:00
evykassirer fc2ce3deb2 search: Fix bug preventing closing regular search pills.
In an earlier refactor, `removePill` was being called with the exit
button element instead of the pill. This change fixes that bug by
using similar code to what we previously did (and still do in
input_pill for cases without on_pill_exit).
2024-08-15 09:49:12 -07:00
roanster007 e104fed6ef echo: Extract the waiting for id and ack into separate module.
This commit extracts the "waiting_for_id" and "waiting_for_ack"
data structures of "echo.js" into a separate module in "echo_state".

This is a preparatory commit so as to be able to use them for
"stream_topic_history" module, without causing import cycles.
2024-08-14 18:24:56 -07:00
Tim Abbott e4567e05ac css: Explode dark theme disabled rule.
This replaces a :disabled selector with individual ones for each
element type; I verified in CSS selector profiling that this change
removes lines that were previously about 10% of profiled CSS selector
processing time for rendering the combined feed.

The reason being that the rendered elements have very few disable-able
elements, but the browser was spending a lot of time trying to match
**every** element for whether it might have been disabled, which was
slow.

This probably reflects a browser bug.
2024-08-14 13:42:59 -07:00
Prakhar Pratyush 39c5bb9fa5 user_topics_ui: Fix 'toggle_topic_visibility_policy' behavior.
This commit updates the stale logic in 'toggle_topic_visibility_policy'
function. It was not updated after the addition of 'follow' visibility
policy resulting in buggy behavior.
2024-08-14 13:20:58 -07:00
Prakhar Pratyush cbc3f84be4 hotkey: Fix 'Shift + M' to not work in unsubscribed channel.
Earlier, 'Shift + M' hotkey was working in unsubscribed channels.

This commit updates the logic to make it non-functional. This
helps to keep the UI consistent as we don't offer a way to
change visibility_policy in unsubscribed channels via
recipient_bar_controls or other UI elements.

Note: We don't implement this restriction in server because
we don't delete the user-topic states in db when a channel is
unsubscribed as it helps to retain those states when re-subscribed.
And implementing this restriction at server level can create
a confusion of why such states exists in db when API doesn't allow.
2024-08-14 13:20:58 -07:00
Aman Agrawal a7b86a7e66 filter: Cached computed values for faster comparison. 2024-08-13 23:28:21 -07:00
Aman Agrawal e956ec0483 filter: Make filter comparison more robust and faster.
Convert operand to lowercase for case-insensitive operators.
2024-08-13 23:28:21 -07:00
Aman Agrawal 1ce9fcdada left_sidebar: Fix user unable to type in DM search input.
This was due to non message list views didn't know that they
shouldn't try to process hotkey when DM search input is in focus.
2024-08-13 23:22:50 -07:00
Shubham Padia a746a7e784 css: Remove unnecessary rule for subscriptions_overlay.
Even though the border-color was set for `#subscriptions_overlay
.subsection-parent div`, since the border-style was not set. It did not
have any effect on the appearance of the children div of
.subsection-parent.
2024-08-13 22:36:35 -07:00
Shubham Padia 2081fb52a1 css: Use padding-top instead of putting margin-top on first div.
It has the same visual effect and we do not have to use a div selector.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-13 22:36:35 -07:00
Shubham Padia 0d95d79033 css: Use classname instead of div for .flex.overlay-content.
Each child div for .flex.overlay-content has the class
.overlay-container, so it is safe to replace the div with that
classname.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-13 22:36:35 -07:00
Shubham Padia 8b96aa277a css: Use classname instead of `div` selector for .blocks.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-13 22:36:35 -07:00
Shubham Padia e9d0e1d30d css: Use flexbox for .stream-row and .group-row.
Before this, we were having each direct child div for both the classes
as inline blocks. It is better to just have `display: flex` on the
parent element instead. There is a slight change in appearance which has
been confirmed in
https://chat.zulip.org/#narrow/stream/6-frontend/topic/Subscription.20list.20slight.20look.20change/near/1906254
2024-08-13 22:36:35 -07:00
Shubham Padia b619fbb7a7 css: Remove unused css for top-bar & bottom-bar for subscriptions.css.
These were added in ae7fe85ec5, and
should have been deleted in 333b8b095c.

Having those rules did not make any difference to the subscription and
user group list items.
2024-08-13 22:36:35 -07:00
Shubham Padia 52240e09ff css: Use classname for .thanks-page instead of div.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
2024-08-13 22:36:35 -07:00
Shubham Padia a48ce954aa rendered_markdown: Remove unused .data-container div css.
Having that css there or not did not make any visual difference.
2024-08-13 22:36:35 -07:00
Shubham Padia 996a091bd9 css: Use class_name for .client-logos div.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
We've introduced a new class called `.client-logos-div`.
In `hello.ts` we just manually append the name of this new class for the
logo changing logic since that felt more readable than adding the class
programmatically.
2024-08-13 22:36:35 -07:00
Shubham Padia f0e484ea07 app_components: Remove unused div selector css.
Having the styling there or not did not make any difference visually to
either of the drafts, scheduled messages or edit history overlays.
2024-08-13 22:36:35 -07:00
evykassirer 1806c390c1 search: Navigate results with up/down when input is focused.
What was happening:

* Focus being in the search input text box made Up/Down be handled
  by the browser and move the cursor. This is default browser behavior,
  and not useful to us (you can use home/end for the same goal, but
  also one just doesn't put much text in that input given the pills
  system).
* We probably don't want to push keyboard focus out of the search box
  after completing a search, since that would make it annoying to type
  a new search term or whatnot.

The fix is to just make the existing Up/Down keyboard handler apply
even if the search input is focused.

More context here:

https://chat.zulip.org/#narrow/stream/9-issues/topic/Can't.20navigate.20search.20results.20using.20the.20keyboard.20.2331291/near/1913535
2024-08-13 19:09:20 -07:00
Shubham Padia 5ffb75387a typeahead: Change color for the right hand side option label.
Fixes
https://chat.zulip.org/#narrow/stream/101-design/topic/UI.20redesign.3A.20new.20topic.20indicator.20in.20typeaheads/near/1908770.
We could have made this change specific to the option label for
composebox typeahead only, but I don't see a scenario where all the
other colors are the same for another typeahead but the right option
label color is different. Currently, the option_label is only used in
composebox typeahead, so visually this commit will only affect that
typeahead.
2024-08-13 18:28:32 -07:00
Shubham Padia 10da3e3626 typeahead: Give appropirate name to option label container.
The class was named `typeahead-option-label` for the element containing
the actual option label. We renamed it to
`typeahead-option-label-container` to give it a more appropriate name.
2024-08-13 18:28:32 -07:00
Varun Singh d8dd682944 echo: Convert module to TypeScript. 2024-08-13 09:37:35 -07:00
Varun Singh 3dd8a4c6d5 echo: Fix incorrect check for message `topic`.
The actual check should be for `falsy` (to handle empty string)
and not undefined, since topic is an empty string for
private messages.
2024-08-13 09:37:35 -07:00
Varun Singh 2e12d3cd25 user: Drop `is_mirror_dummy` field from 'user' object. 2024-08-13 09:37:35 -07:00
Varun Singh 126d4fb137 echo: Remove support for zephyr mirroring. 2024-08-13 09:37:35 -07:00
Varun Singh 3d01ccbbd5 server_events: Parse `message` recieved from server. 2024-08-13 09:37:35 -07:00
Varun Singh 7d0ea7e1e3 server_message: Stop reading `user` field in `reaction` object.
This is now deprecated. We rely on `user_id` post Zulip 3.0
2024-08-13 09:37:35 -07:00
evykassirer 8b19726b82 stream_pill: Use stream id instead of stream name. 2024-08-13 09:04:59 -07:00
Alex Vandiver 6ff2246daa static: Only run CompressionPlugin in production. 2024-08-13 09:01:06 -07:00
Alex Vandiver 2840e68548 static: Pre-compress with zopfli, for better compression.
Zopfli[^1] performs very good, but time-intensive, zlib compression.
It is hence only suitable for pre-compressing objects, not on-the-fly
compression.

Use a webpack plugin to write pre-compressed versions of JS and CSS
assets using Zopfli, and configure nginx to serve those assets when
`Accept-Encoding: gzip` is provided.

This reduces the size of the JS and CSS assets on initial pageload
from 1422872 bytes to 1108267 bytes, or about a 22% savings.

[^1]: https://github.com/google/zopfli
2024-08-13 09:01:06 -07:00
Alex Vandiver b89d47a147 avatar: Stop adding &s=50 to Gravatar and Zulip avatar requests.
This parameter is unused for Zulip avatars, and results in a smaller
(pixel-wise) Gravatar than we use for Zulip "small" avatars.  Omitting
the `s=50` parameter results in a 80x80 image, which is closer to the
100x100 image that Zulip thumbnails avatars to.  Ironically, using the
default (larger) Gravatar dimensions also results in _smaller_
responses (in bytes) from Gravatar.
2024-08-13 08:57:08 -07:00
Karl Stolley 87a0fa0c8c right_sidebar: Avoid vdots appearing beneath Simplebar scroll. 2024-08-13 08:55:31 -07:00
Karl Stolley 480d68143e right_sidebar: Left-align subheads with headings, user row highlights. 2024-08-13 08:55:31 -07:00
Karl Stolley 710abd1cf5 right_sidebar: Allow user rows to use fuller width of right sidebar.
This change is in line with @terpimost's redesign.
2024-08-13 08:55:31 -07:00
Karl Stolley 70fd334b2f right_sidebar: Refactor user search to match left sidebar approach. 2024-08-13 08:55:31 -07:00
Karl Stolley c4dfa7890e right_sidebar: Add minor lefthand padding called for by Vlad's design. 2024-08-13 08:55:31 -07:00
Karl Stolley 557038416c right_sidebar: Rework righthand gutter, header to match Vlad's design.
Fixes #27574.
2024-08-13 08:55:31 -07:00
Aman Agrawal 970dd30f96 compose: Fix restoring big drafts freezes the app.
We are using `.val` to set compose box content which is very fast vs
`setFieldText` which is very slow due to it doing a lot of
forced repaints. The major downside of using `val` here is that
user will not able to perform `undo` operation on this which doesn't
seem something user would want to do here.

Note that this effects compose content restored from drafts,
scheduled messages and on reload.
2024-08-13 07:53:30 -07:00
codewithnick 8786d96fe9 user_group_popovers: Add display message when group is empty.
Previously no message was being shown in the group popover,
when group had no members, this commit intends to fix this
by displaying an approriate message when group is empty.
Fixes #30830.
2024-08-12 11:54:33 -07:00
evykassirer 00e74d0de2 search: Move group user remove logic out of input_pill. 2024-08-12 11:37:31 -07:00
Lauryn Menard 481fb8e518 help: Rename and redirect allow-image-link-previews article.
Note that the link in zulip_update_announcements.py is not updated
so that the content in the source code reflects what users actually
received in the update announcement message.
2024-08-12 11:22:37 -07:00
Shubham Padia 240e2c87a7 typeahead: typeahead-strong-section should have a font weight of 500.
Fixes https://chat.zulip.org/#narrow/stream/101-design/topic/font.20weight.20in.20typeaheads/near/1911442.
2024-08-12 10:13:15 -07:00
afeefuddin 19b85eb600 user_profile: Convert module to TypeScript. 2024-08-12 09:40:33 -07:00
afeefuddin 243cd7e5fb people: Merge type CrossRealmBot into type User. 2024-08-12 09:40:33 -07:00
afeefuddin fd72b4451a user_profile: Pass undefined instead of an empty object. 2024-08-12 09:40:33 -07:00
afeefuddin 14dbe788ec state_data: Extract custom_profile_field_types_schema from realm_schema. 2024-08-12 09:40:33 -07:00
afeefuddin 706c924e7b user_profile: Pass required parameters in group_edit_url. 2024-08-12 09:40:33 -07:00
afeefuddin 943d70936f settings_profile_fields: Improve parameters of get_external_account_link.
To enhance the readability and operand handling of the
get_custom_profile_field_data function in user_profile, avoid the
unnecessary passing of objects inget_external_account_link.

Instead, pass only the required field_data and value.

Also remove the unnecessary field_type key stored in profile_field in
get_custom_profile_field_data data function.
2024-08-12 09:40:33 -07:00
Aman Agrawal 2716b7f2c6 lightbox: Remove unnecessary `open_image` call.
When reset zoom is clicked, image is already visible so there is
no need to open it again.
2024-08-12 08:44:57 -07:00
Shubham Padia 4465997a92 user_card_popover: Show `Manage the user` row for deactivated users.
Fixes https://chat.zulip.org/#narrow/stream/101-design/topic/user.20card.20for.20deactivated.20users/near/1913800
2024-08-12 08:30:42 -07:00
Karl Stolley d445137d36 lightbox: Correct media types to include HTMLImageElement. 2024-08-06 20:50:38 -07:00
Sahil Batra 30e20734d3 popover: Open profile section directly in narrow screens.
On clicking the "Edit your profile" option in the user popover,
profile section is opened directly for narrow screens as well
instead of just showing the left panel list of sections.
2024-08-02 21:45:08 -07:00
Sahil Batra 7b244fcbe8 settings: Show only left side panel list on opening overlay.
For narrow screens, we only show left side panel list on
opening the overlay. Previously, we showed the right section
if the overlay was closed with a right-side section opened.
2024-08-02 21:45:08 -07:00
Sahil Batra 8fd5c02916 settings: Show correct section when increasing screen width.
Currently if the settings overlay is opened on narrow screen,
where only left side panels are shown, and then the screen
width is increased, the right side shows "Profile" and
"Account and privacy" sections of personal settings together
everytime.

This fixes it to show the last opened section or the first
section or the section used in url.
2024-08-02 21:45:08 -07:00
Aman Agrawal 2011e0df76 inbox_ui: Fix row_focus not synced with inbox rows.
Have one inbox row and focus on it. Mark the message as read in
another tab. Press `r` in the first tab will return an error as
the row_focus didn't change but there is no present. So, we
fix it by updating the row_focus if it can get out of bounds
when updating inbox view.
2024-08-02 09:36:37 -07:00
Sahil Batra 506ead4468 settings: Use new group setting to check web-public stream creation.
This commit updates code in webapp to use new group-based setting
for checking web-public stream creation permission.
2024-08-01 22:49:33 -07:00
Sahil Batra e71c3007f6 tests: Refactor group settings test in settings_data.test.ts.
This commit refactors the common function used for test in
such a way that we can test more cases for a group setting
along with the ones tested by the common function.
2024-08-01 22:49:33 -07:00
evykassirer 09f4f787b8 search_pill: Replace user display_value with full_name. 2024-08-01 17:31:59 -07:00
evykassirer 271efb70fa input_pill: Remove InputPillItem now that details are handled elsewhere. 2024-08-01 17:31:59 -07:00
evykassirer 6e47d851ec input_pill: Remove display_value in favor of module-specific values.
This commit is part of a bigger project to remove custom logic in
the input_pill module. This commit move us away from a world where
we have a `display_value` that's used as identifying information
for a pill as well as for what we display to the user. Now individual
widgets can configure how they come up with a display value based
on the data of that type of pill.

Note: The change in the stream pill test for setting subscribers
for denmark is fixing an issue that wasn't discoverable before.
There always should have been three subscribers.
2024-08-01 17:31:59 -07:00
evykassirer 7dfb928277 search: Calculate display_value from SearchPill item.
We no longer need to do `robust_url_decode` because we're
creating the display value ourselves, whereas previously
we were using `Filter.unparse` which does encoding.
2024-08-01 17:31:59 -07:00
evykassirer c19ecf7c07 input_pill: Remove (now) unused custom stream logic. 2024-08-01 17:31:59 -07:00
evykassirer ccbc569bab invite_stream_picker: Don't rely on custom code in input_pill.
By using a custom `generate_pill_html`, we can remove the
`has_stream` logic in `input_pill`, as part of a wider effort
to remove custom pill logic in `input_pill`.
2024-08-01 17:31:59 -07:00
evykassirer 0d52ced27a input_pill: Move group and stream logic to add_subscribers module.
This is part of a larger effort to refactor input_pill to
remove custom logic and move it into relevant modules.

This commit completely removes group_id from all modules, but
there's another module that uses stream that must be refactored
before that can be removed from input_pill.
2024-08-01 17:31:59 -07:00
evykassirer 443e24390b input_pill: Move user fields off of InputPillItem to UserPill.
This is part of a larger effort to move custom code out of
the input_pill module, and this commit is made possible by
earlier commits.
2024-08-01 17:31:59 -07:00
evykassirer 2b7d14084b input pill: Move user pill rendering code to user_pill.
This is part of a larger effort to refactor input_pill to
remove custom logic and move it into relevant modules.
2024-08-01 17:31:59 -07:00
evykassirer aa0b150265 input pill: Move search html logic to search_pill.
This is part of a larger project to move custom
logic out of input_pill. The `generate_pill_html`
function will be used for other modules in upcoming
commits.
2024-08-01 17:31:59 -07:00
evykassirer 92d67fb00c input_pill: Rename <T> to <ItemType>. 2024-08-01 17:31:59 -07:00
evykassirer 78c9adb33c search: Remove unused description_html. 2024-08-01 17:31:59 -07:00
evykassirer c09dbcc781 search: Use search terms instead of query text for some helper code.
NarrowTerm can hold more information than a string, and is more
robust.
2024-08-01 17:31:59 -07:00
Karl Stolley 2f726b20ed compose: Specify non-alpha message-area colors.
This keeps colors uniform between edit and preview modes, and also
ensures no bleedthrough of the editor when in preview mode.

ID selectors have been used for those colors to both keep the text
color declaration in the same place, and to avoid a dark-theme
specificity problem where the generic textarea took precedence over
the colors specified on the compose box's own textarea.
2024-08-01 16:30:56 -07:00
Karl Stolley bee5cd4e04 rendered_markdown: Update markdown timestamps to use Zulip icon.
Fixes: #28830
2024-08-01 16:28:30 -07:00
Alex Vandiver 2d0468bde5 lightbox: Disable controls on video previews in lightbox.
Setting any value for a boolean attribute (like "controls") enables
it.
2024-08-01 09:23:45 -07:00
Kenneth Rodrigues 4b04e2c09c ListWidget: Fix sliding of actions column in tables.
Added right padding to the actions heading in the table.

Fixes #29633.
2024-07-31 22:38:42 -07:00
afeefuddin eab78d996d node tests: Add make_stream helper to create streams in node tests.
With a bunch of comments by tabbott on some details to pay attention
to.
2024-07-31 22:26:55 -07:00
Varun Singh 8570cd81b1 message_events_util: Convert module to TypeScript. 2024-07-31 14:33:11 -07:00
Varun Singh 95a20e29b6 message_events_util: Avoid calling 'process_new_message'for type sanity.
Function `message_helper.process_new_message` takes a
`RawMessage` and throws out `Message`. But here we are
passing it an already processed msg of type `Message`.
This is completely type unsafe. Since our purpose here is to
replace our old message object with a latest copy from
`message_store`.
We can do this directly without calling `process_new_message`.
2024-07-31 14:33:11 -07:00
Anders Kaseorg d074848673 web: Condense unnecessarily verbose function signatures.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-31 13:18:35 -07:00
Karl Stolley 6b8fc6de36 rendered_markdown: Lay out time spans with inline-flex. 2024-07-31 13:14:35 -07:00
Karl Stolley 887e7e1e13 rendered_markdown: Remove expensive :first-child and :last-child selectors.
With the refactoring of the rendered-Markdown area to use only
margin bottom, including in message-edit previewsk, these expensive,
general selectors are unnecessary.

Headings and horizontal rules, which do have margin-top, are zeroed
out elsewhere in the rendered-markdown file.
2024-07-31 12:37:19 -07:00
Karl Stolley cc1cfa9336 message_preview: Set preview height based on edit area.
This ensures that neither the compose box nor the edit-message area
shifts when toggling back and forth between edit and preview modes.
2024-07-31 12:37:19 -07:00
Karl Stolley df04c4c1f9 message_preview: Don't needlessly show/hide compose textarea.
Because the compose-box resize logic is tied to the size of the
textarea, it's possible when resizing in preview mode that the
state of the compose box is not properly tracked. That's because
the height logic in `autosize_message_content` assumes a visible
textarea.

However, because both the textarea and the message preview area
occupy the same named grid area (`message-content`), and because
the preview area comes after the textarea in the DOM, when visible,
the preview area will automatically cover (and be sized to) the
textarea. And because the textarea remains observable in the DOM,
the compose box will obey the same expansion logic in preview mode
as it does in edit mode.
2024-07-31 12:37:19 -07:00
afeefuddin e35fb72a97 landing-page: Convert module to TypeScript. 2024-07-31 10:11:43 -07:00
afeefuddin ab9b748ee3 base_page_params: Update contributors schema in team_params_schema. 2024-07-31 10:11:43 -07:00
Karl Stolley 82b0732b11 message_controls: Add missing class to edit buttons. 2024-07-31 09:15:41 -07:00
Karl Stolley 0831636050 user_profile: Properly center icon for copying URLs. 2024-07-30 16:29:09 -07:00
Tim Abbott 4ae16b7568 stream_list: Fix handling of unsubscribing from last channel.
This check been present since
466beef6fe, but it seems unnecessary in
that the main logic handles there being 0 channels just fine, that's a
rare case (so not a useful optimization), and importantly, not calling
stream_list_sort.sort_groups for that transition resulted in
`stream_list_sort` having stale data structures, resulting in
exceptions if one tried to open the CHANNELS filter widget in the
newly-no-channels state.
2024-07-30 13:53:38 -07:00
Karl Stolley e11cfd7ba8 modal_button: Use negative outline-offset to compensate for scaling. 2024-07-30 11:27:19 -07:00
Aman Agrawal 6c500e9a6e typeahead: Fix typeahead overflowing out of window.
When the caret in textarea is around the right end of the screen,
typeahead can overflow the window. To fix it, we use tippy's
mechanism to keep the tooltip inside the visible boundary.
2024-07-30 11:25:49 -07:00
afeefuddin a88445a6d2 integrations_dev_panel: Convert module to TypeScript. 2024-07-29 15:19:43 -07:00
afeefuddin 6019d8ae17 integrations_dev_panel: Use status key to get the status code. 2024-07-29 15:19:43 -07:00
afeefuddin d3217206ed integrations_dev_panel: Pass correct value to set_message. 2024-07-29 15:19:43 -07:00
Sayam Samal 5549e807eb rendered_markdown: Remove universal selector for embedded content.
This removes the `.message_embed > *` selector which was expensive, and
instead moves the styles to the specific elements that need them.
2024-07-29 15:08:54 -07:00
Karl Stolley 75a20f98d0 message_controls: Explicitly select .message_control_button. 2024-07-29 14:13:31 -07:00
Karl Stolley 6bc7b617d8 message_controls: Add explicit message-controls-icon class. 2024-07-29 14:13:31 -07:00
Karl Stolley aa83b1b5cd message_row: Move message_controls into proper place in row file. 2024-07-29 14:13:31 -07:00
Karl Stolley da7114918f streams_settings: Removed unused FontAwesome references. 2024-07-29 13:19:35 -07:00
Karl Stolley c8ba0f7abf rendered_markdown: Remove incorrect selector with unused color. 2024-07-29 13:18:26 -07:00
Aman Agrawal a43c0693b7 scroll-to-bottom: Fix misclicks to scroll to bottom button.
Scroll to bottom button is visible for a few ms when switching
narrow to Inbox / Recent view while scrolling in message feed.
While we can end the transition faster to completely avoid the issue
for now but this seems like a more permanent and simpler fix
than to fiddle with CSS.
2024-07-27 09:35:12 -07:00
Tim Abbott 68c4d145b0 message_reactions: Use the reactions tooltip template.
Using the existing tooltip template for the other "add emoji reaction"
element in message_controls results in the keyboard shortcut being
shown and avoids doing work to translate the string for every single
message containing emoji reactions.
2024-07-27 09:25:51 -07:00
evykassirer 12207407c9 css: Use classname for topic visibility tooltip instead of span. 2024-07-26 14:42:25 -07:00
evykassirer a243191539 settings css: Use selector for empty option text instead of span. 2024-07-26 14:42:24 -07:00
evykassirer e0b0a3638e portico css: Use classname for header text instead of span. 2024-07-26 14:41:08 -07:00
evykassirer cc6118efae integrations css: Use classname for back to list link instead of span. 2024-07-26 14:41:08 -07:00
evykassirer f7a27be0a8 settings css: Use classname for checkbox label instead of span. 2024-07-26 14:41:08 -07:00
evykassirer 5ed19d1971 landing_nav css: Use classname instead of span for realm name. 2024-07-26 14:41:08 -07:00
evykassirer 9824f76e7d css: Use a classname instead of span for overlay plus button. 2024-07-26 14:41:08 -07:00
evykassirer 952ca6ae3c css: Use color-animated-button-text instead of span selector. 2024-07-26 14:41:08 -07:00
evykassirer 1b8658670c css: Use classname for stream subheader name. 2024-07-26 14:41:08 -07:00
evykassirer 8427b6f744 css: Use classname instead of span selector for todo checkboxes. 2024-07-26 14:41:08 -07:00
evykassirer 90ab7f6287 css: Remove unused span selector in scroll to bottom container.
This rule was originally introduced with a span element in
0eafa6039b but the span has been
since removed.
2024-07-26 14:41:07 -07:00
Tim Abbott 3ffc5c339f portico: Remove unused faqs CSS.
These were styles for a component removed in
f244336271.
2024-07-25 17:31:12 -07:00
Aman Agrawal 88b54526ba message_view: Fix current narrow doesn't rerender when asked to.
Here we want to rerender the current narrow after receiving an
event which moves messages. We have mechanisms to keep using
the cached list if we are narrowing to the same narrow which
we want to avoid in this case.
2024-07-25 12:02:57 -07:00
Shubham Padia bbd9b91238 hotkey: Put focus back into edit text area after Alt + P.
Fixes
https://chat.zulip.org/#narrow/stream/101-design/topic/key.20combination.20for.20hotkey.20to.20toggle.20compose.20preview/near/1902135.
The logic to put focus back to textarea is not part of the
`clear_preview_area` function because you wouldn't expect a function
clearing the preview area to somehow put focus into the edit area.
2024-07-25 11:33:53 -07:00
roanster007 7f1396de32 lightbox: Update `canonical_url_of_media` to use URL pathname.
This reworks canonical_url_of_media to work with HTMLMediaElement,
making it possible to do cross-browser inspection of media sources.
(Firefox and Chrome disagree on whether to return the "href"
attribute as the path in the source, or a full URL).

Additionally, we ensure non-empty cache keys on media so
unexpected results from the DOM do not get cached.

Co-Authored-By: Alex Vandiver <alexmv@zulip.com>
Co-Authored-By: roanster007 <rohan.gudimetla07@gmail.com>
2024-07-25 11:21:02 -07:00
Tim Abbott f61f138b75 tooltips: Clean up aria-label for visiblity tooltips.
Using different punctuation for the aria-label from the tooltip is
silly. Additionally, we don't need to repeat the channel name in
aria-label; it essentially will never be seen and the message list
copy of getting the channel name was buggy.
2024-07-25 08:24:14 -07:00
Tim Abbott a1c8e3549a message_list_view: Don't assume stream_id is defined. 2024-07-25 08:24:14 -07:00
Tim Abbott cbca3a8080 lightbox: Don't try to use unavailable width.
We don't have a width for images without dimensions attributes, and
all such images will have used the other code path.
2024-07-24 17:44:36 -07:00
Aman Agrawal dd7a5ac4c5 recent_view_ui: Fix dm rows not updated for deleted messages.
Tested by deleting a DM and navigating to recent view. No error
is thrown and dm row is correctly placed.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-07-24 13:51:56 -07:00
Pratik Chanda 1ccf5e3ac3 tooltip: Change tooltip info for default topic menu option.
Earlier tooltip info for the default topic menu notification option
had static string to display.

This commit changes the string info and includes channel name and its
corresponding privacy icon to display in the tooltip.
2024-07-24 13:34:52 -07:00
Pratik Chanda 4ef7394df4 tooltip: Change tooltip for topic menu option.
Earlier tooltips for topic menu button had inconsistent context with
that of other tooltips. In topic menu tooltip, action was described in
first line which different from that of other tooltips.

This commit changes the tooltip context and rearranges them to match
the format of action on first line and more context on second line.
2024-07-24 13:31:24 -07:00
Sahil Batra 9aa4ce28ce css: Improve selectors used for recent topics table.
Using "*" selector is inefficient as they require checking every
element because of the browser's bottom-up matching process.
This commit instead updates the selector to use individual
classes for elements to apply the CSS rules keeping in mind
to use unique class names instead of general class names.
2024-07-24 12:31:20 -07:00
Sahil Batra b0e8096579 css: Do not use "*" selector for color_animated_button styles.
Using "*" selector is inefficient as they require checking every
element because of the browser's bottom-up matching process.
2024-07-24 12:31:20 -07:00
Kenneth Rodrigues c4c9c59a41 default_channel: Fix multiple modals opening.
Earlier, the `Add Channel` button was being focused even after the
modal was open, causing multiple modals to open on pressing enter
repeatedly.
This commit fixes the issue by removing the focus from the `Add
Channel` button after the modal is open by focusing the dropdown on the
modal.
2024-07-24 12:26:31 -07:00
Kenneth Rodrigues fe557bde77 custom_profile_fields: Fix multiple modals opening.
Earlier the focus remained on the button to open the modal,
causing multiple modals to open on pressing enter repeatedly.
This commit fixes the issue by removing the focus from the button
by focusing on the first input field of the modal.
2024-07-24 12:26:31 -07:00
Tim Abbott 55884b1338 paste_handler: Skip undo dance if formatting was a noop.
The intent had been only to do the fancy undo thing when no formatting
is present.
2024-07-24 11:11:29 -07:00
Aman Agrawal 8a82639762 message_events: Fix compose stream not updated when moving messages.
When moving message while compose box has content, stream was not
updated to the new stream if it was changed.

Tested by moving message with stream changed and with / without topic
changed.
2024-07-24 10:46:01 -07:00
Kislay Verma 3620139700 copy_and_paste: Paste text first unformatted and then formatted.
This commit makes pasting formatted text a two-step process:

- Insert unformatted text
- Insert formatting

This way, undo (Ctrl+Z) will restore the original pre-formatting
syntax.

This is the same as the approach taken with
auto-formatting in #29302.

Fixes #31061
2024-07-24 10:36:06 -07:00
Sayam Samal e6c0e096f9 user_card_popover: Remove presence circle indicator for bot users. 2024-07-24 10:27:27 -07:00
Sayam Samal eed3890be6 user_card_popover: Add bot specific terminology for mute/unmute option. 2024-07-24 10:27:27 -07:00
Sayam Samal fd638664b5 user_card_popover: Rename "Bot owner" to just "Owner". 2024-07-24 10:27:27 -07:00
Sayam Samal 9c2b60a304 user_card_popover: Fix bot owner field overflowing for long names.
This commit fixes the overflowing issue for long bot owner names in the
user card popover, and also repositions the bot owner user card popover
to align with the bot owner name on the bot user card popover.
2024-07-24 10:27:27 -07:00
Sayam Samal 9b314da0ea user_card_popover: Fix bug where owner's avatar replaces bot's avatar.
The `.popover-menu-user-avatar` selector being used to replace the small
avatar with the medium avatar was a broad selector, which also targeted
the bot's avatar when the bot owner's user card was opened. This commit
fixes this bug by scoping the selector to the current popover instance.
2024-07-24 10:27:27 -07:00
Sahil Batra 8734d34cb7 stats: Remove unnecessary CSS.
This CSS was needed when there was label along with the buttons
on the same line when this was originally added in 626c5ef55e.

But there is no label with the buttons now, so this CSS is not
needed.
2024-07-24 10:12:42 -07:00
Sahil Batra b2ca752f75 css: Remove unused css for scheduled-messages-loading class.
This class was removed in 043d54d170.
2024-07-24 10:12:42 -07:00
Tim Abbott 7c792b1f7a upload: Stop importing unused Uppy styles.
I'm not aware of us using any of these; we don't generate the class
names involved, and we're not using `uppy.use` on any of their UI
components.

I confirmed that the only use of an Uppy UI component was the progress
bar, which was stopped using in
b01ac3623f.
2024-07-24 10:12:17 -07:00
Sahil Batra 5b98bc4848 settings: Allow admins/owners to deactivate themselves from users list.
We previously did not allow users to deactivate themselves from users
list to avoid users deactivating themselves accidentally. But we now
show a confirmation modal before deactivating, so it is fine to allow
it.
2024-07-24 10:05:03 -07:00
Alex Vandiver fccddf9f0d thumbnail: Fix comment. 2024-07-24 09:57:20 -07:00
Tim Abbott 47683144ff thumbnail: Prefer 840x560 thumbnails for web app.
While this has no real effect in the message feed itself, it makes the
transition in the lightbox a lot nicer.
2024-07-24 09:21:50 -07:00
Aman Agrawal 66da0a0945 popover_menus: Fix user card moves to top left of screen.
When the user card is displayed via right sidebar, the reference
can be lost due to it being updated or hidden on window resize.

To fix it, we show user card as an overlay when we cannot find
the reference.

Another solution would have been to relocate the reference and
update it for the popover but that is not naturally supported by
tippy once the popover has been displayed.
2024-07-24 09:19:39 -07:00
Karl Stolley 829212a76a lightbox: Set payload.source on srcset.
This eliminates a flash of the smaller/blurrier preview image when
navigating to images that have already been loaded in full.
2024-07-24 09:14:36 -07:00
Alex Vandiver d448a0b271 thumbnail: Use the pre-fetched thumbnail as a temporary stand-in.
This improves the user experience by showing *something* as we fetch
the full-resolution image in the background.
2024-07-23 16:41:09 -07:00