Commit Graph

2434 Commits

Author SHA1 Message Date
Prakhar Pratyush a22f637769 typing_indicator: Replace private with direct in 'message_type' field.
This commit replaces the value `private` with `direct` in the
`message_type` field for the `typing` events sent when a user
starts or stops typing a message.
2023-10-10 17:15:28 -07:00
N-Shar-ma 5817da709c compose: Refactor and generalise functions for formatting.
The logic for formatting code is generalised to make it reusable for
multiple styles of formatting (added in the next commits).

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-10-10 16:54:33 -07:00
N-Shar-ma e24689a1ce compose: Rename formatting methods and arguments for generalisation.
This is a prep commit for extracting general functions for adding and
removing formatting.
2023-10-10 16:54:33 -07:00
N-Shar-ma 6537004ae9 compose: Move bold formatting code into separate functions.
This is a prep commit for refactoring formatting code to make future
format button additions need minimal code duplication.
2023-10-10 16:54:33 -07:00
Anders Kaseorg b396573acf hello: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:51:14 -07:00
Anders Kaseorg 2163cb7770 popovers: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:48 -07:00
Anders Kaseorg 0006f4a90c audible_notifications: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:07 -07:00
Anders Kaseorg 41c64ee8bb audible_notifications: Add missing $ prefix to parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:50:07 -07:00
Anders Kaseorg 340b0a1181 compose_call: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:48:57 -07:00
Anders Kaseorg 71ac1c880b page_params: Fix alphabetical order of page_params type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 16:48:57 -07:00
Karl Stolley b19986b777 left_sidebar: Use custom Zulip star icons.
This commit replaces all previous Font Awesome references in the
left side bar and relevant popovers with the custom Zulip star
icon.

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-10-10 16:48:20 -07:00
Karl Stolley fd0dd3acd8 left_sidebar: Refactor left_sidebar.hbs structures for readability.
This commit renames the classes and IDs in the views area
(formerly global filters) to a set of flexible values all
prefixed in some way with `left-sidebar-navigation`.

This is meant to make the styles and structures in the area
more readable, while also keeping things flexible into the
future as this area's elements change.

Co-Authored-By: Hardik Dharmani <Ddharmani99@gmail.com>
2023-10-10 16:48:20 -07:00
Hardik Dharmani 7e776b9c76 refactor: Make variable for unread counter's background colors.
This is Prep commit that introduces 2 new CSS variable
`--color-background-unread-counter` and
`--color-background-unread-counter-popover-menu` that has value
`hsl(105deg 2% 50% / 50%)` in dark theme and `hsl(105deg 2% 50%)`
in light theme for unread counter and `hsl(200deg 100% 40%)`
for unread counter in popover menus to match its blue theme.
2023-10-10 16:48:20 -07:00
Hardik Dharmani a61d291ca4 left_sidebar: Correct the color of BACK TO STREAMS in dark theme.
This is a Prep commit. This commit fixes the color of
`BACK TO STREAMS` label in the dark theme to be equal to other labels
in left sidebar such as `STREAMS` label.
2023-10-10 16:48:20 -07:00
Aman Agrawal 3498b07379 modals: Rename open_modal to open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 1d4797834e modals: Rename close_modal to close. 2023-10-10 16:43:57 -07:00
Aman Agrawal c809abf07f modals: Rename close_modal_if_open to close_if_open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 0c7184aaa0 modals: Rename close_modal_active to close_active. 2023-10-10 16:43:57 -07:00
Aman Agrawal d54a917104 modals: Rename is_modal_open to is_open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 577a384845 overlays: Extract modal methods in separate file. 2023-10-10 16:43:57 -07:00
Aman Agrawal 6713ad9d4d overlays: Extract function checking if overlays or modals are open. 2023-10-10 16:43:57 -07:00
Aman Agrawal 63c1c9a37a overlays: Extract enable / disable scrolling to a util module. 2023-10-10 16:43:57 -07:00
Aman Agrawal 065420853f overlays: Fix spelling. 2023-10-10 16:43:57 -07:00
Anders Kaseorg 325b308ed5 about_zulip: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 13:20:31 -07:00
Aman Agrawal ce48aac3db inbox: Fix stream name wrapping to next line. 2023-10-10 13:06:46 -07:00
Aman Agrawal e4252f8f08 settings_config: Change order of option for default view.
Inbox > Recent conversations > All messages
2023-10-10 13:06:46 -07:00
Aman Agrawal 3a2fbfc2fd inbox_ui: Fix mute / unmute not working.
This is fix for the old version of mute / unmute buttons.
Code borrowed from click_handlers.
2023-10-10 12:47:42 -07:00
Anders Kaseorg 881da05cd3 stream_settings_ui: Extract stream_settings_components module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 12:09:15 -07:00
Aman Agrawal 22f4ecdad6 message_fetch: Don't use MessageList to fetch data for recent view.
Since load_messages now supports fetching data with only
MessageListData, we can just use it and avoid calling
MessageListView which also caused our polls and TODO widgets to
not render occasionally.
2023-10-10 11:11:19 -07:00
Aman Agrawal 69e10b4dae message_fetch: Handle MessageListData directly passed to load_messages.
This will allow us to use load_messages to fetch data using it
without initializing a MessageList.
2023-10-10 11:11:19 -07:00
Karl Stolley 88f4ecc943 compose_banner: Restore CSS overzealously removed in #27097.
This also includes a comment for future contributors, explaining
why these styles are necessary.
2023-10-10 10:01:11 -07:00
Anders Kaseorg 521cb15a07 stream_ui_updates: Cut import of stream_settings_ui.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 09:08:53 -07:00
Anders Kaseorg b9bb0d5aa8 settings_org: Cut import of settings_realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-10 09:06:28 -07:00
Anders Kaseorg 1d43a4cccb stream_edit: Extract toggler to new stream_edit_toggler module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 23:19:59 -07:00
Anders Kaseorg 3cac29a8e1 settings_org: Extract settings_components module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 17:26:49 -07:00
Aman Agrawal 9ab1a726a0 inbox: Add page up/down support similar to recent topics.
Leaving page up / down to browser doesn't work very well due to
our custom header, filters and compose.
2023-10-09 16:36:24 -07:00
Aman Agrawal 9fc6af220e inbox: Handle latest message not fetched when replying.
Since inbox is populated based on unread data which is part
of /register request, it is possible that we don't have the
actual message in our message_store. In that case, we return
a fake message object.
2023-10-09 16:36:24 -07:00
Aman Agrawal 2c4156e239 compose_reply: Remove unnecessary pm_recipient being set.
`pm_recipient` is already set in `else` case unconditionally,
so setting it early is not required.
2023-10-09 16:36:24 -07:00
Aman Agrawal bb740ca65e inbox: Fill compose with dm/stream info for `reply` on inbox-header. 2023-10-09 16:36:24 -07:00
Aman Agrawal 2561e7f2d8 inbox: Set compose recipient according to focused row on `reply`.
Fill compose recipient based on the latest message of the focused
row.
2023-10-09 16:36:24 -07:00
Aman Agrawal 50a356389c inbox: Update closed compose text based on focused element.
For header rows, search and filters we just show default text.
2023-10-09 16:36:24 -07:00
Aman Agrawal 3ac6f447d9 inbox_ui: Change current_focus_id when clicking on inbox search. 2023-10-09 16:36:24 -07:00
Aman Agrawal 64cc24722f inbox_ui: Rename function to reflect it only works for focus in list. 2023-10-09 16:36:24 -07:00
Aman Agrawal 3cbd772b8d inbox: Make focus outline around unread count wider. 2023-10-09 16:36:24 -07:00
Aman Agrawal 80a7e995af inbox: Fix spelling mistakes.
Found a good spell checker, hopefully no more of those.
2023-10-09 16:36:24 -07:00
Aman Agrawal e9c86dc524 inbox: Add topic visibility indicator. 2023-10-09 16:36:24 -07:00
Aman Agrawal 8c619d6938 inbox: Rename variable for readability. 2023-10-09 16:36:24 -07:00
Aman Agrawal 49f553ebfc inbox: Add rectangle focus border around inbox header name. 2023-10-09 16:36:24 -07:00
Anders Kaseorg 50928314f2 settings_users: Remove get_status_field.
It’s effectively unused since commit
2d5c678614 (#25061), as predicted by
commit d45f0171cb (#14919).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 16:05:31 -07:00
Anders Kaseorg 95b9d6f7e2 settings: Move set_settings_header to settings_panel_menu.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 16:04:30 -07:00
Aman Agrawal 9abc2cb3fd signup: Add link to redirect user to login page in the form. 2023-10-09 14:36:54 -07:00
Anders Kaseorg 8f564749bb dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 14:16:23 -07:00
Anders Kaseorg 835ee69c80 docs: Fix grammar errors found by mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 13:24:09 -07:00
Anders Kaseorg 4cb2eded68 typos: Fix typos caught by typos.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:55:16 -07:00
Anders Kaseorg 7b4a74cc4d codespell: Fix typos caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:55:15 -07:00
Karl Stolley eea59e2edc compose_banners: Hide upload progress banner on error. 2023-10-09 11:55:01 -07:00
Karl Stolley d887fb57e7 compose_banners: Better align action and cancel buttons.
This uses the banner message's line-height to set a
max-height on the action and cancel buttons to maintain
a consistent vertical spacing.

Additional uses of flexbox here:

1. help the button to remain shorter when it's adjacent a
   single-line banner message, and
2. center the closing X icon relative to the current size
   of the action button, when one is present
2023-10-09 11:55:01 -07:00
Karl Stolley fe8fc98912 compose_banners: Structure innner <p> elements with .banner_message class.
This also styles those inner .banner_message elements to lose
margin inherited from Bootstrap. (This is now also applied to
the upload-message banner.)

It's better to achieve that with a class selector; using a `p`
element selector would mean that such a style would be evaluated
for all `<p>` elements in the DOM. Which is of course a whole lot,
thanks to Markdown alone.

Fixes: #26922
2023-10-09 11:55:01 -07:00
Karl Stolley 1581c6f847 compose_banners: Add .banner_content to elements that need it. 2023-10-09 11:55:01 -07:00
Karl Stolley 3fdf85872e compose_banners: Remove unnecessary upload-message styles. 2023-10-09 11:55:01 -07:00
Tim Abbott 756b465b47 bootstrap: Remove last vestiges of bootstrap-tooltip library.
Everything but this sliver of CSS has been deleted previously as part
of our migration off Bootstrap.
2023-10-09 11:39:12 -07:00
Aman Agrawal c69fe4b6a0 popover: Remove `.popover` class.
Since we are not using bootstrap popover, we don't have popovers
with that class.
2023-10-09 11:39:12 -07:00
Aman Agrawal 8430674aee popovers: Remove unused popover-content class.
Fixes #26821
2023-10-09 11:39:12 -07:00
Aman Agrawal a04117b6d3 user_group_info_popover: Remove bootstrap popover classes.
Added a `group-info-content` inplace of them and added the required
CSS.
2023-10-09 11:39:12 -07:00
Aman Agrawal 04c4b6e8b8 giphy: Move `popover-content` styles to `giphy-scrolling-container`. 2023-10-09 11:39:12 -07:00
Aman Agrawal 094ac010fb user_card_popover: Remove popover content class.
Added CSS styles that were removed due to this back. No visual
changes.
2023-10-09 11:39:12 -07:00
Aman Agrawal ce656da8d7 emoji_popover: Remove popover-content div.
`popover-content` class had no effect on emoji popover since
it was resetting `padding: 0` and background color was
already applied by tippy theme.

In short, removing `popover-content` had no visual changes.
2023-10-09 11:39:12 -07:00
Aman Agrawal 5cd2b0ed86 giphy: Remove old comment.
Destroying popover_instance is now part of how tippy popovers work.
2023-10-09 11:39:12 -07:00
Aman Agrawal 0976b9006e popover-title: Remove class.
Remove bootstrap-tooltip class `popover-title` from code.

It was only used in user_card_popover for showing user avatar,
so cleaned up properties that were duplicated or not required.
2023-10-09 11:39:12 -07:00
Anders Kaseorg b9fe1947f8 navigate: Move scroll_to_selected to message_viewport.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Anders Kaseorg 18bdfde9e7 recent_view_ui: Cut import of unread_ops.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Anders Kaseorg 95785739ac navbar_alerts: Move resize_app to resize.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 11:32:16 -07:00
Sahil Batra 7ffdeecd86 styles: Remove CSS for ".modal-header".
We do not use "modal-header" on any elements now, so
we can remove the redundant CSS rules defined for it.
2023-10-09 11:25:26 -07:00
Sahil Batra 747b62d050 bootstrap: Remove code for bootstrap modals.
We use micromodal library for all the modals now and thus
we no longer require the bootstrap modal code.
2023-10-09 11:25:26 -07:00
Sahil Batra 37d12250ed modal: Re-add required bootstrap CSS for ".modal-body".
This commit adds the required bootstrap CSS rules for
".modal-body" elements to modal.css so that we can remove
them from bootstrap.css.
2023-10-09 11:25:26 -07:00
Sahil Batra 5e263fc4ed subscriptions: Re-add bootstrap CSS for modal-footer elements.
We use "modal-footer" class in stream and user group creation form
and this commit adds bootstrap CSS rules for it to subscriptions.css
so that we can remove the CSS from bootstrap.css.
2023-10-09 11:25:26 -07:00
Prakhar Pratyush 5b7014e7d6 server_history: Prevent concurrent requests for the same stream_id.
This commit updates the 'get_server_history' function to return
early if a request is already in progress for a given stream_id,
thus preventing concurrent requests for a single stream_id.

We maintain a set 'request_pending_stream_ids', which contains all
the stream IDs for whom requests are in progress.

Using this set, we return early.

Fixes #26915.
2023-10-09 11:17:03 -07:00
N-Shar-ma 0cdb54cf65 compose: Ensure cursor is scrolled into view after content is inserted.
This fixes the bug where on pressing enter after the last line in a
textarea, the cursor would go to the new line but the textarea would
not scroll it into view unless more was typed. This was observed on
chromium browsers.

A new function `insert_and_scroll_into_view` is added to `compose_ui.js`
which blurs and refocuses the textarea after inserting the content, then
autosizes the textarea.
2023-10-09 11:13:53 -07:00
Aman Agrawal acdae9eae2 reload: Don't reload on 403 error for spectators.
Fixes #26280
2023-10-09 11:00:33 -07:00
Aman Agrawal 8299506e7a reload: Handle early attempts at reload when loading the app.
Trying to preserve state when app modules like message_lists
haven't been init results in errors.
2023-10-09 11:00:33 -07:00
Anders Kaseorg 5327bcc5ac user_group_settings_ui: Merge into user_group_edit.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 10:58:50 -07:00
Anders Kaseorg 63b4e74cea views_util: Cut import of narrow.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-09 10:54:00 -07:00
Aman Agrawal e8ced3e74a hello: Fix google analytics not working.
Since GA was only imported in portico bundle which we don't use
in hello page due to bootstrap, GA was not loaded.
2023-10-08 17:30:02 -07:00
Anders Kaseorg 70748181da recent_view_ui: Cut import of user_card_popover.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:45:13 -07:00
Anders Kaseorg 27991bd5b0 topic_zoom: Merge into stream_list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:43:55 -07:00
Anders Kaseorg a43ea3efaa pm_list: Cut import of topic_zoom.
topic_zoom.is_zoomed_in() can’t be true in pm_list.zoom_in, because
“more conversations” would not be visible in that state.  And it can’t
be true when pm_list.handle_narrow_activated calls pm_list.expand,
because “more topics” would not be visible in an all-DM view.  So the
only non-inert call is via click_handlers; move it there.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:43:55 -07:00
Anders Kaseorg 564e91f3a8 narrow: Cut import of hashchange.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 19:41:59 -07:00
evykassirer 4adfd57378 message_fetch: Rename batch size constants to specify narrow views.
This is in preparation for introducing a batch size constant for
the recent view.
2023-10-06 17:30:33 -07:00
Anders Kaseorg ba1895cb1c notifications: Rename to desktop_notifications.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg fcaf1fe7d5 notifications: Split out audible_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg 6ef08873d8 notifications: Split out compose_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg db20fd12e0 notifications: Split out message_notifications module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 16:22:40 -07:00
Anders Kaseorg e48771993b widgetize: Move widget registration to new widgets module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Anders Kaseorg 0c991d813f sent_messages: Lift event loop restarting to transmit.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Anders Kaseorg 339b1351f8 echo: Pass transmit.send_message as a callback.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 13:17:51 -07:00
Aman Agrawal b9dd4a14c9 hello: Write better variable names. 2023-10-06 12:51:57 -07:00
Aman Agrawal cbb09f4ee6 hello: Fix client logos not changing on hello page.
Since `zulip.com` doesn't has `/hello` in URL, the JS code
for hello page events was not running. We extract it to a new
file and just always run it.
2023-10-06 12:51:57 -07:00
Prakhar Pratyush b274169ccc util: Fix the 'find_wildcard_mentions' function.
The function considers @**all**, @**everyone**, @**stream**,
and @**topic** as wildcard mentions.

Earlier, the function didn't have a check to match @**topic**
in the message_content.
2023-10-06 11:38:37 -07:00
Aman Agrawal 1a867a43a7 left_sidebar_inbox_popover: Move to new popovers folder. 2023-10-06 11:24:40 -07:00
Aman Agrawal 115de0e847 inbox_ui: Fix unable to insert new stream.
There were 2 issues:
* Wrong format for creating new Map object used.
* Use of `topic_dict` instead of `topics_dict`, which resulted
in `stream_key` being present in `topics_dict` even after stream
has been marked as read. This made inbox believe that the
stream was already rendered even though it was not.
2023-10-06 10:50:34 -07:00
Anders Kaseorg 9dc1e8ed17 sent_messages: Finish .received → .saw_event rename.
Commit 3cc2adcd3b (#25423) missed this
in the rename, resulting in extra creation of no-op timers.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 10:49:42 -07:00
N-Shar-ma 4e9c1293e2 compose: Only save as draft when the compose state is about to change.
Up until now, we unconditionally saved any message content as a draft
whenever the composebox was `start`ed. This led to a lot of unnecessary
saving of drafts even when the composebox stayed undisturbed.

To fix this, now we only save the draft when the compose state is about
to be overidden, which is by either changing the recipient narrow or by
restoring another draft.

Fixes: #26976.
2023-10-06 09:22:41 -07:00
Aman Agrawal 895439ad83 register: Move style to css file. 2023-10-06 09:19:01 -07:00
Aman Agrawal e1b22a04e7 register: Fix for small widths. 2023-10-06 09:19:01 -07:00
Aman Agrawal 15e837ff25 org_registration: Fix page for mobile widths. 2023-10-06 09:19:01 -07:00
Lauryn Menard f19d7e36ee recipient-row: Remove logic for floating recipient bar.
In #23900, the floating recipient bar was replaced with a sticky
recipient bar. The logic in `id_for_recipient_row` was not updated
for that change, so we update that function to just get the first
message in the group and return that message ID.
2023-10-06 09:13:27 -07:00
Anders Kaseorg 971a003180 compose_actions: Extract compose_reply module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 09:07:43 -07:00
Aman Agrawal f85f904fc1 user_profile: Remove redundant call to popovers.hide_all.
`show_user_profile` is only triggered by clicks. Even `enter`
keypress is triggers a click via
`popover_items_handle_keyboard_with_overrides`.
2023-10-06 09:03:46 -07:00
Aman Agrawal 6cfb7239c8 popover_menus: Remove hide_all from on_show functions.
Since popovers only open after a click, all popovers hide already
if the clicks were outside them.
2023-10-06 09:03:46 -07:00
Aman Agrawal 4e4daf2ce5 overlays: Call open and close hooks for modals too.
Right now, the hooks only have a popovers.hide_all call but this
may need to audited when used in future. Added a comment to
that effect.
2023-10-06 09:03:46 -07:00
Aman Agrawal 3cbfe6f31f tests: Remove unnecessary mocks of recent_view_util.
Since is_visible was refactored to use a variable, these mocks
are not required.

Also, since is_visible return `false` by default, mocking it
to return false is not required.
2023-10-06 08:35:21 -07:00
Anders Kaseorg c56f784489 compose: Move update_email to compose_state.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 08:34:39 -07:00
Anders Kaseorg 833a15e121 compose: Move call button display functions to compose_call_ui.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 08:34:39 -07:00
Anders Kaseorg 9c70f92514 reload: Move initialize to new reload_setup module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 08:34:39 -07:00
Anders Kaseorg c4d338a6ab drafts: Extract drafts_overlay_ui module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-06 08:30:31 -07:00
Anders Kaseorg d5064fc7b2 narrow: Extract narrow_title module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 16:26:45 -07:00
Aman Agrawal f2a00c7b9d inbox: Render rows in sorted order.
Fixes #26962

We sort topic and dm data by latest_msg_id and render them.

For updates, we remove rows which for which latest_msg_id was
changed and them insert them again at the correct index.
2023-10-05 15:52:02 -07:00
Aman Agrawal 1d126078a2 unread: Add option to include max msg id in unread topic/dm data. 2023-10-05 15:52:02 -07:00
Aman Agrawal 57c1c56028 inbox: Migrate data objects to use Map.
Since Map store values in insertion order, it will be required
to show rows sorted by time.

This is not pretty but can be improved when
https://github.com/handlebars-lang/handlebars.js/pull/1996
is released.
2023-10-05 15:52:02 -07:00
Aman Agrawal ab1eb78c21 inbox: Fix incorrect dict being accessed.
topics_dict[stream_key] is a dict of topics and doesn't have
is_hidden property. We actually want to access streams_dict
here.
2023-10-05 15:52:02 -07:00
Anders Kaseorg dd584ba8a9 stream_settings_ui: Move set_color to stream_settings_api.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 15:32:04 -07:00
Alex Vandiver 62015a0b48 portico: Remove now-unnecessary twitter-tweet CSS and JS.
The content that this affected was removed in acd0c5568a.
2023-10-05 15:06:10 -07:00
Anders Kaseorg c4221332cd stream_color: Add missing $ prefix to set_colorpicker_color parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 14:52:13 -07:00
Anders Kaseorg e8a2a5ce36 compose: Move initialize to new compose_setup module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 14:42:19 -07:00
Anders Kaseorg 6e725f0d17 compose: Move call link insertion to new compose_call_ui module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 14:42:19 -07:00
David Rosa 13e1a389b0 help: Fix missing icons in "Stream permissions".
This brings back the icons in the legend for the Stream permissions
tables that disappeared somehow.
2023-10-05 12:11:51 -07:00
evykassirer c54ca567a9 typeahead: Only return early from blur if parentElement is specified.
From a bug reported here:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Typeahead.20fails.20to.20automatically.20close/near/1655321
2023-10-05 11:51:42 -07:00
Tim Abbott 3d804ef186 pm_list: Rename handle_narrow_deactivated.
It did the same thing as handle_narrow_activated when passed the
home_msg_list filter.

We still leave a renamed version for use by the inbox/recent views.
2023-10-05 10:31:23 -07:00
Tim Abbott 0a189119aa stream_list: Rename handle_narrow_deactivated.
It did the same thing as handle_narrow_activated when passed the
home_msg_list filter.

We still leave a renamed version for use by the inbox/recent views.
2023-10-05 10:31:23 -07:00
Tim Abbott 20b2323c67 left_sidebar: Deduplicate handle_narrow_deactivated.
handle_narrow_activated did the same thing is passed the home_msg_list
filter.
2023-10-05 10:31:23 -07:00
Tim Abbott 246139e1d0 narrow: Extract handle_post_view_change. 2023-10-05 10:31:23 -07:00
Tim Abbott 62fe1dcad1 narrow: Simplify compute_narrow_title for All messages.
filter.get_title() already returns "All messages" for the filter we
now pass in, which is the "in:home" operator defined by that view.
2023-10-05 10:31:23 -07:00
Tim Abbott 4465262bcb narrow: Pass a msg_list to handle_post_narrow_deactivate_processes. 2023-10-05 10:31:23 -07:00
Tim Abbott ab15462669 hashchange: Remove duplicate handle_narrow_deactivated call.
narrow.deactivate calls this directly.
2023-10-05 10:31:23 -07:00
Sahil Batra f88715cb2c signup: Use portico_modals module to handle modal on signup page.
This does not results in any behavioral or UI change, we just
use portico_modals module to open and close the modal instead
of directly calling functions like Micromodal.open and
Micromodal.close. This change also solves a bug where the
modal was not closed previously on clicking anywhere outside
the modal.
2023-10-05 09:28:27 -07:00
Sahil Batra 2df26f3d27 bootstrap-btn: Remove bootstrap CSS for ".btn-success" elements.
We used "btn-success" class only in user profile modal subscribe
widget and the CSS rules applied by bootstrap on this class were
overridden by other CSS. We also remove the btn-success class
since this is a bootstrap-specific class and we no longer
need it.
2023-10-05 09:28:27 -07:00
Sahil Batra cfc9dccb2a bootstrap-btn: Remove bootstrap CSS for ".btn-primary" elements.
We used "btn-primary" class only in integrations dev panel page
and this commit re-adds the CSS applied by this class in
integrations_dev_panel.css. We also remove the btn-primary class
since this is a bootstrap-specific class and we no longer
need it.
2023-10-05 09:28:27 -07:00
Sahil Batra cc4a6d08e7 development: Update modal in emails page to use micromodal.
We now use micromodal in the modal on dev server emails page to
make it consistent with other modals in the app and this is
preparatory work for moving away from bootstrap as well.
2023-10-05 09:28:27 -07:00
Sahil Batra 8710feb5dd billing: Update modal shown on license increase to use micromodal.
We now use micromodal in the license update modal on billing page
to make it consistent with other modals in the app and this is
preparatory work for moving away from bootstrap as well.
2023-10-05 09:28:27 -07:00
Sahil Batra 866b6cd632 portico: Add portico_modals.ts module.
This commit adds portico_modals.ts module which contains functions
for supporting modals in portico pages. The new module basically
contains code from functions in overlays.ts without the code
that is not needed currently for modals in portico pages.
2023-10-05 09:28:27 -07:00
Anders Kaseorg ac8436d46c resize: Move handler to new resize_handler module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 09:26:59 -07:00
Aman Agrawal c2c1f1ac6d inbox: Add icon in search box to clear any text. 2023-10-05 08:57:44 -07:00
Aman Agrawal b494424ffa inbox: Change hover / focus styles of search box.
This is to make search box less noticeable when focus is given / taken
away from it.
2023-10-05 08:57:44 -07:00
Aman Agrawal 5142f1279a popovers: Refactor show popovers as overlay on mobile widths.
This also fixes user_card_popover not being displayed as overlay
on mobile widths.
2023-10-05 08:29:12 -07:00
Anders Kaseorg 13d1241eed activity: Extract new activity_ui module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 08:27:30 -07:00
Anders Kaseorg 69ceff4995 settings_notifications: Cut import of stream_edit.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 08:22:56 -07:00
Anders Kaseorg 4ec78ee2d4 compose_recipient: Move selected_recipient_id to compose_state.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-05 08:21:33 -07:00
Aman Agrawal 75826d8409 handlebars: Move popover handlebars to a new popovers folder.
Organize related handlebars in a new folder together.
2023-10-05 08:19:49 -07:00
Aman Agrawal 95ee178d1a user_card_popover_content: Rename to remove `_content`. 2023-10-05 08:19:49 -07:00
Aman Agrawal a6f864a9a4 user_card_popover: Rename function name to avoid conflict.
This function name would have conflicted with
`render_user_card_popover_content` variable name once
we remove `_content` from it.
2023-10-05 08:19:49 -07:00
Aman Agrawal 3415a6898c user_card_popover: Rename `_title` suffix to `_avatar`. 2023-10-05 08:19:49 -07:00
Aman Agrawal 78543a7f12 emoji_picker: Merge templates.
Merge `emoji_popover.hbs` and `emoji_popover_content.hbs`.
2023-10-05 08:19:49 -07:00
Aman Agrawal 54233f0363 playground_links_popover: Rename to remove `_content`. 2023-10-05 08:19:49 -07:00
Aman Agrawal ecba66e613 compose_popovers: Rename to remove `_content`. 2023-10-05 08:19:49 -07:00
Aman Agrawal acd584c336 actions_popover: Rename template to remove `_content`. 2023-10-05 08:19:49 -07:00
Anders Kaseorg 4c11f49627 settings_notifications: Fix stream_settings_api namespace import name.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 23:57:16 -07:00
Anders Kaseorg eb6ac7bd98 settings_ui: Fix type and $ prefix of status_element argument.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 23:51:50 -07:00
Aman Agrawal 2ed1465b04 css: Display status emoji along with overflowing sender names.
Even if sender name overflows the available space, we should
show status emoji along with sender name by hiding the overflowing
part of sender name.
2023-10-04 16:49:39 -07:00
Anders Kaseorg 8d217847db stream_edit: Move can_remove_subscribers_group_widget to settings_org.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 16:35:24 -07:00
Anders Kaseorg 278bd52b4e stream_edit: Move get_request_data_for_stream_privacy to settings_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 16:35:24 -07:00
Anders Kaseorg d17c0dabc8 stream_data: Move stream_*_policy_values to settings_config.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 16:35:24 -07:00
Anders Kaseorg 0f0fd3f07d tests: Remove sub_store mock from recent_view test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 16:35:24 -07:00
evykassirer 083062cd11 search: Don't "initiate search" if it's already open.
(or if you're using a hotkey, since then we should select
the searchbar)

Reported here:
https://chat.zulip.org/#narrow/stream/9-issues/topic/search.20bar.3A.20selection.20jumping.20to.20whole.20query/near/1652562
2023-10-04 16:32:19 -07:00
Aman Agrawal 2ec8273c6e left_sidebar: Move all messages popover to inbox.
Also, renamed files and variables as needed.
2023-10-04 13:10:08 -07:00
Aman Agrawal dd1e06886c popover_menus: Remove unused class added to popover. 2023-10-04 13:10:08 -07:00
Aman Agrawal 4f881ee058 left_sidebar: Move unread count from all messages to inbox. 2023-10-04 13:10:08 -07:00
Aman Agrawal af03b9dd06 left_sidebar: Move `All messages` below `Recent view`. 2023-10-04 13:10:08 -07:00
Aman Agrawal 7da0e09d0a left_sidebar: Remove old comment.
Not sure what this means so removed.
2023-10-04 13:10:08 -07:00
Anders Kaseorg b4878d4f0b stream_edit: Move set_stream_property to new stream_settings_api module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 13:04:50 -07:00
Prakhar Pratyush 28fb5ea24d settings: Add UI for automatically follow and unmute topics settings.
This commit adds two drop-down settings in 'SETTINGS / NOTIFICATIONS'
and 'SETTINGS / DEFAULT USER SETTINGS'.

The new settings lie in a new section named "Topic notifications",
just below the "Noification triggers" section.

Label: "Automatically follow topics"
Options: "Topics I participate in", "Topics I send a message to",
"Topics I start", and "Never".

Label: "Automatically unmute topics in muted streams"
Options: "Topics I participate in", "Topics I send a message to",
"Topics I start", and "Never".

Fixes #25914.
2023-10-04 13:04:29 -07:00
N-Shar-ma 46b2d6d06a compose: Remove redundant code from scheduled_messages_ui.js.
We remove redundant code when editing a scheduled message in the compose
box, for resetting the compose box, as it anyway gets reset on calling
`compose_actions.start()`.

Besides ending `scheduled_messages_ui.js`'s dependency on `compose.js`
and `compose_ui.js`, this also fixes the bug where on editing a
scheduled message when there was content in the compose box, it would be
irretrievably lost. The old content is now drafted.
2023-10-04 12:54:36 -07:00
Anders Kaseorg 91f81d3962 flatpickr: Fix Tab key handler for 24-hour time.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-04 12:03:10 -07:00
Anders Kaseorg c98622c63a compose: Extract compose_call module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 18:41:42 -07:00
Anders Kaseorg ac38aaad21 scheduled_messages: Move UI to new scheduled_messages_ui module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 17:56:43 -07:00
Anders Kaseorg c7927569bc scheduled_messages_popover: Move selected_send_later_timestamp.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 17:56:43 -07:00
Anders Kaseorg b50e500dae scheduled_messages: Move update_send_later_options.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 17:56:43 -07:00
Anders Kaseorg 3e4def9c88 narrow: Don’t swallow errors in narrow.activate.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 14:52:07 -07:00
Anders Kaseorg 549bae5176 message_edit: Move get_upload_object_from_row to upload module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 14:50:02 -07:00
Anders Kaseorg fb19476c4e compose: Move uppy to upload module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 14:50:02 -07:00
Sayam Samal abece73c5a tooltips: Add hotkey hints and modify edit history tooltip.
This commit consists of the following visual changes:

- Add the hotkey hints in the tooltip of the view edit history option,
the shortcut (Shift + H) for which was added in PR #26245

- Swap "Click to view edit history." and the edit status string
(EDITED/MOVED/SAVING) to make the tooltip consistent with other
tooltips across the web app.

- Rename "Click to view edit history." to "View edit history", since
the "Click to view" part is evident from the icon as well as the the
keyboard shortcut hints.

Fixes #26581.
2023-10-03 14:37:47 -07:00
Sayam Samal 8d3f2baebf tooltips: Use <div> tags inside tooltip's inner content.
By replacing `<span>` tags with `<div>` tags inside the tooltip's inner
content we remove the redundancy of having to use break tags to
separate the tooltip's title and it's content.

We also replace any `<p>` tags with `<div>` tags for the following
reasons:

- Since what we want to achieve are just block elements in order to
avoid the break tags, using `<div>` tags provide use with a wider
scope of use cases.

- We don't want the pause, screen readers often introduce after reading
the contents of a paragraph.

- The `<p>` tag cannot contain tables and other block-level elements.

- The semantic meaning of the <p> tag doesn't apply to the commonly
used tooltip content.
2023-10-03 14:37:47 -07:00
Anders Kaseorg 9b6301c755 upload: Don’t leak an extra body event handler for each edited message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 14:10:15 -07:00
Anders Kaseorg 4595be29e8 stream_settings_ui: Remove set_muted wrapper.
stream_muting.update_is_muted will be called when the event comes back
from the server.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 12:49:36 -07:00
Anders Kaseorg 6e3d6f531f web: Fix namespace import names.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 12:21:06 -07:00
Anders Kaseorg 4d67bf5605 compose: Delete obsolete comment.
Commit 57340a888c (#19003) separated it
from the variable it was commenting, and commit
8ced075643 (#22754) changed that to a
different variable, so I infer that nobody thought this documentation
was important.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 12:20:01 -07:00
Anders Kaseorg d4a93aa05a popover_menus: Extract compose_popovers module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:29 -07:00
Anders Kaseorg d01db0f5a0 popover_menus: Extract left_sidebar_navigation_area_popovers module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:29 -07:00
Anders Kaseorg dd6676f16e popover_menus: Extract user_topic_popover menus.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:29 -07:00
Anders Kaseorg 825fb8cef5 popover_menus: Extract topic_popover module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:29 -07:00
Anders Kaseorg 16e2a32c4c popover_menus: Extract message_actions_popover module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:29 -07:00
Anders Kaseorg 26e34a163e popover_menus: Extract scheduled_messages_popover module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 11:58:22 -07:00
Ujjawal Modi 0e5bb92111 settings: Improve UI for displaying reactivated and deactivated users.
Earlier when a user is deactivated or reactivated from users
table and deactivated_users table the `Role` column was modified.

This commit changes this and now `Role` column is not modified
instead now the corresponding row is greyed out.

Fixes #21653.
2023-10-03 11:15:39 -07:00
Ujjawal Modi ba1405df96 settings: Live update tooltip in users and deactivated users table.
Earlier tooltip shown on hovering to activate and deactivate user
button in users and deactivated_users table does not live update
when user is deactivated or reactivated.

This commit makes changes to do the live update.
2023-10-03 11:15:39 -07:00
Ujjawal Modi 7453ea61bb settings: Remove title from button in users and deactivated_users table.
This commit removes the `Reactivate` and `Deactivate` title on hovering
to activate and deactivate button in users and deactivated_users table.
This was done as we already show tippy tooltip on hover.
2023-10-03 11:15:39 -07:00
Aman Agrawal be1bd91b96 stream_list: Remove popovers.hide_all in click event.
Fixes #26992
2023-10-03 10:05:07 -07:00
Aman Agrawal ce94e616ca stream_popover: Remove redundant call to popovers.hide_all.
build_stream_popover is only called via a click.
2023-10-03 10:05:07 -07:00
Aman Agrawal 4111c5dd12 user_group_popover: Remove redundant call to popovers.hide_all.
`toggle_user_group_info_popover` is only called via a click.
2023-10-03 10:05:07 -07:00
Aman Agrawal 97d85e3666 settings_user: Remove popovers.hide_all in click event. 2023-10-03 10:05:07 -07:00
Aman Agrawal b680112944 search: Remove popovers.hide_all in click event. 2023-10-03 10:05:07 -07:00
Aman Agrawal 8970786048 read_receipts: Remove unnecessary popovers.hide_all call.
Read receipts can either hide by clicking or pressing escape
button. Since clicking already hides popovers and escape keypress
call `popovers.hide_all` separately, we don't need to call
it again.
2023-10-03 10:05:07 -07:00
Aman Agrawal aae09ed6b7 message_edit_history: Remove popovers.hide_all in click event. 2023-10-03 09:58:29 -07:00
Aman Agrawal cbef6f79a5 echo: Remove popovers.hide_all in click event. 2023-10-03 09:58:29 -07:00
Aman Agrawal 10fe3baa45 click_handlers: Remove `popovers.hide_all`.
Since tippy popovers hide on click outside themselves, we don't
need call `popovers.hide_all` separately for them.
2023-10-03 09:58:29 -07:00
Aman Agrawal 6ef03498a9 popover_menus: Fix enter keypress not working on some popovers.
Fixed for message actions popover, stream popover, topic
popover and maybe others.
2023-10-03 09:57:43 -07:00
Eeshan Garg f3465dea08 demo-orgs: Add UI for converting to permanent organization.
Adds warning banner to the organization settings overlay/tabs
for demo organizations. For owners, clicking on the link in the
banner opens a modal to convert the demo organization into a
permanent organization.

For admins that are not owners, clicking on the link will go
to the help center article on demo organizations.

Non-admin users will not see the warning banner.

The modal for converting a demo organization requires the owner
to have set their email address. Once the owner's email address
is set, then the organization can be made permanent by changing
the subdomain of the organization. The deletion date for the
demo organization will be removed as part of updating the
subdomain.

The organization owner must also have updated the organization
type to be any value other than unsepecified to convert the
demo organization to a permanent organization. The modal's
submit button will be disabled if that is the value for the
organization type in the form. The demo organizations created
in the dev environment now have their organization type set to
unspecified on creation.

This is a part of #19523.

Co-authored by: Lauryn Menard <lauryn@zulip.com>
2023-10-03 09:11:41 -07:00
Lauryn Menard de4e369ece demo-orgs: Update demo organization navbar alert text and links.
Updates the demo organization navbar alert for the deletion deadline
to link to the help center doc for converting it to a permanent org.
Also removes the "Hide notice" text since the "X" close button is
sufficient for users who want to close the notice.
2023-10-03 09:11:41 -07:00
Lauryn Menard ca5d1c1265 tests: Update events and schemas for scheduled message events.
Updates the testing for scheduled message event schemas to be fully
checked by `zerver/tests/test_events.py` and `tools/check-schema`.

Adds the missing 'failed' field to the scheduled message events
in `web/tests/lib/events.js` as well.
2023-10-03 09:05:22 -07:00
Prakhar Pratyush 3b56e0f5ca topic_popover: Fix the wiggle on hovering visibility policy buttons.
On hovering the not-selected option in the left sidebar
topic popover widget to change visibility policy, a wiggle
effect was observed.

This commit fixes the wiggle effect.
2023-10-03 09:00:46 -07:00
Prakhar Pratyush 30166758da icons: Update the icons for Unmute and Follow. 2023-10-03 08:18:39 -07:00
Aman Agrawal 8291883739 ui_init: Initialize add stream options popover.
I forgot to check it :3.
2023-10-03 08:17:31 -07:00
Aman Agrawal 30152f77a9 settings_org: Change text for inaccessible announcement stream. 2023-10-03 08:17:31 -07:00
Aman Agrawal d3588c7559 activity: Hide right sidebar when narrowing to a user via enter press.
Fixes #26989
2023-10-03 08:17:06 -07:00
Aman Agrawal 35b854131e stream_list: Hide popovers when activating narrows on enter press. 2023-10-03 08:17:06 -07:00
Anders Kaseorg ad7d908069 user_group_ui_updates: Merge into user_group_edit module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:16:09 -07:00
Anders Kaseorg 46be4d230c user_group_create: Move create_user_group_clicked.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:16:09 -07:00
Anders Kaseorg 5efbece30a stream_color: Extract update_stream_color to new module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:15:21 -07:00
Anders Kaseorg 0efd9f7bdd settings_users: Extract user sort comparators to new user_sort module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:14:51 -07:00
Anders Kaseorg 30ae936793 settings_invites: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:14:11 -07:00
Anders Kaseorg 15de51d727 settings_invites: Remove pointless global state from do_resend_invite.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:14:11 -07:00
Anders Kaseorg f8d42a6789 settings_invites: Remove pointless global state from do_revoke_invite.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-03 08:14:11 -07:00
Aman Agrawal 0b5e45d1a7 lightbox: Validate urls before before using them. 2023-10-02 22:39:02 -07:00
Aman Agrawal b443916da1 lightbox: Replace image with media.
Since lightbox can also play videos now, replace image with media.
2023-10-02 22:39:02 -07:00
Aman Agrawal 3a507b5752 lightbox: Add support for playing video. 2023-10-02 22:39:02 -07:00
Aman Agrawal 6fb7a64cd0 rendered_markdown: Fix video thumbnail not present in Safari. 2023-10-02 22:39:02 -07:00
Aman Agrawal 8ef52d55d3 markdown: Add support for inline video thumbnails. 2023-10-02 22:39:02 -07:00
Tim Abbott cb1de9092d bootstrap: Remove now-unused carousel plugin. 2023-10-02 22:30:03 -07:00
Tim Abbott 72942c6bb9 portico: Delete now-unused tour,carousel,testimonials CSS.
These components were removed with the /hello redesign.
2023-10-02 22:30:03 -07:00
Aman Agrawal 75a1a74adf hello: Redesign page.
Fixes #24082
2023-10-02 22:30:03 -07:00
Tim Abbott 7a97ceab86 popovers: Extract add_stream_options_popover.js. 2023-10-02 19:17:08 -07:00
Tim Abbott 56f7319d51 message_lists: Fix import cycle from how home is initialized. 2023-10-02 19:17:08 -07:00
Aman Agrawal af170a82f6 popovers: Simplify any_active.
Remove unused functions along with it.
2023-10-02 19:17:08 -07:00
Aman Agrawal 1d62abee61 popovers: Simplify hide_all.
Since we only have tippy popovers now, functions calling
not_hide_tippy_instances have been removed.

Also, all of emoji_picker, stream_popover, user_card etc popovers
are tippy popovers so calling hideAll is enough to hide them all.
2023-10-02 19:17:08 -07:00
Aman Agrawal e957603fb9 sidebar_ui: Hide sidebars when user clicks outside them. 2023-10-02 19:17:08 -07:00
Aman Agrawal 1a8320dc8e sidebar_ui: Track sidebar's expanded state using variable. 2023-10-02 19:17:08 -07:00
Anders Kaseorg 91e656398d settings_muted_users: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 19:15:03 -07:00
evykassirer e578773ac9 compose: Update recipient placeholder when topic input changes. 2023-10-02 17:50:30 -07:00
Anders Kaseorg c5c5b18ab4 settings_exports: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:49:36 -07:00
Anders Kaseorg e459b83c06 pm_list_dom: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:48:39 -07:00
Anders Kaseorg 961c7185ab vdom: Fix types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:48:39 -07:00
Anders Kaseorg fcd8395eb5 bulleted_numbered_list_util: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:46:56 -07:00
Anders Kaseorg 819a91aec7 alert_words_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:46:22 -07:00
N-Shar-ma 681180ee86 compose: Migrate `empty_topic_placeholder` to `compose_state`.
This makes it so that `drafts.js` now no longer imports `compose.js`.
2023-10-02 17:45:27 -07:00
Tim Abbott e87b9955c9 compose: Simplify drafts interface for message content.
Previously, we had logic to update the compose box state living in the
drafts module, for no particularly good reason.
2023-10-02 17:45:27 -07:00
Sahil Singh 7ecb63c332 drafts: Pass draft_id to compose_actions.start as part of compose_args.
This will allow us to remove some duplicated compose box code that was
previously inside restore_draft.

Co-authored-by: N-Shar-ma <bablinaneh@gmail.com>
2023-10-02 17:45:27 -07:00
Anders Kaseorg 67f2bc030f ui_init: Move update_invite_user_option to sidebar_ui.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:37:56 -07:00
Anders Kaseorg 457544e0d2 message_scroll: Move state flags to new module message_scroll_state.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:37:56 -07:00
Anders Kaseorg 73507ee2ae inbox_util: Move is_in_focus to inbox_ui.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 17:37:56 -07:00
Anders Kaseorg 919381e5e7 copied_tooltip: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 15:36:23 -07:00
Anders Kaseorg 6e0f9df188 copied_tooltip: Remove incorrect $ prefix from non-jQuery variable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-10-02 15:36:23 -07:00
Satyam Bansal 8b7a650370 integration-url: Disable "Copy URL" button when topic input is empty.
Fixes #26797.
2023-10-02 12:29:42 -07:00
Satyam Bansal 51e2030f7b integration-url: Migrate integration typeahead to dropdown widget.
Fixes part of #26797.
2023-10-02 12:29:42 -07:00
Satyam Bansal 66e3a68acb integration-url: Rename stream dropdown item click callback.
This is a prep commit to migrate integration input to dropdown
widget.
2023-10-02 12:26:43 -07:00
Aman Agrawal 4c57b3f289 popover_menus: Set correct instance as undefined.
This caused a bug where input keys were not working since
`compose_mobile_button` was always set.
2023-10-02 12:07:05 -07:00
evykassirer 605c4688b1 buddy list: Show self in search results.
We should search for what the user asked us to search for.
CZO conversation:
https://chat.zulip.org/#narrow/stream/101-design/topic/search.20buddy.20list.20for.20self/near/1630454

This commit also stops the user from being at the top of
the search list, so that the search list is fully
alphabetical (though still sorted by online status).

We switch to not having the user at the top of the list
only when there's search text in the search bar, otherwise
there'd be a visual jump that would happen just by opening
the search bar. There's almost always visual change when
entering text into the search input field, so that seems
like the time to change the sorting.
2023-10-02 12:05:42 -07:00
Karl Stolley 35e4be0b68 message_grid: Properly align elements in media-only messages. 2023-10-02 09:20:10 -07:00
Ryan Song 6a9aa54406 node tests: Add test for popover_menu_data.js. 2023-10-02 09:17:39 -07:00
palashb01 2ca1c0c63e settings: Decrease the gap between the account heading and banner.
This commit fixes the alignment of account-alert-notification-banner
by using a new classname 'account-alert-notification' for this specific
banner, removed the default margin-top and margin-left from this banner
which is set to all other banners, and Aligned the banner with
vertical-align property set to middle.

To left-align this specific banner when the email is long enough
to wrap to the next line removed the margin-left and used a new
classname 'account-settings-heading' for the accounts heading,
and gave a margin-right of 10px to ensure that the notice banner and
the heading have enough space between them, when the email is short.

If the email is long enough to wrap to multiple lines, then the gap
between the email input field and the banner is too low. To adjust
this, set the margin-bottom to 10px.
2023-10-01 17:54:22 -07:00
palashb01 89970eabeb settings: Wrap the content in the alert notification banner.
This commit fixes the issue where, if the content inside the alert
notification banner is long enough, it will wrap inside the alert
banner.

To prevent the email from spilling over in the notice,added the
'overflow-wrap' property set to 'anywhere'.

Fixes: #23653
2023-10-01 17:54:22 -07:00
Tim Abbott 4143dac95e muted_users_ui: Move functions to more appropriate modules. 2023-10-01 16:55:21 -07:00
Tim Abbott 9283da57f0 hash_util: Extract hash_parser.ts.
This allows these functions to be used by modules that need this code
and cannot import people.ts without creating import cycles.
2023-10-01 16:55:21 -07:00
Tim Abbott 1aea88fac1 spectators: Move build_login_link out of hash_util.ts. 2023-10-01 16:55:21 -07:00
Prakhar Pratyush 247d4626a0 recent_view: Show 'followed topics in muted streams' in recent view.
Earlier, followed topics in muted streams were not listed in
the 'Recent conversations' table when 'Include muted' filter is
unchecked.

They should be listed as we currently list unmuted topics.
2023-10-01 09:27:11 -07:00
Prakhar Pratyush d07d436b46 recent_view: Update the stale comment mentioning the 'hidden' field.
The 'hidden' field was removed in e8cc9da.

This commit updates the stale comment.
2023-10-01 09:27:11 -07:00
Prakhar Pratyush ef16f1cb23 recent_view: Fix the muted topic being tested in spectator view.
The "test_filter_all" includes tests for muted and not muted topics,
but the 'is_spectator' field is set to 'true'.

Logically, it is incorrect because a topic can't have a
visibility policy set in spectator view.

This commit fixes the incorrect behavior and adds a separate test
for the case 'is_spectator=true'.

The issue was introduced in d0a697f.
2023-10-01 09:27:11 -07:00
Aman Agrawal 08bf7efeb8 inbox: Don't set focus to inbox search by default.
Set focus inbox list, focus on search if list is empty.
2023-09-29 14:34:56 -07:00
Aman Agrawal c5f8a72631 inbox: Rename set_default_focus. 2023-09-29 14:34:56 -07:00
Aman Agrawal 0ad47b5d09 inbox: Focus on entire row instead of stream name on `show`. 2023-09-29 14:34:56 -07:00
Aman Agrawal c471e82e37 inbox: Make set_list_focus readable.
No change in behaviour.
2023-09-29 14:34:56 -07:00
Aman Agrawal d7451ac456 inbox: Fix left arrow navigating to unread count for inbox-row.
If you focus on inbox-header name by right arrow then down and then
left, it will focus on unread count instead of ellipsis icon.

Hard to explain how this fixes the bug here, next commit adds
explanatory comments to the function.
2023-09-29 14:34:56 -07:00
Aman Agrawal e79f5e11bd inbox: Use a variable to track left and right navigation keys. 2023-09-29 14:34:56 -07:00
Tim Abbott 1a15e07bf4 user_group_popover: Fix buggy user sort order.
This was caused by a typo and would have been naturally fixed when
moving this file to typescript.

Fixes #25963.
2023-09-29 13:04:22 -07:00
Aman Agrawal d574129a29 user_profile: Move init call to ui_init. 2023-09-29 11:59:51 -07:00
Aman Agrawal bdd991dc67 stream_popover: Move init call to ui_init. 2023-09-29 11:59:51 -07:00
Aman Agrawal 4243347db7 sidebar_ui: Move some related event handlers here. 2023-09-29 11:59:51 -07:00
Aman Agrawal 4d4a747b91 flatpickr: Fix misspelled variable name. 2023-09-29 11:59:51 -07:00
Aman Agrawal 2b8784935f popovers: Separate out sidebar visibility check from any_active.
We check popovers.any_active and visibility of popovers separately
since sidebars are not actually popovers.
2023-09-29 11:59:51 -07:00
Hardik Dharmani c12d249627 message_list_hover: Fix hover edit button visibility on new messages.
This commit resolves an issue where the edit button was not visible
during message hover for new messages. The problem occurred when a
message was sent after the hover event, resulting in the hovered
message being a local copy with the `locally_echoed` attribute set
to true. This caused the `is_message_editable_ignoring_permissions`
function to return false, subsequently causing `is_content_editable`
to return false as well. As a result, the `is_content_editable`
argument was false, leading to the edit button not being displayed.

The issue was caused due `$current_message_hover` being set to the
locally echoed version of `$message_row`. When the message was
successfully sent and the message was rerendered, the `message_hover`
function was called again on the properly sent message row.

However, the conditional check `($current_message_hover &&
rows.id($current_message_hover) === id)` returned true because
`$current_message_hover`, set to the locally echoed version, had the
same ID as the actual `$message_row`. Consequently, this condition
returned true at the start of the `message_hover` function,
preventing further execution of message_hover function and,
consequently, the updating of hover buttons.

To address this, an `else if` condition was introduced to check if
the message is locally echoed. If true, the function is terminated
to prevent `$current_message_hover` from being set to the locally
echoed version of `$message_row` until the message is sent correctly.

Once the message is sent correctly, the `message_hover` function is
executed again, setting `$current_message_row` to the properly sent
version of `$message_row`, and resulting in updating of hover buttons.

Fixes #25312
2023-09-28 18:07:26 -07:00
Hardik Dharmani bae28dfe64 message_list_hover: Extract module for hover/unhover logic.
Remove the various message-hover related functions from ui_init.js and
put them in a new module.
2023-09-28 18:07:26 -07:00
Karl Stolley ec8e6c2179 compose_banners: Explicitly target banner content, child p.
This ensures uniform display and flexing of different bits of
banner content, including:

* Banners like Sent! Scroll down to view...) that have only a
  classless `<p>` marking their content
* Banners like the unscheduled message allert, which puts a
  .banner_content class right on the paragraph
* Banners like the Your message was sent to a stream you have
  muted", which tuck a `<p>` into a div with the .banner_content
  class
2023-09-28 17:06:49 -07:00
N-Shar-ma 7ef3ce9e8b todo_widget: Use colon `:` as task and description display separator.
Uptil now, a dash `-` was used to separate the task from its (optional)
description. But a colon `:` was used in the `/todo` command syntax to
indicate where the task ends and it's description starts.

To make the separator symbol consistent for both the syntax and widget,
`:` is used for both. It was chosen over `-` as `:` is encountered less
often in normal language, and so accidental usage of it when using the
`/todo` command syntax is less likely. It is also is impossible to
confuse with the bullet list syntax which is allowed for tasks.
2023-09-28 16:03:03 -07:00
N-Shar-ma e537195a85 todo_widget: Do not sort alphabetically and by status of completion.
Earlier the tasks in a list were sorted alphabetically and on marking
one complete, it was pushed under any incomplete tasks. This behaviour
can be unexpected and confusing, so now each task is appended to the
bottom of the list on being added, and no shifting takes place on
marking it completed.

Fixes part of #20213.
2023-09-28 15:53:13 -07:00
Tim Abbott 925077c036 user_card_popover: Fix incorrect import after rebase.
4ee515a245 was rebased past this
function moving modules.
2023-09-28 15:34:03 -07:00
Hardik Dharmani 7721100378 bot_settings: Use same copy icon across the app.
The bot settings avatar row was using `fa-clipboard` icon. Changed
the icon to use `{{> copy_to_clipboard_svg }}` SVG icon that is used
everywhere else in the app as copy icon.
2023-09-28 15:15:57 -07:00
Hardik Dharmani 4ee515a245 user_profile_modal: Abbrevate long URLs of custom fields.
Abbreviated long URL for custom field in the user profile modal
and user card popover. Added a copy-to-clipboard icon at
the end of the URL. When hovering over the copy button, it displays
a tippy tooltip with the text `Copy URL`. Clicking the copy button
displays a `Copied` tippy tooltip for 1 second.

Fixes #21680
2023-09-28 15:15:57 -07:00
Hardik Dharmani f27adec02d refactor: Rename `custom_profile_fields_link` to use kebab-case.
This is a prep commit. This commit renames
`custom_profile_fields_link` to `custom-profile-fields-link`
to follow kebab-case, which is the preferred style in Zulip.
2023-09-28 15:15:57 -07:00
N-Shar-ma 57c0b597f5 typeahead: Allow automatic insertion/removal of bulleting/numbering.
When the user is typing a numbered / bulleted list in the compose box,
on pressing Enter the list syntax will be inserted automatically on
a new line, and removed if Enter is pressed after an empty line.

Fixes: #20305.
2023-09-28 15:05:34 -07:00
N-Shar-ma 836363b0f5 compose: Add button to format numbered lists.
A formatting button below the compose box can format the selected text
by numbering or unnumbering the selected (partially or completely)
lines. The behaviour is inspired by GitHub's bulleted list formatting.

Fixes part of: #20305.
2023-09-28 15:05:34 -07:00
N-Shar-ma 3c0a6d8ee3 compose: Add button to format bulleted lists.
A formatting button below the compose box can format the selected text
by bulleting or unbulleting the selected (partially or completely)
lines. The behaviour is inspired by how GitHub's bullet list format
button works.

Also adds a new breakpoint for showing vdots for formatting buttons.

Fixes part of: #20305.
2023-09-28 15:05:34 -07:00
Aman Agrawal 9232a45fc2 inbox: Move focused row to visible area on scroll.
This will also work for page up/down naturally.
2023-09-28 14:23:42 -07:00
Aman Agrawal d79a51b3f2 inbox: Extract is_element_visible. 2023-09-28 14:23:42 -07:00
Aman Agrawal 6f6e83d2e2 message: Remove ineffective `auto-select` class.
The internal design here was that we had no-select on the outer
element and auto-select on these inner elements to override it.

But, `auto-select` class seems to have no effect so we are
removing it.
2023-09-28 14:26:21 -05:00
Aman Agrawal 1d697c344b message_avatar: Don't allow direct selection.
Use can no longer copy the avatar directly unless starting from
somewhere outside the `recipient_row` like date divider.
2023-09-28 14:26:21 -05:00
Aman Agrawal 3838561b05 message_body: Allow sender name to be selected.
This also blocked /me messages from being selected.
2023-09-28 14:26:21 -05:00
Aman Agrawal e7a3a44e35 util: Implement is_valid_url more correctly, with tests. 2023-09-28 12:22:44 -07:00
Aman Agrawal 7b252572b0 navbar: Stop restricting max-width of org name at 1170px window width.
This was unnecessary as tested manually.
2023-09-28 09:51:47 -07:00
Aman Agrawal 29c8f6bd06 navbar: Darken navbar on hover.
This improves the contrast between navbar text and background.
2023-09-28 09:51:47 -07:00
Karl Stolley 938b4f012a left_sidebar: Limit privacy icon styles to streams list.
This fixes a regression introduced in #26807, where a padding
adjustment spilled over to the privacy icon display in message
headers.

This fix should prevent future spillover by isolating left-sidebar
stream icon styles to just the streams list.
2023-09-28 09:36:44 -07:00
Hardik Dharmani 71b915e09d unread: Fix logic for wildcard mentions in direct messages.
Wildcard mentions in direct messages were not being count as mentions
due to incorrect calculation of `is_unmuted_mention` variable in
`update_message_for_mention()` function in `unread.js`. Fixed this by
correcting the calculation of `is_unmuted_mention`.
2023-09-28 09:35:30 -07:00
Aman Agrawal f7b633f511 settings_org: Move is_valid_url to util. 2023-09-28 09:13:51 -07:00
Aman Agrawal de2b1adfe6 markdown: Combine regexes. 2023-09-28 09:13:29 -07:00