Commit Graph

628 Commits

Author SHA1 Message Date
Steve Howell 663170f0d3 code cleanup: Alphabetize event types in switch statement. 2023-05-01 07:26:51 -07:00
Tim Abbott 6fe02e933a timerender: Extract new variant of get_full_datetime.
Separating these concepts allows us to provide a much nicer format for
contexts where ultra-specific clarification is not a priority.

This new variant is currently only used in the scheduled messages UI.
2023-04-30 22:39:52 -07:00
PALASH BADERIA 341f3a1ce2
tippy: Add message_list_tooltip helper to clear tooltips on rerender.
We've had a series of bugs where tooltips get leaked when a message list
is rerendered. For some tooltips, we used a 'mutation observer' to remove the tooltip
in this situation, but this was expensive and messy. We replace this with a Tippy
plugin to keep track of this class of tooltips, with a central hook to remove them
during rendering.

Message lists are rerendered in the background in a variety of situations;
a simple way to trigger it is clicking the mute/unmute topic/stream button in
the topic menu/stream menu and the clickable area overlaps with the
message list tooltips area. If a tooltip was visible at the time, the tooltip loses its
reference due to the re-rendering removing its DOM element, appearing at the top-left corner.

To prevent this behavior for all message list tooltips, we need to
store all instances of the message list tooltips and then destroy
them if the instances does refer to something else then document.body
using the 'destroy_all_message_list_instances' function just
before re-rendering.

Whenever the message list is rendered, all the message list tooltips
will be destroyed if they do not refer to document.body. This
prevents the double appearance of those tooltips if the reference
is removed from the DOM.

This plugin allows us to remove the mutation observers and net delete code
while hopefully fixing this bug for the whole app.
2023-04-30 22:33:14 -07:00
Tim Abbott 368d2aa27d compose: Fix misaligment of compose top right icons.
When composing a private message to a different recipient than the
current view, the go-to-compose-target icon looked vertically
misaligned with these icons. Fix this by removing the CSS rule that
made these other top-corner icons not centered within their row.
2023-04-30 21:02:21 -07:00
Hardik Dharmani 69779688f0 settings: Update disabled state of button in email change modal.
The new update_submit_disabled_state_on_change feature of the
dialog_widget component makes this simple.

Fixes #22683.
2023-04-30 20:56:51 -07:00
Hardik Dharmani 96d6fda2a7 dialog_widget: Add support for managing submit button disabled state.
The new update_submit_disabled_state_on_change parameter configures
the dialog_widget system to disable/enable the confirmation button
depending on whether any of the fields in the modal have values
differing from their initial values.

Fixes #22683.
2023-04-30 20:56:49 -07:00
sbansal1999 33705b6116 tooltips: Remove keyboard shortcuts from View Scheduled Messages modal.
This commit removes the keyboard shortcut from tooltips that
can be seen when hovering over the two buttons in
"View Scheduled Messages" modal.

This is a temporary change as the keyboard shortcut will be
added to the tooltips when the shortcuts are actually working.
2023-04-30 20:34:53 -07:00
Aman Agrawal eeb3ff26e1 css: Fix loading spinner position for messages loading indicator. 2023-04-29 07:21:19 -07:00
Lalit 3e179a2c58 actions_popover: Hide "Add emoji reaction" in action menu in spectator mode.
We should hide the "Add emoji reaction" from the message action menu while a
user is not logged in, that is user is in public access mode.

Fixes #25331.
2023-04-28 20:09:24 -07:00
palashb01 acba8518fb recent: Replace presence dot with bot icon for bots.
This commit replaces the presence dot with a bot icon for
private messages (PMs) with bots in the recent conversations
narrow.
2023-04-28 19:14:00 -07:00
palashb01 8eb90bbc7f left_sidebar: Fix the opacity of group,bot icons.
This commit fixes the opacity of the group-icon and bot-icon
in the left-sidebar direct message section to make them look
 more consistent with the other icons in the left sidebar.
2023-04-28 19:14:00 -07:00
palashb01 cee0cabd8d left_sidebar: Replace the presence dot with bot icon for bots.
This commit replaces the presence dot display with a bot icon
for bots in the left sidebar PM list.
2023-04-28 19:14:00 -07:00
palashb01 29377c7f32 user_card: Fix the padding of bot-icon with name.
This commit fixes the padding of the bot-icon with the name
to make it look consistent with the way it is displayed in
the message feed.
2023-04-28 19:14:00 -07:00
palashb01 bb4d2f5f5b profile_popover: Remove the display presence dot for bots.
This commit removes the presence dot display for bots and fixes
the gap between the bot name and bot icon in the user profile
popover. It also fixes the alignment of the bot icon.

Fixes: #25066
2023-04-28 19:14:00 -07:00
evykassirer 199afbe8eb messagebox: Update background-color for mentions.
This is part of #22059.
2023-04-28 19:06:50 -07:00
Tim Abbott 56c5c8902b scheduled_messages: Disallow dates in the past in the UI.
The server will probably accept them and just send the message
immediately, which seems OK, but we probably want to discourage
scheduling a message to be sent in the past, since that's unlikely to
be intentional and would make it hard to undo.
2023-04-28 19:01:40 -07:00
Tim Abbott cef1e3363c compose: Increase size of recipient menu.
We should do a better long-term fix, but the current menu feels cramped.
2023-04-28 18:44:11 -07:00
Tim Abbott 798391824b compose: Refactor dropdown-menu CSS rules. 2023-04-28 18:43:51 -07:00
Karl Stolley e4ae4c5b75 send_later: Remove send_later_input_group.
This removes the HTML structure and CSS styles previously associated
with the element in the scheduling modal.

Preserving this all in its own commit in case it needs to be
restored.
2023-04-28 17:50:54 -07:00
Karl Stolley 8180cc786f send_later: Pick time from 'Custom time' link.
This introduces a 'Custom time' link to the bottom of the scheduling
modal's options. Clicking on it pulls up the date picker.

Additionally, clicking on the 'Custom time' link, then clicking
elsewhere to close the time-picker, then subsequently clicking
'Custom time' again reveals the time-picker.

However, repeatedly clicking the 'Custom time' link while the
date-picker is already open will cause the date-picker to redraw
each time.
2023-04-28 17:50:54 -07:00
Karl Stolley 865cba834b send_later: Cancel scheduling from popover. 2023-04-28 17:50:54 -07:00
Aman Agrawal e89cbf0ac1 send_later: Move some options to a modal. 2023-04-28 17:50:54 -07:00
Tim Abbott 13592b4495 scheduled_messages: Fix date formatting call.
d42ac60d61 accidentally lost the "new Date" part.
2023-04-28 17:50:54 -07:00
Tim Abbott d42ac60d61 scheduled_message: Fix i18n for scheduled time. 2023-04-28 17:25:00 -07:00
Aman Agrawal f40855bad2 reminder: Remove feature from zulip.
This is being removed to make the code simpler. We have plans
to add it as a feature in the future , but it will most likely
not use the same code.
2023-04-28 17:25:00 -07:00
Aman Agrawal 6bff396711 scheduled_messages: Remove unnecessary compose_fade call.
We just need to call clear_compose_box() here similar to when
sending a message.
2023-04-28 17:25:00 -07:00
Aman Agrawal 5baa0dc313 compose: Use the new endpoint to create scheduled messages. 2023-04-28 17:25:00 -07:00
Lauryn Menard 7739703111 scheduled-messages: Update scheduled message objects in the API for type.
Updates the objects in the API for scheduled messages so that those
for stream messages return the `to` property as an integer since it
is always the unique stream ID and so that those for direct messages
do not have a `topic` property since direct messages never have a
topic.

Also makes small update so that web app scheduled messages overlay
has the correct stream ID.
2023-04-28 17:25:00 -07:00
Aman Agrawal 963fe566d7 scheduled_messages: Use scheduled_message_id instead of message_id.
Using `message_id` can be confusing for API users since it can be
mistaken for the ID of the message that will be sent.
2023-04-28 17:25:00 -07:00
Hardik Dharmani a2b36bbabb user_card: Fix user_card background for dark theme for width < $md_min.
Previously, in the dark theme, the `background-color: #18222f` of the
`.popover` class took precedence over the
`background-color: hsla(0,0%,0%,.7)` of the `.message-info-popover`
and `.user-info-popover` classes. This commit fixes this issue by
adding !important to the background-color property of
`.message-info-popover, .user-info-popover` classes.
2023-04-28 15:35:43 -07:00
Hardik Dharmani d43c5e6071 tooltips: Convert edit notice tooltips to tippy. 2023-04-28 15:34:59 -07:00
Hardik Dharmani 15860c8b13 tooltips: Convert recipient row tooltips to tippy. 2023-04-28 15:34:59 -07:00
Aman Agrawal b33438eb55 css: Move `10px` navbar bottom padding above message header.
This is a more natural place for this extra padding than below the
navbar. Padding below navbar was primarily needed to hide the
message content above the sticky header while scrolling the message feed.
We are still able to do with this change without partially hiding the
loading message indicator.

Fixes #25159
2023-04-28 12:48:10 -07:00
Lalit 0d51e2d1f9 left_sidebar: Add same styles to schedule messages row as all other rows.
This fixes the bug where the schedule message whole row was not clickable
and had some padding issues. By adding same styles as all other rows in
left sidebar we eliminate those bugs.
2023-04-28 12:44:59 -07:00
Karl Stolley df508659db css: Lighten button border for visibility.
This replaces the previous dark border.

A pure white border looked a little too garish, so this dials back the
alpha channel just a bit.

Fixes: #25303.
2023-04-28 12:44:30 -07:00
Karl Stolley 942eb7b375 css: Pad send button for click comfort. 2023-04-28 12:44:30 -07:00
Karl Stolley d9654f4f0a css: Introduce padded vdots for send later.
This uses eyeballed vertical padding on the nested .zulip-icon class
to ensure that the entire send-later button area is clickable (and
not merely hoverable).
2023-04-28 12:44:30 -07:00
Aman Agrawal 2deec692f6 dark_theme: Fix dark recipient background in light theme for spectators.
Since, we didn't update `user_settings.color_scheme` for spectators
and our recipient bar color calculations were based on it, this
resulted in a wrong recipient bar color if the OS default color
scheme of the user was different from `spectator-theme-preference`
set by the user using the gear menu.

To reproduce the bug:
* Set preferred color scheme to `dark` in your OS settings / Chrome
  dev tools.
* Login as spectator in Incognito.
* Switch to light theme.

You will see dark background colors in recipient bars.
2023-04-28 12:39:46 -07:00
Lauryn Menard f574bd4952 narrow: Fix "pm-with" narrow in scheduled messages. 2023-04-28 12:38:29 -07:00
Tim Abbott 496b403fcf tooltips: Add new central tooltip template store.
We should migrate all the static content tooltip templates to this
file to avoid duplicate DOM elements.
2023-04-27 18:12:32 -07:00
Hardik Dharmani ea6ae50326 tooltips: Add tippy tooltip for view_user_card.
Added modern tippy tootip for view_user_card tooltip by adding a
<template> with id=view-user-card-tooltip-template for the element.

Fixes part of #24311.
2023-04-27 18:12:32 -07:00
Tim Abbott 6aea3f2be5 tooltips: Use tippy tooltip for stream list toggle. 2023-04-27 18:12:32 -07:00
Hardik Dharmani dcfd374f2f left_sidebar: Correct hotkey for `All direct messages` tooltip. 2023-04-27 18:12:32 -07:00
Hardik Dharmani 941c15b802 tooltips: Add tippy tooltip for search_query.
Added tippy tooltips for search_open, search_close icon and
search_query input field with hotkey hint `/' by adding a class
`.tippy-zulip-delayed-tooltip` which adds tooltip with
LONG_HOVER_DELAY and default placement top with fallback placement
equal to bottom.

Added tippy tooltip with text `Close` on `.search_close_button`.

Fixes part of #24311
2023-04-27 18:12:32 -07:00
Hardik Dharmani 9c866f9be1 tooltips: Add tippy tooltip for message expander/condenser.
Added tippy tootip for '.message_expander' and
'.messsage_condenser' by adding '.tippy-zulip-delayed-tooltip' class,
and creating 2 <template> with id equal to crresponding
data-tooltip-template-id of the elements.

Fixes part of #24311
2023-04-27 18:12:32 -07:00
Hardik Dharmani 15a15240da tooltips: Add tippy tooltips in manage stream settings.
Added tippy tooltips for create_stream_plus_button and
preview-stream-button in manage stream settings by adding
class `.tippy-zulip-delayed-tooltip` which add tooltips
with LONG_HOVER_DELAY. Added data-tippy-placement="bottom"
to match with 'Archive stream' tooltip.

Created a new tooltip for sub_unsub_button in tippyjs with
class .toggle-subscription-tooltip that has
EXTRA_LONG_HOVER_DELAY, placement equals to bottom
and appended to body.

Fixes part of #24311.
2023-04-27 18:12:32 -07:00
Hardik Dharmani 394fcbfd51 tooltips: Add tippy tooltip for userlist-toggle icon with hotkey hint `W`. 2023-04-27 18:12:32 -07:00
Hardik Dharmani 892bd38062 tooltips: Use tippy for `gear-menu` icon with hotkey hint `G`.
Fixes part of #24311
2023-04-27 18:12:32 -07:00
Hardik Dharmani 7785fb2948 tooltips: Add new tippy configuration `.tippy-zulip-delayed-tooltip`.
Added new tippy tooltips configuration with target class
`.tippy-zulip-delayed-tooltip` which add tooltips with
`delay: LONG_HOVER_DELAY`, appended to body, and have a
default placement top with fallback placement equal to bottom.

Fixes part of #24311
2023-04-27 18:12:32 -07:00
Palash Baderia c10d33d23c tippy: Remove the focus trigger from the compose-control-buttons.
By default, tippyjs uses a trigger value of 'mouseenter focus',
which means that the tooltips can appear either when the element
is hovered over or when it receives focus (e.g., by being clicked).
Because of this, if you click on the button to open the popover,
the tooltip also appears. To prevent this behavior, we need to
remove the 'focus' trigger from the buttons so that the tooltips
don't appear when the buttons are clicked.

Fixes: #25277
2023-04-27 17:36:48 -07:00