Commit Graph

12975 Commits

Author SHA1 Message Date
Ganesh Pawar 6262c88e00 modal: Grey out the submit button when disabled. 2021-11-15 10:38:57 -08:00
Ganesh Pawar ca4d9b0fd6 modal: Mark submit button CSS `color` property as important.
This is necessary to override the global `color` property defined
for disabled buttons in night mode.
2021-11-15 10:38:57 -08:00
Aman Agrawal 5f4595d7b6 landing_page: Avoid gradient overflowing under content.
Gradient under content makes links which are of similar color
hard to see.
2021-11-14 18:56:34 -08:00
Alex Dehnert dfaeb10087
settings: Link to help on restrict wildcard mentions.
This is necessary to indicate the definition for "large streams" used.
2021-11-12 11:33:35 -08:00
Lauryn Menard 6046f94521 settings: Fix live `update_page` behavior for user settings.
Changes `update_page` to only update the modified user setting instead
of updating all of the user settings on the page. This is modeled on
the behavior for updates to the realm user default settings.

This is a follow up on feedback in #20070.
2021-11-10 13:03:20 -08:00
akshatdalton e9a2183fda drafts: Fix tooltip css in draft controls.
Tooltip popover in draft controls was too narrow.
Now its width is set to max-content width.
This looks nice.
2021-11-10 12:54:53 -08:00
akshatdalton 2b1cc006fa drafts: Add hotkey hint to restore draft. 2021-11-10 12:54:53 -08:00
Tim Abbott 12c6ee7962 drafts: Document that drafts are not shared with other devices.
We plan to change this in the future, but we should make sure it's
clear to users what the current model is.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels 151db3c9ef drafts: Increase the duration of "Saved as draft" tooltip.
Now that it's further away from the composebox, we probably want it to
be visible for longer. Doubling it from 1.5 seconds to 3 seconds seems
reasonable to start with, although we should tune it based on feedback.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels fe89dee284 compose: Remove "Drafts" button.
Now that this is in the left sidebar, we can remove the now-redundant
compose area button for it.  This also changes where the "Saved as
draft" tooltip appears.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels df8f0b2afe left_sidebar: Add "Drafts" item.
This currently shows the drafts as a popup. Eventually, we'll want to
migrate it to be a view in the center pane, as we did with Recent
Topics.

This uses the same style as starred messages in order to show the number
of drafts.

See CZO for more context:
https://chat.zulip.org/#narrow/stream/101-design/topic/drafts.20in.20sidebar
2021-11-10 12:53:44 -08:00
Aman Agrawal cfbed9a60c recent_topics: Re-select last selected topic.
Since the position of topic in recent topics can change, we
focus the last selected topic using the `topic_key` instead
of relying `row_focus` value which is incorrect.
2021-11-10 12:25:15 -08:00
Aman Agrawal 7f61997d09 recent_topics: Directly pass topic index instead of element.
Since the element may get re-rendered while we extract info from
it, we do it as fast as possible to avoid errors.
2021-11-10 12:25:15 -08:00
Aman Agrawal c6d74c4b67 recent_topics: Separate behaviour for scrolling and hotkeys.
When user is scrolling, we simply keep the center element in
focus.

When user is using hotkeys, we keep the focused element in
center.

When user is using keyboard, we need to always keep the
"focused" topic in visible scrolling area.

We determine if the topic row is above or below the visible
area and scroll half_height_of_visible_area so that the selected
topic is visible.

This gives a nice navigation experience for both the views.

Reduced height of recent topics table to account for
compose box so that focused element is not below compose box.
2021-11-10 12:25:15 -08:00
YashRE42 f21cee7caa upload: Return single elem for get_item(drag_drop_container) w/ edit.
Previously, opening multiple message_edits and then drag-dropping a
file into any one of them would cause all of them to upload ie you'd
get one uploaded file in each message_edit.

This bug was caused by returning multiple elements from
upload.get_item("drag_drop_container", config) when config.mode =
"edit".

This commit changes the selector to use the row provided (config.row),
and so ensures that the above bug doesn't happen.
2021-11-10 12:06:15 -08:00
YashRE42 e8eb6724ad message_view_header: Switch selector for hover to ~ instead of +.
This is a prep commit for adding extended descriptions to
message_view_header, it ensures hover effects work even if we add
additional elements to the message_view_header.
2021-11-10 11:05:22 -08:00
Ganesh Pawar 7a505e3857 user_profile_modal: Migrate modal to Micromodal. 2021-11-10 11:04:38 -08:00
Tim Abbott f905171e78 stream_edit: Remove unused import.
This was introduced when rebasing
d62e44fcba on top of
8cc781f0c8, which removed the other use
of this module in this file.
2021-11-10 10:33:12 -08:00
Ganesh Pawar d62e44fcba stream_privacy_setting_modal: Migrate modal to dialog_widget. 2021-11-10 10:23:31 -08:00
Aman Agrawal 9af4d5a155 reminder: Don't ack server for reminder / scheduled messages. 2021-11-10 09:12:23 -08:00
Aman Agrawal 3237196687 reminder: Fix incorrect method applied on object.
The intention here is to apply `find` on the array of values
in the object.
2021-11-10 09:12:23 -08:00
Aman Agrawal 59a62573ed popover_menus: Simplify check for any active popovers. 2021-11-10 09:12:23 -08:00
isakhagg 7edbf673e4 poll: Handle duplicate poll options.
Fixes #20164.
2021-11-10 09:07:03 -08:00
Ganesh Pawar 6bc291cdf2 edit_bot: Remove unnecessary CSS from bot owner button.
Fixes #20201.
2021-11-10 09:02:08 -08:00
Aman Agrawal a8c488bc56 compose: Use calendarContainer to check if flatpickr is open.
`calendarContainer` is defined for flatpickr instance if it is
open.

This also fixes a bug where the flatpickr doesn't open when
user tries to toggle it using the global time icon in compose.
2021-11-10 09:00:59 -08:00
Manan Rathi aac8ceadf9 user docs: Add documentation for /todo.
Fixes #20141.

Co-authored-by: Alya Abbott <alya@zulip.com>
2021-11-09 10:16:47 -08:00
Tim Abbott 4aedb129ea settings: Add comments for default settings update_page. 2021-11-09 10:05:08 -08:00
Sahil Batra f49980098d settings: Fix live update code for twenty_four_hour_time setting.
We need to handle live-update of twenty_four_hour_time setting
separately in update_page because the database value of this
setting is boolean but we use dropdown in the frontend for this
setting with option values as "true" and "false" strings.
2021-11-09 10:03:23 -08:00
Sahil Batra 4a1153b06c settings: Fix bug in "Default user settings" section.
There was no heading for "Time format" setting in the
"Default user settings" section and thus no save-discard
widget to update the setting. This commit fixes the bug
and changes the heading to be only "Time" since there is
no realm-level default of language setting.

This bug was introduced in adb612a0b4.
2021-11-09 10:03:23 -08:00
Ganesh Pawar 41ddf29e76 move_topic_to_stream: Migrate modal to dialog_widget. 2021-11-09 10:02:43 -08:00
Aman Agrawal 05bd417de4 flatpickr: Visual improvements.
* Fix time input buttons not positioned correctly.
On <768px screens:
* Center align flatpickr.
* Remove bottom arrow.

We should ideally have a semi-transparent black background
for flatpickr on mobile but it is hard to do so with flatpickr
being inserted into DOM by an external library.
2021-11-09 09:40:52 -08:00
Aman Agrawal 8c46fde342 flatpickr: Show the same picker on mobile as on desktop.
Flatpickr tries to show a different picker for mobile which
is not visible for some reason. We display the same picker
on mobile which we know works for our use case.

Docs: https://flatpickr.js.org/options/

```
Set disableMobile to true to always use the non-native picker.
By default, flatpickr utilizes native datetime widgets unless
certain options (e.g. disable) are used.
```
2021-11-09 09:40:52 -08:00
Sahil Batra 041711dcbd streams: Add padding between subscriber-list columns.
This commit adds 5px of padding between columns of
subscriber-list such that the list doesn't look too
bad on narrow widths. This does not completely fixes
the issue on narrow widths but is atleast a small
improvement.
2021-11-09 15:11:02 +05:30
Sahil Batra 46660e5daa streams: Show "hidden" in subscriber-list when email is not accessible. 2021-11-09 13:26:31 +05:30
Sahil Batra 305131c7d7 settings: Show "hidden" in users list when email is not accessible. 2021-11-09 13:22:44 +05:30
YashRE42 a150b9b0ae recent_topics: Don't rely on ":visible" to avoid forced reflow.
Previously, navigating from any stream to the recent topics view would
cause a forced reflow every time we checked `is_visible()` because it
would call `$("#recent_topics_view").is(":visible")`.

The reason for this is related to how browsers ship frames, the
process follows these steps:
JavaScript > style calculations > layout > paint > composite.
(The layout step is called Reflow in firefox.)

Typically, the browser will handle these steps in the most optimal
manner possible, delaying expensive operations until they're needed.

However, it is possible to cause the browser to perform a layout
earlier than necessary. An example of this is what we previously did:

When we call `top_left_corner.narrow_to_recent_topics()`, we ask to
add a class via `.addClass()`, this schedules a Style Recalculation,
then, when we call `message_view_header.make_message_view_header()` it
calls `recent_topics_util.is_visible()` which calls
`$("#recent_topics_view").is(":visible")`.

Before the browser can get this value, it realizes that our dom was
invalidated by `.addClass()` and so it must execute the scheduled
Style Recalculation and cause a layout.

This is called a forced synchronous layout.

This commit adds a JavaScript variable representing the visible state,
in order to prevent the above behavior.

This commit reduces the main thread run time of
`build_message_view_header` from 131.81 ms to 5.20 ms.

Unfortunately we still have the case where
`recent_topics_ui.revive_current_focus()` calls
`recent_topics_ui.set_table_focus()` which causes a reflow.

However, by eliminating this reflow we still save ~100ms.
(It's important to note that we only save this sometimes, as other
things can still cost us a reflow.)

Further reading: https://developers.google.com/web/fundamentals/
performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
2021-11-08 18:30:44 -08:00
Sahil Batra c8b00941f2 stream_settings: Add user-id column in subscriber-list. 2021-11-08 18:10:25 -08:00
Sahil Batra e3aed119ec stream_settings: Add heading row in subscriber list. 2021-11-08 18:10:25 -08:00
Sahil Batra 2105b5eda8 settings: Add user-id column to bot list. 2021-11-08 18:10:25 -08:00
Sahil Batra 36c1a1f1ee settings: Add user-id column in active and deactivated users list. 2021-11-08 18:10:25 -08:00
Ganesh Pawar edf7c0fb5a edit_bot: Migrate modal to dialog_widget. 2021-11-08 17:34:42 -08:00
Ganesh Pawar 8cc781f0c8 change_stream_info_modal: Migrate modal to dialog_widget.
The CSS changes make the description input box a more likely size for
what currently makes sense for stream descriptions.
2021-11-08 17:27:27 -08:00
Ganesh Pawar 8c7d320422 message_edit_history: Migrate modal to dialog_widget. 2021-11-08 17:24:31 -08:00
Aman Agrawal ffba7c7352 open-source: Stop quote used as image for feature from overflowing.
In small screens, the quote used as a standin for image used
to overflow from screen as it didn't had responsive size set.
This image has additional bound of `max-width: 100%` which
stops them from overflowing which the quote did not.
2021-11-06 06:18:06 -07:00
Anders Kaseorg 2080278758 styles: Use legacy color notations for older browser compatibility.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 22d68831d7 styles: Fix function-url-quotes.
Fixed manually.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 17e72da336 styles: Fix declaration-block-no-redundant-longhand-properties.
Fixed manually.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg 52ad928d3e styles: Fix shorthand-property-no-redundant-values.
Generated by stylelint --fix.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Anders Kaseorg c732a63b2f upload_widget: Convert $e.get(0) to $e[0].
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-05 17:34:13 -07:00
Vishnu KS 6c06858e02 billing: Migrate to Stripe hosted checkout page. 2021-11-05 17:23:10 -07:00