Commit Graph

969 Commits

Author SHA1 Message Date
Lalit 91d3a480b6 ts: Migrate `fetch_status` to TypeScript.
Extended the type `RawMessage` which represents the message object received from
the server, now it matches correctly with the OpenAPI schema for it.
2023-05-31 13:31:12 -07:00
Anders Kaseorg 5b07bf767b landing-page: Add Microsoft Store download link.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-31 08:16:59 -07:00
Aman Agrawal 634a771a37 hotkey-hint: Fix text not middle aligned at different zoom levels.
* Remove `box-sizing` and `min-width` properties which have no
  effect on `inline` positioned element. Modified class selector to
  add `span` which reflects this while reading the CSS.

* Remove `2px` vertical padding and `line-height` which combined
  are fighting for space??
2023-05-31 00:23:57 -07:00
Tim Abbott 3c60e538f9 people: Downgrade late added user errors for spectators.
As noted in the comment, this condition is expected to happen for
spectator users.
2023-05-30 20:45:18 -04:00
Aman Agrawal a47d204ca0 stream_ui_updates: Only update UI if the stream is being edited.
If the stream settings is open but the stream which was
subscribed/unsubscribed wasn't open (say user unsubscribed
from a different tab), `$settings_button` would
be `undefined` here.
2023-05-30 14:50:24 -07:00
Aman Agrawal 086db7621c css: Use a variable to track bottom_whitespace height.
Since we want the same space in recent topics to display the
compose box without overlapping with any other topics, it makes
sense to use a common variable.
2023-05-30 12:41:08 -07:00
Aman Agrawal 839af9ed8d compose: Update `max-height` when compose banner is displayed.
Othwersie, compose banner will overlap with any breadcrumbs
we have below the last message when user is fully scrolled up
and compose is at max-height.
2023-05-30 12:41:08 -07:00
Aman Agrawal 7706d64530 resize: Extract method to get bottom whitespace.
Minor optimization to reduce left sidebar and right sidebar
calculation when we just want to update bottom whitespace height.
2023-05-30 12:41:08 -07:00
Aman Agrawal 0f4bccd107 recent_conversation: Make all topics visible with compose open.
Fixes #25751
2023-05-30 12:41:08 -07:00
Aman Agrawal 43b83588c9 recent_conversation: Move padding to filter buttons.
This removes it from being included in the max-height of the table.
2023-05-30 12:38:17 -07:00
Aman Agrawal e2ac125a6d recent_conversation: Fix incorrect min-height dimension. 2023-05-30 12:36:40 -07:00
Karl Stolley d720ce4b4e popovers: Register mobile compose tooltip on button container.
This ensures that the click event on the mobile `+` button for
showing the compose tooltip is registered on a different element
from the tooltip for showing the `C` shortcut menu.
2023-05-30 12:27:20 -07:00
Lauryn Menard 892c5f48f7 narrow: Mark as read when narrowing `by_topic` or `by_recipient`.
In commit a93598c22e, we removed, in `narrow.by_topic` and
`narrow_by_recipient`, calls to `unread_ops.notify_server_message_read`
because that would have marked messages as read for users who had
set their preference in the web-app to never mark messages as read.

We add those calls back now, but with a check for that user setting.
2023-05-30 12:26:36 -07:00
Lalit 56463ce921 ts: Convert `internal_url.js` to TypeScript. 2023-05-30 10:45:01 -07:00
Karl Stolley 30b7da34e0 css: Size stream recipient box for small screens.
This allows the recipient box to take 100% of the available
horizontal space, up to 175px. The effect is that the
compose-box buttons are available to users at mobile scales
(viewports of 400px wide or less).
2023-05-30 10:39:25 -07:00
Anders Kaseorg 3ca131743b CVE-2023-33186: Fix topic tooltip cross-site scripting vulnerability.
Commit 903dbda79b (#25370) introduced a
cross-site scripting vulnerability in the tooltips for the stream and
topic in the recipient bar.  An attacker who can send messages could
maliciously craft a topic for the message, such that a victim who
hovers the tooltip for that topic in their message feed triggers
execution of JavaScript code controlled by the attacker.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-29 16:35:49 -07:00
Sahil Batra 200d43d4cd alerts: Fix vertical alignment of "x" button.
This commit fixes the vertical alignment of "x" button in the
alert to be more closer to the center. We can still improve it
by probably using something like flexbox layout instead of
hard coding paddings or margins.
2023-05-29 14:49:32 -07:00
Sahil Batra 7f4f905ec8 message: Show error while resolving/unresolving topic.
We were not showing the error, if any, when resolving and
unresolving the topic using topic popover in left sidebar
or using the banner in compose box. This commit adds code
to show the error in the message feed where we show other
errors like connection error, etc.
2023-05-29 14:49:32 -07:00
Zixuan James Li 7a5d3e164e linkifier: Remove unused debug message.
This is a follow-up to #23125.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-05-29 14:40:55 -07:00
Aman Agrawal ecc1433d02 compose_recipient: Improve post recipient selection behaviour.
This moves selection of the correct input box / textarea to
a `on_hidden_callback` of dropdown widget, which also allows us
to just simplify `on_compose_select_recipient_update` to only
call `switch_message_type` when necessary so that it doesn't
interfere with setting focus.
2023-05-29 08:59:18 -07:00
Aman Agrawal f3aeabaeec dropdown_widget: Add a on_hidden_callback. 2023-05-29 08:59:18 -07:00
Aman Agrawal 51a7c94b9c compose_recipient: Extract `update_recipient_label`. 2023-05-29 08:59:18 -07:00
Aman Agrawal 230b3f075b scroll_bar: Fix overlapping right sidebar and browser scrollbars.
Fixes #25779

We move the simplebar scroll on the right sidebar to a little left
when there is an overlay scrollbar present so that user can drag
either of them.
2023-05-29 08:50:06 -07:00
Sahil Batra 4724d45abd settings: Rename "Full name" label to "Name" in bot modals.
This commit renames "Full name" label to "Name" in bot creation
and bot edit modal.
2023-05-29 08:47:09 -07:00
Aman Agrawal ea9992d853 overlays: Use `close_overlay` to close overlays!
It is unusal to use a hack to close overlays when there is a method
to do it.

This fixes a bug where user is unable to scroll message feed
after opening an overlay and then using browser back button.

This could have easily cause other bugs too.
2023-05-29 08:29:47 -07:00
Aman Agrawal db26f2b2fc resize: Use autosize on window resize.
This fixes a bug where reducing the height of the window, reduces
the size of textarea and doesn't instroduce scrollbars, making
the textarea not scrollable.
2023-05-29 08:12:34 -07:00
Aman Agrawal 9c2ffaf1b3 message_list_view: Fix incorrect comparison.
`this` is MessageListView here while `message_lists.current` is
MessageList.
2023-05-29 08:06:00 -07:00
Aman Agrawal a1ba41ce66 message_list_view: Discard unused variable. 2023-05-29 08:06:00 -07:00
Tim Abbott 1f8b3fd09a css: Fix fluid_layout_width setting.
0457f6807c seems to have accidentally
inverted the setting; we also clean up duplicate declarations of this
1400px value.
2023-05-28 22:06:16 -07:00
Alya Abbott c97deb6be2 help: Tweak docs on keyboard shortcuts for composing messages.
- Adjust the order in keyboard shortucts help menu and help center.
- Make minor wording improvements.
2023-05-28 19:18:34 -07:00
Palash Baderia f46f557109 tippy: Add delay for recipient bar icons.
This commit adds a long hover delay [750,20] to recipient bar icons.
Doing this prevents the situation when the tippy tooltips are left
floating when the icons suddenly disappear as you enter the topics
according to the organization settings and the references are removed.
Adding an additional delay ensures that the icons disappear and then
the tooltips appear.
2023-05-28 15:22:07 -07:00
Karl Stolley e54f920549 alert_box: Maintain alert-box position despite scrolling.
Fixes #25791.
2023-05-28 15:21:00 -07:00
Aman Agrawal 8654f839b5 overlays: Stop document from occupying the extra scrollbar width.
When overlay / modal is displayed, scrollbar is hidden due to
the disabled scrolling on `html`. Reduce width of fixed elements
that will be visible in background and `html` so that they don't
occupy that extra space.

Also, I was over-thinking how we can get the scrollbar width. The
moment we allowed scrolling on `html`, it was easy to get the
scrollbar width.
2023-05-28 15:20:20 -07:00
Aman Agrawal 0457f6807c scroll_bar: Use a CSS class to toggle fluid layout. 2023-05-28 15:16:08 -07:00
Aman Agrawal d03e72bc0e message_viewport: Rename `message_pane` variable. 2023-05-28 15:16:08 -07:00
Aman Agrawal 46a4964633 message_list_view: Minor optimization. 2023-05-28 15:16:08 -07:00
Aman Agrawal 2c8a5ac751 message_list_view: Only update scroll position for current msg list. 2023-05-28 15:16:08 -07:00
Karl Stolley 052e6655b5 css: Remove superflous background color on date row.
This fix prevents the active-message outline from being obscured
under certain conditions, such as when setting a browser to zoom
out at 90% or less.

Suggested-by: Anders Kaseorg <anders@zulip.com>
2023-05-28 15:08:05 -07:00
Aman Agrawal 067ce35fb1 popovers: Use fixed position for all popovers.
I manually verified that they were working correctly.
2023-05-27 08:04:45 -07:00
Aman Agrawal 6a5cfd2c05 popovers: Fix popovers not being hidden on scrolling. 2023-05-27 08:04:45 -07:00
Aman Agrawal 61f7ede43c hashchange: Never set empty hash `#` in URL.
Setting empty hash `#` scrolls user to the top of message feed if
done via `window.location.hash` or using browser back / forward button.

To avoid this, we set don't set `hash` after org URL for default view
when user uses `escape` key or clicks on org logo.

In other situations, we explicitly set the hash of the view.
2023-05-26 16:28:45 -07:00
Josh Yap 6b77499286 settings: Link to user card in new stream/group tables.
When creating new streams or groups, open up user card when
a user's name is clicked on. This behavior now matches
other settings tables elsewhere.

Fixes #25725.
2023-05-26 09:55:01 -07:00
Aman Agrawal a55c1ab2da server_events_dispatch: Remove body fade out on changing theme.
This causes the app to scroll to top and causes slow paint.
2023-05-26 09:40:24 -07:00
Anders Kaseorg 03a0a7abc6 shared: Avoid replaceAll again.
The JavaScript engine used by zulip-mobile on Android is still some
four years out of date, apparently.

This reverts commit a3d6c47b7d (#25734)
and part of commit 54f90e41c0 (#25554).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-25 22:39:12 -07:00
Karl Stolley 199567228a unread_marker: Style as subtle linear gradient. 2023-05-25 17:43:38 -07:00
Lalit 38dd1de5b2 ts: Convert `compose_textarea.js` to TypeScript.
Added type definitions for `jquery-caret-plugin` third party package and
converted `compose_textarea.js` to TypeScript.
2023-05-25 17:33:18 -07:00
evykassirer 932bbac04c drafts: Darken background in drafts and scheduled message overlays. 2023-05-25 17:22:23 -07:00
Karl Stolley 060c95dda6 compose_box: Explicitly set topic bar text color. 2023-05-25 17:19:29 -07:00
Karl Stolley 42e0d72b67 compose_box: Maintain consistent dropdown height.
This commit keeps the height of the dropdown consistent, even when
it's adjacent a multiline collection of pills in a group DM.

It also keeps the righthand buttons and narrows top-aligned, too.

Additional markup and CSS ensures that the < marker always stays
vertically centered with respect to the dropdown.
2023-05-25 17:19:29 -07:00
Karl Stolley 4df04f1032 compose_box: Correct topic input-box height.
While this commit achieves what the subject advertises (fixing the
input box's height to match the recipient drop-down), but it does
so by relying heavily on flexbox's behavior to manage the height
of the elements and vertical centering, where necessary, rather
than positioning hacks or vertical padding.

This commit also removes some additional styles that do not make
sense (e.g., `min-width: 0`) or that need not be set.
2023-05-25 17:19:29 -07:00