Commit Graph

10414 Commits

Author SHA1 Message Date
Gittenburg c42c2a9a22 click_handlers: Don't focus elements on dragstart.
Chrome focuses elements when you start dragging them,
which can confuse users because of our focus outline.
2020-07-16 01:32:26 -07:00
Tim Abbott 4f9f6b18e7 css: Fix recipient bar stream hover text color in night theme.
It's unclear what the purpose of this logic was, but testing confirms
that the text color is as expected without this in the day theme (so
it's likely a relic of an old design) and removing it fixes the hover
text being overridden to white in the night theme.
2020-07-16 01:14:03 -07:00
Aman Agrawal ddef014eea recent_topics: Patch colors.
Don't allow bootstrap to override row hover colors.
Show unread topics in same color as others.
2020-07-15 23:57:58 -07:00
Rohitt Vashishtha ea1c178305 markdown: Format spoilers for desktop notifications.
We hide the spoiler content in browser/desktop notifications.

Note: its not worth adding zjquery tests for this bit of code because
the tests do not operate on the actual data and are likely to get stale
if we change the syntax for spoilers.
2020-07-15 23:30:28 -07:00
Anders Kaseorg e60ae89caa logo: Delete unused old logos and screenshots.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-15 20:56:58 -07:00
Anders Kaseorg c080b4da06 favicon: Remove ancient browser workarounds.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-15 20:56:58 -07:00
YashRE42 78d511fd03 navbar: Clean up implementation of tab_bar.narrow_description hover.
This handler adds a neat little effect whereby hovering over the
clickable region to open the navbar triggers the search_icon hover
effect and is a neat little visual cue about what happens onClick.

The previous implementation was slightly messy because it fetched the
color and applied it via ".css(". This commit cleans it up by creating
and using the class "search_icon_hover_highlight" instead. We also
make the selectors more specific, ensuring they target children of
"#tab_bar", this was so because it was reasonable to expect someone to
define eg `search_closed` elsewhere and we wanted to prevent bugs when
that happened.
2020-07-15 18:56:06 -07:00
YashRE42 b554333421 night_mode: Fix search_icon hover regression.
In 9046fc1032 we updated the navbar.html
file so that our css selectors did not override each other and cause
annoying problems.

Unfortunately this caused a regression in night mode where the
search_icon didn't have the correct hover effect.

This fixes the regression by adding the selectors.
2020-07-15 18:56:06 -07:00
Tim Abbott a785a74fd0 timerender: Fix use of page_params.timezone.
The page_params.timezone feature is perhaps a misfeature, but
importantly it's not what is used to display the time in the message
feed (it's mainly used to show others your timezone).

Given that reality, we shouldn't use it for a feature whose whole
purpose is to display the time using the same timezone we use in the
message feed.

Fixes #15790.
2020-07-15 17:01:42 -07:00
Sebastian Morr bb12e407d2 timestamp: Observe user's 24-hour clock setting.
Fixes #15791.
2020-07-15 17:01:42 -07:00
Gittenburg 797fb00791 styles: Hide focus outline for active links.
We still want it everywhere for accessibility.
2020-07-15 12:37:27 -07:00
Aman Agrawal 5d5434ec2f recent_topics: Update topics post message deletion.
Delete stored topic data in `recent_senders` and `recent_topics`
about the message's topics and re-render them. The process is similar
to topic editing. See `recent_senders.process_topic_edit` for
logical details.
2020-07-15 12:35:24 -07:00
Tim Abbott 5150e1f8cf css: Limit recent focus handler change to popovers.
In 9648e64d23, we added a clear outline
around focused link elements in popovers.

This was a good fix for popovers, but it's distracting for the
experience of clicking links in the sidebars and message feed.
2020-07-15 12:12:01 -07:00
Tim Abbott 35023824b0 condense: Add missing stopPropagation/preventDefault.
This fixes an issue where an open compose box would close when
clicking to expand a condensed message.

Fixes #15808.
2020-07-15 10:42:22 -07:00
Aman Agrawal 19b7ef3888 list_render: Use simplebar container to track scroll event.
We have changed our all instances of list_render to use
simplebar and thus, we will now use simplebar container
to track scroll event for all the lists created by
list_render.

This fixes the bug of new subscribers not rendering on
scrolling at the end of subscriber list in stream settings
and similar bug in some other lists also.

This commit also removes scroll_util.get_list_scrolling_container
function as this is no longer used.

Fixes #15637.
2020-07-15 10:16:56 -07:00
sahil839 d41f66a917 muted_topics: Rerender list only if modal is opened and section is loaded.
We should rernder the muted topics list in settings only if the settings
modal is opened and the muted topics section is loaded.
2020-07-15 10:16:56 -07:00
Aman Agrawal c1b047b0d1 recent_topics: Use simplebar for scrolling. 2020-07-15 10:16:56 -07:00
Aman Agrawal 57b6f9179b settings: Fix simplebar scrollbar in org settings dropdown.
This commit fixes the dropdown_list_widget to use simplebar for
scrolling.

It was not being used because data-simplebar should not be inserted
to the element being rerendered. This commit adds a new element
wrapping 'dropdown-list-body' which was being rerendered and
data-simplebar is added to that new element 'dropdown-list-wrapper'.

Also, there should always be a max-height property on data-simplebar
element and it is also added in this commit.

There is also a change to set margin of 10px only on the first div
element and which is direct children of organization-settings-parent
element. This is correct because we only want margin to add some space
between the heading of subsection and the first setting of that
subsection. Previously, the margin was being added to first div of all
the other child containers also and this was adding unnecessary margin
to the first div element of different simplebar containers.
2020-07-15 10:16:56 -07:00
sahil839 6259456df1 settings: Do not use list_render for stream specific notification settings.
We do not need to use list_render for displaying list of streams specific
notification settings, as this is not scrollable and we do not provide
option to sort or filter this list as well.

After this change, all our list_render instances will be using simplebar
and we can change the code accordingly to fix the behaviour of scrolling.
2020-07-15 10:16:56 -07:00
Aman Agrawal c4bbdf040e recent_topics: Fix search clear icon overflowing in next line.
Sometimes, the clear icon overflows on the next line on specific
widths. This makes sure it never happens by wrapping them in a
block.
2020-07-15 10:00:52 -07:00
Aman Agrawal d39b969c64 recent_topics: Add background color to avatars extra count. 2020-07-15 10:00:52 -07:00
Aman Agrawal 71cae3370c recent_topics: Hide participants and last msg time on <750px width.
This ensures the UI experience on <750px width doesn't look
like too many things packed in a small space.
2020-07-15 10:00:51 -07:00
Aman Agrawal e7a65fa688 recent_topics: Show action buttons next to topic.
We remove the action column and show action buttons next to topic
after unread count (if present). This save us a lot of extra space
on small window sizes.
2020-07-15 09:59:37 -07:00
Aman Agrawal 1ee09799e6 recent_topics: Don't wrap last message header and stream names. 2020-07-15 09:59:37 -07:00
Aman Agrawal 8951f77e5d recent_topics: Show read topics in a darker shade. 2020-07-15 09:59:37 -07:00
Gittenburg 9648e64d23 styles: Make focus outline work reliably.
For a:focus Bootstrap sets the following rules:

    outline: thin dotted #333;
    outline: 5px auto -webkit-focus-ring-color;

Firefox does not know -webkit-focus-ring-color and falls back to the
previous rule, making the outline invisible in darkmode.

Chromium has a bug[1] that makes outline: auto invisible when focussing
elements programmatically (which we do for the up & down arrow keys).

[1]: https://bugs.chromium.org/p/chromium/issues/detail?id=1105822

Fixes #15768.
2020-07-15 09:57:19 -07:00
Gittenburg 953d475274 settings: Fix saving indicator glitch.
jQuery's fadeOut() sets display: none using inline CSS.
This was overriden by .alert-notification since it used !important
to override the display: block set in loading.js.  Removing the latter
allows us to remove the !important, and doesn't seem to break anything.

Fixes #15759.
2020-07-14 16:29:39 -07:00
Anders Kaseorg f1d475206e search: Fix ESLint prefer-arrow-callback error.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-14 12:38:25 -07:00
Tim Abbott cb54e30832 Revert "search: Fix blur event handler for `search_query_box`."
This reverts commit 63643c9d9d.

As the commit mentions, it makes a UI change for legacy search which
has largely been considered a regression.  We've been running with
this reverted in zulip.com essentially since it was first merged.
2020-07-14 12:26:28 -07:00
Tim Abbott 42d601e214 help: Fix exception with invalid fragment causing bogus extra scrollbars.
Apparently, our scrollbar logic crashed with an invalid URL fragment
(hash), which resulted in initialization not completing and thus the
logic failing.

In my view the root issue here is that we're not doing a good job of
catching JavaScript exceptions in portico pages.

Fixes #15706.
2020-07-14 12:19:52 -07:00
Gittenburg bc1f2fa80e reactions: Add back missing e.stopPropagation().
In 42f20e81be I fixed an edge case but
also accidentally made clicking on reactions open the compose box.

This commit adds back the e.stopPropagation(); and explicitly hides the
emoji picker popover, to address the inconsistency fixed in the previous
commit.
2020-07-14 00:38:36 -07:00
YashRE42 75cfd886b7 navbar: Fix disappearing left border when search opens.
Previously, we were experiencing a bug that caused the left border of
the searchbox/tab_bar to disappear when the searchbox was opened. This
bug was a result of the following changes:
- 4cdd7aed2b accidentally added this line
  as right: 2; instead of right: 2px;
- 46c966576d fixed this line to be
  right: 2px; but caused the regression.

This commit fixes the bug by deleting this line.
2020-07-14 00:37:40 -07:00
SiddharthVarshney 972a1019cf message_controls: Replace chevron-down with ellipsis-v icon.
After migrating chevron-down with ellipsis for
sidebar-menu, this commit will do the same for
message narrow for consistency.
2020-07-13 16:12:26 -07:00
SiddharthVarshney 1ea9e2841c message_controls: Make click area for icons more uniform.
Previously user have to click pixel perfect on the message controls
icons to achieve the click action.

This commit will uniformly increases the click target
area for the icons.

Tweaked by tabbott to avoid some weird glitches.
2020-07-13 16:12:06 -07:00
SiddharthVarshney d0fd0cae3f message-controls: Use <i> tag for starred message icon.
Throughout the codebase we use <i> tag for icons.
This commit will add <i> tag inside the starred message
div and fa classes are now used with this <i> tag.

The starred message div is now consistent with other
message_controls divs.

Tweaked by tabbott to use the name star_container for better
readability.
2020-07-13 15:59:12 -07:00
YashRE42 ae7ff04fe6 navbar: Purge tab_list label from code base.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base.

It would have been nicer if we could simply purge tab_bar from the
codebase and rename "#tab_list" so that we have an anchor and wrapper
structure in the html, but dropping the float: left on tab_bar causes
some confusing problems such as causing the horizontal border to
disappear and the search_box to shift out of its intended position and
so its simpler to get rid of tab_list from our code base first.

This commit:
- Removes the #tab_list wrapper div from tab_bar.hbs.
- Removes any #tab_list selectors from night_mode.scss so that they
  simply target based on "#tab_bar" instead of "#tab_bar #tab_list".
- Removes tab_list selectors from zulip.scss, so that #tab_list
  attributes now apply to the #tab_bar, in the process we drop the
  duplicated width property and reorder the attributes.
- Replaces all mention of #tab_list with #tab_bar in JS files.
2020-07-13 15:39:36 -07:00
YashRE42 632f62c8b6 navbar: Remove padding-top from #tab_bar CSS because it defaults to 0.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base. This commit pushes us towards that goal by simplifying
the future merge of the two CSS labels.
2020-07-13 15:39:36 -07:00
YashRE42 a050061494 navbar: Drop letter spacing from #tab_bar in CSS.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base. This commit pushes us towards that goal by simplifying
the future merge of the two CSS labels.

The letter-spacing attribute was set to its default value and so we
remove it and rely on the default.
2020-07-13 15:39:36 -07:00
YashRE42 f0882e8539 navbar: Remove unnecessary overflow attributes from #tab_bar CSS.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base. This commit pushes us towards that goal by simplifying
the future merge of the two CSS labels.

Currently the #tab_bar is just a container for the #tab_list and the
 #tab_list handles the overflow attributes and so these do not serve
any purpose.
2020-07-13 15:39:36 -07:00
YashRE42 e4f1dfe80b navbar: Remove height attribute from #tab_bar CSS.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base. This commit pushes us towards that goal by simplifying
the future merge of the two CSS labels.

We have the same selector within #tab_list and the duplication is
unnecessary.
2020-07-13 15:39:36 -07:00
YashRE42 437b9a1a90 navbar: Refactor >:nth-last-child(2) style to use scss nesting. 2020-07-13 15:39:36 -07:00
YashRE42 87c9d527ef navbar: Add comment in scss explaining the nth-last-child(2).
Ideally we would not be relying on something that requires a 4 line
comment, and also makes it harder to add more static elements at the
end of the navbar, but this block should be acceptable for now.

One alternate would be a "grow-1" class or similar but we might need
to think that through.
2020-07-13 15:39:36 -07:00
YashRE42 bf91dad438 navbar: Simplify narrow_description conditional in hbs template.
Previously, we had the entire div within the conditional, instead of
just the contents, which were the only variable elements.

This change moves the conditional over just the contents of the div
and improves readability.
2020-07-13 15:39:36 -07:00
YashRE42 25765faf58 navbar: Live update sub_count.
Previously, the navbar sub count would not live update as users
subscribed or unsubscribed, this commit adds the relevant calls in
stream events.

It would have been better to just have a single call within
server_events_dispatch but it seems difficult due to the way of
mark_subscribed and mark_unsubscribed are structured.

stream_events.mark_unsubscribed conditionally calls
subs.update_settings_for_unsubscribed which calls
subs.rerender_subscriptions_settings and as such handles the update
for the subscriptions modal on its own. Hence, we simply rely on the
stream_data.update_calculated_fields to ensure the subscriber counts
are updated and make a call to
tab_bar.maybe_rerender_title_area_for_stream(sub).

stream_events.mark_subscribed is similar.
2020-07-13 15:38:15 -07:00
YashRE42 0667925c93 refactor: Extract maybe_rerender_title_area_for_stream(modified_sub).
Previously, we had the lines from this block being duplicated in all
the stream update paths, which is a little brittle.

Hence, in this commit, we extract it out with a comment explaining
what it does and call it in all the duplicated spots.
2020-07-13 15:36:53 -07:00
Gittenburg 53c66fd9c4 message_header: Fix date alignment in PMs.
My previous message_header fix
0b4568d249
accidentally changed the alignment of dates in private messages (so that
it was inconsistent to the alignment in other narrows).
2020-07-13 13:26:54 -07:00
sahil839 fff7fe21cb stream_edit: Use narrow_state.stream_sub instead of narrow_state.stream.
We use narrow_state.stream_sub instead of narrow_state.stream to directly
get the sub object instead of stream name, while subscribing to a stream
from the stream narrow.
2020-07-13 13:09:17 -07:00
sahil839 a0d2c7db16 stream_data: Modify is_user_subscribed to use stream id.
This commit changes stream_data.is_user_subscribed to use stream id
instead of stream name.
We are using stream ids so that we can avoid bugs related to live
update after stream rename.
2020-07-13 13:09:17 -07:00
Ryan Rehman 14c869d803 message send: Update failed message ui on re-send success.
We have logic in place to update the ui for re-sending messages
on recieving the acknowledgement from the server on that API call.

However, if the acknowledgement is recieved through the get events
request before the `on_success` of `resend_message`, the message
gets re-rendered allowing the failed message actions to be clickable.

Now, we update the ".message_failed" ui for both cases. This helps
in preventing the "Trying to get local_id from row that has reified
message id" exception.

Fixes #15351.
2020-07-13 12:29:33 -07:00
Aman Agrawal 55f80a2502 recent_topics: Don't render topic of deactivatedstreams.
Fixes error when trying to render topic of a deactivated stream in
the Recent Topics widget.
2020-07-13 11:22:43 -07:00