Commit Graph

1070 Commits

Author SHA1 Message Date
Lauryn Menard 73e5812831 node-tests: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/tests`
directory to instead use "direct messages".
2023-06-26 11:07:28 -07:00
Lauryn Menard 7c47616ffa web-e2e-tests: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/e2e-tests`
directory to instead use "direct messages" or "DM".
2023-06-26 11:07:28 -07:00
Lauryn Menard 4d3d9bcefa web-src: Update comments with "private message" or "PM".
Updates comments in files the `web/src` directory to use "direct
message" instead of "private message" or "PM".
2023-06-26 11:07:28 -07:00
Lauryn Menard 5be0f80135 recent-topics-ui: Rename constant for direct message columns.
Renames constant for the number of direct message columms from
`MAX_SELECTABLE_PM_COLS` to `MAX_SELECTABLE_DIRECT_MESSAGE_COLS`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 842623c294 unread: Update class name for unread direct message counter.
Renames the class name in `web/src/unread.js` from `UnreadPMCounter`
to `UnreadDirectMessageCounter` and renames the associated instance
of `unread_pm_counter` to `unread_direct_message_counter`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 4b2b278a53 dm-conversations: Update direct message data structure name.
Updates data structure class name in `web/src/pm_conversations.js`
from `RecentPrivateMessages` to `RecentDirectMessages`.
2023-06-26 11:07:28 -07:00
Lauryn Menard 3c6d283aa9 compose-actions: Update trigger for composing a new direct message.
Updates the trigger in the compose box from "new private message"
to "new direct message".
2023-06-26 11:07:28 -07:00
Zixuan James Li dd3fad4b30 mute users: Remove leftover check for muting bot users.
This was missed in #26005. The user popover button does not appear
for bot users. We complete the TODO here and simplify the
calculation for show_manage_menu so that we always show it if not in
spectator view and not showing the popover for self.
2023-06-26 11:01:40 -07:00
evykassirer 87649ddbab condense: Replace $.fn.height with using the DOM API.
This increases performance by at least 10x. See discussion
on CZO for more details:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/resize.20undo.20redo.20condense/near/1581598
2023-06-26 10:59:53 -07:00
evykassirer ca6e93ac7d condense: Remove _message_content_height_cache.
Since `scrollHeight` is very quick, we don't need
the cache anymore, and the code is easier to reason
about without it.

Profiling checks described on CZO here:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/resize.20undo.20redo.20condense/near/1581520
2023-06-26 10:59:53 -07:00
evykassirer 43b18eabf1 condense: Avoid layout thrashing.
More information on layout thrashing
[here](https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/#avoid-layout-thrashing).
2023-06-26 10:59:53 -07:00
evykassirer 8d0fa236c8 more/less: Fix bug where messages rapidly condense and uncondense.
This commit changes a few things:

* Using `scrollHeight` instead of `offsetHeight`, which explicitly
  also measures content not visible on the screen due to overflow.
* Measures the height of `.message_content` which is the div with
  the full message height.
* Only resizes messages that are visible on the screen, i.e. only
  those in `message_lists.current`.
2023-06-26 10:59:53 -07:00
Karl Stolley d6c21c2237 docs: Correct scope of copied material from copy button.
This traverses the DOM to the <pre> element containing the
copyable material of interest.

The button is attached to the .codehilite element to ensure
that the button does not move with horizontally-scrolling
code content that exceeds the width of the content column,
as happens frequently at mobile scales or for very long
lines of content.

Fixes #26093.
2023-06-24 07:51:54 -07:00
David Rosa 0e0512df92 widgets: Rename confusing variable name in `tabbed_instructions.ts`.
The `tabbed_instructions` widget used for both language toggles in our
API documentation and app toggles in our Help Center documentation
misleadingly calls the identifier for the tab `language` in local
variables and its interface.

- Renames local variables `language` -> `tab_key`.
- Renames HTML data attributes `data-language` -> `data-tab-key`.

Fixes #24669.
2023-06-24 07:47:25 -07:00
Karl Stolley a9bc5e94e7 bot_icon: Adjust bot-icon color for light and dark modes. 2023-06-23 14:43:22 -07:00
tyler ed1431f1bd gear_menu: Rename tooltip to reflect name change from 'Menu' to 'Main menu'. 2023-06-23 14:42:34 -07:00
tyler 0ce0995e49 gear_menu: Add accessibility label to gear menu toggle. 2023-06-23 14:42:34 -07:00
evykassirer 22d6d9455a header: Fix dark mode header box-shadow.
Followup to 239b6737c0
2023-06-23 14:41:16 -07:00
Sahil Batra db825ad202 settings: Remove settings_text_input class from url type inputs.
This commit removes settings_text_input class from url type inputs
and we instead add the width property to settings_url_input.

Note that we might instead have a single class for all type of inputs
instead of having different classes for url, password and text type
inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 7d0da75430 modal: Remove modal_text_input class from password and url type inputs.
We remove the modal_text_input class from password and url type inputs
in modals and add the width property CSS to modal_password_input and
modal_url_input instead.

Note that we might instead have a single class for all type of inputs
instead of having different classes for url, password and text type
inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra a860e717bb bootstrap: Remove bootstrap CSS for url type inputs.
We use url type inputs in the add and edit custom field modals
and also to show the url type custom fields in "Profile" panel
and "Manage user" modal.

This commit re-adds the bootstrap CSS rules to these specific
input elements using modal_url_input and settings_url_input
class and thus removes the CSS for url type inputs from
bootstrap.css.

We might replace the new class added here with a common class
for all type of inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 9cf214a7cb bootstrap: Remove bootstrap CSS for email type inputs.
We use email type inputs only in portico pages and
the bootstrap CSS is already overridden by CSS
defined in portico_signin.css. Only outline property
was being applied by bootstrap on focusing the input
which has been added to CSS in portico_signin.css in
the previous commit as password and email type inputs
have common CSS.

Thus, we can remove the bootstrap CSS for email type
inputs safely.
2023-06-23 11:53:38 -07:00
Sahil Batra 631eba09ee css: Remove bootstrap CSS for password type inputs.
We use password type inputs for API key and password
change modal in the main app and in login, register
and password reset pages.

For the portico pages, i.e. login, register and
password reset pages, the bootstrap CSS is already
overridden by our custom CSS defined in
portico_signin.css and some of the CSS added by
bootstrap is redundant. Only outline property was
being applied by bootstrap on focusing the input
which has been added to CSS in portico_signin.css
in this commit.

For the inputs used in app, i.e. API key and password
change modal, we have already added the CSS rules of
Bootstrap using "modal_password_input" class.

Thus, we can remove the CSS for password type inputs
from bootstrap.css.
2023-06-23 11:53:38 -07:00
Sahil Batra 5ac72eedd9 modals: Re-add bootstrap CSS to password inputs in modals.
This commit adds specific CSS styles from bootstrap to password
type inputs in modals using modal_password_input class. This
change helps us in removing the bootstrap CSS for password type
inputs in further commits.

We might replace the new added class with a single class which
will be used for all type of inputs in further commits.
2023-06-23 11:53:38 -07:00
Sahil Batra 954f605514 bootstrap: Remove CSS image type inputs.
We do not use any image type inputs in our app.
2023-06-23 11:53:38 -07:00
Sahil Batra 4703292c35 bootstrap: Remove CSS for file type inputs.
This commit removes bootstrap CSS for file type inputs
and we can safely do so all file type inputs are hidden.
2023-06-23 11:53:38 -07:00
Sahil Batra 35f252f5b2 templates: Remove pull-left class and its bootstrap CSS.
The "pull-left" class was used for hidden file type input
in compose_control_buttons.hbs and in the copy code button
in codeblocks. It was only used to set the float property
in CSS, but we do not need to set it and removing it does
not make any change in the position of these elements.
So, this commit removes the pull-left class and its CSS
from bootstrap.css as well.

For the file type input, it is already hidden and after
removing the float property also, it is positioned at the
same place due to ordering of elements in HTML.

For the copy code button in codeblocks, it is postioned
using "position" and "right" attributes and removing
"float" property has no effect.
2023-06-23 11:53:38 -07:00
Sahil Batra 8c0ff704df bootstrap: Remove bootstrap CSS for pull-right class.
We use pull-right class for copy button with the multi-use
invite link only and this commit adds CSS for that specific
element. This commit then removes the bootstrap CSS for
pull-right class and also removes pull-right class from the
copy button since it is no longer required.
2023-06-23 11:53:38 -07:00
Sahil Batra f4d082a5ff bootstrap-btn: Remove CSS for fieldset elements.
All the CSS for fieldset elements in bootstrap-btn.css
was for disabled fieldset elements and we do not use
them anywhere in the app.
2023-06-23 11:53:38 -07:00
Sahil Batra cbcbfef396 bootstrap: Remove CSS for fieldset element from bootstrap.css.
This commit adds the required bootstrap CSS rules for fieldset
elements to the specific selector in portico_signin.css and
removes the CSS from bootstrap.css.
2023-06-23 11:53:38 -07:00
Sahil Batra 0c3076b7d6 bootstrap: Remove CSS for input-block-level class.
We use input-block-level class only for search input
and this commit adds the required bootstrap rules for
it to the specific elements in search.css. So, we can
safely remove the CSS defined for this class in
bootstrap.css.
2023-06-23 11:53:38 -07:00
Lauryn Menard c5fbd3f085 narrow: Mark as read in `by_recipient` based on case ("dm" or "stream").
In commit #25837, we added in a check for the user's mark as read
policy in the frontend for `by_topic` and `by_recipient` narrowing.
In that change, the assumption was that for both functions, it was
sufficient to check only for whether the user policy was to never
mark as read.

But because the `by_recipient` function may narrow to an interleaved
stream view, it is possible that message will be marked as read
when the user did not expect it to be (e.g. they marked all the
messages in a topic narrow as unread and then used the `S` key
shortcut to navigate back to the stream view) when they have
conversation views only as their mark as read  policy.

Here we move the check for the user's mark as read policy to be in
the two cases for `by_recipient` so that the mark as read behavior
here matches the user's setting.
2023-06-23 11:51:14 -07:00
Daniil Fadeev daab1d4265
compose_banner: Remove uploads banners when clearing compose box.
Upload banners were not cleared after closing compose box, which meant
that they would remain present in a paused state after compose was reopened.

https://chat.zulip.org/#narrow/stream/9-issues/topic/Incomplete.20Upload.20banner.20remains.20on.20closing.20compose/near/1582602
2023-06-23 11:45:04 -07:00
Lalit 13187ff8f6 ts: Convert `web/src/billing` module to TypeScript.
Converted all files inside `web/src/billing` to TypeScript.
2023-06-23 11:42:29 -07:00
Lalit 1f4dd0705d page_params: Make seperate `page_params` for billing module.
This commit introduces a seperate `page_params` file for billing module
since we only use certain page_params in billing module only that it does
not make sense to include them in the main `page_params.ts`.

Also introduced `zpage_billing_params` for proper testing new `page_params`
in billing module.
2023-06-23 11:42:29 -07:00
evykassirer e360a896f6 message view header: Don't initalize multiple times.
The `initialize` function registers a click handler, and
previously it was being registered another time each time
one of these calls to `initialize()` happened. The only
other thing that happens in `initialize` is a call to
`render_title_area`, so this commit replaces the extra
calls to initialize with that.
2023-06-23 11:33:44 -07:00
evykassirer 7ee827a24b search: Remove unused `search_open` classname. 2023-06-23 11:33:03 -07:00
evykassirer 84a066cb48 search: Invert double negative with De Morgan's law.
No functional changes. This change is more consistent with how this
expressions looks in other parts of the codebase.
2023-06-23 11:32:42 -07:00
Akarsh Jain 92ea4a02a1 stream_edit: Replace saving notice with spinner editing stream name.
This commit remove the Saving/Saved notices when editing the stream
name and/or description. Instead, it replaces the "Save changes" button
with a spinner while the changes are being saved.

Fixes #24535.
2023-06-23 11:28:12 -07:00
Akarsh Jain 132c4245d0 modal: Fix button height issue on modals with long text on submit button.
This commit fixes an issue where the button height increases while
it has the spinner on modals with long text on the submit button. The
issue occurred due to the button height being calculated after hiding
the span element, which resulted in an incorrect height. To overcome
this, the commit suggests computing the span element's height before
hiding it to ensure that the button height is accurately set.
2023-06-23 11:27:52 -07:00
Aman Agrawal 5efa32be66 wildcard_mention: Don't highlight for unsubbed users. 2023-06-23 11:20:28 -07:00
Sahil Batra b119ff68c3 stream_settings: Fix height of select elements.
Previously, we used to have top and bottom paddings of 4px to
the select elements but it was removed in a208da9c4d to make
sure that text for the selected option is aligned properly.

All other select elements have height set to 30px, but the
select elements in stream settings page had height set to
"fit-content" and so they looked ugly after removing the
padding.

This commit sets the height of select elements in stream
settings to 30px.
2023-06-23 11:04:19 -07:00
lapaz 7ddf56514e settings: Remove disconnection of date-picker pop-up on scroll.
Disconnection of pop-up of date-picker for birthday on scroll of
settings is prevented.
Fixes #24924
2023-06-23 10:54:55 -07:00
Daniil Fadeev b13a85cdbf compose: Fix keyboard indicator appearance in send shortcut. 2023-06-23 10:53:51 -07:00
Daniil Fadeev 83b4fef060 compose: Fix keyboard indicator vertical alignment in send shortcut. 2023-06-23 10:53:51 -07:00
Lalit 50dc8c87e9 typing_status: Refactor `recipient` family of variables.
Refactored `recipient` family of variables to better names like
`recipient_ids` which also aligns with the type of these variables.

Also, refactored `typing_status.test.js` to use array of user ids
instead of string names like `alice` and `bob` to stay consistent with
the actual type of these parameters.
2023-06-23 10:52:53 -07:00
Lalit 66c672ed36 ts: Convert `web/shared/typing_status.js` to TypeScript. 2023-06-23 10:52:53 -07:00
Lalit 3613404581 typing_status: Refactor `state` object to either be null or has all
fields set.

This commit refactors the `state` object to either be null or has all
the fields set at the same time because they are note really decoupled.

This helps us to clean our code a little bit as well as makes it easier
to migrate this module to TypeScript.
2023-06-23 10:52:53 -07:00
Lalit 6ade7dcfb9 compose_typeahead: Cut dependency on `compose.js`. 2023-06-19 16:54:28 -07:00
Lalit e1ef8c623c compose_pm_pill: Cut dependency on compose_recipient.js. 2023-06-19 16:54:28 -07:00