Commit Graph

2559 Commits

Author SHA1 Message Date
Steve Howell e8ad76f522 subscribers: Fix misleading placeholder text.
You don't start auto-completing user groups with an @,
so the previous placeholder text made no sense.

There might be a better way to do autocomplete in
these add-subscriber input pills, but that is beyond
the scope of my current efforts.
2022-02-15 17:15:02 -08:00
jai2201 44bd6cafb7 js: Add tabindex attribute for anchor tag to allow focus.
This adds tabindex='0' in anchor tags for allowing the message menu
popover box to be focusable using hotkey 'i' through keyboard.

This is a necessary follow up to
729c09074a, which removed the href
attribute from anchor tags to which click-handlers were attached,
which resulted in making them non-focusable as jQuery doesn't allow
anchor tags to be focusable without tab-index or href attribute.

Fixes #21125.
2022-02-14 15:23:46 -08:00
Aman Agrawal 2421f6846d compose_control_buttons: Move GIF button out of the popover. 2022-02-13 19:13:29 -08:00
jai2201 2281adc101 left-sidebar: Make subscription link non-sticky. 2022-02-11 14:28:09 -08:00
Tim Abbott c674d4cac0 templates: Fix indentation formatting of input_pull.hbs. 2022-02-11 13:58:02 -08:00
YashRE42 96682a3517 status_emoji: Show status emoji in compose_pm and mentions typeaheads.
Previously the emoji_status set by the user would only be seen in a
few places, it was decided that it would be useful to show the
emoji_status in a couple of other additional places as well.

As such this commit uses the status_emoji template to show the status
emoji in the compose_pm typeahead and the mentions typeahead.

Status emoji changes do not live update these, but neither do user
renames, so there's bigger problems if that's a concern.

Fixes: #19865.
2022-02-11 13:30:08 -08:00
YashRE42 fa7c8f8c32 status_emoji: Show status emoji in compose_pm pills.
Previously the emoji_status set by the user would only be seen in a
few places, it was decided that it would be useful to show the
emoji_status in a couple of other additional places as well.

As such this commit uses the status_emoji template to show the status
emoji in the compose_pm pills. Due to the fact that we use the same
pills system to render in the user_group, we need to add a
conditional to prevent rendering there since the user status is not
valuable there.

Status emoji changes do not live update these, but neither do user
renames, so there's bigger problems if that's a concern.
2022-02-11 13:30:08 -08:00
AnushaNathRoy 8da5edb7af status_emoji: Show status emoji in message_body.
Previously the emoji_status set by the user would only be seen a few
places, it was decided that it would be useful to show the
emoji_status in a few additional other places as well.

Use the status_emoji template to show the status emoji in the
message_body and also implement live update behavior.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-11 13:02:56 -08:00
AnushaNathRoy e1fd47a692 status_emoji: Show status emoji in single PMs in the PM list.
Previously the emoji_status set by the user would only be seen in the
buddy list, it was decided that it would be useful to show the
emoji_status in other places as well.

As such this commit uses the status_emoji template to show the status
emoji in the PM list and also implements live update behavior.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-12 01:06:52 +05:30
Mr.mad 22bfa56301 left sidebar: Redirect users with no stream create permissions.
Previously, when the user clicked the `Add streams` icon in the
streams list sidebar, we provided a popover offering to create or
subscribe.  This was confusing for users who did not have permission
to create streams.

Redirect users that don't have stream creation permissions
directly to browse streams without going through this popover.

Fixes: #20676.
2022-02-11 11:02:09 -08:00
Tim Abbott a6c364cdd7 left sidebar: Rename streams_inline_cog.
The icon hasn't been a cog for some time.
2022-02-11 10:58:32 -08:00
jai2201 67625d6c7b message_feed: Remove the parenthesis around edited notices.
They were found to not particularly improve the UI.

Fixes #21043.
2022-02-10 13:52:24 -08:00
Aman Agrawal bf3bf285a2 recent_topics: Hide mute and read buttons for spectators. 2022-02-10 11:37:38 -08:00
Anders Kaseorg a800a86f54 Revert "drafts: Use simplebar."
This reverts commit 8e06335788 (#21048).

It regressed the ↑ and ↓ keys because drafts.drafts_scroll was not
updated to use ui.get_scroll_element.  Also, styling the native
scrollbar as hidden is not the right workaround because the hidden
native scrollbar still exists and can be scrolled independently of the
SimpleBar.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-09 14:15:27 -08:00
Parth e3ddd662ab message_editing: Fix topic edit propagate option cut-off.
In the topic changing UI, the 'Change later messages to this topic'
and other options in the drop down were cut off when selected in some
languages like Russian.

Make the selection box width adjust appropriately according to the
length of the text, and also place it on its own line unconditionally.
users.

With tweaks by tabbott to use the same approach we already use in the
"Move topic" modal to have the bottom margin for the color block match
that of the dropdown_list_widget itself, of having them share CSS.

Fixes #19739.
2022-02-09 14:06:49 -08:00
Julia Bichler 8e06335788 drafts: Use simplebar. 2022-02-09 10:38:30 -08:00
Sahil Batra 518024e826 stream_settings: Use button element for button used to change stream permission.
We use button element instead of <a> element for the button used to change
stream permission. This change fixes the focus problem where the container
was focussed when closing the permission modal.

The problem here was because Micromodal focuses the element which was just
focused before opening the modal, on closing the modal. And in this case the
focused element before opening the modal was the "simplebar-content-wrapper"
element as <a> tah without href is not focusable element.

Related issue - #20223.
2022-02-09 10:20:47 -08:00
Tim Abbott 729c09074a js: Avoid href="#" for buttons with a JavaScript click handler.
As seen in
https://chat.zulip.org/#narrow/stream/9-issues/topic/edit.20history.20bug/near/1320430,
clicking such a link takes you to the user's default view if the click
handler throws an exception before doing preventDefault().

There hrefs also have the negative effect of having your browser claim
that clicking the link will navigate you to the default view, which it
won't.

Comes with a linter rule to prevent future instances, since it seems
there are some recently added ones, though they are likely the result
of copy/paste.
2022-02-08 17:38:12 -08:00
AnushaNathRoy 5e05dcbc8f status_emoji: Extract status emoji template.
Currently the emoji_status set by the user is only seen in the buddy
list, it would be useful to show the emoji_status in other places as
well.

As such this commit does the prep work of extracting a template which
will be used in all places that need to show the status emoji.

With refactor and minor edits by Yash RE.

Co-authored-by: YashRE42 <33805964+YashRE42@users.noreply.github.com>
2022-02-08 16:52:49 -08:00
YashRE42 768a133715 status_emoji: Modify centering technique for .selected_emoji.
Currently, the emoji_status set by the user is only seen in the buddy
list, it would be useful to show the emoji_status in other places as
well.

As such this commit does the prep work of decoupling the
selected_emoji style in user_status.css from the .status_emoji
style... by having it always override the value of "top".
2022-02-08 16:52:49 -08:00
Steve Howell 35d1d326c9 subscribers: Move new_stream_users template. 2022-02-08 15:21:45 -08:00
Steve Howell e205d54796 subscribers: Extract add_subscribers_form template. 2022-02-08 15:21:45 -08:00
Aman Agrawal e1e9708ea8 compose: Remove keyboard focus from stream color block.
This make `shift-tab` from stream input to `compose_top_right`
buttons directly possible.
2022-02-07 22:23:13 -08:00
Aman Agrawal d2a96e905c compose: Reorder compose_top_right buttons in DOM.
User should be able to tab from topic/pm input to textarea and back.
Moving `compose_top_right` button before the stream, topic and PM
input structurally in DOM but keeping them visually in the same
place, allows us to do so.
2022-02-07 22:23:13 -08:00
Anders Kaseorg b0ce4f1bce docs: Fix many spelling mistakes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-02-07 18:51:06 -08:00
Aman Agrawal 6c0f513569 compose: Move time icon out of popover on narrow widths.
We have some extra space to do so.
2022-02-07 09:46:19 -08:00
Aman Agrawal 42d5f51a4c compose: Move help link beside formatting buttons.
We advertise it as message formatting button with `Aa` icon
instead of `?` help icon.
2022-02-07 09:46:19 -08:00
Aman Agrawal bed77a0a76 compose: Add drafts beside formatting buttons.
We hide the drafts button on small screen sizes since it overflows
the window on some languages like Russian.
2022-02-07 09:46:19 -08:00
Aman Agrawal c827c73783 right_sidebar: Add realm description for spectators. 2022-02-04 16:00:59 -08:00
Austin Riba 81b1b18886 lightbox: Prevent undesired closing of lightbox during pan.
This commit adds a method of marking an overlay as being meant to be
left open despite click events triggering that would normally close it.
This is to prevent the case where a user drags an image and "unclicks"
in an area where normally clicking would close the overlay.
2022-02-04 14:58:36 -08:00
Austin Riba 5f83bc5cfe lightbox: Replace lightbox_canvas with PanZoom library.
This PR changes how the Pan & Zoom feature of images displayed in the
attachment lightbox are handled.

The existing method of using a canvas element is replaced by the Panzoom
library (timmywil/panzoom). This library is lightweight and has 0
transitive dependencies.

This fixes #20759 where the issue is that the viewport of a zoomed image
was not expanding to fill the available space on the page. Switching to
this new library also solves several other UX issues:

    * Images are no longer blurred when in Pan & Zoom mode.
    * The zoom behavior itself uses focal point zooming: zooming occurs
      where the cursor is on the image instead of at the center of the
      image, reducing the need for extra panning.
    * CSS transitions are used for a more visually pleasing experience
      when switching images, toggling zoom off, etc.
    * The library has the potential to open other file types which
      leaves that option open for us in the future.
2022-02-04 14:58:36 -08:00
Aman Agrawal acbfdb1c36 compose: Use flexbox to align items in compose top right.
This will help us align components on compose box top better
on small screen sizes.

We also center align the compose_top elements.
2022-02-02 10:04:38 -08:00
Aman Agrawal 1f812df0d2 compose: Use tippy to show tooltips for top right compose icons. 2022-02-02 10:02:49 -08:00
Priyam Seth 17f74a3f57 compose: Show warning while composing to a resolved topic.
This commit creates the function warn_if_topic_resolved that checks if
the topic to which the user is composing is resolved or not. First it
checks if the stream exists and then if the topic name starts with the
RESOLVED_TOPIC_PREFIX. If the conditions are true, a warning banner is
shown to the user.

It also shows to the user a button to unresolve the topic, if he has
the permission to do so.

Fixes #20584.
2022-02-01 17:50:17 -08:00
Tim Abbott 4989a300f8 message_edit: Fix internationalization of edited notices.
The previous internationalization approach didn't support languages
with a different word order than English.

We also switch to using "moved" to explain topic/stream moves,
consistent with how the message feed explains it.
2022-02-01 14:09:19 -08:00
somesh202 2b10f958bb message-edit-history: Show the edited stream in the edit history.
Previously, message edit history never displayed stream moves.

Fixes #20452.
2022-02-01 12:22:46 -08:00
jai2201 38003408cb settings: Make authentication settings more like other panels.
This may still needs further work to replace the table with a more
standard implementation.

Fixes part of #21001.
2022-02-01 11:28:27 -08:00
Sahil Batra 8565aad3fa stream_settings: Fix color of icon of the title in right column.
This commit fixes two things -

- We use the exact same color that is used for stream name in
day mode.

- Previously, we were passing black color explicitly to the
stream_privacy_icon template. This commit changes it to pass
different color in the night mode which is the same used for
stream name in night mode.
2022-02-01 11:25:01 -08:00
Aman Agrawal b4075b78eb message_feed_errors: Don't show search public stream to spectators.
Fixes #20299.
2022-01-31 17:12:03 -08:00
Aman Agrawal f00db27b64 message_feed_errors: Convert to handlebars. 2022-01-31 17:10:05 -08:00
Aman Agrawal 8f2e973ab2 message_list_view: Cleanup unused bookend code.
`bookend_top` is already defined firmly for `group` in
`add_subscription_marker`, so no need to redefine it.

`bookend_bottom` is no longer used anywhere in the codebase. Not
sure what the history is here.
2022-01-31 16:50:54 -08:00
Aman Agrawal 93a03dcf3a message_list_view: Mark trailing bookend using a new variable.
We need to mark trailing bookends differently to identify them
in DOM easily. This fixes a bookend replication bug which can
happen sometimes when rendering.
2022-01-31 16:42:46 -08:00
Tim Abbott 6065d66d3d bookend: Simplify can_toggle_subscription variable flow. 2022-01-31 16:39:16 -08:00
Aman Agrawal 0ce2ae1782 bookend: Use it to advertise recent topics for spectators.
We show a minimal text "Browse recent topics" at the end of
every narrow. This will help new users to find additional
content on the app.

Fixes #19844
2022-01-31 16:32:09 -08:00
Aman Agrawal 0a614fe985 bookend: Move conditional bookend content inside the template.
We move the stream subscribed/unsubscribed bookend info from
js files to bookend handlebar.

Tweaked by tabbott to override the check-templates indentation logic.
2022-01-31 16:32:09 -08:00
Anders Kaseorg 90e202cd38 docs: Consistently hyphenate “web-public”.
In English, compound adjectives should essentially always be
hyphenated.  This makes them easier to parse, especially for users who
might not recognize that the words “web public” go together as a
phrase.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-01-28 17:45:45 -08:00
Sahil Batra 12efde8a51 stream-settings: Refactor code to pass sub object to title template.
This commit refactors the code to directly pass sub object to
selected_stream_title template instead of passing name, is_web_public
and invite_only as different parameters.
2022-01-28 11:39:15 -08:00
Aman Agrawal 38e044173d login_to_access: Remove icons for login buttons.
They don't serve the purpose of adding clarity to button.
2022-01-28 08:30:56 -08:00
Sahil Batra 7265a76fc6 stream-settings: Show icon according to in the right column title.
We were showing # for all types of streams in the title at the top
in the right column of stream settings overlay. This commit fixes
it to show globe icon for web-public streams and lock icon for
private streams.
2022-01-26 12:50:05 -08:00
Ganesh Pawar 49e9cf10de user_status: Migrate modal to dialog_widget. 2022-01-21 16:17:25 -08:00