Commit Graph

5728 Commits

Author SHA1 Message Date
Karl Stolley 46f5854185 tippy: Initialize maxWidth in em units. 2024-07-03 10:43:25 -07:00
Karl Stolley cbdfdf06b4 tippy: Allow Tippy tooltips to scale with UI. 2024-07-03 10:43:25 -07:00
Aman Agrawal 59e9a1ac90 recipient_row: Remove extra whitespace around recipient full name.
Might fix the CI errors due to extra space between `You and` and
the user full name.
2024-07-03 10:38:35 -07:00
Aman Agrawal ef49c29ddf recent_view_ui: Update if all msgs in topic were deleted. 2024-07-02 23:01:16 -07:00
Aman Agrawal b99ff8f34c recent_view_ui: Do single update instead of doing multiple rerenders. 2024-07-02 23:01:16 -07:00
Vector73 b306233cab pm_conversation: Add new has_conversation helper.
Adds `has_conversation` function in
`pm_conversation.RecentDirectMessages` for checking whether we have in
cache evidence of previous messages in a direct message conversation.

Preparation for #28470.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-07-02 19:02:41 -07:00
evykassirer 9dd36b4727 filter: Add validation function for search pill terms. 2024-07-02 16:25:45 -07:00
Tim Abbott da6c2e0c3c settings: Rename Deactivated users settings subtab.
Includes help center updates to better link to the tab.

Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/deactivated.20users.20tab/near/1843114
2024-07-02 13:53:31 -07:00
Shubham Padia ba05e8eeac custom_profile_fields: Initialize typeahead for every pronoun field.
Fixes #29921.
Before this, we used to initialize only 1 typeahead resulting in the bug
of only the first field updating even when trying to change values in the
others.

Co-authored-by: Ngadou Yopa <ngadou.y@turing.com>
2024-07-02 13:30:40 -07:00
Karl Stolley 58b40fb6c7 privacy_icon: Raise lock icon throughout UI for better visual centering. 2024-07-02 13:24:16 -07:00
Shubham Padia e539d2226b stream_create: Move `Add all users` beside `Choose subscribers`.
Fixes part of #30690.
We also drop the `Do you want to add everyone?` text.
2024-07-02 12:54:52 -07:00
Shubham Padia 49f6fc5a40 scroll: Set outline as none for `.simplebar-content-wrapper`.
We're reverting removing `outline: none` from commit
fe11f3be7c. While we set tabIndex to -1 in
that commit, which makes sure that it does not get focus when navigating
via a keyboard. But it does not prevent us from programmatically focusing
on the element. In this case, we don't want to see the outline.

Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/.F0.9F.8E.AF.20weird.20left.20sidebar.20outline/near/1834137
2024-07-02 12:47:44 -07:00
Kenneth Rodrigues 57167b2e2e reactions view: Add narrow title.
Earlier the narrow title for `sender:me` was being displayed.
Instead, display the narrow title for `has:reaction sender:me`.
2024-07-02 12:18:55 -07:00
nikhil singh b75bdc129b
emoji: Change event trigger for emoji_picker.js.
Previously the `maybe_change_focus_emoji` was being triggered
on `mouseenter` event instead of `mousemove` event. 

Because `mouseenter` events occur when a popover opens underneath
the mouse, without the mouse actually moving, this could result in 
the wrong emoji being picked when user tried to choose emoji
through the keyboard. 

Fixes #30559.
2024-07-02 12:09:55 -07:00
Karl Stolley 51d25bad09 message_row: Only set bottom margin on avatar for me-messages. 2024-07-02 11:45:30 -07:00
Karl Stolley 47430ac719 message_row: Allow user avatar to scale with UI. 2024-07-02 11:45:30 -07:00
Karl Stolley 0f05c67c88 message_box: Set same vertical space below reactions, length toggles. 2024-07-02 11:45:30 -07:00
Karl Stolley 8697c0c63e message_box: Base sender line-height on single-line message. 2024-07-02 11:45:30 -07:00
Karl Stolley 8556e098fb message_box: Set vertical margin to interelement space. 2024-07-02 11:45:30 -07:00
PieterCK b2515e8214 subscription css: Add new app variable for bottom border color.
This commit add a new css variable for subscription lists bottom
border color.

Fixes #30677.
2024-07-02 11:16:51 -07:00
PieterCK 7556414337 subscription css: Refactor subscriber list bottom border.
This commit refactors the css for subscriber list in channel
settings and group settings by moving the css rules that were
initially used to format the bottom border of the table to
the wrapper div (.subscriber_list_container) around the table.

On specific screen height, this wrapper div will overlap the
actual bottom border of the table and make it look like it's
cut-off. This commit makes it look like the table have consistent
bottom border accross all screen sizes.
2024-07-02 11:16:51 -07:00
Karl Stolley 3cb4bb830a left_sidebar: Refactor nav rows for low-resolution screens. 2024-07-02 10:24:20 -07:00
Aman Agrawal ce9c9ddf12 typeahead: Fix search typeahead open on `near` narrows.
This css accidentally got removed in #29882. This bug fix was
originally part of #30514.
2024-07-01 22:33:36 -07:00
roanster007 90c44d63b7 css: Update css of landing page images to show fading effect.
This commit adds the css class - "message-screenshot" and
"message-starred" to the "landing_page" to exhibit fading
effect.
2024-07-01 16:04:13 -07:00
Sahil Batra dbd0fae6af group_settings: Update save discard buttons when live-updating.
This commit adds code to hide save discard buttons and
discard the changes if another user changed a setting
in the same subsection.
2024-07-01 15:30:21 -07:00
Sahil Batra 08f35e08a4 stream_settings: Update save discard buttons when live-updating.
This commit adds code to hide save discard buttons and
discard the changes if another user changed a setting
in the same subsection.
2024-07-01 15:30:21 -07:00
Sahil Batra 5da1e57fc2 settings: Update save discard buttons when live-updating.
This commit adds code to hide save discard buttons and
discard the changes if another user changed a setting
in the same subsection.
2024-07-01 15:30:21 -07:00
Sahil Batra cb69a819d4 settings: Add functions to discard complete subsection.
This commit adds new functions which will be used to discard
changes for all the settings in a subsection when clicking
on discard button. This change will help in avoiding code
duplication when they will be used to discard changes in
a subsection if some other user changed a setting in the
same subsection.
2024-07-01 15:30:21 -07:00
Sahil Batra da95d01c37 settings: Use discard function to live-update realm default settings. 2024-07-01 15:30:21 -07:00
Aman Agrawal eca1a66fe8 drafts: Show saved time in UTC format in a tooltip. 2024-07-01 15:13:21 -07:00
Aman Agrawal c9c3a0fbc3 message_view: Fix hash not updated when filter is adjusted.
If the filter was changed due to topic move, the hash was not updated
due to `browser_history.state.changing_hash` being true. To bypass
it, we set trigger as `retarget message location`.
2024-07-01 12:36:24 -07:00
Aman Agrawal b3e65896b8 message_view: Adjust filter to match `near` message before narrow.
If the topic was renamed but the `near` link contains the name
of the old topic and we have the `near` message in the current
list, we can still narrow without re-rendering.
2024-07-01 12:36:24 -07:00
Aman Agrawal a3ced731bf message_view: Move adjusted_terms_if_moved to filter.ts. 2024-07-01 12:36:24 -07:00
afeefuddin cb1c293030 compose_popovers: Convert module to TypeScript. 2024-07-01 11:09:12 -07:00
afeefuddin e9bf3825d4 rows: Fix inaccurate types of parameters of a couple functions. 2024-07-01 11:09:12 -07:00
Aman Agrawal bb5c732dae stream_topic_history: Ask server for last msg id for historical topics.
Historical topics = Topics which we received from server and have
no messages cached for them to make any sense for the removed messages.
2024-06-30 22:37:46 -07:00
Aman Agrawal e82fe09cfc message_events: Bulk remove messages in stream_topic_history.
We can implement the TODO since the concern raised in the TODO
is no longer relevant as stated in the TODO.
2024-06-30 22:37:46 -07:00
Aman Agrawal 2cbb10bd22 message_events: Update old comment.
This got renamed incorrectly from recent topics to recent conversations
and also we not longer use set_message_topic to set message topic.
2024-06-30 22:37:46 -07:00
Shubham Padia 5ac6d671fc stream_create: Rename `Subscriber` list to `Subscriber preview`.
See https://github.com/zulip/zulip/pull/30610#issuecomment-2195284653
2024-06-28 15:35:56 -07:00
Shubham Padia 87b3642b62 stream_create: Soft remove users on clicking the remove button.
Fixes #29825.
Clicking on remove button will not delete the row anymore. We will
add a strikethrough to the user pill and email text. `Remove` button
will change to `Add` on click to undo this action.
Re-adding a user explicitly should will not undo the soft remove on
their row. e.g If `Iago` was added as part of a group and crossed out.
Now, adding another group with Iago as part of it should not undo the
soft remove.
We maintain a seperate set of soft removed users, but we will not
remove those users from the main user list on clicking `Remove`.
That list can only be modified by actions with the input pills.
We will subtract the soft removed user ids from main user id list
when sending the request to add subscribers to the new channel.
I've not added extra puppetteer tests, since adding users was
not part of the existing tests.
2024-06-28 15:35:56 -07:00
Shubham Padia 3e7be80656 stream_create: Remove add button and add to list on typeahead enter.
Clicking remove in the subscriber list table should strikethrough
according to the new behaviour but we will do that in the next
commit.
One additional detail to the specs described in #29825 is that we
will not have a pill for the current user. Discussion can be found
here: https://chat.zulip.org/#narrow/stream/6-frontend/topic/Disabled.2Fun-editable.20input.20pill/near/1838691
2024-06-28 15:35:56 -07:00
N-Shar-ma c10ff0bea8 compose: Use same focus ring color for compose buttons in each theme.
A new css variable is created with the same blue color in light theme as
`color-outline-focus`, and gray color in dark theme, and is used for the
focus-visible state of the compose control buttons, the compose close
button, and the send later vdots button.
2024-06-28 15:14:01 -07:00
N-Shar-ma 3262afeb9b Revert "css: Redefine `--color-outline-focus` for dark theme."
This reverts commit 5c1069872d.
2024-06-28 15:14:01 -07:00
N-Shar-ma 5a740d4fbb compose: Fix the red outline in invalid state in dark theme.
In dark theme, the selector for the outline was the wrong element, so a
double, misplaced outline would show up.
2024-06-28 15:13:21 -07:00
Karl Stolley 104c76c18b left_sidebar: Remove .input-append from stream filter. 2024-06-28 15:12:00 -07:00
Karl Stolley d3d4ddcfc2 left_sidebar: Rewrite topic filter in grid. 2024-06-28 15:12:00 -07:00
Karl Stolley a9c9115175 left_sidebar: Resize topic check with UI. 2024-06-28 15:12:00 -07:00
Karl Stolley 652db1b8b1 left_sidebar: Resize navigational subheaders with UI. 2024-06-28 15:12:00 -07:00
Sayam Samal 2165fe7e3c compose: Update mobile message buttons popover logic.
Instead of displaying contextual options in the message buttons popover
based on the message type, we instead abstract the logic behind the
scenes and instead just show the "Start new conversation" with the
relevant hotkey hint.

This also removes the `is_in_private_narrow` parameter which now serves
no purpose in the popover template, as we display the
"New direct message" option in all cases.
2024-06-28 12:40:20 -07:00
Sayam Samal a62337d08f compose: Redesign mobile message buttons popover.
As part of the popover menu redesign, this redesigns the mobile message
buttons popover using the new "popover-menu" tippy theme and improves
accessibility by using appropriate ARIA attributes.

Fixes part of #28699.
2024-06-28 12:40:20 -07:00
Aman Agrawal 49adbcc375 popover-menu: Use `popover-menu` style for emoji and giphy popovers. 2024-06-28 11:24:12 -07:00
Aman Agrawal 469582a974 giphy: Style search input same as dropdown widget.
Fixes #26929
2024-06-28 11:24:12 -07:00
Aman Agrawal 772969e68c emoji_picker: Format search bar same as dropdown widget. 2024-06-28 11:24:12 -07:00
Aman Agrawal be6650f035 emoji_picker: Convert search selector from class to id.
There is only emoji picker active at a time with only one search box,
so it makes sense for it to be an id.
2024-06-28 11:24:12 -07:00
Prakhar Pratyush caedcb8b8b onboarding: Narrow new users in DMs with Welcome Bot.
Earlier, new users were narrowed to the interleaved
DMs view on the first visit.

This commit updates the behavior to narrow new users
in DMs with Welcome Bot.

Reason for the change:
It makes more sense overall as an interleaved DMs view
is a power user view and it would also prevent the
message fading banner #29076 from showing up if the
user DMs Welcome Bot right away.
2024-06-28 11:04:31 -07:00
Karl Stolley c8aeff9a79 left_sidebar: Convert Sass-style vars to CSS vars. 2024-06-28 10:42:35 -07:00
Kislay Verma f58728d3e6 compose: Renarrow to unresolved topic.
When posting a message in an empty resolved
topic, the `Unresolve topic` button in the
compose banner unresolves the topic
and then renarrows to the unresolved topic
if currently viewing the old (resolved) topic.
2024-06-27 17:10:15 -07:00
Sayam Samal f49a11c810 theme: Rename day->light and night->dark in the frontend code.
This commit standardizes the naming of the day and night themes to light
and dark, respectively. This makes the codebase more consistent with
the naming used in the settings and the user interface.
2024-06-27 16:24:49 -07:00
Sayam Samal bc6deb7a0a theme: Rename "enable", "disable", and "default_preference_checker".
As a follow-up to the previous commit renaming the `dark_theme.ts`
module to `theme.ts`, this commit renames the following functions:
- `enable` -> `set_dark_theme`
- `disable` -> `set_light_theme`
- `default_preference_checker` -> `set_automatic_theme`
2024-06-27 16:24:49 -07:00
Sayam Samal 2417155828 theme: Rename dark_theme.ts -> theme.ts.
The dark_theme module now contains logic for light, dark, and automatic
theme switching. Thus, we rename it a more generic name, `theme.ts`.
2024-06-27 16:24:49 -07:00
Sayam Samal 05c61037c8 dark_theme: Refactor and consolidate theme setting logic.
This commit centralizes the logic for setting a user's theme preference,
both for regular users and spectators, into the `dark_theme.ts` module.
This simplifies theme handling throughout the codebase and ensures that
the theme is set consistently across all modules.

Instead of relying on various call sites to update the recipient bar's
background color and switch between the light/dark realm logo after a
theme change, this commit modifies the `set_theme_and_update` function
to include these calls after every theme change. Before this commit,
some modules used to update the realm logo after a theme change, while
others did not. This led to inconsistencies in the UI depending on
which method was used to change the theme.
2024-06-27 16:24:49 -07:00
Sayam Samal b616f013f0 gear_menu: Add theme switcher to the gear menu popover.
Standardize theme selection across the web app by replacing separate
light/dark theme menu options being used in the spectator view with the
new 3-way theme switcher.

Fixes #30318.
2024-06-27 16:24:49 -07:00
Sayam Samal d49426b950 realm_logo: Render light/dark realm logo on theme change for spectators.
Before this, the realm logo was not being updated instantly when the
theme was changed through the gear menu, and instead required a page
reload to take effect.
2024-06-27 16:24:49 -07:00
Sayam Samal 2f6cc4a6b0 dark_theme: Add automatic color scheme support for spectators.
Similar to the light/dark theme support for the spectators, this adds
the automatic color scheme support by storing the user's preference
in the local storage.
2024-06-27 16:24:49 -07:00
codewithnick e41d1fb48f settings: Add links to topic notification settings.
In this commit, a help center link to follow-a-topic and mute-a-topic
has been added in SETTINGS / NOTIFICATIONS > Topic notifications
so that users can understand thier options.

Fixes #30562
2024-06-27 15:33:10 -07:00
sanchi-t 77c614e072 set_up_stream: Update sorter function.
Make sure that typeahead results are alphabetized.

Fixes #30577.
2024-06-27 15:29:47 -07:00
sanchi-t 1a8997589d set_up_stream: Update typeahead items to 12.
Fixes part of #30577.
2024-06-27 15:29:47 -07:00
Karl Stolley fed0aa6642 inbox: Resize user circles in inbox view. 2024-06-27 15:28:27 -07:00
Karl Stolley d0f5d93f4b inbox: Size unread focus ring without shifting rows. 2024-06-27 15:28:27 -07:00
Karl Stolley 18e5b3ab6b unread_counts: Scale unread counts with UI. 2024-06-27 15:28:27 -07:00
Aman Agrawal 15195fc08f sub_store: Update first_message_id of stream if we can.
Tested by moving first message in a stream to other stream and
checking for the updated value in console via
`zulip_test.get_sub("verona")`.
2024-06-27 14:59:45 -07:00
Aman Agrawal cffae1439c stream_topic_history: Let server help us with latest msg id for topics.
If we already have latest data for topics, we shouldn't pass on the
opportunity to update the latest message id for existing topics.
2024-06-27 14:59:45 -07:00
Aman Agrawal d2d479ba61 stream_topic_history: Fix wrong topic order when moving messages.
Fixes #27500

It is hard to reproduce the bug but this should fix any bugs
involving topic order when moving messages since we are updating
the data again from the server.
2024-06-27 14:59:45 -07:00
Aman Agrawal d80dba75c5 stream_topic_history: Remove the concept of historical topics.
It is hard to maintain the concept of `historical` topics locally,
thus, we remove them entirely to simplify what we can do here.

This commit can introduce bugs when are addressed in the next commit.
2024-06-27 14:59:45 -07:00
Aman Agrawal d381a358d0 message_events: Remove message from message_store on deletion.
We did not remove the deleted messages from message_store
previously. This commit adds the code to remove the deleted
messages from message_store.

Co-authored-by: Sahil Batra <sahil@zulip.com>
2024-06-27 14:59:45 -07:00
sanchi-t 281ce39a0d template_stub: Remove the requirement to mock templates.
We will now just run the actual template if not mocked, such that code
that ends up rendering a template incidentally does not need to mock
templates.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2024-06-27 11:58:59 -07:00
Aman Agrawal edb02fcc98 giphy: Fix focus outline left vertical line not visible. 2024-06-27 09:19:23 -07:00
Aman Agrawal f27488adc9 giphy: Upgrade giphy to implement TODO.
Upgraded to use the tabindex support provided by giphy itself.
2024-06-27 09:19:23 -07:00
Sahil Batra d60075a8cf settings: Make the label for disabled checkboxes less faded.
This commit updates the CSS to makes the label for disabled
checkbox less faded such that it is faded enough to figure out
that the setting is disabled but the text is also visible clearly.
2024-06-27 09:18:39 -07:00
Aman Agrawal 39bcb6bd8b typeahead: Remove all sources of white space inside `strong` element.
We are using `white-space: pre` which doesn't condense whitespaces,
so we need to remove any unintentional whitespaces here.
2024-06-27 09:18:23 -07:00
Anders Kaseorg 3dccb72519 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-26 21:34:18 -07:00
Anders Kaseorg 7d4d4017b3 eslint: Fix unicorn/prefer-array-find.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-26 20:13:26 -07:00
Anders Kaseorg 4428609ece eslint: Fix unicorn/prefer-includes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-26 20:13:26 -07:00
N-Shar-ma 9bc1eb4bb9 compose: Allow 3-way compose box resizing with new fixed expanded state.
Apart from the normal (collapsed) and full screen sizes, a new expanded
state with the same size as the maximum a normal compose box can stretch
to when full (40% of the screen height) is now available. Now a user can
expand the compose box without it covering the full screen with a click.
The vertical resize icon in the bottom right corner of the compose box
is rendered useless so has been removed.

All three states can be cycled through by clicking the compose resize
button in the order: collapsed -> 40% of the screen -> full screen. When
a message naturally causes the compose box in its normal state to expand
up to 40% of the screen, clicking the resize button will take it to full
screen state.

Fixes: #29966.
2024-06-26 16:36:52 -07:00
N-Shar-ma b432b269ee refactor: Make compose size related variables & functions more specific.
We divide functionality into that for "full_size" and "expanded", which
are identical for now.

This is a prep commit for adding an intermediate expanded screen size.
2024-06-26 16:36:52 -07:00
Aman Agrawal 5f956cd369 typeahead: Change background of active elements. 2024-06-26 16:31:28 -07:00
Aman Agrawal a8eff69fc2 typeaheads: Reduce left padding for all elements.
This required taking special care of typeaheads with user circle
and making sure long typeaheads wrap correctly.
2024-06-26 16:30:26 -07:00
Aman Agrawal 52ac602acb typeahead: Make them look like dropdown widget.
This attempts to change background color and text color of typeaheads
to be same as dropdown widgets we have in the app.
2024-06-26 16:26:31 -07:00
Sahil Batra 1fac997338 settings: Refactor CSS for "control-label-disabled" class.
We previously had two CSS rules for control-label-disabled
class, one in settings.css and one in subscriptions.css
and the rule in subscriptions.css was being used by all
the elements with that class.

This commit refactors the code to have only single CSS rule
for that class with the value being set to the one used in
subscriptions.css, because that was the one being used and
that also looks better in terms of design, and the CSS is
defined in settings.css since it can be considered more
general file for writing CSS used in organization/personal
settings along with stream settings.

This commit also removes the unused code for
".control-label-disabled.enabled" selector since we no
longer use that selector.
2024-06-26 14:22:47 -07:00
Sahil Batra f7a6d841c8 stream-settings: Fade label of disabled default stream checkbox. 2024-06-26 14:22:47 -07:00
Sahil Batra 28174aecca settings: Fade label for disabled checkbox. 2024-06-26 14:22:47 -07:00
afeefuddin 22a58c739c left_sidebar_navigation_area_popover: Convert module to TypeScript. 2024-06-26 14:08:39 -07:00
adnan-td 4bde1586e4 topic_name: Fix compressing of display topic names.
Fixes part of #30478.
2024-06-26 12:23:32 -07:00
evykassirer 7ae0972c28 typeahead: Hide by default and show container on `show()`.
This avoids a bug (currently only for search) where the page
can be loaded with an empty but visible (half-loaded) search
typeahead.
2024-06-26 12:02:10 -07:00
Karl Stolley b519344dd9 message_controls: Remove unreachable read-receipt styles. 2024-06-26 12:00:21 -07:00
Karl Stolley cedc34bdea widgets: Remove hard-coded 14px font-size. 2024-06-26 12:00:21 -07:00
Karl Stolley 67b8b9e13a settings: Remove font size, unnecessary height from emoji file name. 2024-06-26 12:00:21 -07:00
Pratik Chanda 81abbab0d8 pm_list: Fix duplicate DM row in left sidebar.
When narrowing to a DM with their own user pill in recipient, a
duplicate DM row gets rendered.

This commit fixes this behaviour and doesn't render a separate row
when one's own email is included in recipient.

Fixes regression from zulip#29175.
2024-06-26 10:12:57 -07:00
Pratik Chanda d3fbfeae31 topic_list: Fix duplicate topic rows in left sidebar.
When narrowing to an existing topic name with different casing, left
sidebar renders duplicate topic rows for the existing topic name and
one with the different casing. Since topic names are case insensitive,
it should narrow to the existing row only.

Fixes regression from #29175.
2024-06-26 10:12:57 -07:00
Aman Agrawal ef09051003 css: Move text-error class from bootstrap.
Remove hover and focus CSS for anchor tags since `text-error` elements
which use this CSS right now don't have anchor tag.
2024-06-26 10:03:05 -07:00
Aman Agrawal 2eefe94b94 stream_settings: Add color for success message.
This was incorrectly removed in
98637e3a88.
2024-06-26 10:03:05 -07:00
Aman Agrawal 959bf39320 bootstrap: Remove unused `text-warning` class. 2024-06-26 10:03:05 -07:00
Karl Stolley c0837a6d20 status_emoji: Allow status emoji to scale with text. 2024-06-26 10:02:13 -07:00
Karl Stolley 818094f81d user_circles: Set user circles to scale with text. 2024-06-26 10:01:24 -07:00
Karl Stolley a43ae2a561 user_circles: Address TODO and remove styles. 2024-06-26 10:01:24 -07:00
Karl Stolley 4c1cc4e62e mention_pills: Allow pills to scale with other message text. 2024-06-26 09:51:29 -07:00
N-Shar-ma dcf2c67f2d typeahead: Add non breaking space (\u00a0) to list of word separators. 2024-06-25 22:52:28 -07:00
Aman Agrawal c8379b4f9a message_fetch: Stop infinite fetch for first unread message id.
Found while migrating message_fetch to Typescript in #30509.
2024-06-25 22:51:43 -07:00
Alya Abbott b892f8a7a8 notifications: Test notification should say that it's a test. 2024-06-25 17:28:17 -07:00
Alya Abbott 145654fd55 notifications: Improve label for button to test desktop notifications. 2024-06-25 17:28:17 -07:00
Aman Agrawal 9e0a3bebfd recent_view: Fix right arrow not working on read DM rows.
Fixed by letting col_focus exceed max selectable rows in this case
and having it reset back to 0.
2024-06-25 14:12:19 -07:00
Aman Agrawal a83b882705 inbox_ui: Let browser handle tab key. 2024-06-25 14:12:19 -07:00
Aman Agrawal 2bf3191ddf recent_view: Let browser handle tab hotkey. 2024-06-25 14:12:19 -07:00
Aman Agrawal 1c3c794385 views: Set focus to topic visibility icon on click. 2024-06-25 14:12:19 -07:00
Aman Agrawal dd071c7303 topic_visibility: Remove deprecated topic visibility toggle classes.
These classes became slowly unused as switched to the new topic
visibility system over time.
2024-06-25 14:12:19 -07:00
Aman Agrawal 909a0c1843 recent_view: Don't allow user to focus on time.
Since we don't want col_focus to be on the time column as we don't
track it in recent view, we simply mark it as an element user
cannot focus to avoid any confusion.
2024-06-25 14:12:19 -07:00
Aman Agrawal b0978ba4d5 tippy: Fix sidebar toggle button tooltip not hidden on blur.
Tabbing through the navbar elements, `Hide user list` tooltip
stays visible even if focus is moved away from it.

We move tooltip to the element receiving focus and blur event
to fix it. See previous commit for more details.
2024-06-25 14:12:19 -07:00
Aman Agrawal 23927ea5b1 left_sidebar: Fix tooltips not hidden on blur.
The elements which received focus didn't have tooltips attached to
them, thus when blur was triggered on `a`, the tooltip didn't hide
as it was not listening on it for the blur event.

We move the toolip to `a` elements so that when focus and blur
are triggered tippy is able to capture them.
2024-06-25 14:12:19 -07:00
Lauryn Menard 79fc430b56 narrow: Expand informative text in empty starred messages view.
Fixes #29378.
2024-06-25 14:11:42 -07:00
Lauryn Menard 89a3c290db narrow: Expand informative text in empty mentioned messages view.
Limits the width of the empty message notice to 600px so that this
longer and more descriptive text is similar to the width of the
empty header text.
2024-06-25 14:11:42 -07:00
Aman Agrawal cd2812c131 message_notifications: Tag notification text for translation.
Fixes #21032
2024-06-25 14:11:06 -07:00
Aman Agrawal 07525a2f7d message_notifications: Split title into two parts.
We separate the prefix and suffix parts of title, so that they
can be translated independently later.
2024-06-25 14:11:06 -07:00
Aman Agrawal 98341d811e message_notifications: Remove unused `test-notification` case. 2024-06-25 14:11:06 -07:00
Sahil Batra d7d83618a4 settings: Refactor code to update realm group based settings.
This commit refactors code such that we do not add separate
if condition block for each realm group based settings using
the new API format to send the request accordingly. We now
use a single if-block to update the request data for realm
group permission settings using new API format.
2024-06-25 09:26:38 -07:00
Kislay Verma 84cd835a8c composebox_typeahead: Avoid generating broken stream-topic links.
The #**stream>topic** syntax generates broken links for
topics containing two backticks or ending with *, because of
architectural flaws in the backend markdown processor.
So we avoid generating the syntax for such topics and instead
generate the normal link syntax in markdown.

Fixes #19873
2024-06-24 18:14:33 -07:00
Anders Kaseorg b75e016a2c realm_user_settings_defaults: Restore missing members.
Commit 02e236f58a (#30519) caused Zod to
remove them.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-24 15:23:52 -07:00
Anders Kaseorg 7f49a4f0bd user_settings: Restore missing members.
Commit ed1c169bfb (#30519) caused Zod to
remove them.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-24 15:23:52 -07:00
Karl Stolley 8fb8bd95f0 info_density: Scale reaction emoji with font-size. 2024-06-24 15:05:53 -07:00
Anders Kaseorg f35e1fdef6 blueslip: Show popups for unhandled promise rejections in development.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-24 15:05:28 -07:00
Anders Kaseorg 148af2a301 blueslip: Show popups for thrown non-Error values in development.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-24 15:05:28 -07:00
Anders Kaseorg 18137709a1 typeahead_helper: Straighten CombinedPill types.
The generic argument of InputPillContainer should not be
InputPillItem<…>, as InputPillContainer already uses InputPillItem
where applicable.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-24 12:35:51 -07:00
Karl Stolley e235240685 info_density: Recalculate timestamp widths on density dispatch events. 2024-06-24 12:30:38 -07:00
Karl Stolley 3f6760f41a info_density: Correctly set em context for timestamp calculations. 2024-06-24 12:30:38 -07:00
Karl Stolley 7dc20a56f2 info_density: Move timestamp calculations to better location. 2024-06-24 12:30:38 -07:00
Shubham Padia 991fec5b23 hotkey: Don't close compose box on topic list input ESC.
Fixes https://chat.zulip.org/#narrow/stream/9-issues/topic/Pressing.20escape.20in.20topic.20filter.20closes.20compose.20box/near/1833316
Topic list escape key action should take preference over
open composebox.
2024-06-24 10:37:24 -07:00
Aman Agrawal 3aaf25e42d bootstrap: Remove unused dropdown class.
We don't have any element using dropdown class in codebase.
2024-06-24 09:06:53 -07:00
Aman Agrawal 244d4e9620 bootstrap: Move `hidden` class to `app_componenets`. 2024-06-24 09:06:53 -07:00
Aman Agrawal 8457d12e59 bootstrap: Remove `hide/show` classes. 2024-06-24 09:06:53 -07:00
Karl Stolley 83a590dc06 compose: Zero out UA padding on composebox buttons. 2024-06-24 09:03:13 -07:00
Aman Agrawal 6999d84ddc message_view: Select `near` message without rerender.
If the new narrow has the same terms except `near` message id,
then we select the message if it is already rendered in the
current message list.

Tested by sending link to two different messages in a narrow and
clicking to ensure we don't have any loading indicators active.

Tested we are scrolling to target message too if it was not in the
visible viewport but is rendered above.
2024-06-24 08:41:14 -07:00
Karl Stolley 5cd4a8c8e5 pills: Express pill-container spacing on base class. 2024-06-23 22:00:18 -07:00
Karl Stolley 780391fd43 pills: Better express pill-container outer spacing. 2024-06-23 22:00:18 -07:00
Anders Kaseorg 95a2ce6ed6 ui_init: Restore guard against direct use of page_params.state_data.
Before commit fd253539e0 (#30519), each
part of state_data was removed by pop_fields, to ensure that it was
only used by its associated module and not manipulated directly.
Restore this guarantee by removing page_params.state_data itself.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-23 07:42:28 -07:00
Anders Kaseorg 3a7f5da717 page_params: Add a separate error message for missing #page-params.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-22 21:50:51 -07:00
sanchi-t 2d79ce2e93 invite: Replace stream checkboxes list with stream pills.
Introduce an input field with typeahead functionality, initially
populated with the default streams for the organization.

Fixes #26871.
2024-06-22 20:04:28 -07:00
sanchi-t 445ff79e10 stream_pill: Update `format_stream_name_and_subscriber_count`.
Use `$t` to ensure the function returns a translatable string.
2024-06-22 20:04:28 -07:00
sanchi-t 7580130873 stream_pill: Rename `stream_display_pill`. 2024-06-22 20:04:28 -07:00
Anders Kaseorg 0b3cf78333 blueslip: Untangle from page_params.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-22 19:18:10 -07:00
Anders Kaseorg f7eecb0e03 sentry: Untangle from page_params.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-22 18:53:56 -07:00
Anders Kaseorg 3db05666ac state_data: Accept null for ProfileDatum["rendered_value"].
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-22 11:21:54 -07:00
Anders Kaseorg ca5fba258e giphy: Split is_giphy_enabled to a separate module.
This removes giphy from the critical path of the TypeScript migration.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-22 08:21:08 -07:00
Aman Agrawal 4d84ed305e stream_color: Fix stream icon color not changing on theme change.
Changing theme didn't change the color of the stream icons.
2024-06-22 08:20:23 -07:00
N-Shar-ma 00240b6dbe compose: Reduce space between recipient area and textbox. 2024-06-21 17:29:56 -07:00
N-Shar-ma 878d02cf5c compose: Redesign control buttons row and textbox to look like 1 unit.
The row of buttons is placed using CSS grid template areas so that
visually it is now inside the bottom edge of the textbox. The color of
the buttons row and individual buttons is changed to match the color of
the textbox. All textbox border / box shadow properties are now applied
to its parent instead which is extended under the buttons' row, so that
its border snuggly fits around the buttons row too.

Notable side effects:
- In dark mode the textbox in focused state now has a light border which
does not match the recipient input's current border which doesn't change
when focused. Likely, the recipient input should be updated to match the
textbox's border color.
- The dividers in the formatting buttons row are not vertically centered
now. This should be figured out soon.

Fixes: #28702.
2024-06-21 17:29:56 -07:00
Karl Stolley ac002b358c markdown: Improve alignment, spacing around horizontal rules. 2024-06-21 16:45:16 -07:00
Karl Stolley 7febb78b3b markdown: Use interelement spacing on horizontal rules. 2024-06-21 16:45:16 -07:00
tnmkr 6b255fcc14 custom_profile_fields: Rename is_editable variable for clarity.
The variable is renamed to is_target_element_editable. This makes it
explicit that this variable is referring to HTML structure and not a
property of the field.

This is a prep commit for #22883 which allows admins to restrict users
from modifying field values.
2024-06-21 16:32:18 -07:00
Anders Kaseorg 4ddc8f406d onboarding_steps: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 72902d70f3 presence: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 438509a8f1 presence: Fix presence_last_update_id type.
It’s undefined for spectators.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 1a73101371 bot_data: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg bf8fc8429b unread: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 9c2ab2842f unread: Ignore deprecated sender_id synonym.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg ca99016f04 user_status: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 4b4ef75729 muted_users: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 8ce77cabae user_topics: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 6bff8161ea user_topics: Remove stream__name from user_topic_schema.
This field is internal to the backend and never escapes to the
frontend.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 97907b0a9c pm_conversations: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg e28240a9ac stream_data: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 9b511f5caa sub_store: Fix ApiStreamSubscription["email_address"] type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 370a6c350e local_message: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 788552b916 alert_words: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 1ee5c46a20 user_groups: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg 41ec6c9b7c user_groups: Fix UserGroupRaw["direct_subgroup_ids"] type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Anders Kaseorg d5cc7d7b79 emoji: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 15:53:44 -07:00
Karl Stolley 3a4719915c compose: Let pill-container dictate spacing of pills.
The 2px and 6px values expressed as variables here are taken from
@terpimost's mocks in Figma.
2024-06-21 14:46:44 -07:00
Karl Stolley 0844e2cba9 pills: Size pill components and inputs in ems. 2024-06-21 14:46:44 -07:00
Anders Kaseorg 39d4ddaa96 stream_edit_subscribers: Rename misleading variable.
.safeParse does not return a “schema”.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 14:44:52 -07:00
Anders Kaseorg 15d4866856 stream_edit_subscribers: Fix incorrect error result test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 14:44:52 -07:00
Varun Singh 05a480f1d1 zcommand: Use `raw_data` and `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Varun Singh 87a9877a93 attachments_ui: Use `raw_data` and `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Varun Singh f2c3207538 stream_topic_history_util: Use `raw_data` and `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Varun Singh 3d64fb6cda message_edit_history: Use `raw_data` and `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Varun Singh f553142c7c settings_linkifiers: Use `raw_data` and `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Varun Singh 4186cac151 stream_edit_subscribers: Use `raw_data` & `data` more.
Prefer using `raw_data` and `data` instead of
`data` and `clean_data`.
2024-06-21 12:58:21 -07:00
Kenneth Rodrigues 245332eef4 new conversation: Show correct tooltip when dms are disabled.
Earlier the `data-conversation-type` attribute of the new conversation
button was being set to `direct` only if dms were enabled. As a result a
stale tooltip was being shown when dms were disabled.
This commit updates the attribute to `direct` reagardless of dms being
enabled or not.

Fixes #29916.
2024-06-21 11:21:37 -07:00
Karl Stolley 2820bd277f pygments: Fully isolate light and dark themes.
Co-authored-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 11:15:34 -07:00
Karl Stolley 8936febbd3 pygments: Remove legacy Zulip customizations.
These styles were from before opting to work with themes maintained
by the Pygments project. Their removal will make it much easier to
upgrade Pygments themes in the future, and more importantly,
reduce the effort required to square syntax highlighting in the web
and mobile apps.
2024-06-21 11:15:34 -07:00
Varun Singh 80cf16a303 stream_edit_subscribers: Convert module to TypeScript. 2024-06-21 09:54:08 -07:00
Varun Singh 894cafe3c0 subscriber_api: Fix types of function parameters. 2024-06-21 09:54:08 -07:00
Varun Singh 5891a9ef24 subscriber_api: Don't return unused channel request objects. 2024-06-21 09:54:08 -07:00
Anders Kaseorg ce71e5ad8c starred_messages: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg 9a94cb2269 people: Validate paramters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg b93509019d people: Mark possibly missing fields as optional.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg 02e236f58a realm_user_settings_defaults: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg 282ea2d77f realm_user_settings_defaults: Fix user_list_style type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg bb8f044a35 scheduled_messages: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg ed1c169bfb user_settings: Validate parameters with Zod.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Anders Kaseorg fd253539e0 ui_init: Use Zod to split state_data.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-21 09:28:35 -07:00
Aman Agrawal 32b4aa0883 navbar: Remove empty space to the left and right. 2024-06-20 16:11:19 -07:00
Anders Kaseorg 139d6ff81b markdown_timestamp: Remove incorrect space.
The space wasn’t visible because it was narrower than the padding on
`.rendered_markdown time`, but it showed up in copy-and-paste.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-20 16:04:30 -07:00
Sahil Batra e19524ba92 settings: Use new group setting to private channels creation permission.
This commit updates webapp code to use new group based setting to check
permission for creating private streams.
2024-06-20 15:48:14 -07:00
Sahil Batra 69e88f8787 tests: Extract common function to test realm group based settings.
Test for "can_access_all_users_group" setting does not use the
common function as it allows different options as of now.
2024-06-20 15:48:14 -07:00
evykassirer f6c9b515c7 input_pill: Redesign input pills.
This commit also replaces the close button with
an svg. This is part of the app redesign, and
preparation for the upcoming search pill project.
2024-06-20 15:16:17 -07:00
evykassirer 84cf7f8677 input pill: Remove pill-container-btn class in favor of search styling.
This style is currently only used for search suggestions. Soon,
styling for those suggestions will become more specific, and so
for now we'll keep those styles in search.css to be more clear
about what the new styles affect. If we want to repeat something
like this in the future somewhere else in the app, we can come
up with a generic styling then once we have a better idea of
what that will look like.
2024-06-20 15:16:17 -07:00
Aman Agrawal 792a9bd81e presence: Fix presence status not updated for offline users.
As per the new presence API, we don't get presence info for
users if they went offline after `last_update_id`. This results
in webapp not updating presence info for them.

To fix it, we loop over all the active / idle status users and
update presence status for them as per the latest server time.
2024-06-20 12:35:42 -07:00
Ujjawal Modi 9bb74fb064 settings-config: Use snake case for expires_in_values keys. 2024-06-20 12:26:29 -07:00
Ujjawal Modi cdbc20d304 invite-user-modal: Remove duplicate CSS rules.
Removes some CSS rules used in the invite user modal that were
already being applied via the shared `modal_select` class.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-06-20 12:26:29 -07:00
Kislay Verma d38d82edc3 dropdown_widget: Fix bug in `disable_for_spectators`
If `disable_for_spectators` is true, the widget text is greyed out
but the tippy instance is still delegated, causing it to appear
on click/enter.

This commit fixes that by not delegating tippy if the
`disable_for_spectators` is true.

This bug was surfaced when it was found that the
topic type filter in Recent conversations has disabled
styling for spectators, but a spectator could still click on it to
open the dropdown.

Fixes #30461
2024-06-20 12:09:04 -07:00
Shubham Padia 43eebbf9c6 scroll: Set tabIndex to -1 for simplebar content wrapper.
Fixes #30403.
Having tabIndex set to 0 led to keyboard focus being put on
a scrollbar container, which led to users having to tab twice
to skip a container.
This commit also removes instances of tabIndex being set to
-1 programatically for certain cases, since it is -1 by default now.
This commit also removes `outline: none` for simplebar since
that property is not needed anymore because the wrapper is
not focusable anymore.
2024-06-20 10:25:51 -07:00
Shubham Padia b771c5f5b0 pm_list_data: Rename private_message(s) to conversation(s).
Since it's an array of PMConversation objects, not of messages, the
old name was confusing.
2024-06-20 09:58:39 -07:00
Shubham Padia 98f4f1bc35 left_sidebar: Remove unused more_private_messages_sidebar_title css.
This was introduced in 6f9e97921d and
has never been used.
2024-06-20 09:58:32 -07:00
Shubham Padia a7da20a66a left_sidebar: Rename show-all-pms-template to use `direct-messages`.
Rename `show-all-pms-template` to `show-all-direct-messages-template`.
Part of the private_message to direct_message rename project.
2024-06-20 09:58:32 -07:00
Shubham Padia cad5843da6 left_sidebar: Rename show_all_private_messages to use `direct`.
Rename `show_all_private_messages` to `show-all-direct-messages`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-20 09:58:32 -07:00
Shubham Padia f90ad8ca15 left_sidebar: Remove unused toggle_private_messages_section class.
This was introduced in 6f9e97921d and
has never been used.
2024-06-20 09:58:04 -07:00
Shubham Padia 0e8a6a0196 left_sidebar: Rename toggle_private_messages_section_icon to use direct.
Rename `toggle_private_messages_section_icon` to
`toggle-direct-messages-section-icon`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-20 09:55:29 -07:00
Shubham Padia 5a3fc26d74 left_sidebar: Rename private_messages_section_header to use `direct`.
Rename `private_messages_section_header` to
`direct-messages-section-header`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-20 09:55:29 -07:00
Shubham Padia b197659d8a left_sidebar: Rename private_messages_section to use `direct`.
Rename `private_messages_section` to `direct-messages-section`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-20 09:55:29 -07:00
Shubham Padia 7dc47e8484 left_sidebar: Rename private_messages_sticky_header to use `direct`.
Rename `private_messages_sticky_header` to
`direct-messages-sticky-header`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-20 09:55:29 -07:00
N-Shar-ma b852b5fef0 compose: Show focus ring on buttons only when using keyboard navigation.
For the compose control buttons, the compose close button, and the send
later vdots button, we show the focus ring only on `focus-visible` and
not on `focus`.

Fixes part of: #27117.
2024-06-20 09:45:18 -07:00
N-Shar-ma 5c1069872d css: Redefine `--color-outline-focus` for dark theme.
The css variable `--color-outline-focus`, which affects focus rings
throughout the app, now has a different value defined for the dark theme
but this should have no visible effect, and help clean up the code.

This is a prep commit for the next, which shows focus rings only on
`focus-visible` and not on `focus` for composer buttons.
2024-06-20 09:45:18 -07:00
Shubham Padia 35aa186a72 css: Remove unused css for channel & topic list filter.
The margin properties in question were getting overridden by other
css, so they were not important. The width was not making a difference
in case of channel filter, since its parent was a flexbox. For the
topic list, the width was getting overriden by
`#stream_filters .input-append.topic_search_section input`.
2024-06-20 09:34:08 -07:00
Aman Agrawal 12e2b6637e list_widget: Fix more elements not rendered on scrolling to bottom.
This bug can be reproduced by scrolling anywhere where list widget
is used except recent view.

`$scroll_container` was used before
371cd0da6c
to listen to scroll events which was incorrectly replaced by
`opts.$simplebar_container` in the above commit. To fix this,
we use the same function `scroll_util.get_scroll_element` to
get the correct scroll element.
2024-06-20 09:33:22 -07:00
evykassirer ee2852ede1 search suggestion: Consistently show user pills in typeahead.
Fixes #23365.
2024-06-19 18:41:51 -07:00
evykassirer 0899b621d3 search_suggestion: Show pills for all users in a group suggestion.
This fixes half of #23665. It shows all user pills when making
a group suggestions as the active new suggestion, but still
doesn't show user pills for the first parts of suggestion lines.
2024-06-19 18:41:51 -07:00
Shubham Padia 628757a2df left_sidebar: Use same color for active narrow filter for dm section.
Fixes #30467.
2024-06-19 18:10:15 -07:00
Shubham Padia e9f3371eca css: Remove unused css rules for background colour in dark theme.
We don't need this explicit rule anymore, since the css variable will
change the background color from zulip.css itself.
2024-06-19 18:10:15 -07:00
Shubham Padia b0eab81459 left_sidebar: Rename active_private_messages_section to use `direct`.
Rename `active_private_messages_section` to
`active-direct-messages-section`.
We've also hyphenated the attribute during the rename.
Part of the private_message to direct_message rename project.
2024-06-19 18:10:15 -07:00
Shubham Padia 694d457f43 css: Remove unnnecessary ids from active pm section color.
By removing the ids and setting the background-colour directly
for `.active_private_messages_section` achieves the same purpose.
2024-06-19 18:10:15 -07:00
Aman Agrawal 024d940724 message_list_view: Combine sticky header DOM updates.
This significantly reduces the time taken to update the
sticky header on scrolling.
2024-06-19 17:55:49 -07:00
Aman Agrawal 9d3f8bff55 inbox_ui: Don't process scroll events if Inbox is not visible.
The `get_all_rows` call should be scoped inside `#inbox-main` otherwise
it used to query all the elements in the DOM which is quite expensive.

Also, we don't need to handle scroll events in Inbox view if it
is not visible.
2024-06-19 17:55:49 -07:00
Sayam Samal fec89ad70d visibility_policy_popover: Fix popover shrinking bug on Safari.
A bug was observed on Safari where the visibility policy switcher
popover was shrinking beyond the width of the policy switcher, hiding
a portion of the switcher component.

This was due to the presence of the `width: min-content` on the
popover for supporting dynamic popover menu sizing based on the content
of the menu items, in tandem with some issue in Safari since it worked
fine on other browsers.

This commit adds the `.popover-menu-label` class to the visibility
policy switcher's label to enforce `max-content` width on the label
element, which in turn fixes the popover shrinking issue on Safari.
2024-06-19 17:47:35 -07:00
Sayam Samal eb93738873 pm_section: Fix ghost tooltip on collapse/expand DM toggle.
As reported in a bug report, the tooltip on the DM collapse/expand
toggle was reappearing after switching in and out of the browser window.

This commit destroys the current instance of the tooltip when it is
hidden. This clean up ensures that the tooltip does not appear again
unless the triggered explicitly by the user.
2024-06-19 17:46:59 -07:00
N-Shar-ma 906a9ca8f2 compose: Rework alignment of upper elements, and redesign close icon.
We now right align recipient input (even at very narrow widths) and
banners to the textbox, and move the close button to the absolute top
right corner of the compose box, updating the icon to be slimmer, bigger
and purplish, and adding a background highlight on hover.

This involved refactoring the send control area width into a responsive
css variable, and simplifying the html structure of the compose box.

Fixes: #28792.
2024-06-18 15:51:51 -07:00
roanster007 7ebbdd942d typing: Move the typing notifications to below the mark as read banner.
Previously, the typing notifications used to appear between the
message list and the mark as read banner in a thread. This would
cause the banner to shift down whenever someone starts typing,
and shift back up if everyone stops typing.

This frequent bouncing of the banner could be distracting, and hence,
is fixed by moving the typing notifications to below the mark as
read banner.
2024-06-18 14:30:19 -07:00
roanster007 1d3da31b8b unread_ui: Refactor method to update unread banner.
This commit refactors the "update_unread_banner", so that
the "mark_read_on_scroll_state_banner" innerHtml is
set using a separate method by passing the necessary
template.

This is a preparatory commit.
2024-06-18 14:30:19 -07:00
sujal shah 8d29e1829f uesr_group_settings: Update panel titles.
Change the titles of both panel in usergroup section.

Fixes part of #29403.
2024-06-18 14:20:17 -07:00
sujal shah eb259780f7 stream_settings: Reduce vertical space between setttings.
There was previously an excessive margin between
the "default streams" and "announce streams" settings.
2024-06-18 14:20:17 -07:00
opmkumar 30f65e5e2d left sidebar: Make Views label visible for spectators.
We don't include the toggle functionality, to avoid needing to design
what a collapsed Views thing would look like.

Fixes #30324.
2024-06-18 10:50:09 -07:00
Karl Stolley 6fe15626ae search: Set base font-size on search input. 2024-06-18 10:14:27 -07:00
Karl Stolley d9238cf784 message_time: Express font-size in em units. 2024-06-18 10:12:58 -07:00
Karl Stolley ceb89a3dd8 inbox: Enable flexible font-sizing on inbox. 2024-06-18 10:10:38 -07:00
Karl Stolley 424b3add6d left_sidebar: Restore righthand padding to DM partners. 2024-06-18 10:09:40 -07:00
Karl Stolley c80ffe8e0f server_dispatch: Calculate typography vars on dense_mode.
Owing to logic added in #30050, which accounts for the legacy line-
height value, toggling dense mode requires recalculating the
typography vars--otherwise, a non-legacy line-height value will
not be picked up until a refresh.
2024-06-18 10:08:54 -07:00
PieterCK c4d20678e4 settings: Refactor css for notification table.
Add new app variable for .notification-table class.
This variable is responsible to set the tables' thead
background color in dark theme. Previously it depended
on a genral CSS rule in dark_theme.css for its thead
color, however that cluster of rule has been deprecated
in #29859.

Note: The `thead` background color for the notification
table in the light theme is transparent, so the new
variable in `app_variable.css` does not have a
corresponding value for the light theme.
2024-06-18 09:48:41 -07:00
PieterCK 681adc1a75 app_components: Refactor table-bordered border color rule.
This optional commit also fixes #30431. It refactors the CSS
for the .table-bordered class, which is used directly by the
tables in the info_overlay menus (keyboard_shortcuts,
search_operators, markdown_help). This approach differs from
PR #30431, where the CSS for .overlay_body—a wrapper div
around these tables—was edited instead.

This commit make the CSS rules for .table-bordered class
use a new CSS variable for its border color where appropriate.
This is aligns with how we organizes CSS in #29859 and in
cd63e8d93cb0f84ec1e4ead348a225cb798f9cf0.

Fixes #39431.
2024-06-18 09:48:41 -07:00
PieterCK 2c7f8ef4a1 informational_overlays: Deprecate redundant fix for table color.
This is a prep commit to an optional commit. It rolls back the
changes from #30431 because #30449 tries to fix a wider regression
that included the issue #30431 tried to fix.
2024-06-18 09:48:41 -07:00
PieterCK d16ae00b15 app_components: Refactor table-striped border color rule.
This commit fix the regression for tables at uses the
.table-striped css, which are primarily used at the
settings menu.

In #29859, we began organizing CSS into more specific
variables and selector, which led to the deprecation of
several general CSS rules that affected these tables.

The fix switches the border-color value used by the
.table-striped css rules to a new CSS variable that
contains both dark and light theme values.

Fixes #30449
2024-06-18 09:48:41 -07:00
Shubham Padia 13ba9cc72a custom_profile_fields: Convert select field tooltip to use tippy.
See https://github.com/zulip/zulip/pull/29880#issuecomment-2166510991
2024-06-18 09:41:56 -07:00
Shubham Padia 2a7cbc96ec settings: Rephrase comment in settings_components.ts. 2024-06-18 09:41:56 -07:00
Aman Agrawal 00c56a65ed navbar: Rename realm-logo to realm-navbar-wide-logo. 2024-06-18 09:38:51 -07:00
Aman Agrawal 7ddf7a96dc navbar: Show realm icon logo instead of full logo on narrow widths.
When left sidebar is hidden between 1200px and 768px, we show
smaller realm icon logo instead of the full realm logo. Also,
we use the new space to expand the middle column to better show
the narrow description.
2024-06-18 09:38:51 -07:00
Aman Agrawal 406e9b89d0 css: Fix navbar logo misaligned on small heights. 2024-06-18 09:38:51 -07:00
Tim Abbott 1c3350b0b9 popovers: Fix typo in recent view menu. 2024-06-17 18:32:57 -07:00
Sayam Samal 72dd63a184 left_sidebar: Move popover `theme` prop to `left_sidebar_tippy_options`.
As a follow-up to the previous commits redesigning the left sidebar
popovers using the new `popover-menu` theme, this moves the `theme`
prop from all the individual left sidebar popovers to the shared
`left_sidebar_tippy_options` object.
2024-06-17 18:32:57 -07:00
Sayam Samal a529abc16e left_sidebar: Redesign stream settings popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal f81f26116f left_sidebar: Redesign condensed view popover.
This commit also sets all popover labels to flex grow into the remaining
available space. This allows us to align the unread counters, if any
to the rightmost corner of the menu option. This change, however, does
not lead to visual changes in any popover.

Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal c4defc80aa left_sidebar: Redesign drafts view popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal 40e548ef5b left_sidebar: Redesign starred messages popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal 6db809db70 left_sidebar: Redesign recent conversations view popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal b0ae9fedbf left_sidebar: Redesign combined feed view popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
Sayam Samal 7482f9b0fe left_sidebar: Redesign inbox view popover.
Fixes part of #28699.
2024-06-17 18:32:57 -07:00
nimish 81ea09be19 search: Add is:followed filter.
Create the is:followed search operator.
Fetch all messages that are from followed topics
using exists.
Update API documentation and changelog.

Co-authored-by: Kenneth Rodrigues <kenneth.nrk123@gmail.com>

Fixes #27309.
2024-06-17 18:22:50 -07:00
evykassirer 5c9f62443a search_suggestion: Refactor Attacher to keep a list of suggestion terms.
Previously we generated the search_string and display_html as we
generated suggestions. This commit changes the way Attacher works
to generate these strings once we want the final result. This gives
more flexibility, and will let us replace the last item of `result`,
which will be required for implementing search pills.
2024-06-17 18:01:11 -07:00
evykassirer 20e4778163 search: Don't use e.target for the query click handler.
This is preparation for search pills.

The X button for user pills will be a click target
that disappears from the DOM. We don't want to
look for the parent of a click element that might
not exist, since that would give us a false positive
and lead us to reset the search bar when removing a
user pill. This commit brings this click handler to
a more stable state.
2024-06-17 18:01:11 -07:00
Shubham Padia 8254ef428b settings_users: Add keyboard nav to org user settings toggler.
This commit also adds an extra $elem argument to
`settings_panel_menu.set_key_handlers` which defaults to $mail.elem.
This argument helps us specify a specific element to attach the key handlers
to, instead of the entire settings panel.
2024-06-17 17:16:21 -07:00
Shubham Padia aeaf808c57 settings_users: Add live-update on deactivation & reactivation.
We will redraw the list on every deactivation or reactivation.
While that might seem expensive to redraw on each user, the other
option we have is to have some logic run each time the tab is selected
and redraw if the user list has changed.
Since deactivation and reactivation is not something that an admin
would do multiple times a day, redrawing on each user should be fine
for now.
We will continue displaying the reactivated/deactivated users in a
greyed out column after the live-update, since it is weird for a user
to disappear suddenly from the list.
2024-06-17 17:16:21 -07:00
Shubham Padia 8ab6e71593 settings: Unite user settings into a single panel.
Previously, there were three different sections for managing active
users, deactivated users and invitations.
This commit combines users section has into a single tabbed panel.

Fixes: #26949.

Co-authored-by: shashank-23002 <21bec103@iiitdmj.ac.in>
2024-06-17 17:16:21 -07:00
Shubham Padia e4c89771fd settings: Rename `user-list-admin` to `users`.
Renaming the url for better readability on the user's side.
We've also added a redirect for this, which will change the `section`
from `user-list-admin` to `users` whenever required.
See https://github.com/zulip/zulip/pull/30268#discussion_r1631539656
2024-06-17 17:16:21 -07:00
Shubham Padia 9c47a7be28 hashchange: Add stub_with_args for admin.launch test.
We've added a new stub function that records the arguments passed
to a function called `stub_with_args`. We're only using this right
now for `admin.launch` since we plan to test that arg in the upcoming
commits for the redirect.
For most of the other functions, the args are empty, so it doesn't make
sense to refactor those tests to use this new stub.
2024-06-17 17:16:21 -07:00
Shubham Padia 1204d86818 settings_toggle: Rename `highlight_toggle` to `goto`.
The name sounded like it was doing some highlighting of the given
tab, instead of the actual navigation that the function does.

See https://github.com/zulip/zulip/pull/30268#discussion_r1631531684
2024-06-17 17:16:21 -07:00
Shubham Padia d858c36c43 settings_invites: Rename `Invites` to `Invitations`.
Since we are uniting the user settings into a single panel in the
upcoming commits, we are naming the invites tab as `invitations`.
We also replace `invites` with `invitations` on all user facing
strings on this page.
This commit is a preparatory commit for that.
See https://github.com/zulip/zulip/pull/30268#issuecomment-2155213539
2024-06-17 17:16:21 -07:00
Shubham Padia dd4fc4285a toggle: Add register_event_handlers to toggle prototype.
This is a preparatory commit to combine user settings panels into
one. We need to re-register event handlers since they get destroyed
when the settings modal is closed. After re-opening the modal,
clicking the tabs would not do anything unless we re-register our
event handlers.
2024-06-17 17:16:21 -07:00
Shubham Padia 78630b6395 settings: Store current tab value in current_tab.
When the organization settings are launched, there
is a duplicate function call to the 'activate_section_or_default'
function to render the correct section.

This commit adds a field to store the section name,
which is then used to render the correct section.

Co-authored-by: shashank-23002 <21bec103@iiitdmj.ac.in>
2024-06-17 17:16:21 -07:00
Joy Chen 8a1a41e1ac
search: Remove is:dm suggestion from get_operator_suggestions.
Previously, is: searches as a spectator would suggest "Direct messages", even though 
DMs aren't accessible for spectators. Fix this by moving the is:dm suggestion
logic to `get_is_filter_suggestions`, which is not used for spectators.

Fixes #30320.
2024-06-17 16:30:40 -07:00
sujal shah 967f99779a user_group: Move "Choose members" into a separate second panel.
Break the current user group creation panel into two panel
"Create user group: configure settings" and
"Create user group: add members".
2024-06-17 16:20:06 -07:00
sujal shah 8e6d07615c user_group: Extract `show_user_group_settings_pane`.
Extract `show_user_group_settings_pane` with related functions and
variable.
2024-06-17 16:20:06 -07:00
sujal 279e9d1dc3 stream_settings: Move "Choose subscribers" into a separate second panel.
Changed the title of the first panel to
"Create channel: configure settings" and title of second panel to
"Create channel: add subscribers".

Implement logic in stream_create.js to show and hide both the panels.

Add two buttons to facilitate switching between the tabs or panels.

Added new descriptions to 'stream type descriptions'.
2024-06-17 16:20:06 -07:00
sujal shah 56b00c4239 stream_settings: Update `selected_stream_title` file.
Before it was necessary to pass `preview_url` add `title_icon_color`,
But now they are optional parameters.
2024-06-17 16:20:06 -07:00
sujal shah 872d85daf6 stream_settings: Update stream type descriptions.
Update the descriptions of Web-public, Public, Private, shared history
and Private, protected history.
2024-06-17 16:20:06 -07:00
sujal 4dd8b258cd stream_settings: Restructure stream creation panel.
Removed the "Stream permissions" heading to simplify the panel.

Moved the "Announce new stream in {stream}" option just above
"Default stream for new users".

Implement a collapsible "Advanced configurations" section,
collapsed by default, to accommodate less commonly changed settings.
This allows for future expansion of stream permission configurations.

Fixes part of #29403.
2024-06-17 16:20:06 -07:00
Aman Agrawal 06d43cad3b navigate: Take user to top / end of feed on home / end keypress.
Fixes #14971

Instead of taking user to top / end of fetched history, we take
user to the first / last message of the narrow.

We simply check our cached history if we have the data for the
jump, if not, we ask server for the data.

Tested by simply pressing `fn + left / right arrow` on mac in
combined feed and topic narrows. Also, reduced message_fetch
constant values to be all single digital to check if the -
data not in cache -> fetch data -> select message logic works well.
2024-06-17 16:08:51 -07:00
Aman Agrawal e3cd3756bc navigate: Convert back to JS.
Need to import message_view which is not migrated to TS yet.
2024-06-17 16:08:51 -07:00
Lauryn Menard 1350157fdf profile-fields: Check for date fields before initializing flatpickr. 2024-06-17 13:44:13 -07:00
Prakhar Pratyush 5fd676c4e0 test_fixtures: Add 'message_link_test_cases' test fixture.
This is a prep commit to extract out the test cases
for 'test_is_same_server_message_link' in hash_util.test.js
as a test fixture.

This will help in reusing the same test cases in the node and
backend tests.

Also, it will help in making sure that the logic for
'is_same_server_message_link' is in sync, in both the
web client and server code.
2024-06-17 10:42:32 -07:00
Aman Agrawal 885957c529 resize_handler: Fix scroll jumps on iOS.
The URL bar in iOS shrinks / expands on scrolling causing change
in height. This triggers our resize handler and forces user to
jump to the selected message. This jump triggers before our
keep pointer in view logic kicks in which means user scrolls back
to the previous selected message instead of scrolling forward.

To fix this, we only do this jump when width changes on mobile
devices.

Note that modern devices support resizeable windows of all forms but
for most use cases where app is full expanded, this seems like the
right fix.
2024-06-17 09:28:09 -07:00
Kislay Verma 2feee9d756 right_sidebar: Remove realm description for spectators.
This commit removes the realm rendered description from
the right sidebar for spectators.

Fixes #30322
2024-06-16 11:56:11 -07:00
roanster007 ab6ae1099b refactor: Rename huddle to direct message group in web codebase.
This commit renames "huddle" to "direct_message_group" in the
web codebase. It also renames the file - "huddle_data.ts" to
"direct_message_group_data.ts"

Fixes part of #28640
2024-06-14 18:07:07 -07:00
roanster007 9f2eb329ef rename: Rename "huddle_data.ts" to "direct_message_group_data.ts".
This commit renames the file "huddle_data.ts" to
"direct_message_group_data.ts" in the web codespace.

This is a part of the migration of huddle to direct_message_group
of #28640.
2024-06-14 18:07:07 -07:00
Prakhar Pratyush de0c22592f push_notifications: Compress blockquotes when replying to a message.
To make better use of the limited characters in mobile push
notifications for messages quoting another message, we compress
the blockquotes and "user said" paragraphs to make space for the
actual message.

Fixes #28951.
2024-06-14 17:26:22 -07:00
Sahil Batra a70eb21ea1 settings: Use page_params.is_spectator field for spectator checks.
Instead of current_user.user_id we use page_params.is_spectator
field to check the spectator cases as it makes it more clear
to the reader about what is the condition checking.
2024-06-14 17:11:23 -07:00
Sahil Batra 3faaa5ecc8 settings: Use map to store setting dropdown widgets.
Instead of using different variables to store dropdown setting
widgets, we now store them in a map with setting name as key
and avoid duplicate switch cases in functions to get and set
the widget value.
2024-06-14 17:11:23 -07:00
Sahil Batra bf24d5b936 settings: Use common selector for dropdown widget CSS.
This commit updates CSS to use a common selector to set the
width and color properties for all dropdown widgets in the
"Organization permissions" panel as we expect all dropdown
widgets to have same width and color.

This helps in avoiding bug in UI if someone forgots to update
the CSS while adding a new setting using dropdown widget.
2024-06-14 17:11:23 -07:00
Sahil Batra 77f327260d settings: Fix public channel creation setting in dark theme.
The correct CSS was not being applied to the public channel
creation setting dropdown in dark theme and this commit fixes
it by just updating the CSS to use a common selector for all
dropdown widgets in "Organization permissions" panel, so that
we would avoid having this kind of bug in future when more
settings are added.

We do not update the CSS to use a common selector for all
dropdown widgets in the whole settings overlay because
the one used for notification stream settings use different
text color for now.
2024-06-14 17:11:23 -07:00
Karl Stolley 5c23d80db8 navbar: Consolidate view, channel structures and styles.
In addition to simplifying the code in this area, this has the
effect of correcting vertical alignment of icons on views.
2024-06-14 17:06:59 -07:00
Karl Stolley 270ba008d9 informational_overlay: Constrain to variablized width. 2024-06-14 16:43:05 -07:00
Anders Kaseorg 9b7f17eb72 state_data: Move comments back to the correct declarations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-14 16:19:02 -07:00
Karl Stolley ec33bde88f org_settings: Improve organization preview button layout. 2024-06-14 11:04:18 -07:00
PieterCK 56db3f3d12 informational_overlays: Fix CSS for tables in info_overlay.
This commit refactors the CSS for table in info_overlay
menus (keyboard_shortcuts, search_operators, markdown_help).

In #29859, we began organizing CSS into more specific
variables and selector, which led to the deprecation of
several general CSS rules that affected these tables. The
fix adds a new variable in app_variables.css which is used
at a wrapper div specificly targeting these tables.

Fixes #30428.
2024-06-14 10:50:45 -07:00
Karl Stolley 544d86646e recent_view: Improve alignment and grouping of status emoji. 2024-06-14 10:50:21 -07:00
Karl Stolley 25e19d8417 recent_view: Improve icon sizing and alignment. 2024-06-14 10:50:21 -07:00
Karl Stolley ee0d38166a recent_view: Remove unnecessary group icon styles. 2024-06-14 10:50:21 -07:00
Lauryn Menard 0bd2f0e545 api-docs: Extract logic for rendering events table and use templates.
Extracts code for generating the events table strings to a separate
function and uses templates so that the HTML is clearer.

Updates events table classes for CSS to start with "api-" for
clarity.
2024-06-14 10:29:53 -07:00
Lauryn Menard 963c871858 api-docs: Extract logic for generating individual event strings.
Creates a dataclass for getting the data needed for an individual
event's documentation and uses that dataclass in a separate
function for generating the strings for each event's documentation.

Uses templates for parts of event documentation with HTML and CSS,
and updates CSS classes to have clearer names.
2024-06-14 10:29:53 -07:00
N-Shar-ma 50fcc740bc compose: Fix bug causing layout shift on expanding compose box.
The messagebox-wrapper div is removed, and it's only style `flex: 1` is
applied to the messagebox div. The `height: 100%` and `margin-top: 5px`
styles on the messagebox div were earlier causing it to move 5px down,
outside the messagebox-wrapper div, when the compose box was expanded.
2024-06-14 10:18:08 -07:00
N-Shar-ma af76d80856 compose: Fix bug where compose box was sometimes not scrollable.
Earlier, autosize wasn't updated for the compose box after resetting its
`max-height`, so in cases where the older `max-height` was more than the
height, and the current max-height was less than the height, the compose
box would not be scrollable.

We now always update the autosize after resetting the max-height.
2024-06-14 10:15:47 -07:00
Karl Stolley 90f6e19948 user_groups: Restore correct max-height value.
This restores a value that was erroneously changed in #30388.
2024-06-14 10:01:58 -07:00
Aman Agrawal a361f2939a stream_edit: Fix user popover permanently displayed in stream settings.
If a user popover is open in stream settings, and user presses
`down/up` arrow to view settings for a different stream, the user
popover stay open.

Why we need to explicitly hide it?
We have click handlers to hide the popover and `data-reference-hidden`
to hide the popover if the reference goes offscreen via scrolling.

In this case, those events don't fire, there is no reason for tippy
to check if reference is visible and thus show / hide the popover.
2024-06-13 06:57:23 -07:00
Vector73 e8a5cb99bf api_docs: Improve events table and fix font style of events title. 2024-06-13 06:53:51 -07:00
Kislay Verma 03f81eef07 navbar: Tweak Combined feed description for spectators.
Since spectators cannot mute channels or topics, the combined
feed description for spectators is tweaked to exclude that part.

Fixes #30321
2024-06-13 06:50:07 -07:00
PieterCK dae4c28b5b css: Add new css for rendered markdown table in dark mode.
Add a new dark mode css in app_variable.css for rendered
markdown tables. This rule sets a brighter color for tables
in messages / chat to make it more visible when the user is
using dark theme.

Fixes zulip#29856.
2024-06-12 06:45:00 -07:00
PieterCK e16b8eba56 css: Refactor css for markdown thead background color.
This refactor aims to make managing css for rendered
markdown table easier by abstracting the css for thead
background color into a new variable in app_variable.
2024-06-12 06:45:00 -07:00
PieterCK 55fe0c5c85 css: Refactor css for markdown table border color.
This refactor aims to make managing css for rendered
markdown table easier by abstracting the css for table
border color into a new variable in app_variable.
2024-06-12 06:45:00 -07:00
Aman Agrawal 4e9ea5d782 help: Fix left sidebar not bouncing on mac.
Since left sidebar was in fixed position, mac's rubber-band scroll
effect was not working on it while it was working for others making
the bounce look weird.

Fixed by letting it bounce with the rest of the elements on the page.
2024-06-12 05:33:36 -07:00
Aman Agrawal 5aec31cf99 billing: Remove success message from URL after being displayed.
We directly override the browser history to remove the parameter from
URL to avoid it being displayed if user comes back in history too.
2024-06-11 15:26:57 -07:00
Anders Kaseorg 3b22065477 web: Add missing CSS escaping for url(…).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-11 15:22:33 -07:00
N-Shar-ma ac3b5b3b04 compose: Redesign and relocate compose expand / collapse button.
The compose expand / collapse button is moved from the top right of the
compose area to the top right corner inside the compose textarea /
preview.

The textarea / preview and the button area shares the same grid parent.
25px extra padding is added to and margin is subtracted from the right
of the element so the button is visually inside it. It appears only on
hovering the compose area, and uses a new custom icon.

Fixes: #28791.
2024-06-11 14:13:10 -07:00
N-Shar-ma 41d790bd08 compose: Make the preview box background color same as the textbox's. 2024-06-11 14:13:10 -07:00
Tim Abbott 5d88ff6676 user_profile: Fix live-update exception when viewing channels tab.
Sentry reporting discovered that if the user was viewing the channels
tab for a bot when the bot's owner was changed (or various other
live-updates), we'd throw an exception trying to access the
original_values object for the manage-user/bot tab.

This code is fragile and messy, but probably a framework change is the
most expedient path to fixing it.
2024-06-11 13:41:46 -07:00
Karl Stolley 47c3903ce0 settings: Present modal sidebars as gridded rows. 2024-06-11 13:34:11 -07:00
Karl Stolley a4aa8d48ca settings_modal: Scope sidebar transition to properties in use. 2024-06-11 13:34:11 -07:00
evykassirer fea4b2f65d buddy list: Remove buggy check preventing updates to me.
This check doesn't work with the `me` user, because that
user is always at the top of the all users list, and
therefore `new_pos_in_all_users` will always be 0 and
never `render_count`. It's possible this was already
broken before the split buddy list change.

We can remove this check because `insert_new_html` is only
called when we definitely want to insert html. It's only
called from `insert_or_move`, and for moves we always
remove the user we're moving/replacing before the insert.
2024-06-11 12:58:18 -07:00
Aman Agrawal c5b8255d42 navbar: Move left sidebar toggle icon to left of org logo.
Make the org logo smaller and moves the left sidebar toggle icon
to the left of the logo.
2024-06-11 12:42:42 -07:00
Aman Agrawal 04f4b75d62 sidebar_ui: Save current toggle status in localstorage. 2024-06-11 12:42:42 -07:00
Aman Agrawal 043e0311d2 css: Expand to occupy left sidebar space if available on narrow widths. 2024-06-11 12:42:42 -07:00
Aman Agrawal 8aafb72e18 css: Let middle column expand to full width in fluid layout.
When left / right sidebar are hidden, we let middle column to take
up the extra space.
2024-06-11 12:42:42 -07:00
Aman Agrawal 80cc699f42 css: Fix left sidebar toggle button misaligned on small window height. 2024-06-11 12:42:42 -07:00
Aman Agrawal 96dac9ece9 navbar: Add button to toggle left sidebar. 2024-06-11 12:42:42 -07:00
Aman Agrawal c531631ecf navbar: Rename left sidebar toggle button unread count indicator.
Renamed to match the name with the wrapper element and used class
so that we can apply same CSS to other buttons.
2024-06-11 12:42:42 -07:00
Aman Agrawal 9fec1f69ed navbar: Rename left sidebar toggle button.
This name better describes what the button does and using a class
helps us use it's CSS and events for other buttons.
2024-06-11 12:42:42 -07:00
Aman Agrawal 38482c2e4e right_sidebar: Fix user list toggle button not spanning navbar height.
We don't need to reduce height of user list toggle button on
narrow widths. Reduced height is already applied to the user list
toggle button when the window height is below a threshold.
2024-06-11 12:42:42 -07:00
Karl Stolley db5f584684 info_density: Sanely restore Zulip-style oversize emoji. 2024-06-11 12:25:16 -07:00
Karl Stolley cc3202a1be info_density: Size and align emoji precisely with line-fitted values. 2024-06-11 12:25:16 -07:00
Karl Stolley 1270e4b74b info_density: Calculate values for inline-box vertical alignment.
Co-Authored-By: Greg Price <greg@zulip.com>
2024-06-11 12:25:16 -07:00
Sahil Batra 901b216e7a settings: Refactor code to handle dropdown widgets.
We now add a new function to set up the dropdown widget for
settings using new dropdown_widget.DropdownWidget instead of
calling dropdown_widget.DropdownWidget multiple times to
reduce code duplication.
2024-06-11 12:22:10 -07:00
Sahil Batra 47b678a4ab settings_components: Use single function to set dropdown widget variables.
Instead of having different functions to set values of dropdown widget
variables, we now use a single function to set their values by passing
the setting name to the function.
2024-06-11 12:22:10 -07:00
adnan-td ef65137675 compose_pills: Fix long text overflow in DM recipient box.
Removes the fixed height of the input field in compose
DM recipient box. This commit makes the behaviour of recipient
compose box equal to input pills used else where.

Fixes: #27688.
2024-06-11 12:00:15 -07:00
adnan-td 2521adb0cd invite_user_modal: Fix background color of input field. 2024-06-11 11:59:40 -07:00
Varun Singh fee7fb6c87 user_group_create_members: Convert module to TypeScript. 2024-06-11 11:58:12 -07:00
Varun Singh 78f105475a stream_create_subscribers: Convert module to TypeScript. 2024-06-11 11:57:46 -07:00
Vector73 f4c111b68a api_docs: Convert event names to lowercase in api docs. 2024-06-11 11:17:38 -07:00
Vector73 a4108e05ad api_docs: Add table of links for easy navigation in events api docs. 2024-06-11 11:17:38 -07:00
Sayam Samal 1cb3c85417 compose: Update CZO links from stream to channel in compose tests.
This is a follow-up to the previous commit, which updated the links in
docs and comments. This commit updates those links that are part of
some code.

This commit is a part of the effort to rename stream to channel.
2024-06-11 10:44:31 -07:00
Sayam Samal a7772f86a2 docs: Update CZO links from stream to channel in docs and comments.
Updates all the https://chat.zulip.org/#narrow/stream/ links in the
docs and comments to use the new /channel/ path. All these links are
for documentation/reference purposes only and thus, can be bulk-updated.

This commit is a part of the effort to rename stream to channel.
2024-06-11 10:44:31 -07:00
Aman Agrawal 16f2c4195b activity: Move `.container` CSS from bootstrap to activity.css.
* `.container` class is only used in `/activity/support` and
  `/activity/remote/support` pages. It is also used in emails but
  it has its own CSS.

* Since the CSS applied is localized and looks good, we just
  move the CSS relevant to us to `activity.css` which is used
  by both of these pages.

* Searched `"container"`, ` container `, `"container ` and
  ` container"` to look for the uses of this class.
2024-06-11 10:42:43 -07:00
Aman Agrawal b40e9acfdf portico: Remove stale CSS.
`container` class was removed from error pages as part of
b2f0677c25.
2024-06-11 10:42:43 -07:00
Aman Agrawal f26b000621 resize: Remove height of hidden elements from buddy list height.
If the elements are hidden, their margin is still included in
calculating the height of buddy list which we don't want.
2024-06-11 10:40:48 -07:00
Karl Stolley 520b7b6a9e compose: Declare banner dimensions in ems. 2024-06-11 10:38:40 -07:00
Karl Stolley 2b92baa754 compose: Size collapsed compose buttons relatively. 2024-06-11 10:38:40 -07:00
Karl Stolley 47cf447bf2 compose: Express recipient box height in ems. 2024-06-11 10:38:40 -07:00
Karl Stolley 131ae54eb7 compose: Prevent blowout on recipient box. 2024-06-11 10:38:40 -07:00
Sayam Samal 01cbaa154f popovers: Add `.popover-menu-tab-group` class to popover tab pickers.
This commit, adds the `.popover-menu-tab-group` class to the tab pickers
that appear together with the other popover menu options and thus
need to match their spacing and margins for a uniform look.

This removes the need to maintain a cluttered list of tab pickers that
need to be styled as such in the `popovers.css` file.
2024-06-10 16:54:11 -07:00
Sayam Samal 70fb213868 visibility_policy_popover: Use the new "popover-menu" popover theme.
As part of the popover menu redesign, this updates the topic visibility
popover to use the new "popover-menu" popover theme and improves
accessibility by using appropriate ARIA attributes.

This also moves the `:focus-visible` CSS rule to apply to any tab
picker in a popover, removing the need to explicitly add it to each
tab picker.

Fixes part of #28699.
2024-06-10 16:54:11 -07:00
Prakhar Pratyush 0c13422c0d compose_banner: Don't show banner if message sent in a near view.
Earlier, when a user was in /near/ topic or dm view, on sending
message in the same conversation we were incorrectly displaying
the 'jump to sent message' banner.

This commit fixes the incorrect behavior.

Fixes #30341.
2024-06-10 14:23:17 -07:00
Prakhar Pratyush bb4d62ffa6 scheduled_message_feed_ui: Show the scheduled indicator in near view.
Earlier, when a user was in /near/ topic or dm view, the scheduled
message indicator was missing in the conversation.

This commit fixes the incorrect behavior.
2024-06-10 14:23:17 -07:00
N-Shar-ma ff4d7974f2 css: Remove dead code for an unused empty div. 2024-06-10 13:25:21 -07:00
Sahil Batra 222995b1be settings: Remove create_public_stream_policy.
This commit removes create_public_stream_policy setting
since public channel creation permissions are now handled
by group-based setting.

We still pass "realm_create_public_stream_policy" in
"/register" response though for older clients with its
value being set depending on the value of group based
setting. If we cannot set its value to an appropriate
enum corresponding to the group setting, then we set
it to "Members only" considering that server will not
allow the users without permissions to create public
channels but the client can make sure that UI is
available to the users who have permission.
2024-06-10 12:24:45 -07:00
Sahil Batra f98a3fc684 settings: Use new group setting to check permission for creating public channels. 2024-06-10 12:24:45 -07:00
Kenneth Rodrigues f53a7cdffa reaction-view: Create has reaction operator.
Create has:reaction search operator and search suggestions.
Create sidebar view for the user to view their messages that
have reactions using has:reaction sender:me operators.
Add custom heading for the view and tooltip in the sidebar.
Add documentation for the new operator.

Fixes: #27328.
2024-06-10 11:46:37 -07:00
Prakhar Pratyush 9120fec604 message_basic_tests: Fix flaky behaviour on sending multiple messages.
While sending multiple messages to different recipients in
'message_basic_tests', we were facing flaky test failure.

The reason being now we jump to the conversation where message
was sent & that was resulting in calls to the
'wait_for_fully_processed_message' function as 'outside_view'
was not correctly set.

Precisely, the call to 'wait_for_fully_processed_message' uses
zulip_test.current_msg_list which won't remain correct when
the sender is narrowed to different views on sending messages
to different recipients in succession.
2024-06-10 10:37:41 -07:00
Anders Kaseorg 1a8d8411a7 tsconfig: Enable composite.
This allows TypeScript to use incremental compilation by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-09 12:08:03 -07:00
Anders Kaseorg f03c56d9da shared: Enable exactOptionalPropertyTypes, noUncheckedIndexedAccess.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-09 12:08:03 -07:00
Anders Kaseorg 56753edbcd tsconfig: Organize and sort options consistently.
Organize and sort the options in tsconfig.json according to the way
they’re listed at https://www.typescriptlang.org/tsconfig/.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-09 12:08:03 -07:00
Anders Kaseorg 48feabbb17 shared: Upgrade TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-09 12:08:03 -07:00
Anders Kaseorg 13c44efad9 marked: Fix type stub to declare marked as a CommonJS module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-08 00:26:38 -07:00
Anders Kaseorg fa91a4493c web: Qualify global uses of location and history.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-07 16:10:39 -07:00
Mateusz Mandera 45118180bb presence: Don't send slim_presence in the webapp when querying presence.
Sending last_update_id implies using slim_presence=true, so sending the
extra param is redundant now.
2024-06-07 13:57:40 -07:00
Mateusz Mandera 3ded4c2a7d presence: Frontend implementation of the last_update_id API.
Note: This involves adding presence info of unknown users to the
presence data.
With some small tweaks, we can just add the info to the presence data
structures, just making sure the buddy list correctly skips those
entries and that we redraw the user in the case where the user creation
event arrives after the presence polling loop.
2024-06-07 13:57:40 -07:00
Anders Kaseorg 407655b84f portico header: Remove unnecessary type assertion.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-07 12:12:39 -07:00
Anders Kaseorg 6fd27ce892 list_widget: Reduce TypeScript wreckage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-07 11:54:37 -07:00
Karl Stolley 4ed51fd06b right_sidebar: Uniformly group user name and status emoji.
This fixes the presentation of emoji in the compact view, where the
flexbox for properly aligning emoji was not set.
2024-06-07 11:53:26 -07:00
Karl Stolley 835bda9634 navbar: Express font and icon sizes in ems. 2024-06-07 11:28:39 -07:00
Karl Stolley 7e1a5e7e45 navbar: Remove unused fa-hashtag CSS. 2024-06-07 11:28:39 -07:00
Karl Stolley dc60317dad info_density: Set calculated font-size on body. 2024-06-07 11:18:52 -07:00
evykassirer 346dc7d79d compose: Auto-close unchanged auto-opened drafts on narrow change.
Fixes #30104.
2024-06-07 10:38:20 -07:00
evykassirer 4cbcd66753 compose_recipient: Set flag that recipient was changed when stream is selected.
This was missed when moving to a stream dropdown instead of input field.
2024-06-07 10:38:20 -07:00
Aman Agrawal 371cd0da6c recent_view: Use html as scroll container.
Fixes #17933, #27517

Instead of `recent_view_table`, we make `html` as our scroll container.
This fixes an important bug for us where filters sometimes disappear
due to them scrolling under navbar which is unexpected. Since we are
now using separate containers to display rows and
filter (while includes table headers), where filters use sticky
positioning, this bug will be fixed.
2024-06-07 10:17:10 -07:00
Aman Agrawal 4750f84ba8 recent_view_ui: Fix first row being focused after scrolling to bottom.
If recent view load more banner is at the center as a result of
`document.elementFromPoint(topic_center_x, topic_center_y)`,
there is no `tr` to focus, resulting in first row to be focused
as the closest element as per previous logic.

To fix it, we just focus the last row which is just above the
load more banner and is visible.
2024-06-07 10:09:30 -07:00
Aman Agrawal 3cc7613841 css: Remove no longer used `required-text` class.
Since we moved to use standard empty view handlebars everywhere,
this became stale.
2024-06-07 10:09:30 -07:00
Anders Kaseorg c9e822f7ad custom_profile_fields_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-07 09:49:40 -07:00
Anders Kaseorg e6bfaed782 pill_typeahead: Separate user-only typeahead to specialized function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-07 09:49:40 -07:00
Kislay Verma a83dc572df overlay: Blur focused element while overlay is open.
We blur the focused element when an overlay opens, and refocus
it when the overlay is closed, to prevent side effects.

What motivated this change was that opening a lightbox overlay
from preview content while editing a message caused the escape
key to close the message edit form instead of closing the overlay.
2024-06-06 17:13:11 -07:00
Karl Stolley 1d7e0367b8 right_sidebar: Establish inner grid on selectable_sidebar_block. 2024-06-06 17:08:13 -07:00
Karl Stolley 55e0b99670 right_sidebar: Establish outer grid on user rows. 2024-06-06 17:08:13 -07:00
Karl Stolley 74800ba69a right_sidebar: Set user rows to normalized em-based line-height. 2024-06-06 17:08:13 -07:00
Karl Stolley 9b7107ab08 user_circles: Specify colors as CSS variables. 2024-06-06 17:08:13 -07:00
N-Shar-ma 0b728e1b34 copy_and_paste: Let uppy handle pasted single images.
This fixes the bug where an image copied from sites like Twitter / X did
not paste as expected.
2024-06-06 17:03:44 -07:00
Anders Kaseorg aaf90a1da0 typeahead: Nest User inside UserPillData, UserOrMention.
Commit 33484e7ac3 (#29200) added a cache
for remove_diacritics, but this caching was rendered ineffective by
commit 45e9c046d8 (#29650) because it
relied on mutating a direct reference to the User object.  Fix the
cache by rearranging the types to preserve that direct reference.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-06 15:24:54 -07:00
Aman Agrawal 2340855851 typeahead: Remove delay when opening / closing typeahead.
This default delay comes off as the typeahead being laggy to the user.
2024-06-06 12:10:16 -07:00
Varun Singh 4ac12022ca navigate: Convert module to TypeScript. 2024-06-06 11:10:05 -07:00
Aman Agrawal fe162290f1 portico: Remove extra margin on help page.
Likely an effect of recent error pages refactoring.
Tested /help and /api page on desktop and mobile width.
2024-06-06 11:06:08 -07:00
Karl Stolley 53c1c4d98f widgets: Improve structure and layout of headers. 2024-06-05 17:49:21 -07:00
Karl Stolley 81d9eb4a54 widgets: Present poll options as flexboxes. 2024-06-05 17:49:21 -07:00
Karl Stolley ae90258942 widgets: Extend flexbox to widget inputs, buttons. 2024-06-05 17:49:21 -07:00
Karl Stolley da6f69f8b2 widgets: Present to-do items with flexboxes. 2024-06-05 17:49:21 -07:00
Karl Stolley f78fef699e widgets: Set margin only on widget bottom. 2024-06-05 17:49:21 -07:00
Karl Stolley 7820c5e15e widgets: Add classes to todo-widget div and span tags. 2024-06-05 17:49:21 -07:00
Karl Stolley 9b8e8bf0d3 widgets: Remove unnecessary styles. 2024-06-05 17:49:21 -07:00
Anders Kaseorg 72b6c97042 i18n: Allow get_language_name to return undefined again.
This can happen when the user’s configured language is less than 5%
translated.  Fixes an assertion failure introduced by commit
6a429603ad (#30261).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-05 12:25:15 -07:00
Aman Agrawal f58c586bee narrow: Rename to `message_view`.
This brings it in sync with other libraries like `message_list`
and `message_list_data`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 48cdfd25f7 narrow: Rename `by_topic` to `narrow_by_topic`. 2024-06-05 12:03:59 -07:00
Aman Agrawal fecb9afa94 narrow: Rename `activate` to `show`.
This make the main call which displays message list sound similar
to `recent_view.show` and `inbox_ui.show`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 69cd263312 narrow: Rename by_recipient to narrow_by_recipient.
This would make the call `message_view.narrow_by_recipient` sound
better than `message_view.by_recipient`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 9374195418 narrow: Migrate uses of `by` function to `activate` function.
This is part of renaming effort of `narrow` to `message_view`.
2024-06-05 12:03:59 -07:00
Sayam Samal 552ab984a9 message_actions_popover: Hide extra separator in spectator view.
In the spectator view, we are only left with the last few options
belonging to the same group, and the separator is not needed.
2024-06-05 11:56:56 -07:00
Sayam Samal 09bf7d0f95 personal_menu_popover: Move the theme switcher to the settings group.
This moves the theme switcher from the randomly placed position to the
settings group since it is one of the user preference settings.
2024-06-05 11:16:55 -07:00
Prakhar Pratyush 22f3aebb33 compose: Show a one-time banner for jump to sent message conversation.
We immediately navigate the user to the conversation they just
sent a message to if they are not already in the appropriate
conversation view.

This commit adds a first-time banner to explain the same.

Fixes #29575.
2024-06-05 09:31:17 -07:00
Prakhar Pratyush e4cbca698d compose: Jump to conversation where message was sent.
Removes two 'narrow_to_recipient' banners which were
shown after sending a message to a different conversation.

Now, the sender is narrowed to the conversation where
message was sent.

Fixes #29186.
2024-06-05 09:30:34 -07:00
N-Shar-ma e959a392c9 compose: Make conversation arrow double as a go-to-conversation button.
The chevron arrow icon before the topic / dm user field now also acts as
a go to conversation button. Whenever the functionality is available,
the plain icon changes to look and behave like a button. The old go to
conversation button on the right of the field is removed.

Fixes: #28697.
2024-06-05 09:26:01 -07:00
Aman Agrawal b1a143e47c css: Remove unused `row-fluid` class. 2024-06-05 09:15:32 -07:00
Sayam Samal 94627196df popovers: Fix popovers force closing on topic visibility change.
When a topic is muted, it is removed from the view in some cases.
This can lead to the popover being force closed since the popover is
anchored to the reference element.

We add a delay to all the methods that contribute to hiding the topic,
on mute, to allow the relevant animations to be completed before the
topic is hidden from view and the popover is closed.
2024-06-04 15:56:44 -07:00
Sayam Samal 56be95a1c8 topic_popover: Remove redundant code from previous visibility options.
Commit 3f2ab44f94 removed the 'development' guard and cleaned the
older UI of the previous topic visibility options implementation,
but it missed the related JS logic.

This commit removes this redundant code, which was now present in
`web/src/topic_popover.js`.
2024-06-04 15:56:44 -07:00
Sayam Samal d93a3bb175 topic_sidebar_actions: Use sliding animation in the visibility switcher.
This commit updates the sidebar topic actions popover to use the new
sliding tab switcher for the topics visibility policy switcher.

This also includes changes such as hiding the popover only on
successful request completion, and adds error feedback by indicating
it via the sliding animation.
2024-06-04 15:56:44 -07:00
Sayam Samal 8877833603 visibility_policy_popover: Add feedback via switcher when request fails. 2024-06-04 15:56:44 -07:00
Sayam Samal a3d60c9f09 visibility_policy_popover: Hide popover only when request is successful.
This hides the visibility policy popover only when the request to
change the topic visibility policy is successful.

This allows a user to retry changing the policy in case of a request
failure, without having to open the popover again from the start.
2024-06-04 15:56:44 -07:00
Sayam Samal db4c5cdfc6 visibility_policy_popover: Use sliding animation in the switcher.
This commit updates the topic visibility popover to use the new
sliding tab switcher, which was introduced in personal menu >
theme switcher.
2024-06-04 15:56:44 -07:00
Kislay Verma 2c98263d4c left_sidebar: Rename "more topics" to "all topics".
This commit renames the occurrences of "more topics"
to "all topics" in comments and documentation.

Fixes #30014
2024-06-04 10:18:54 -07:00
Lauryn Menard c4f1d44dd7 i18n: Fix translated strings for delete profile field option.
Fixes how the confirmation modal title is generated for translation
for deleting an option or multiple options from a customer profile
field that's a list of options.
2024-06-04 09:54:35 -07:00
sujal shah d793cc0f54 tooltip: Render tooltips for `Not subscribed` and `All channels` tabs.
Render tooltips for both the tabs if the user is guest user.

Fixes #21869.
2024-06-04 09:49:50 -07:00
sujal shah 26ae173a2c left_sidebar: Change redirect link for Browse channels.
This commit changes the redirect links for "Browse channels" and
"Browse 1 more stream" to the Not subscribed(#streams/notsubscribed)
tab.
2024-06-04 09:49:50 -07:00
sujal shah 6c437eda77 stream_settings: Display No channel text when no channel present.
In the "not-subscribed" tab, when there are no channels to show, we
display a text message saying "No channels to show. View all channels"
along with a link that redirects the user to the "All channels" tab
(All channels(#channels/all)).

Updated the update_empty_left_panel_message function in
stream_settings_ui.js to modify and determine which banner to display
when no channels are available to show, modified that function to also
display the banner of the "not-subscribed" tab using a new classname
called 'not_subscribed_streams_tab_empty_text'.
2024-06-04 09:49:50 -07:00
sujal shah 619e234100 stream_settings: Change the if-else with switch statement. 2024-06-04 09:49:50 -07:00
sujal shah 6deb165ef6 stream_settings: Add Not subscribed tab to stream settings.
This commit adds a new tab to the stream settings overlay called
"Not subscribed" which lists all the streams the user is not
subscribed to. This tab is disabled if the user is a guest.

Introduced a new variable called "show_not_subscribed" to replicate
a similar model to how the subscribed tab is working. Currently,
there are only two tabs: "subscribed" and "all streams" so we can
use an if-else condition.

Refactored the 'update_stream_row_in_settings_tab' function inside
stream_ui_updates.js to include the case of a 'Not-subscribed' tab,
so that the tab is immediately updated in any add/remove subscription
event.

Fixed and added the node tests for these changes.
2024-06-04 09:49:50 -07:00
sujal shah d7936fe576 stream_overlay: Change the subscribed_only to show_subscribed.
This commit changes the variable and function name from
"subscribed_only" to "show_subscribed" and
"set_subscribed_only" to "set_show_subscribed"
so that in the next commit, when the "not subscribed" tab is added,
we can use a similar variable named "show_unsubscribed" and function
named "set_show_unsubscribed".
2024-06-04 09:49:50 -07:00
Aman Agrawal c6c8e831f8 portico_error_page: Apply `error` class to all the error pages.
This helps us control the CSS applied to the elements outside the
content scope of `portico_error_page.html`.
2024-06-04 09:41:34 -07:00
Aman Agrawal b2f0677c25 portico: Remove `container` and `row-fluild` bootstrap classes.
Fixes #28526

* Removed `container` and `row-fluid` class from error pages.
* Use a variable for footer height.
* Made header sticky instead of fixed allowing us to position
  page content without adding arbitrary padding or margin at top.
  Header is around 60px in height, so reduced that much top padding
  or margin.
2024-06-04 09:41:34 -07:00
Aman Agrawal b3a5b2b9aa 5xx: Fix header colors. 2024-06-04 09:41:34 -07:00
Aman Agrawal 27d2b89412 unsupported_browser: Remove not required extra bottom padding. 2024-06-04 09:41:34 -07:00
Varun Singh 6b42c18220 settings_preferences: Convert module to TypeScript. 2024-06-04 08:50:07 -07:00
Varun Singh b1943f560a settings_preferences: Refactor initialize function.
Before this commit the `user_settings_panel` object was declared as
a `const` and assigned an initial value of `{}`. Later, inside the
initialize function the object was mutated with three fields (`container`,
`settings_object`, `for_realm_settings`).

TypeScript does not allow this.Hence,we have removed the initial
value(`{}`) and changed the object to be a `let` var. This means,
when the `initialize` function is called `user_settings_panel` object is
undefined and hence `user_settings_panel.foo` will throw an exception.
To avoid this we have refactored the function by changing the way
`user_settings_panel` object is assigned value.
2024-06-04 08:50:07 -07:00
Varun Singh 796cc038c4 page_params: Add property to zod object. 2024-06-04 08:50:07 -07:00
Varun Singh be91b41236 settings_preferences: Don't store 'success_msg_html' if undefined.
Although both 'sticky' and 'success_msg_html' parameters
are passed optionally, the conditional took into account
only the former.
2024-06-04 08:50:07 -07:00
Lauryn Menard 6f7e288b1f billing-css: Remove out-of-date rule for input styling.
These were removed in commits ebc7cbaf3, 6cadf333f and e9a0c8a03.
2024-06-04 08:49:43 -07:00
evykassirer 9a3263ec5d messages: Rename convert_raw_message_to_message_with_booleans. 2024-06-03 15:42:41 -07:00
Anders Kaseorg 48d3601649 echo: Use newly created MessageWithBooleans in insert_local_message.
Commit 50f5cf9ad8 (#30227) changed
message_helper.process_new_message (called by
message_events.insert_new_messages) to return a newly created message
object rather than mutating the object it was passed.  So
echo.insert_local_message needs to use this new object, fixing a
regression where we’d fail to replace a locally echoed message when
the server-rendered message came in.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-03 12:25:08 -07:00
afeefuddin 394e8fc856 navbar_alerts: Convert module to TypeScript. 2024-06-03 12:19:58 -07:00
afeefuddin 7025d409c3 navbar_alerts: Use UNIX timestamp consistently. 2024-06-03 12:19:58 -07:00
afeefuddin b3809a33b5 state_data: Update realm_schema.
Add demo_organization_scheduled_deletion_date and realm_date_created
to realm_schema.
2024-06-03 12:19:58 -07:00
Karl Stolley 0f6072d2d6 left_sidebar: Condense nav rows to standard size. 2024-06-03 10:32:29 -07:00
Karl Stolley 5dafaf9deb left_sidebar: Expand topic rows to prominent size. 2024-06-03 10:32:29 -07:00
Vector73 88df01bee5 web: Replace `realm_uri` with `realm_url` in frontend files.
Replaces `realm_uri` with `realm_url` in some frontend files and a js test.
2024-06-03 10:07:10 -07:00
Prakhar Pratyush 32391c3d06 ui_init: Don't store onboarding_steps state_data as current_user_param.
Earlier, onboarding_steps field of state_data was stored as
current_user_params.

Now, we store it separately in a data structure initialized in
onboarding_steps.ts

Reason: All the other state_data fields stored in current_user_params
are attributes of UserProfile. So, it makes sense to store it
separately.

Fixes part of #30043.
2024-06-03 08:53:28 -07:00
Prakhar Pratyush 915503df10 onboarding_steps: Rename the function 'update_notice_to_display'.
This commit renames the function 'update_notice_to_display' to
'update_onboarding_steps_to_display' as it can be used for
onboarding step of any type.

Currently, we have only one type i.e. 'one_time_notice'.
2024-06-03 08:53:28 -07:00
Aman Agrawal 6750b02437 recent_view: Reduce constant flashing of recent view on initial load.
We completely rerender recent view when we receive a new message,
which is not ideal since it is flashes recent view frequently
during the initial fetch.

Since later parts of initial fetch which trigger the flash, only
load old messages, they cannot change the latest message of
rendered rows in recent view. That means we can just inplace
rerender the rendered rows which got updated and don't have
to worry about order of rows being changed.
2024-06-02 21:52:45 -07:00
afeefuddin 2fb1199af5 compose_call_ui: Pass $target_textarea consistently to insert call link.
Pass $<HTMLTextAreaElement>("textarea#compose-textarea") instead of
undefined when inserting the call link in compose-textarea.
2024-06-02 21:49:49 -07:00
afeefuddin 7b5ccf0c98 compose_call_ui: Rename target_textarea to $target_textarea. 2024-06-02 21:49:49 -07:00
afeefuddin 9cf9cec43a compose_call_ui: Convert module to TypeScript. 2024-06-02 21:49:49 -07:00
afeefuddin 49c4e5ec44 ui_report: Fix inaccurate annotations for generic_embed_error parameter.
The remove_after parameter is optional; when not provided, the alert is
not removed.
2024-06-02 21:49:49 -07:00
afeefuddin ab3bb767af state_data: Add has_zoom_token to current_user_schema. 2024-06-02 21:49:49 -07:00
Aman Agrawal bb6e6ecaa5 hello: Redesign landing page.
Co-authored-by: Vlad Korobov <terpimost@gmail.com>
Co-authored-by: Alya Abbott <alya@zulip.com>
2024-06-02 21:45:37 -07:00
afeefuddin 9d33c94f2d settings_components: Split functions to improve typechecking. 2024-06-01 22:53:34 -07:00
afeefuddin 7355aa3922 settings_org: Pass undefined implicitly when sub is undefined. 2024-06-01 22:53:34 -07:00
afeefuddin 23e22d1bbe settings_components: Remove unnecessary parameter. 2024-06-01 22:53:34 -07:00
Aman Agrawal 0468f609e8 popovers: Fix selected message being changed on scroll inside popover.
Since scroll event is always fired at root level, we don't have
control over capturing the event and containing it to the popover
if scroll happened inside the popover.

This can lead to unintentional moving of selected message since
we try to move the selected message to rendered top / bottom if
we receive a scroll event when top / bottom ends are rendered.
2024-05-31 15:40:21 -07:00
Aman Agrawal ddf14116b2 emoji_popover: Fix white arrow color in dark theme.
Tested left, top and bottom placement of emoji popover to check
if arrow color is correctly displayed in both dark and light theme.
2024-05-31 15:39:09 -07:00
Sayam Samal ce1163ebe8 popovers: Add the missing aria-hidden attribute to popover icons.
Some of the popover icons were missing the aria-hidden attribute, which
caused them to be read out by screen readers.
2024-05-31 15:28:01 -07:00
Sayam Samal 17424c5f14 topic_actions_popover: Remove redunadant data-* attributes.
This modern implementation of this popover gets these values from what
was passed into its constructor.
2024-05-31 15:28:01 -07:00
Sayam Samal 34e6d84cf5 topic_actions_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
    offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
    or`role="menuitemradio"` to child elements based on their function.

- `role="group"` to the topic visibility picker, identifying it as a
    container for related menu items.

- `role="none"` to `<li>` elements, removing the implied `listitem`
    role that conflicts with the parent menu structure.
2024-05-31 15:28:01 -07:00
Sayam Samal 125a4d2a11 stream_actions_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
    offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
    or`role="menuitemradio"` to child elements based on their function.

- `role="none"` to `<li>` elements, removing the implied `listitem`
    role that conflicts with the parent menu structure.
2024-05-31 15:28:01 -07:00
Sayam Samal 4c4d0c5774 help_menu_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
    offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
    or`role="menuitemradio"` to child elements based on their function.

- `role="none"` to `<li>` elements, removing the implied `listitem`
    role that conflicts with the parent menu structure.
2024-05-31 15:28:01 -07:00
Sayam Samal 3dfaca0773 personal_menu_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
    offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
    or`role="menuitemradio"` to child elements based on their function.

- `role="group"` to the theme switcher, identifying it as a container
    for related menu items.

- `role="none"` to `<li>` elements, removing the implied `listitem`
    role that conflicts with the parent menu structure.
2024-05-31 15:28:01 -07:00
Sayam Samal ed9d2a7af6 gear_menu_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
  offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
  or`role="menuitemradio"` to child elements based on their function.

- `role="none"` to `<li>` elements, removing the implied `listitem`
  role that conflicts with the parent menu structure.
2024-05-31 15:28:01 -07:00
Sayam Samal 3c1d248abe message_actions_popover: Flatten nested lists for better accessibility.
This refactors popover list structure to use a flattened `ul > li`
structure along with aria-related additions, enabling screen reader
accessibility and announcing menu length and position (`# of n`).

Added ARIA roles:
- `role="menu"` to the parent `<ul>` element, indicating it is a widget
  offering a list of choices.

- `role="menuitem"`, `role="menuitemcheckbox"`,
  or`role="menuitemradio"` to child elements based on their function.

- `role="none"` to `<li>` elements, removing the implied `listitem`
  role that conflicts with the parent menu structure.

Also removes the unused `should_display_reminder_option` code, which
should have been removed in f40855bad2.
2024-05-31 15:27:30 -07:00
Varun Singh a177d8fa49 settings_streams: Convert module to TypeScript. 2024-05-31 15:19:43 -07:00
Varun Singh 40953f7ada dialog_widget: Fix 'onclick' event type. 2024-05-31 15:19:43 -07:00
Karl Stolley a2a735273b left_sidebar: Maintain em-equivalent 16px separator row height. 2024-05-31 15:18:06 -07:00
Karl Stolley b4b5d03a8e left_sidebar: Set topic rows to normalized em-based line-height. 2024-05-31 15:18:06 -07:00
Karl Stolley 9a2cc09ec2 left_sidebar: Set channel rows to em-based line-height. 2024-05-31 15:18:06 -07:00
Karl Stolley 3f9897cfee left_sidebar: Set DM rows to em-based line-height. 2024-05-31 15:18:06 -07:00
Karl Stolley d8a73c8637 left_sidebar: Set navigation area rows to em-based line-height. 2024-05-31 15:18:06 -07:00
Karl Stolley ef68132a5a left_sidebar: Declare header row-heights as prominent rows. 2024-05-31 15:18:06 -07:00
Karl Stolley 4405136ffb info_density: Declare em-based line-height vars for sidebar rows. 2024-05-31 15:18:06 -07:00
Karl Stolley 3d04f7dbda info_density: Set a minimum line-height on body. 2024-05-31 15:18:06 -07:00
Anders Kaseorg e53e3af0f6 codespell: Fix spelling mistakes caught by codespell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-31 14:32:33 -07:00
Aman Agrawal 8aea76448f copy_and_paste: Fix our logic being confused about selected messages.
If the selection stays inside a message header and there
are messages before the message header, our logic thinks `end_id`
is message before the header while `start_id` and `end_id` should
be that same.

It is best to just let browser handle the copy paste in this case.
2024-05-31 12:42:51 -07:00
Anders Kaseorg 804c3706ff tsconfig: Enable noUncheckedIndexedAccess.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 16:29:23 -07:00
Anders Kaseorg 4e91572c96 hello: Add safety assertions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 16:19:15 -07:00
Anders Kaseorg 94f0f9340c e2e-tests: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 16:19:14 -07:00
Anders Kaseorg ed5f1455f2 e2e-tests: Consistently move fullname lookups to callers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 16:19:00 -07:00
Anders Kaseorg 067a342b4e upload_widget: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 6c0c19addb upload: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg e134ad1363 unread_ops: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 07c220f08b typing_events: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 83eb0a326a typeahead_helper: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg d0a03be8e0 topic_list: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg c70799ca25 stream_list: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg e6358f5edc settings_profile_fields: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg d49ad41a68 settings_emoji: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 11ab831e41 settings_components: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg fcf2e607c2 rendered_markdown: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 8417b54035 recent_view_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 38b5fc32f7 playground_links_popover: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg c2c17dcd14 people: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg df849b294a narrow_state: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg ab3110817f narrow_banner: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg b953584d45 messages_overlay_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg eddf79fca2 message_viewport: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg ad763ee7a7 message_list_data: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg d8a7d65647 markdown: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 74bfa62d78 left_sidebar_navigation_area: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg f15c2c5dfd inbox_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg 6a429603ad i18n: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg eedde08f24 hash_util: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:49 -07:00
Anders Kaseorg fc17821119 hash_parser: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg da7d8b902b filter: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg beef5d259b dropdown_widget: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 7303851fd5 drafts: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg ff23f79550 copy_and_paste: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg e50a115d6f composebox_typeahead: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg a1ca665119 compose_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 6eec89ab96 compose_reply: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg cbffc10e9e compose_fade: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 468da9ed23 compose_actions: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 015e3917ac common: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 5a4b0420d1 buddy_list: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 6cd8c9bb8c bot_data: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 8cec7dd917 bootstrap_typeahead: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 9ad8ca4223 blueslip_stacktrace: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 284beed889 billing/sponsorship: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg c2c2e0b9ea billing/remote_billing_auth: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 01677db59e attachments_ui: Fix TypeScript noUncheckedIndexedAccess errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:54:48 -07:00
Anders Kaseorg 9b711cda20 tippy: Use namespace import for tippy.js.
Names like “delegate”, “Instance”, “Placement”, “Props”, and
“ReferenceElement” are much too generic to make sense as named
imports.

The downside is that we now need to write tippy.default(…) instead of
tippy(…) (because ES module namespace objects cannot be callable), but
that cost is worthwhile.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 15:45:46 -07:00
Aman Agrawal 817bffe6b1 message_list: Rename `narrowed` property.
We rename it for clarity so that someone new to the codebase
knows instantly what it is checking.
2024-05-30 11:41:13 -07:00
Aman Agrawal 71341d282e narrow: Remove last remains of was_narrowed_already.
This doesn't seem useful even for sentry logs since they
will already contain the full hash change history.

Rest of it was removed in 240f7b53b2.
2024-05-30 11:41:13 -07:00
roanster007 7b1a5d84fc refactor: Extract the methods called post narrow message list update.
This commit extracts various methods called post the current
message list is updated in "narrow.js" such as update_unread_banner,
handle_post_view_change, etc. into a separate method --
"handle_post_message_list_change".

This allows us to be able to call these methods independently
in case we need to update the filter and the corresponding
message lists.

This is a preparatory commit to #30114.
2024-05-30 11:37:13 -07:00
Varun Singh 50e0f336f0 settings_streams: Fix error thrown when adding 'default-channels'.
The 'Select channel' dropdown in 'Add default channels' modal is
the LAST dropdown element on the modal and it does not contain
`data-stream-id` attribute.

.attr('data-stream-id') would return undefined for this element
and as a result the returned `Set` would have its last element a
`NaN` --- passing a `NaN` inside 'data' field of 'channel.post' threw
an error.

We tweaked the selector string to selectively map over the elements with
'data-stream-id' attribute.
Also we removed '.toString()' converting stream-id to a string (stream-id is a
'number' type).
2024-05-30 10:53:19 -07:00
Anders Kaseorg 4d8e5b5029 5xx: Fix development server preview of 500 error page.
This can be viewed at http://localhost:9991/webpack/5xx.html on the
development server.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 10:49:03 -07:00
Anders Kaseorg 27a993a504 stats: Make sent_data_schema specifically expect human and bot keys.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-30 10:01:59 -07:00
Aman Agrawal e74dd93b52 5xx: Add a comment explaining how CSS is applied to this page. 2024-05-30 09:12:59 -07:00
Aman Agrawal 4811dd3ffd Revert "5xx: Remove css classes and duplicate div tags."
This reverts commit eada57921e.

This does have CSS applied to it via webpack.

See

```
new HtmlWebpackPlugin({
    filename: "5xx.html",
    template: "html/5xx.html",
    chunks: ["error-styles"],
}),
```
2024-05-30 09:12:59 -07:00
Anders Kaseorg 7377d3fab9 topic_generator: Fix types of get_next_stream, get_prev_stream.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:27 -07:00
Anders Kaseorg c20af83770 people: Fix get_custom_fields_by_type type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:11 -07:00
Anders Kaseorg a01d68e838 people: Rename ProfileData type to singular ProfileDatum.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 23:33:11 -07:00
Anders Kaseorg ec199082fd types: Move Submessage to submessage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-29 17:47:09 -07:00
evykassirer 48fc0bc750 message_helper: Convert module to typescript. 2024-05-29 16:45:36 -07:00
evykassirer 7364c02ed6 message_helper: Set clean reactions when processing the raw message. 2024-05-29 16:45:36 -07:00
evykassirer 28107eb913 message_helper: Be more explicit about converting subject to topic. 2024-05-29 16:45:36 -07:00
evykassirer 297d393539 message_helper: Only convert subject to topic for stream messages.
There was a stale comment here saying we needed to do this for
private messages too, but `convert_message_topic` only modifies
`message` if its type is "stream".
2024-05-29 16:45:36 -07:00
evykassirer 50f5cf9ad8 message booleans: Return new message instead of mutating a raw message. 2024-05-29 16:45:36 -07:00
evykassirer 59a743de01 reify_message_id: Save id on most up-to-date message object.
Previously we relied on `echo.reify_message_id` to set the new
`id` and `locally_echoed` value, but it was setting this on
the message stored in `waiting_for_id`, which isn't guaranteed
to be the same as the message in the message store. Once
`process_new_message` stops mutating the message it gets and
returns a new message object, this would have caused a bug.
2024-05-29 16:45:36 -07:00
evykassirer bab1dc5d9c message tests: Don't assume process_new_message mutates the message.
We already changed callsites in the codebase to use the message
returned from `process_new_message` instead of assuming the raw
message passed in will be mutated. This fixes a few remaining tests.
2024-05-29 16:45:36 -07:00
evykassirer 61371868ad message_store: Mark optional attributes as optional.
These aren't set when the Message object is first created
and only used within `message_list_view`, so they should be
optional.
2024-05-29 16:45:36 -07:00
evykassirer 26dbb953e0 people: Remove line for type of message that can't exist.
This will help us with a code coverage issue in an upcoming
commit.
2024-05-29 16:45:36 -07:00
evykassirer 854b3868ac message: Remove unused star_status attribute.
Based on git log -S 'starred_status', it’s been unused since
4bf16ca9cc (#22746).
2024-05-29 16:45:36 -07:00
Aman Agrawal eada57921e 5xx: Remove css classes and duplicate div tags.
Since this file doesn't link any stylesheet, no CSS is applied to
these classes.

Tested change by pasting the content of it in `link_malformed`
and rendering that template using a malformed email confirmation link.
2024-05-29 09:37:25 -07:00
Aman Agrawal 0daee09b79 bootstrap_typeahead: Rename parentElement for clarity.
We don't use tippy to position the typeahead if a `parentElement`
is specified. `non_tippy_parent_element` helps us covey that.
2024-05-29 09:35:32 -07:00
Tim Abbott 097066f412 Revert "recent_topics: Change background color in dark mode on hover on a row."
This reverts commit 4ee37244bb.

This was not found to be uniformly agreed as an improvement.
2024-05-28 14:38:50 -07:00
sanchi-t 8ef4ee6845 user_profile: Update the profile tab after editing.
Use user events to update profile tab for a
synchronized experience across all users.

Fixes #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t ca74c95c60 user_profile: Display `Saved` feedback.
Visually confirms successful profile changes with a clear
`Saved` message.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t 5a0abeed92 user_profile: Disable save button until changes are made.
Prevents modal from closing when `Save changes` is clicked
after editing a profile field. Also, disables the `Save changes`
button until at least one field has been edited.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t c442db64fc custom_user_profile_fields: Add `name` attribute to fields.
In `custom_user_profile_fields.hbs`, the name attribute has been
introduced to profile fields to facilitate the future use of the
`get_current_values` function in retrieving field values.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
sanchi-t 2ad886f427 dialog_widget: Extract `get_current_values` function from `launch`.
This commit separates the `get_current_values` function from the
`launch` code, allowing it to be exported and utilized independently.

Fixes part of #26692.

Co-authored-by: Kunal Sharma <v.shm.kunal@gmail.com>.
Co-authored-by: Angelica <angelica.ferlin@gmail.com>.
2024-05-28 14:34:57 -07:00
Karl Stolley 0884b96fc6 spoilers: Style headers in Markdown-neutral way. 2024-05-28 14:34:10 -07:00
Prakhar Pratyush 95be5db08b narrow: Add 'more topics' state to browser history.
When navigating "back" or "forward", the left sidebar state
should be restored.

Earlier, "more topics" expanded was not considered a distinct
state.

This commit makes it possible to correctly place you in the
"more topics" view or not, depending on where you were.

Fixes #29548.
2024-05-28 12:09:57 -07:00
Sahil Batra 3971c033c3 templates: Remove unnecessary prop-element class.
We use "prop-element" class only to handle save-discard widget
and not anywhere else, so there is no need to have this class
for elements that do not use save-discard widget.
2024-05-28 10:44:15 -07:00
Sahil Batra 671547345d settings: Refactor code to handle realm authentication methods.
This commit refactors code to handle realm authentication methods
in a better way. We remove the get_complete_data_for_subsection
function and instead let populate_data_for_request handle the
request data for authentication methods.

We also remove the "prop-element" class from each authentication
setting checkbox and instead add it to the container div as a
the list of those checkboxes represent a single field, i.e.
the realm_authentication_methods field received from the server
and the authentication_methods field sent to 'PATCH /realm'
endpoint.
2024-05-28 10:44:15 -07:00
Aman Agrawal 431145d4f2 bootstrap_typeahead: Fix AssertionError due to `onHidden` not called.
Since `onHidden` is only called once tippy is fully hidden, tippy
can fail to call `onHidden` if `onShow` is called before
tippy is fully hidden. This hurts us as we want to call `destroy`
to remove this tippy instance from DOM.

To avoid this, we `destroy` the tippy instance outside of tippy
callbacks which is more reliable since our event handlers call
`hide` without fail.
2024-05-28 10:34:06 -07:00
Aman Agrawal 847dbe5b91 inbox: Fix assertion error on row being outside visible area. 2024-05-28 07:21:26 -07:00
Anders Kaseorg a4256012ed scroll_util: Remove workaround for SimpleBar type issue fixed upstream.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:23:35 -07:00
Anders Kaseorg 4019ccecbb eslint: Outsmart formatjs/enforce-default-message.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:20:10 -07:00
Anders Kaseorg caf6387514 stylelint: Fix shorthand-property-no-redundant-values.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-26 19:20:10 -07:00
Varun Singh 7861fd0a50 starred_messages_ui: Rename field 'new_value' to 'updated_starred_flag'.
The name 'new_value' seemed rather generic and uninformative.
2024-05-25 17:50:00 -07:00
Varun Singh f7e1403a12 starred_messages_ui: Convert module to TypeScript. 2024-05-25 17:50:00 -07:00
Sahil Batra 4ef3117191 invite: Fix comment mentioning textarea.
We no longer use textarea element to take emails in the invite
modal and instead use a pills.
2024-05-25 17:48:48 -07:00
Sahil Batra 5e347e971d invite: Remove code for old UI.
We still had some code in invite.ts for the textarea element
which was replaced by pill container, so this commit removes
that code.

This commit also removes the CSS for textarea and radion buttons
which are no longer present in the UI.
2024-05-25 17:48:48 -07:00
Sahil Batra 41409b7c4c invite: Remove unnecessary calls of toggle_invite_submit_button.
There is no need to call toggle_invite_submit_button while
changing inputs on the modal, or while selecting all streams
using the "Check all" button as the state of button is only
dependent on the input in email pill container and on which
tab is opened.
2024-05-25 17:48:48 -07:00
Sahil Batra 52ec8a0c2b invite: Fix button state when initially opening invite modal.
Previously, when the invite modal was opened with user having
permission to send email invites, the button at the bottom had
"Generate invite link" text. It should instead be "Invite" with
the button disabled since email invites section is opened by
default.

This was because the toggle_invite_submit_button was called
when the modal was not visible and thus calling `.is(":visible")`
for email pill container element returned false. This commit
changes it to pass the selected tab to toggle_invite_submit_button
to avoid computing which tab is opened by checking the element
visibility, attributes, etc. when the modal is not visible and
the tab container might not be present in the DOM.
2024-05-25 17:48:48 -07:00
Anders Kaseorg 8364cbe26d user_settings: Fix initialize_user_settings type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg dbfc980c82 realm_user_settings_defaults: Fix initialize type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:24:22 -07:00
Anders Kaseorg a5995a69f3 people: Fix get_custom_profile_data type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 16:23:00 -07:00
Tim Abbott 3bce9fd293 muted_users_ui: Rename misleading variable name. 2024-05-24 15:18:35 -07:00
afeefuddin 8a13bbd953 muted_users_ui: Convert module to TypeScript. 2024-05-24 15:18:35 -07:00
Anders Kaseorg a68bc645ed filter: Don’t parse dm-including operand as a list.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-24 10:25:46 -07:00
evykassirer 825fa6f0e1 narrow_state: Remove narrowed_to_topic function.
This was only being used in one place in compose_closed_ui
to create the label for the closed composebox. But it
only checked if the `channel` and `topic` filters existed,
while `stream_sub` can return `undefined` for a few other
reasons. To ensure that we're catching the undefined sub
while also avoiding duplicate work, it makes sense to just
call `stream_sub()` directly.

Fixes this bug:
https://zulip.sentry.io/issues/5367251929/events/40073ecf007a4a9798e728061a576377/?project=450455688282112
2024-05-24 10:24:16 -07:00
Karl Stolley 852637d3b3 left_sidebar: Convert stream-privacy icon sizes to ems. 2024-05-24 10:23:41 -07:00
Karl Stolley d5a5044ecd left_sidebar: Improve icon alignment in stream rows. 2024-05-24 10:23:41 -07:00
Karl Stolley 0818aa759d icons: Correct whitespace around lock, vdots icons.
This fixes a perennial problem with a droopy lock icon, and better
situates the vdots in the box created in the SVG-to-font
conversion.
2024-05-24 10:23:41 -07:00
Karl Stolley dda75a56bc left_sidebar: Consolidate .stream-privacy styles. 2024-05-24 10:23:41 -07:00
Aman Agrawal 29048bf19a compose: Prevent lingering textarea typeahead after sending message.
Compose textarea typeaheads don't hide when `Send` button is clicked.
If you type `@` and press send, mention typeahead is still visible.
This happens since the textarea is still focused after sending the
message while other input area trigger a `blur` event which hide
the typeahead for them.

We always call `clear_compose_box` wherever textarea is cleared
as a result of sending message. So, it is the right function to
hide the typeahead in.
2024-05-24 10:12:17 -07:00
Anders Kaseorg a1895683b2 message_list_data: Fix _next_nonlocal_message type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:18:46 -07:00
Anders Kaseorg 24904f32bb message_list: Remove ids_greater_or_equal_than.
It’s unused since commit c876e12b86
(#23579).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 19:08:08 -07:00
Anders Kaseorg 9cee037f2a message_list: Remove nth_most_recent_id.
It’s unused since commit 748e5b6da6.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 18:56:59 -07:00
Anders Kaseorg 8f0dda3d4b e2e-tests: Fix check_compose_state arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:51:36 -07:00
Anders Kaseorg 931f515207 message_list_data: Fix type of first, first_including_muted.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 16:41:50 -07:00
Anders Kaseorg 26fd6be88f billing helpers: Add missing $ prefix to jQuery object parameter.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-23 15:41:18 -07:00
evykassirer 27b5c61399 composebox_typeahead: Allow for undefined topic in PersonSuggestionOpts.
Fixes this error, which occured when editing DM messages and bringing
up the mention typeahead with "@"

https://zulip.sentry.io/issues/5389123227/events/46ab6c6ca68344ac89af7444fa0f8c39/?project=4504556882821120
2024-05-23 14:55:40 -07:00
Sahil Batra 959c78e1e1 invite: Fix rendering invite modal for realms without default channels.
The default channels checkbox only exists in DOM if there are default
channels in the realm, so we should make sure that we check whether
there are default channels in the realm before accessing the
checkbox element in set_streams_to_join_visibility.
2024-05-23 11:32:09 -07:00
Aman Agrawal e6c074e206 recent_view: Fix no topic found at center of recent view.
The bug is hard to reproduce, but I was able to reproduce with #30134
and used the same strategy to fix it here.
2024-05-23 10:39:27 -07:00
Aman Agrawal e530af5013 narrow: Fix combined feed selecting random messages on narrow.
Reproducer:

* Have some unreads in the Combined feed view.
* Scroll up and select a message that was not part of initial fetch.
* Reload.
* Go a another narrow.
* Come back to combined feed to find your at a random message. This
  message is actually last message of the current fetch of
  combined feed view which was returned via `first_unread_message_id`.
2024-05-23 10:37:29 -07:00
Aman Agrawal b22adc1d5f filter: Fix combined feed navigating to muted unread message.
Some we didn't have a check for if topic is muted here which
resulted in combined feed trying to navigate user to muted
unread message if it was the first unread in the narrow.
2024-05-23 09:17:40 -07:00
Karl Stolley 20d6dd110a left_sidebar: Align more-topics indicator on topic grid. 2024-05-22 17:24:35 -07:00
Karl Stolley 50a7e3cf2c left_sidebar: Flatten renamed .sidebar-topic-name selector. 2024-05-22 17:24:35 -07:00
N-Shar-ma 68c83bce44 widgets: Fix bug where `process_submessages()` was run for empty rows.
We now check if the row exists in the current view, and only then do we
process the submessages in it, instead of letting `Error: Failed to
do_process_submessages` happen.
2024-05-22 17:16:54 -07:00
roanster007 3b73f19719 refactor: Extract method to create and update message lists in narrow.
This commit extracts the method to create and update message
lists in the narrow. This is particularly useful in cases when we
need to update the narrow and view with our own message lists.

This is a preparatory commit to #30114, since it involves
creating a new message list from the messages fetched,
which may be of a different narrow from that of the
initial filter, and updating the view and narrow with it.
2024-05-22 15:31:49 -07:00
Karl Stolley 0fbdd02d87 compose: Tune send-controls vdots for narrowest viewports. 2024-05-22 11:36:28 -07:00
Karl Stolley ac6ac58385 compose: Strengthen layout in send-controls area. 2024-05-22 11:36:28 -07:00
Sahil Batra 39c6a01c74 settings: Fix updating realm join restrictions setting.
This commit fixes the bug when updating
"Restrict email domains of new users?" setting by
adding data-setting-widget-type attribute to the select
element as get_input_element_value now expects every
element to have that attribute after 64c8262eaf.

Due to this change, we also need to update the code in
populate_data_for_request function to not send invalid
parameter in the request. This change resulted in some
refactoring which now helps in not passing in the
"disallow_disposable_email_addresses" and
"email_restricted_to_domains" when these fields are
not changed.
2024-05-21 21:20:50 -07:00
Sahil Batra ed8d7ed864 settings: Fix code for updating realm default language.
This commit fixes the bug when updating realm default
language setting by adding data-setting-widget-type
attribute to the relevant element with "prop-element"
class as get_input_element_value now expects every
element passed to it to have that attr after 64c8262eaf.

As a result we can now remove the code from
get_complete_data_for_subsection to handle realm
default language and just let get_input_element_value
handle it and it also helps in passing the parameter
unnecessary to request when the setting is not changed.
2024-05-21 21:20:50 -07:00
Sahil Batra a530311646 settings: Fix user notification batching settings.
This commit solves the bug for user notification batching
setting which was introduced during the typescript migration
of settings_components.js due to assertion error in
get_input_element_value.
2024-05-21 21:20:50 -07:00
Aman Agrawal 0d3e223493 compose: Fix formatting popover persists on wide screens.
Reproducer:

1. Make your window narrow, to get the `...` formatting buttons menu.
2. Open the menu.
3. Make your window wide again.
2024-05-21 14:56:00 -07:00
afeefuddin 206c8ffedc settings_profile_field: Fix class selector. 2024-05-21 09:09:58 -07:00
Aman Agrawal 7d41c8ce06 narrow: Add minor comment. 2024-05-20 15:01:48 -07:00
Aman Agrawal cd41e5f4fa narrow: Rename save_narrow. 2024-05-20 15:01:48 -07:00
Aman Agrawal 625b07c010 recent_view: Complete TODO to use first unmuted unread message id.
We already had the data at initial request, so we just add
some plumbing to make it available.
2024-05-20 15:01:47 -07:00
Anders Kaseorg ffb182fb25 compose_popovers: Fix message_type typo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-20 14:30:29 -07:00
Anders Kaseorg b545abe1e2 typos: Fix typos caught by mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-20 13:55:00 -07:00
afeefuddin dbd44bff5c settings_components: Rename subsection to $subsection_elem. 2024-05-20 13:33:08 -07:00
sujal 4a652ed38d stream_settings: Update feedback message to include user name.
Add user name in feedback message so that it is more clear
which user is unsubscribed.

With tweaks by tabbott to handle the yourself case.

Fixes #19165.
2024-05-20 11:32:19 -07:00
afeefuddin 64d8a18b76 settings_profile_fields: Convert Module to TypeScript. 2024-05-20 11:17:58 -07:00
afeefuddin 578f0319b2 types: Add UserExternalAccountData type. 2024-05-20 11:17:58 -07:00
afeefuddin ea4fdcb2a5 state_data: Add realm_default_external_accounts to realm_schema. 2024-05-20 11:17:58 -07:00
afeefuddin e40ef29e63 settings_profile_fields: Pass Jquery consistently. 2024-05-20 11:17:58 -07:00
afeefuddin 448870225b settings_profile_fields: Use this keyword instead of e.currentTarget. 2024-05-20 11:17:58 -07:00
afeefuddin 1fcc3e8878 settings_org: Move populate_data_for_request to settings_components. 2024-05-20 11:17:58 -07:00
Lalit 5ea98cba54 input_pill: Add test for `input` event handler. 2024-05-20 09:13:26 -07:00
Sayam Samal dbebd0ddbf popovers: Move navbar popovers to a subdirectory. 2024-05-20 09:10:36 -07:00
Sayam Samal a289a823a0 popovers: Move left sidebar popovers to a subdirectory. 2024-05-20 09:10:36 -07:00
Sayam Samal dd4b1fdfed popovers: Rename and move topic_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 7e021e6699 popovers: Rename and move stream_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal e6cb690037 popovers: Rename and move personal_menu.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 018142e6ec popovers: Rename and move gear_menu_popover.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal 05b1ae42b2 popovers: Rename and move navbar_help_menu.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal dae9b6b9ed popovers: Rename actions_popover.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal b30698e49d popovers: Rename and move starred_messages_sidebar_actions.hbs. 2024-05-20 09:10:36 -07:00
Sayam Samal f4129aa9df popovers: Rename and move drafts_sidebar_action.hbs. 2024-05-20 09:10:36 -07:00
Aman Agrawal 44fa39c4c4 recent_view: Fix error on initial fetch being all muted messages.
If the initial fetch pre #29740 fetches all muted messages we don't
have any messages in all message list and hence query for
oldest message is undefined.

This results in us trying to render oldest_message_timestamp
with its value as infinity.

To fix it, we include muted messages in our search for oldest
message in the list and if we still cannot find one, we wait
for the next fetch.
2024-05-19 23:27:14 -07:00
ecxtacy 6af748fa77 pills: Optimize removePill function.
The removePill function of input_pill module uses a for loop
for iterating and finding the required pill.
Replace the for loop with inbuilt findIndex function for efficiency.

Authored-by: Dhruv Chouhan <dc.dhruvchouhan@gmail.com>.
2024-05-17 10:47:22 -07:00
ecxtacy ac7dd6fa08 settings: Show user_group_popover when pill is clicked.
Add 'click' event listener to the pills in stream settings
to toggle the user_group_info_popover.

Fixes #28687.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK 82a817aaab hashchange: Fix popover not disappearing on overlay hash URL.
Refactored hashchanged() so that popover.hide_all()
is executed before checking is_overlay_hash() to close
popovers when the user changes hash but still on overlay.
2024-05-17 10:47:22 -07:00
ecxtacy 35248c1920 settings: Show user_card_popover when pill is clicked.
Add a 'click' event listener to the user pills in
stream and group settings which toggles the
user_card_popover.

Co-authored-by: PieterCK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
ecxtacy 30ede1cc80 input_pill: Pass user_id and group_id to render pill.
While rendering input pills in input_pills.create function,
pass in the user_id or group_id accordingly.
Display the id as an html attribute in input_pill.hbs.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK 3b46d0e53c settings: Refactor UserGroupPill to improve consistency.
Changed UserGroupPill's 'id' key to 'group_id' because
UserPill uses 'user_id' instead of only id.
2024-05-17 10:47:22 -07:00
ecxtacy ad177a8b48 css: Show 'x' button hover styling when hovered over 'x'.
When input pills are hovered, the 'x' button is highlighted.
This commit ensures that 'x' button is highlighted only if the
'x' button is hovered, not anywhere else on the pill.

Author: ecxtacy <dc.dhruvchouhan@gmail.com>.
2024-05-17 10:47:22 -07:00
PieterCK d882d90857 hash_parser: Add utility function to dynamically detect hash.
Added new utility function to hash_parser to dynamically
detect the hash category of an URL. This is intended to
reduce the need of adding more adhoc hash_parser utility
functions.
2024-05-17 10:47:22 -07:00
evykassirer 71a5d46de2 typeahead_helper: Clean up current_stream check.
Followup for
https://github.com/zulip/zulip/pull/29650/files#r1569209419
2024-05-17 10:41:32 -07:00
evykassirer 43a6873c57 composebox_typeahead: Clean up initalize method to take JQuery object. 2024-05-16 19:49:46 -07:00
evykassirer 96c9950115 composebox_typeahead: Convert module to typescript. 2024-05-16 14:53:26 -07:00
evykassirer 7f9361a865 composebox_typeahead: Filter and sort candidates within get_candidates.
This simplifies some of the logic and will make it easier to
convert to TypeScript.
2024-05-16 14:51:28 -07:00
evykassirer 96abc52d97 composebox_typeahead: Return mentions from get_candidates. 2024-05-16 14:51:28 -07:00
evykassirer 19a4810d53 composebox_typeahead: Remove DM blur handler.
Since #private_message_recipient is a <div contenteditable>,
not an <input> or <textarea>, it doesn’t make sense to call
.val() (it will always give the empty string).

It looks like this line is from over 10 years ago
(09deef9611 (diff-f2b22549dc2fb4824b37e787d964a2c9f4f580e767f86b6d7ded1d0ff37d5a62R291))
and probably before we had pills here. We can just remove this
whole block.
2024-05-16 14:51:28 -07:00
evykassirer e08c7548af composebox_typeahead tests: Create user_or_mention items directly. 2024-05-16 14:51:28 -07:00
evykassirer 7a9a445088 emoji: Restrict reaction_type for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer 297fd2654d emoji: Restructure EmojiDict for compatibility with typeahead.Emoji. 2024-05-16 14:51:28 -07:00
evykassirer bccdec8971 typeahead: Create new EmojiSuggestion type.
This will be used for when we suggest emojis in
the composebox typeahead.
2024-05-16 14:51:27 -07:00
Aman Agrawal b8cec0ff2a message_edit: Restore focus to the message being edited.
When user is editing a message and we rerender it, we should always
set focus back to the textarea.
2024-05-16 09:59:22 -07:00
Aman Agrawal 2035305b89 recent_view_ui: Filter out DMs as per search query.
We use the filter we use in buddy list for consistency.
2024-05-16 09:20:43 -07:00
Aman Agrawal b2dc6f4039 people: Split search terms inside the search function.
This helps other views calling this function to not do a separate
split of the terms.
2024-05-16 09:20:43 -07:00
Aman Agrawal 2a8174baa3 recent_view: Rename filters_should_hide_topic.
Since we also filter DMs using this function, the name is
misleading.
2024-05-16 09:20:43 -07:00
Aman Agrawal aa31f9ae8d server_events: Fix infinite loading indicator on page load.
Hiding the loading indicator was based on us adding some messages
into the view which was no always the case.
2024-05-16 09:10:07 -07:00
Aman Agrawal 62c682b2e1 hashchange: Fix infinite home view <-> narrow loop on escape keypress.
Reproducer:
* Start with empty hash and combined feed as home view.
* Go to any narrow.
* Keep pressing escape key.

You will keep switching between narrow view and home view while
you should just stop at home view. This was due to
`set_hash_to_home_view` not considering empty hash as a valid
home view hash.
2024-05-16 08:59:05 -07:00
Anders Kaseorg 507eb4913c tsconfig: Enable exactOptionalPropertyTypes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-16 08:58:20 -07:00
Aman Agrawal 7203661d99 support: Set discounted price instead percentage for customers.
This allows us to set the price of a plan exactly as discussed with
the customer.
2024-05-16 02:18:43 -07:00
AfonsoOrmonde b42cd1022b
streams: Close color picker when scrolling stream settings.
Fixes #17451.
2024-05-15 17:22:03 -07:00
Isabela Pereira fee0470a97 popovers: Refine word wrapping in user profile.
This commit refines word wrapping in user profile popovers. It implements 'overflow-wrap: break-word;' for category ‘name’ items (e.g., ‘Email’, ‘User ID’) and 'overflow-wrap: anywhere;' for category ‘value’ segments, ensuring proper line breaks and preventing overflow issues. Additionally, addressed prettier problems to maintain code consistency.

Fixes #22865
2024-05-15 17:20:21 -07:00
Lauryn Menard 7a61044a03 org-settings: Update tab for default channel settings.
Updates instances of default-streams-list to instead be
default-channels-list as the data-section for the organization
settings overlay is part of the URL hash.
2024-05-15 12:18:36 -07:00
Aman Agrawal 1c7c8cede8 recent_view: Fix marking topic as read resulting in error.
Since we were trying to close dialog widget regardless of caller
after marking messages as read, it results in an error if the dialog
widget is not open especially since there was no dialog widget
involved in the process.

So, track the id of the dialog widget which called the `read` `op`
and operate on it based on it's status if there was a dialog
widget involved.
2024-05-15 12:02:57 -07:00
Aman Agrawal e51962d6ac dialog_widget: Assign each dialog widget a unique id.
This makes it easy to check if the correct dialog widget is open
and to perform actions based on the state of dialog widget in
async callbacks.
2024-05-15 12:02:57 -07:00
Sahil Batra f73f27b45f invite: Replace "streams" with "channels" in default subs banner.
This commit replaces "streams" with "channels" in the banner for
default channel subscriptions shown to user user who cannot
subscribe others.
2024-05-15 10:59:05 -07:00
Sahil Batra 6f5143b5b8 invite: Fix margins around subscriptions banner.
This commit fixes the margins around banner for default stream
subscriptions, shown to users who cannot subscribe others, to
be same as that for other banners like the one shown when
description is not set for the organization.
2024-05-15 10:59:05 -07:00
Sahil Batra 05d74a367c invite: Fix invite modal bug for users who can't subscribe others.
The bug was due to the element being accessed when not present
in the DOM. This function fixes it by calling the function to
setup streams UI only when the concerned elements are present
in DOM, i.e. when user can subscribe others.

The bug was introduced in 016917679e.
2024-05-15 10:59:05 -07:00
Anders Kaseorg fba81d1cd5 upload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 97b0fd424d upload: Replace get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 60545fb475 upload: Reimplement get_item with config object methods.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 25b29b5cd4 upload: Centralize config object construction.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg d9f05121d9 upload: Fix @uppy/xhr-upload locale configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg ac6e0a2d34 upload: Add missing get_item("upload_banner_message", …) argument.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg b132fc50b3 compose_reply: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg c8981be08f compose_state: Fix last_focused_compose_type_input type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 941e2ae5dc inbox_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 1fa6c707ce inbox_ui: Split filter_should_hide_row into two functions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
Anders Kaseorg 77100aca6a inbox_ui: Fix CSS escaping.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-15 10:53:09 -07:00
N-Shar-ma a567fb633a copy_and_paste: Fix bugs surfaced by typescript migration.
Fixed 2 bugs in the detection of the last message row copied. This fixes
the issue where when the mouse was released on the message header after
copying multiple messages, the pasted text was not formatted correctly.

Follow up to #30091.
2024-05-15 10:44:20 -07:00
Aman Agrawal 5e671de1e7 unread_ops: Fix unable to mark messages as read in Inbox view.
Converting stream_id to string invalidates the
value as our narrow parser expects integer as valid stream_id and
stream name if it is string.
2024-05-15 01:29:37 -07:00
Sahil Batra c41a352a12 invite: Use include_default_realm_subscriptions parameter in webapp.
This commit adds code to use include_default_realm_subscriptions
when user selects "Subscribe to default streams" checkbox
in the invite modal instead of passing the stream ids of
default streams.
2024-05-14 14:20:07 -07:00
Sahil Batra 016917679e invites: Do not show streams if user cannot subscribe others.
We do not show the streams list in invite modal if the user
does not have permission to subscribe others to stream and
show a notice mentioning it.
2024-05-14 14:20:07 -07:00
Anders Kaseorg 4d407c6b8d copy_and_paste: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:12:05 -07:00
Anders Kaseorg 2e776bf8dc copy_and_paste: Fix CSS selector injection bug.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:12:05 -07:00
Anders Kaseorg a41d0b16e6 user_topics_ui: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:01:04 -07:00
Anders Kaseorg c50b28610c user_topics_ui: Fix backwards setTimeout arguments.
Introduced by commit 401c8bbb21
(#27254).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 14:01:04 -07:00
Aman Agrawal f57fb0862e message_edit: Fix event handlers lost on restoring edit form.
To avoid event handlers being lost when we restore a message edit
form we go through the process of creating the edit form for the
message again. This has the additional benefit of updating the
status of buttons based on org settings like GIF or upload button.
2024-05-14 12:21:49 -07:00
Aman Agrawal ca8f04ea35 message_list_view: Remove unnecessary parameter passed.
Since we are already selecting the previously selected id in
`reselect_selected_id` there is no need to pass the message id here.
2024-05-14 12:21:49 -07:00
Aman Agrawal a30029c8ad upload: Don't render upload button instead of hiding.
Doesn't make sense to hide the upload button button later when
we can just not show it if the browser doesn't has support for
it.
2024-05-14 12:21:49 -07:00
Aman Agrawal 7a831617af message_edit: Directly use currently_editing_messages for checks.
Makes it easier to search and verify changes related to
currently_editing_messages.
2024-05-14 12:21:49 -07:00
Sahil Batra 9d87131fa8 settings: Use new format to update can_mention_group setting.
This commit updates the webapp code to use new format to update
the can_mention_group setting.
2024-05-14 12:17:15 -07:00
Anders Kaseorg 6479cc5970 unread_ops: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg 0cbc6cb82b unread_ops: Remove unused bulk_update_read_flags_for_narrow arguments.
Introduced by commit 664f29b4f1
(#28560).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg d7a9cb6c12 unread_ops: Simplify handle_mark_unread_from_here_error with callback.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Anders Kaseorg a54d178b8a unread_ops: Fix do_mark_unread_by_narrow arguments after rate limiting.
Introduced by commit f0d87fcf6e
(#23605); propagated by commit
0bef960b34 (#29521) and commit
42a6929f5c (#30047).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-14 12:15:44 -07:00
Shubham Padia 4ee37244bb recent_topics: Change background color in dark mode on hover on a row.
Fixes #30083.
We have used the dark theme color for the left sidebar row hover:
`--color-background-active-narrow-filter`. We are not using that variable
directly since we don't want a change in that color affecting the color in
recent conversations.
We've also used a single color on hover compared to 2 different colors
for unread and read row before. Light mode also uses a single color on
hover.
Relevant CZO conversation:
https://chat.zulip.org/#narrow/stream/101-design/topic/Hover.20color.20in.20Recent.20conversations.20dark.20mode.2E/near/1797727
2024-05-14 11:46:37 -07:00
Anders Kaseorg 2e8fdab896 user_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Anders Kaseorg c0c852046d user_group_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Anders Kaseorg b3fbfd9da8 stream_pill: Avoid unnecessary array allocations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-05-13 18:12:54 -07:00
Tim Abbott 4bf8c19b32 message_view_header: Fix misleading variable name.
It never contained only icon data.
2024-05-13 17:56:30 -07:00
nimishmedatwal 941c5daf36 navbar: Describe views in top navbar.
Adds description in views styled like stream descriptions also adds a
help center link to the appropriate page at the end of each
description.

Fixes #29769.
2024-05-13 17:56:30 -07:00
afeefuddin d36e19389d add_subscribers_pill: Convert module to TypeScript. 2024-05-13 16:57:02 -07:00
afeefuddin bf3eb2c269 user_pill: Fix type annotations.
Change the type annotation of current_items in create_item_from_email
to InputPillItem<CombinedPillItem>.
2024-05-13 16:57:02 -07:00
afeefuddin 0927e03677 user_group_pill: Fix type annotations.
Change type annotations of get_user_ids and create_item_from_group_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
2024-05-13 16:57:02 -07:00
afeefuddin 0f622d3025 stream_pill: Fix type annotations.
Change type annotations of get_user_ids and create_item_from_stream_name
to accept CombinedPillContainer and InputPillItem<CombinedPillItem>
respectively.
2024-05-13 16:57:02 -07:00
afeefuddin 0b7c63a695 typeahead_helper: Add type CombinedPillItem. 2024-05-13 16:57:02 -07:00
Aman Agrawal 80d19fe15d css: Fix theme switch changing color of elements at different intervals.
Due to these transitions the theme switch from dark <-> light was
not pleasant as the background color and color changed at different
intervals.
2024-05-13 13:21:10 -07:00