Commit Graph

1596 Commits

Author SHA1 Message Date
Samuel 3ce7b77092 typing: Add typing constants to the post register api response.
Adds typing notification constants to the response given by
`POST /register`. Until now, these were hardcoded by clients
based on the documentation for implementing typing notifications
in the main endpoint description for `api/set-typing-status`.

This change also reflects updating the web-app frontend code
to use the new constants from the register response.

Co-authored-by: Samuel Kabuya <samuel.mwangikabuya@kibo.school>
Co-authored-by: Wilhelmina Asante <wilhelmina.asante@kibo.school>
2023-08-23 16:36:44 -07:00
evykassirer 0289beb784 emoji: Match emoji sequences in markdown.
Fixes #11767.

Previously multi-character emoji sequences weren't matched in the
emoji regex, so we'd convert the characters to separate images,
breaking the intended display.

This change allows us to match the full emoji sequence, and
therefore show the correct image.
2023-08-23 16:18:15 -07:00
evykassirer 78f0dca269 narrow: Save blue box position and restore on navigation.
This saves the blue box position as state on the location
in brower history, with `history.replaceState`.

The position is restored when a narrow is activated.

Fixes #20066.
2023-08-23 13:40:26 -07:00
Karl Stolley 3de007d9cd actions: Make uniform horizontal alignment. 2023-08-22 16:21:27 -07:00
Karl Stolley a17c7dfe0b controls: Present bell icon as a block.
This gives better positioning control over this icon, while not
inviting the side-effects and headaches of introducing another
flexbox.
2023-08-22 16:21:27 -07:00
Karl Stolley f07fb4fd58 time: Revert to Source Sans lnum, tnum defaults.
Source Sans 3 defaults to lining (lnum), tabular (tnum) figures,
the latter of which is necessary to have times like 11:11 and 11:18
line up in short, adjacent messages.

CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1629117
2023-08-22 16:19:54 -07:00
palashb01 eee7d18d03 user_profile: update the streams list row dynamically.
Previously, there was no mechanism in place to replace the data.
Therefore, we had to manually delete the stream row when
unsubscribing. However, with the introduction of this new function,
there is no need for manual deletion. The server events code path
already handles the case when any stream is unsubscribed, so we
can simply remove this code.
2023-08-22 11:56:42 -07:00
palashb01 485d307b64 user_profile: Update the streams list dynamically.
This commit introduces a new function named
'update_user_profile_streams_list_for_users'. it will be used
to update the stream_list in the unsubscribed streams section.
Since the list_widget offers a function to replace the data, we
can invoke this function whenever there is a subscription change
in the server_events file or stream_events file.
2023-08-22 11:56:42 -07:00
palashb01 8198a04ce8 stream_data: Refactored function to return sub and can_sub streams.
This commit refactors the 'get_subscribed_streams_for_user' function
to return an object with two keys: one for the subscribed streams
and another for the streams the user can subscribe to. The node
tests have been updated accordingly.

Renamed 'get_subscribed_streams_for_user' to 'get_streams_for_user'.
2023-08-22 11:56:42 -07:00
palashb01 94fe762ea5 user_profile: Add function to return the user profile modal id if open. 2023-08-22 11:56:42 -07:00
Palash Baderia 45569539c5 stream_events: refactor the peer add/remove code path.
This commit is a prep commit for implementing the live update of
user profile streams list. Since the code for both adding and
removing peers is the same after adding or removing the peer data,
it is better to extract that code to reduce duplication in a new
function called 'process_subscriber_update'.
2023-08-22 11:56:42 -07:00
Lauryn Menard b90505699a narrow: Fix by_topic and by_recipient for stream and message ID.
In commit 846b470b99, `narrow.by_topic` was missed for getting
the stream name via the stream ID in the message data. Updates
function to get the stream name to pass in the filter terms
to `narrow.activate`.

In that same commit, `narrow.by_recipient` was updated to not
pass the message ID to `then_select_id`. Updates call to
`narrow.activate` to include that opts parameter so that the
selected message doesn't change.
2023-08-22 11:27:44 -07:00
Junyao Chen 5efe78205d bot_data: Fix `owner_id` field to allow null value.
According to zulip `/register` API doc, `realm_bots[].owner_id`
should be nullable.
Fixes commit 7140149373.
2023-08-22 11:24:40 -07:00
Anders Kaseorg 328cdde243 documentation: Remove duplicate heading IDs on server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 17:25:14 -07:00
Karl Stolley cd0ae56ad4 icons: Implement new gold star color and states.
This not only introduces a new gold color that works across light
and dark modes, but it also separates out the hover and focus-
visible styles for stars--regardless of whether a star has been
filled or not.
2023-08-21 17:13:43 -07:00
Karl Stolley adb3b24cb2 icons: Display focused icons only without default outline.
The :focus-visible selector is more appropriate here, as that
enables browsers to determine whether focus should be displayed
or not. That's generally the case with keyboard-achieved focus,
but pointers and fingers generally do not need focus to be
displayed.

By not displaying a different icon color on simple :focus, this
will also ensure that star icons behave predictably when hovered
or focused via keyboard in both starred and unstarred states.
2023-08-21 17:13:43 -07:00
Karl Stolley 2ac578537c icons: Remove :focus-within styles on hover controls.
This corrects for an issue where hover controls would remain
visible after multiple clicks on one of the hover control icons,
despite the mouse pointer leaving the area.

This does not really create a regression for keyboard focus, as
there is currently no reasonable way to get a Tab key into the
hover controls area.

However, if one clicks multiple times on the vdots icon, and uses
Tab to move back and forth, the icons still remain visible--thanks
to the mouse pointer still being in the hover area.
2023-08-21 17:13:43 -07:00
Karl Stolley 14e9f65349 grid: Apply mobile-style grid when middle column is small.
This introduces a new breakpoint. In the future, this kind of
round-about sizing will be made unncessary by container queries,
but while those ship in all modern browsers, their availability
is quite recent:

https://developer.mozilla.org/en-US/docs/Web/CSS/@container
2023-08-21 17:13:43 -07:00
Karl Stolley 60aa58dfb9 icons: Test out second alternate vdots icon.
See CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1626845

TODO: If this alternate version moves forward, there are still styles
in this PR referring to the other vdots version. So be sure to clean
those up.
2023-08-21 17:13:43 -07:00
Karl Stolley 68ac18a338 time: Increase font-size to 13px.
This is an effort to better unify the size of the timestamp text
with the redesigned hover controls.

CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1621756
2023-08-21 17:13:43 -07:00
Karl Stolley 5d293c82cd icons: Size vdots icon for greater prominence. 2023-08-21 17:13:43 -07:00
Karl Stolley 152722cbed popovers: Use new Zulip icons in actions popover. 2023-08-21 17:13:43 -07:00
Karl Stolley 6380184973 time: Align :hover color with message controls. 2023-08-21 17:13:43 -07:00
Karl Stolley 59e9849a7f icons: Improve hover, focus states and target areas. 2023-08-21 17:13:43 -07:00
Karl Stolley 3c729b60b4 icons: Display alternate move and source icons. 2023-08-21 17:13:43 -07:00
Karl Stolley b0c428edf1 icons: Add microlayout for new icons.
This, along with the preceding commits, fixes #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley b05f76c29e icons: Implement monochrome colors and scaled active state. 2023-08-21 17:13:43 -07:00
Karl Stolley 2a8f14e40a icons: Add icon-independent .message-actions-menu-button class.
Behavior shouldn't depend on the specific names of icon classes.
2023-08-21 17:13:43 -07:00
Karl Stolley 735a42d037 icons: Reference new icons from templates and JS. 2023-08-21 17:13:43 -07:00
Karl Stolley bf7cdc8f7a icons: Add new custom icons for message hover buttons.
Files are those posted with #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley 058d21c4e2 css: Rename .message_table to .message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley c741c43800 css: Rename .focused_table to .focused-message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley e68af8a48d css: Rename .message_list to .message-feed. 2023-08-21 15:17:45 -07:00
evykassirer 37ce223b91 drafts: Use stream_id instead of stream names.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 846b470b99 messages: Use stream_id instead of stream name.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 45af8a9406 stream_data: Get is_invite_only by stream_id instead of name. 2023-08-21 15:10:17 -07:00
evykassirer 8e33b7a3a7 recent topics: Use stream_name instead of stream for clarity. 2023-08-21 15:10:17 -07:00
Sahil Batra 882663394a settings: Reduce width of "Actions" column in tables.
This commit reduces the width of "Actions" column in tables so
that they do not take any unnecessary space.
2023-08-21 15:00:39 -07:00
Sahil Batra 75126c96a4 settings: Make custom profile fields table similar to other tables.
This commit updates the admin custom profile fields table to be
similar to other tables in settings page. After this change,
the table will be horizontally scrollable for narrow screens
and the buttons in actions column will not wrap to multiple lines.

This increases the width of "Actions" column and it takes some
unnecessary space, but this will be handled in the next commit
which will adjust "Actions" column in all the tables.
2023-08-21 15:00:39 -07:00
Sahil Batra ebdd63f327 settings: Fix heading borders for striped tables.
The bottom border of heading row in striped (and not bordered)
tables was thicker than needed due to two borders being present -
one from the bottom border for heading element and one from top
border for the first row in the table.

This commit changes the CSS to remove the top border of the first
row.
2023-08-21 15:00:39 -07:00
Sahil Batra 16bf9e7600 templates: Remove table-condensed class for <table> elements.
The table-condensed class was used by bootstrap to add padding
to the table cells. But since we want padding in cells for all
tables, we added the padding CSS to the other existing CSS for
tables while removing the bootstrap CSS for tables and
"table-condensed" is not required anymore.
2023-08-21 15:00:39 -07:00
Sahil Batra 154f4f16b5 css: Remove unnecessary CSS defined using table-condensed class.
This commit removes unnecessary CSS defined for tables using
table-condensed class.

The vertical-align property for "td" elements is not needed
since by default the vertical-align property for "td" elements
is inherited and is set to "middle".

The margin properties set for the tables in informational
overlay is also not needed since we have set the width
to 100% and setting the margin to auto does not result in
anything different.
2023-08-21 15:00:39 -07:00
Anders Kaseorg 4b87a79a7e help: Apply noscroll class on server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 1244c066ad help: Highlight current article on the server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 8dba4cbba6 help: Stop pretending to be a single page application.
The API and user documentation pages gain nothing from being a single
page application other than a bunch of random errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Karl Stolley 13311ef91d reactions: Present alt-code emoji like other reaction emoji. 2023-08-21 11:38:39 -07:00
Karl Stolley 65466cec44 reactions: Let emoji and count act as simple flex items.
This commit uses a `gap` property on the containing reactions
flexbox to recreate space previously set by margins.
2023-08-21 11:38:39 -07:00
Karl Stolley 69413fe887 reactions: Mirror reaction_button styles with message_reaction. 2023-08-21 11:38:39 -07:00
Karl Stolley c0c62e477c reactions: Use a flex layout for reactions. 2023-08-21 11:38:39 -07:00
Karl Stolley 34928407cf grid: Remove message content from document flow when editing.
This effectively reverts a change introduced in #26260 that used
the original message to maintain the basline grid. With more
robust control over first-row line-heights, it is now safe to
fullyl hide the message again.

This also fixes a regression where messages with images would have
additional whitespace beneath the message edit box; see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/message.20edit.20form.20height/near/1621758
2023-08-21 11:29:00 -07:00
Karl Stolley c25da457e5 grid: Allow message toggles to occupy message area. 2023-08-21 11:29:00 -07:00
Karl Stolley 72119d161b grid: Use message_time to maintain baseline group. 2023-08-21 11:29:00 -07:00
Karl Stolley ce7f5ba785 message_edit: Hide length controller when editing. 2023-08-21 11:29:00 -07:00
Daniil Fadeev d4ef28bc8d unread_count: Remove letter spacing for better horizontal alignment. 2023-08-21 11:23:35 -07:00
Aman Agrawal f7b0282a0d navbar: Hide right arrow displayed by Safari on summary elements. 2023-08-20 23:15:18 -07:00
evykassirer 76d9b1d9d0 message scroll: Check message feed visibility instead of recent topics.
This is functionally the same, but semantically more relevant.
It will also be helpful if some day in the future these two
function calls are no longer perfect opposites of each other.
2023-08-17 15:48:53 -07:00
Prakhar Pratyush f8f2af5ebe recent_topics_ui: Add support to follow topic via recent conversations.
This commit replaces the mute/unmute topic button in the recent
conversations UI with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the recent conversations UI has an icon corresponding to
the current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute,
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' option. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted
in the popover.

Fixes #25915.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 41697f2663 message_header: Add support to follow topic from the message header bar.
This commit replaces the mute/unmute topic button in the message
header bar with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the message header bar has an icon corresponding to the
current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute',
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' options. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted in the
popover.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 07186e8de1 topic_popover: Fix the 'Mute' topic icon.
Earlier, the icon was half-filled instead of being transparent.
2023-08-17 13:30:24 -07:00
Junyao Chen d8c6311e33 bot_data: Eliminate owner field.
`owner` is a legacy key in one of bot data field. We would like to
remove this field as it's not used in the codebase. `owner_id` is
the identifier to find the owner of a bot.

CZO discussion: https://chat.zulip.org/#narrow/stream/6-frontend/topic/Can.20we.20mark.20.60owner.60.20field.20in.20bot.20data.20optional.3F/near/1625968
2023-08-17 11:53:34 -07:00
Junyao Chen 983c6b74ab ts: Migrate `user_group_create_members_data.js` to TypeScript. 2023-08-17 11:38:13 -07:00
Junyao Chen 6178a245b0 ts: Migrate `stream_create_subscribers_data.js` to TypeScript.
While `user_id` from `page_params` is marked as `number | undefined`,
when fuctions in this file are called, `page_params.user_id` will
never be undefined. Verifying from all of callers of
`initialize_with_current_user`, this is because when user is able
to create and initialize a stream, this user is authenticated and
thus a `user_id` is always available. Therefore, adding an assertion
when undefined user id is detected to handle a confirmed error.
2023-08-17 11:38:13 -07:00
Junyao Chen 80d0813dea people: Narrow the return type of `get_users_from_ids` function
`get_users_from_ids` is a function that map an array of user ids to
`User` object. According to `get_by_user_id` for mapping, every
id should be mapped to a valid `User` object. Thus removed
`undefined` annotation in this commit.
2023-08-17 11:38:13 -07:00
Junyao Chen 59aa62a36f stats: Add `zod` validation to server data and misc data.
Data retrieved from the backend using `get_chart_data` is validated
in the expected form for frontend usage. Used `zod` schemas to
validate data.
2023-08-17 11:35:00 -07:00
Junyao Chen a2669d146b ts: Migrate `stats.js` to TypeScript.
Add primitive types and promise types to variables, function
parameters and return values.

Apply type conversion functions to some objects so that the type
unification afterwards will succeed, such as converting int to
string.

Add custom types that for helper methods.

Add non-null assertions for trivial statements from code base context.
2023-08-17 11:35:00 -07:00
Junyao Chen 4ff3b8f04a stats: Fix improper function parameter passing.
Second parameter (boolean) is not supported by the function definition
in the scope. Removed in this commit.

Previous commit that made this happen:
fa9d79e203
2023-08-17 11:35:00 -07:00
Junyao Chen 0815d0473b stat: Add comments specifying the compoenents that the methods refer to.
Added one line comment for each `populate_*` methods specifying the
corresponding component that the method rendering for on the webpage.
Comments make the cross-checking experience easier.
2023-08-17 11:35:00 -07:00
Junyao Chen 1e1122282a stats: Remove unsupported sort property.
According to
https://github.com/plotly/plotly.js/blob/master/src/traces/bar/attributes.js,
plotly does not have `sort` available for bar plots. This was missed in
e01f80bf93.
2023-08-17 11:35:00 -07:00
Junyao Chen 6757c5a9f8 stats: Install @types/plotly.js for type check.
This is a prep commit for typescript migration for `stats.js`,
which used a third party module `plotly.js` that doesn't come
with types.
2023-08-17 11:35:00 -07:00
Junyao Chen 640de3ad29 page_params: Add `web/src/stats/page_params.ts` for stat module
`stat.js` has its page params different from all other modules.
2023-08-17 11:35:00 -07:00
Brijmohan Siyag 4e7bf3c4fb upload: Support drag and dropping files anywhere on message viewport.
While Zulip has supported drag/drop into the compose box for some
time, if you drag/drop the file onto other parts of the message
viewport, it would just do the default browswer behavior of replacing
the Zulip app with that file opened in a new tab, which nobody wants.

The inline comments document the set of rules for how we choose
whether to drop the upload into the compose box or an edit widget, and
also how to open the compose box in different situations.

Fixes #14579.
2023-08-16 17:06:45 -07:00
Sahil Batra 1b9fb037a1 settings: Update confirmation modal shown when reactivating a bot.
If the owner of the bot is deactivated while reactivating the bot,
we mention in the reactivation modal that the bot owner will be
changed and the bot may be unsubscribed from some private streams.
2023-08-16 15:37:37 -07:00
Lalit Kumar Singh 38250ccb83 ts: Migrate `presence.js` module to typescript. 2023-08-16 11:46:40 -07:00
Aman Agrawal 0988751d6c widgets: Remove box-shadow and use background-color to show focus.
The box-shadows cuts off on left and overlaps with button on right.
We instead change background-color in dark theme and border color in
white theme to show focus.
2023-08-16 10:06:40 -07:00
Aman Agrawal 8c4efb4f2e css: Rename variable name.
This will be used in other widgets too.
2023-08-16 10:06:40 -07:00
Aman Agrawal eda91378ec portico_signin: Fix back to login button alignment. 2023-08-16 10:05:15 -07:00
Satyam Bansal eefa124351 dialog_widget: Add horizontal padding to the modal content.
Previously, the modal content bottom border sometimes got hidden
due to subpixel rounding.
2023-08-16 10:38:42 -05:00
Tim Abbott 0e2bce3bcb recent_topics: Move is_in_focus to UI module.
This better fits how this function is used, and cuts unnecessary
dependencies from recent_topics_util.js.
2023-08-15 18:17:02 -07:00
Kunal Sharma c3173b979e docs: Avoid exceptions in scrollToHash() in Safari.
In Safari (and Google's crawler), this would throw an exception trying
to create a jquery element for certain unusual hashes like
`#:~:text=something`.

Fixes #26249.
2023-08-15 17:59:56 -07:00
Junyao Chen 446aea41b3 ts: Migrate `settings_ui.js` to TypeScript. 2023-08-15 17:17:40 -07:00
Karl Stolley ac7cf01cfa alerts: Show Copied! Tippy alert in About Zulip modal.
Fixes #23210.
2023-08-15 12:20:35 -07:00
Karl Stolley d73ae26e4b alerts: Remove unused .alert-msg elements. 2023-08-15 12:20:35 -07:00
Karl Stolley 0c9aec24fd alerts: Show Copied! Tippy alerts in message area.
This commit properly displays Tippy Copied! alerts in two cases:

1) On the clipboard icon when copying message source.
2) On the hover controls when copying the link to a message.

Fixes #21036.
2023-08-15 12:20:35 -07:00
Karl Stolley b75b53d465 tippy: Add callback, timeout args to copied confirmation. 2023-08-15 12:20:35 -07:00
Joelute 2b9e36ab48 navbar_alerts: Update text on "Complete your organization profile" banner.
Previously, the reason to complete the organization profile on the banner
wasn't clear and at times confusing. With the updated wording, it clears
up the confusion and improves the explaination of "why" as well.

Fixes: #24122.
2023-08-15 10:46:33 -07:00
Joelute eb78264162 navbar_alerts: Delay showing "Complete the organization profile" banner.
Currently, we are displaying the "Complete the organization profile"
banner immediately after the organization was created. It's important to
strongly encourage orgs to configure their profile, so we should delay
showing the banner if the profile has not been configured after 15 days.
Thus also allows the users to check out Zulip and see how it works before
configuring the organization settings.

Fixes: #24122.
2023-08-15 10:46:33 -07:00
Zixuan James Li 255e382750 linkifiers: Disable dragging when a filter is applied.
Dragging while a filter is applied can be confusing because the
reordering request won't succeed if the complete list of linkifiers is
not provided.
2023-08-15 10:21:22 -07:00
Zixuan James Li b8a770d9c6 list_widget: Pass filter_value to modifier.
The information can be useful when we want to determine if a filter
has been applied.
2023-08-15 10:21:22 -07:00
Prakhar Pratyush 71244f4a94 topic_popover: Add a 'Default' option and Show 'Unmute' conditionally.
The 'Unmute' option is available in not-muted streams only when
it is the current value.

Add a 'Default' option. Available in both muted and not-muted
streams. 'Default' corresponds to the 'INHERIT' visibility policy.

Summary:
* In muted streams:
  Four options: Mute, Default, Unmute, and Follow.

* In not-muted streams:
  Three options: Mute, Default, and Follow.
  The fourth option, 'Unmute' is available only when it is the
  current value.

Reason for conditional availability of 'Unmute' option:
In a not-muted stream, 'Unmute' has no special significance.
We only show 'Default' because both 'Default' and 'Unmute' has the
same behaviour in the not-muted stream.

This avoids the big design downside of showing this fourth
nearly-identical option to users who are just in the normal
default state of a normal topic within a normal stream

We only show the 'Unmute' option in the not-muted stream to users.
if they have followed a sequence of steps that led them to
'Unmute' state in a not-muted stream. 
For example:
Mute a stream > Unmute a topic > Unmute the stream

By doing so, we avoid destroying information. The user, when
mutes the stream again, the topic will retain the 'Unmute' state.

New icons for Mute, Default, Unmute, and Follow.
2023-08-15 10:02:03 -07:00
Prakhar Pratyush 87bd7b0b7d topic_popover: Update 'data-tippy-content' and 'aria-label'.
Update the 'data-tippy-content' and 'aria-label' from
* 'Mute topic' to 'Mute'
* 'Unmute topic' to 'Unmute'
* 'Follow topic' to 'Follow'
in the left-sidebar topic-popover UI to toggle visibility policies.

As we plan to add a 'Default' option, 'Default topic' doesn't sound
good (if we stay consistent with the earlier texts).

Instead, 'Mute', 'Default', 'Unmute', and 'Follow' sound good, and
it is obvious that we are performing action on the topic itself
(as it is a topic popover). There is no need to add an extra 'topic'
keyword.
2023-08-15 10:02:03 -07:00
Lalit Kumar Singh a0cb034731 ts: Migrate `spectators.js` to typescript. 2023-08-15 09:58:17 -07:00
Lalit Kumar Singh cd16176c10 ts: Migrate `browser_history.js` module to TypeScript. 2023-08-15 09:58:17 -07:00
Lalit Kumar Singh 9b01872e8c ts: Migrate `hash_util.js` module to TypeScript. 2023-08-15 09:58:17 -07:00
Lalit b2400d2688 stream_data: Refactor `create_sub_from_server_data` function.
We should just accept `subscribed` and `previously_subscribed` fields as
arguments to this function to avoid adding them on the `attrs` object
itself to simplify the type for `ApiGenericStreamSubscription`.
2023-08-14 16:10:16 -07:00
Lalit Singh 64f59d8daf stream_data: Consistent return values for is_* family of functions.
We should always return `boolean` type instead of `boolean | undefined`
type for functions `is_subscribed_by_name`, `is_subscribed`,
`is_web_public` to stay consistent with other similar functions which
have the type of `boolean` like `is_invite_only_by_stream_name` and
`is_web_public_by_stream_name`.
2023-08-14 16:10:16 -07:00
Lalit 69cdf6cf2f ts: Migrate `stream_data` to typescript. 2023-08-14 16:10:11 -07:00
Lalit Singh 5d109fc670 stream_data: Use `Map` instead of `FoldDict` for `BinaryDict` class.
After commit e52a3bc662, `BinaryDict`
class currently only deals with numeric stream ids so there is no
benefit to use case-insensitive `FoldDict` here anymore.
2023-08-14 16:08:25 -07:00
Lalit Singh dcbf62f492 babel: Include "transform-optional-chaining" in presets.
We need to include this "transform-optional-chaining" for babel presets
to prevent an error related to optional chaining syntax when we convert
this module to typescript. This error is a bug which is present in the
unmaintained `babel-plugin-rewire-ts` plugin.
2023-08-14 16:07:16 -07:00
Lalit 980c74e8da sub_store: Add seperate types for api stream objects.
I refined types for Subscription objects and Stream objects which were
already present `sub_store`. I took reference for the types from the
`zerver/lib/types.py` file.
2023-08-14 16:07:16 -07:00
Lalit c3292660d6 stream_data: Refactor `sub` objects when creating subs in stream data.
This commit refactors the `sub` object we were creating in
`create_sub_from_server_data` function, there were some fields which
didn't need to have a default set like `name`, `description` etc. so we
can remove those fields from here.

Also I set the color field in the object field itself to avoid making an
incomplete type object with not having `color` propertie initially.
2023-08-14 16:07:15 -07:00
Lalit 5dc599e07c stream_data: Make new object instead of modifying `sub`.
We should make a new object called `attrs` instead of adding new fields
directly to `sub` in `populate_subscriptions` method because these
additional properties which are being added does not staisfy the type
definition for the data we are getting from the server.

Because of this when we will type this function we will get type errors
saying that these additional field does not exist. So we should make a
seperate object with the correct types.
2023-08-14 16:07:15 -07:00
Junyao Chen 7140149373 ts: Migrate `bot_data.js` to TypeScript.
Add type annotations. Create custom types for Bot and Service.
Add zod data validation for incoming bot data from server.
Based on `zerver/openapi/zulip.yaml` description, `add` operation
(`op`) carries data that follows `Bot` structure. So taking
reference from `bot` structure, I create `ServerAddBotData` zod
schema and infer its type. Similarly, `update` operation carries
data that follows `BasicBot`, so I create `ServerUpdateBotData`.
Note that `Bot` inherits from `BasicBot`.

`zerver/openapi/zulip.yaml` describes that `services` in `BasicBot`
can be one of two objects, one with `{base_url, token, interface}`,
another with `{service_name, config_data}`. Therefore, I create
two corresponding schema and infer their types.

Fix two test cases `bot_data.test.js` and `settings_bots.test.js`
whose synthetic objects should have had followed the schema.
2023-08-14 16:06:15 -07:00
Junyao Chen 208438634c ts: Convert `signup.js` to TypeScript.
Added type annotations for function parameters and return values.
Added non-null assertions or type narrowing to some variables to
enforce type safety.
In `global.d.ts`, I added a namespace `JQueryValidation` which is
neccessary for type annotations inovolved in `jquery-validation`
plugin.
2023-08-14 16:00:20 -07:00
Junyao Chen 113a791532 signup: Use `querySelector` instead of accessing document property.
Previous line written in that way assumes `email_form` will appear
in the `document`. A modernly standard way is to use `querySelector`
selecting by id. Another advantage is easy for enforcing typecheck.

The commit related to this line of change is linked below:
9cb682cada
2023-08-14 16:00:20 -07:00
Junyao Chen c008ba1172 common: Fix parameter type of `autofocus` function.
Throughout the codebase there is currently one usage of `autofocus`
excepts in test files. The only one usage is in `signup.js` and was
supposed to pass a `JQuery` selector to `autofocus` rather than a
string. Passing a selector is more convenient in this case: The
selector accessed in `signup.js` is ready to `trigger` the `focus`
function, while getting a attirubte string from the selector and then
passing to `autofocus` and then accessing the selector by attribute
cost extra layers of work. Therefore writing this commit to simplify
the type for easy usage.

Fixes the test case(s) accordingly.
2023-08-14 16:00:20 -07:00
Zixuan James Li 5301060954 linkifiers: Support dragging and reordering linkifiers.
This also removes sorting on the pattern and the URL template, because
it does not make sense anymore as we make linkifiers draggable.

Fixes #23716
2023-08-14 15:21:48 -07:00
Zixuan James Li 31b7003d61 settings: Rename movable-profile-field-row.
So that we can reuse it for other movable rows in places like
.admin_linkifiers_table.
2023-08-14 15:21:48 -07:00
Zixuan James Li 112a6e445e linkifiers: Support multiple linkifiers in puppeteer tests.
Select the linkifier with `:nth-child` assuming the possibility of other
linkifiers in the realm. This prepares for a later change that requires
us to populate the test database with linkifiers.
2023-08-14 15:21:48 -07:00
David Rosa d205850d54 docs: Update .html links pointing to "Upgrade Zulip" or "Modify Zulip".
Follow-up to #24089.
2023-08-11 16:49:32 -07:00
evykassirer 4c2995c613 stream settings: Warn users before locking them out of a stream.
Organization owners can make streams private even if they're not
subscribed to them, but cannot access private streams they're not
subscribed to. This means they're able to lock themself out of streams.

This change warns users of this and give them a chance to subscribe.

Fixes #26437.
2023-08-11 16:46:41 -07:00
Satyam Bansal fe39f28497 drafts: Rename class name to provide more context. 2023-08-11 15:54:17 -07:00
Satyam Bansal ee0d45d13c drafts: Increase tippy delay for "Delete Drafts" icon.
Previously, the tippy delay was too short, resulting in
the tippy being flashed for an instant, which could lead
to confusion for the users.
2023-08-11 15:54:17 -07:00
Julia Bichler fed866449d drafts: Add functionality to bulk delete drafts.
Fixes #19360.

Co-authored-by: Satyam Bansal <sbansal1999@gmail.com>
2023-08-11 15:54:17 -07:00
Satyam Bansal e4048de0a9 app_components: Convert "overlay_message_controls" div to flexbox.
Previously, the icons were spaced by hardcoded values of margins
and would require changes everytime a new icon is added.
2023-08-11 15:54:17 -07:00
Satyam Bansal b4be3f6266 drafts: Remove unused CSS styles. 2023-08-11 15:54:17 -07:00
Satyam Bansal 0f0c52e096 drafts: Remove classes that had the same effect.
In commit 5edc8fc, abstract classes were added to the
drafts overlay, but the classes that were already there
were not removed. This resulted in the same styles being
applied twice.
2023-08-11 15:54:17 -07:00
Daniil Fadeev 28ba839857 condense: Focus on the message after condensing/expanding it. 2023-08-11 12:39:43 -07:00
Lauryn Menard 225be0bb97 dropdown-list-widget: Remove dropdown-list-body class and reference.
Removes the "dropdown-list-body" class and references as it is no
longer used in the new DropdownWidget. The previous uses of the
class were removed in commit 875d564f2d.
2023-08-11 12:26:47 -07:00
Karl Stolley da4e0c4073 compose: Allow URLs to be pasted onto selected text.
Fixes: #18692
2023-08-09 15:35:14 -07:00
Karl Stolley cd0fd49a83 copy_paste: Strip back tests to only test handler.
This gets us out of the brittle business of trying to mock a
complex event like "paste"--which mocking basically means we
are testing against the mock more than a real event.

The test name is also changed to clarify the handler being
tested.

See CZO discussion behind this change:
https://chat.zulip.org/#narrow/stream/43-automated-testing/topic/mocking.20browser.20events.3F/near/1615110
2023-08-09 15:35:14 -07:00
Karl Stolley 96654c49c7 print: Hide closing X on search bar. 2023-08-09 15:26:10 -07:00
Karl Stolley a73faf6579 tests: Disable flaky test_edit_bot_form test. 2023-08-09 15:25:48 -07:00
Hemant Umre 63173ce1bc stream_settings: Add 'Default stream' option in create stream UI.
In this commit, we introduce a new option in the stream creation
UI - a 'Default stream for new users' checkbox. By default, the
checkbox is set to 'off' and is only visible to admins. This
allow admins to easily designate a stream as the default stream
for new users during stream creation.

Fixes #24048.
2023-08-09 15:20:09 -07:00
Hemant Umre a81715786c stream_settings: Add 'Default stream' option in edit stream UI.
This commit adds a 'Default stream for new users' checkbox in
the stream editing UI to allow admins to easily add or remove
a stream as the default stream for new users. Previously, this
functionality required navigating to separate menu.

Fixes a part of #24048.
2023-08-09 14:38:52 -07:00
nimish d3c99682c3 message_feed: Fix collapsed messages for highlighted texts.
Fixes #26346.
2023-08-08 12:19:54 -07:00
Lalit 119f581470 ts: Migrate `pm_conversations` module to typescript. 2023-08-08 12:19:12 -07:00
evykassirer c3fe96af52 compose: Use stream id instead of stream name for composebox opts. 2023-08-07 17:08:59 -07:00
evykassirer 41b900c2c0 compose: Get stream name from id in create_message_object.
Since this is based off of the id now and doesn't try
to get a stream from a name (because stream is now
selected by a dropdown and not a free-form input field),
we can also remove the error handling for when the
stream name doesn't correspond to any streams.
2023-08-07 17:08:59 -07:00
evykassirer f190419bc9 composebox_typeahead: Get topics_seen_for stream id instead of name. 2023-08-07 17:08:59 -07:00
evykassirer 8cee3dfbf2 snapshot_message: Get stream id from name instead of name from id. 2023-08-07 17:08:59 -07:00
evykassirer d9edcba724 narrow_state: Rename stream() to stream_name() which is more accurate. 2023-08-07 17:08:59 -07:00
evykassirer ba9cfc2cd8 update_messages: Compare to compose stream by id instead of name. 2023-08-07 17:08:59 -07:00
evykassirer 4b23bc1915 narrow: Get stream name from id instead of id from name. 2023-08-07 17:08:59 -07:00
evykassirer ab630b166c compose state: Check if stream is selected with id instead of name. 2023-08-07 17:08:59 -07:00
evykassirer 368c613738 focused recipient: Remove unused stream attribute.
Now that stream_id is used instead of stream, we
can stop setting `focused_recipient.stream`.
2023-08-07 17:08:59 -07:00
evykassirer d7d7828a12 hashchange: Remove hiding of recent topics.
Recent Topics is hidden when we switch to a narrow view
or the All Messages view, so this call is not needed.
It will also become actively unhelpful when we build
a stream-specific recent topics page, because then it
will be possible to have a hash change that shouldn't
close the recent topics view.
2023-08-07 10:06:48 -07:00
evykassirer 40e40e09ba puppeteer: Use `stream_name` instead of `stream` for clarity. 2023-08-07 09:57:40 -07:00
Sahil Batra db3b9e4742 settings: Make custom profile fields table consistent with others.
We change the custom profile fields table to have same header as
of other table and as a result this also makes the page look
better if an organization has zero custom profile fields.
2023-08-06 18:13:33 -07:00
Sahil Batra 7bd7ccc439 bootstrap: Remove bootstrap CSS defined using "table" class.
We have already added the required bootstrap CSS defined using
"table" class in specific files and thus we can remove them
from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 817e39650e css: Re-add bootstrap CSS defined using "table" class.
This commit re-adds bootstrap CSS rules defined using "table"
class to the specific CSS files where CSS for different tables
is present.

This is a prep commit for removing table related bootstrap CSS
from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra fcaaa6566e bootstrap: Remove bootstrap CSS for <table> element.
This commit adds the required bootstrap CSS for "<table>"
element in the specific files and removes them from
bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 9240d780a4 bootstrap: Remove CSS for table-stripped from bootstrap.css.
This commit re-adds the CSS to have different background for
alternate rows in striped tables to specific files and remove
them from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 806abf7d1c bootstrap: Remove bootstrap CSS for table-condensed class.
This commit re-adds bootstrap CSS rules defined using
"table-condensed" class to the required files and removes
them from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 1111cbb190 bootstrap: Remove bootstrap CSS for table-bordered.
We have already re-added the bootstrap CSS rules defined using
"table-bordered" class in the specific files where required and
thus this commit removes them from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 91cba1a05e informational_overlays: Fix top and bottom borders in thead.
Previously, two borders were applied on the heading of tables
in informational_overlay. Top of the heading element had one
border from "table" and one from "th" element. Bottom of the
heading had one border from "th" element and one from "td"
element.

This commit fixes it by changing the CSS for borders on
"th" element to be applied only on striped tables without
borders (i.e. tables having "table-striped" class but not
"table-bordered" class) as bordered tables already have
top borders defined on td and table element while on
striped tables without borders, only bottom border is
applied on "td" elements along with the top and bottom
borders on "th".
2023-08-06 18:13:33 -07:00
Sahil Batra 3ce6fbe10a css: Re-add bootstrap CSS for tables with "table-bordered" class.
This commit re-adds bootstrap CSS rules with "table-bordered" class
to app_components.css so that tables used in the app can use this
css and we can remove the CSS from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 29ce34020d portico: Re-add bootstrap CSS for tables with "table-bordered" class.
This commit re-adds required bootstrap CSS rules defined with
"table-bordered" class to the specific files.

This is a prep commit to remove bootstrap CSS for tables.
2023-08-06 18:13:33 -07:00
Sahil Batra 2976f3f9e7 bootstrap: Remove unnecessary CSS defined using ".table".
We do not use classes like "success", "warning", "info"
and "error" for "tr" elements used in tables and thus
we can remove the related CSS from bootstrap.css.

We also do not have selectors of the form ".table .table"
and so we can remove that CSS from bootstrap.css as well.

ALso, the CSS defined using ".table tbody + tbody" to
set the border is not required as we already set borders
on th and td elements.

The browser defaults for font-weight for `th` elements
is "bold" so we can remove the CSS to set font-weight
from bootstrap.css.
2023-08-06 18:13:33 -07:00
Sahil Batra 3da647c246 bootstrap: Remove unnecessary CSS for th and td elements.
The html for tables used by us has a following structure-

<table>
    <thead>
        <tr>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td></td>
        </tr>
    </tbody>
</table>

So, as per the above structure, we do not have th elements
inside tbody and td elements inside thead and thus we can
remove the bootstrap CSS rules for these cases. Also, we
always have a thead before tbody, so tbody:first-child CSS
can also be removed.
2023-08-06 18:13:33 -07:00
Sahil Batra ba4ccb00a9 bootstrap: Remove CSS for "tfoot" elements.
We use "tfoot" element only in realm_domains_modal.hbs
template and this table does not have table-bordered class.
The bootstrap CSS rules for "tfoot" elements are only for
the "tfoot" elements inside a table with "table-bordereds"
class so we can safely remove the bootstrap CSS.
2023-08-06 18:13:33 -07:00
Sahil Batra ae72151ec1 streams: Pass stream_weekly_traffic field in stream objects.
This commit adds code to pass stream traffic data using
the "stream_weekly_traffic" field in stream objects.

We already include the traffic data in Subscription objects,
but the traffic data does not depend on the user to stream
relationship and is stream-only information, so it's better
to include it in Stream objects. We may remove the traffic
data and other stream information fields for Subscription
objects in future.

This will help clients to correctly display the stream
traffic data in case where client receives a stream
creation event and no subscription event, for an already
existing stream which the user did not have access to before.
2023-08-06 18:06:42 -07:00
Sahil Batra 7258a2caaf settings: Fix save-discard widget handling for code block language.
The save-discard was not being hidden properly in the below case-
- The "Default language for code blocks" setting was disabled
initially (i.e. the "Disable" option was selected in the dropdown),
meaning there was not default language set.
- The setting is then udpated to "javascript" and the save-discard
widget is shown as expected.
- The setting is then again change to "Disable" option.

The save-discard widget should have been hidden after the last
step, but it does not.

This was because while comparing the old and new value, the new
value (obtained using get_dropdown_list_widget_setting_value) was
computed as "null" while the old value (obtained from page_params)
was an empty string "". This commit fixes the bug by changing
get_dropdown_list_widget_setting_value to return empty string "",
instead of null, when the "Disable" option is selected in the
dropdown.

The "get_dropdown_list_widget_setting_value" function was returning
null previously, as we supported both null and empty string "" to
represent the state of no language selected, with null being the
initial value and empty string being used if user changed the
setting to some language and then disabled it again.
This was changed in #26275 and the state of not setting any default
language for code blocks is now represented using empty string in
all cases.
2023-08-06 17:53:57 -07:00
Sahil Batra fc5b63e5cd settings: Fix save-discard widget fo.
The save-discard widget was not showing and hiding correctly
for the "Automated messages and emails" section in organization
settings panel. This was because the "proposed_val" was always
being returned as "undefined" for language setting as
"data-language-code", which is used to check the proposed value
of setting, was not set after changes in 36475daba7.
This commit fixes it by passing language_code value to
language_selection_widget and thus setting "data-language-code"
attribute correctly.

The changes in 36475daba7 removed language_code parameter from
language_selection_widget as it was not passed in the template
from "Display settings" section. So, this commit also passes
the language_code parameter to language_selection_widget from
"Display settings" section.
This change sets the "data-language-code" attribute even when
it is not being used there, to make sure there is no reference
to undefined fields in language_selection_widget.

Note that the above bug was reproducible only if you have not
changed the language even once and are trying to change the
other settings, as the data-language-code attribute was set
after selecting a language from the modal, but it was not
set initially after rendering the page.
2023-08-06 17:53:57 -07:00
evykassirer 5b5ab1dbc1 scheduled messages: Allow user to reschedule quickly from edit window.
Currently we unschedule messages as soon as they're opened for editing.
Users have requested a way to easily reschedule, especially for
situations where they didn't end up wanting to edit the messages in
the first place.

This commit adds an action button to reschedule the message for the
time it was originally scheduled for.

CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Scheduled.20message.20sent.20to.20draft.20if.20no.20changes
2023-08-06 14:34:33 -07:00
Aman Agrawal 3303b5ab72 dropdown_widget: Show disabled if value not in options.
It is possible that the current value of a dropdown widget is
valid but not present in options since the current user doesn't
have access it. So, we show [disabled] as value in that case.

This can be reproduced by setting a private stream for
notifications in org settings and then opening org settings
as a user which doesn't have access to the private stream.
2023-08-06 14:18:51 -07:00
Prakhar Pratyush 3d5d434e71 settings: Add a saving-saved indicator to the 'SETTINGS/TOPICS' UI.
This commit adds a 'saving...' - 'saved' indicator to the
'SETTINGS/TOPICS' UI.

This improves the UX by reflecting that the changes are saved.
2023-08-06 13:55:21 -07:00
Karl Stolley 399092543c print: Try to keep message headers with messages.
This avoids making "orphans" out of message headers when printing
interleaved views on supporting browsers.
2023-08-06 13:27:40 -07:00
Karl Stolley 7012fd5b78 print: Add Safari-inspired fixes. 2023-08-06 13:27:40 -07:00
Karl Stolley 6193b5577d print: Set auto height on html, body. 2023-08-06 13:27:40 -07:00
Karl Stolley d3dcc8895d print: Ensure crisp edit/timestamp text. 2023-08-06 13:27:40 -07:00
Karl Stolley d020a100c3 css: Isolate dark theme to screen only.
The primary motivation for this change is to default to the light
theme when printing.
2023-08-06 13:27:40 -07:00
Anders Kaseorg 63c9296d53 tests: Fix direct mutation of ES modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-04 18:00:38 -07:00
Anders Kaseorg 64c973d8ec namespace: Tighten override_rewire old_value check.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-04 18:00:38 -07:00
Anders Kaseorg 529d35c530 namespace: Clean up template_path manipulation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-04 14:38:37 -07:00
Karl Stolley 73fbca7ae9
tests: Correct the spelling of 'caret'. 2023-08-03 12:54:43 -05:00
Anders Kaseorg 6632eca2dc stream_data: Use yield*.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-02 19:01:20 -07:00
Junyao Chen 8df9828ed1 ts: Migrate `alert_words.js` to TypeScript.
Added type annotations for function params, return values and
local variables.
2023-08-02 18:38:58 -07:00
Lalit Singh 2893685890 people: Revert to using `ignore_missing` parameter.
We revert to use `ignore_missing` parameter for `maybe_get_user_by_id`
function to avoid sending unnecessary `blueslip.error()` calls to
sentry.
2023-08-02 17:25:14 -07:00
Aman Agrawal 875d564f2d stream_settings: Migrate to new DropdownWidget.
Also, remove old DropdownListWidget since it is no longer used.
2023-07-27 14:10:08 -07:00
Aman Agrawal aa8e94ca6d settings_org: Migrate dropdowns to new DropdownWidget.
This also moves [Disabled] button inside the dropdown.
2023-07-27 14:10:08 -07:00
Aman Agrawal 6efcb7a349 dropdown_widget: Refactor to use Class. 2023-07-27 14:10:08 -07:00
Anders Kaseorg d91d6d1fd1 settings_profile_fields: Simplify convoluted sort algorithm to max.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-27 14:06:25 -07:00
evykassirer ec25baa344 compose: Return focus to DM input after pill selection.
Before this change, the cursor left the DM recipient box after
selecting a pill from the typeahead. This was only the case with
mouse clicks and not with keyboard selection.

This change ensures we always return focus to the input field
after selection.
2023-07-26 21:05:38 -07:00
Karl Stolley 3b63faf33c bot_icon: Correct vertical alignment. 2023-07-26 12:15:11 -07:00
Ujjawal Modi fbcc3b5c84 user_groups: Rename `can_mention_group_id` parameter.
Earlier the API endpoints related to user_group accepts and returns a
field `can_mention_group_id` which represents the ID
of user_group whose members can mention the group.

This commit renames this field to `can_mention_group`.
2023-07-25 18:33:04 -07:00
Ujjawal Modi c8bcb422f5 streams: Rename `can_remove_subscribers_group_id` parameter.
Earlier the API endpoints related to streams accepts and returns a
field `can_remove_subscribers_group_id` which represents the ID
of user_group whose members can remove subscribers from stream.

This commit renames this field to `can_remove_subscribers_group`.
2023-07-25 18:33:04 -07:00
Karl Stolley 61f30fa347 print: Add print styles targeted at topics. 2023-07-25 17:30:40 -07:00
Sahil Batra befcb46ba3 dialog_widget: Rename "dialog_cancel_button" to "dialog_exit_button".
This commit renames "dialog_cancel_button" class in the exit button
of modals to "dialog_exit_button", which seems a much better name
for a button that is used to close a modal.
2023-07-25 10:25:12 -07:00
Sahil Batra 8db9093d0b stream: Change button text to "Close" in copy email address modal.
This commit changes the button text from "Cancel" to "Close" in
copy email address modal, since it is weird to click on "Cancel"
button after having copied the email address and might confuse
users. Using "Close" makes it clear that the button is to just
close the modal.
2023-07-25 10:25:12 -07:00
Tim Abbott 213387249e css: Fix prettier error and reorganize some colors. 2023-07-24 18:06:25 -07:00
evykassirer 92e24a9727 compose: Don't select compose input field after focus.
Fixes #25950.

Focus area is mostly determined by finding the first
relevant field that is *empty*, and selecting empty
fields has no effect.

The only situation where the field might not be empty
is when the textarea already has text in it, since
that's the default option. We don't want to select
the composebox textarea because this can lead to
people losing their messages if they start typing
right away.
2023-07-24 17:53:46 -07:00
Ishita Gupta aa86533f22 UI redesign: more-less message interaction.
This commit encompasses the following changes:
* Replace the [More...] link with a button titled "Show more".
* Replace the [Show Less...] link with a button titled "Show less".
* Add various on-hover interactions to the buttons.
* In the condensed view, add fading to the bottom of the message to
  visually communicate that the message is truncated.
* Update /help/ description.

Fixes #22801.

Co-authored-by: Evy Kassirer <evy.kassirer@gmail.com>
2023-07-24 17:42:08 -07:00
Zixuan James Li fe1a2f6f02 realm_playgrounds: Refactor error handling for validation on creation.
Previously, the view function was responsible for doing a first pass of
the validations done for RealmPlayground. It is no longer true now. This
refactors do_add_realm_playground to check_add_realm_playground and make
it responsible for validating the playground fields and doing error
handling for the ValidationError raised.
2023-07-24 17:40:59 -07:00
Zixuan James Li 000761ac0c realm_playgrounds: Replace url_prefix with url_template.
Dropping support for url_prefix for RealmPlayground, the server now uses
url_template instead only for playground creation, retrieval and audit
logging upon removal.

This does the necessary handling so that url_template is expanded with
the extracted code.

Fixes #25723.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-07-24 17:40:59 -07:00
evykassirer c4bc0ad589 message feed: Change color of zulip logo at top of feed. 2023-07-24 17:27:59 -07:00
Junyao Chen 30c535fc63 ts: Migrate `vdom.js` to TypeScript.
Added type annotations for variables, function params, and return
values. Created custom types that help with clean type annotations.

Notes on `attrs` field in custom `Option` type:
 `attrs` is an `Iterable` where each element is a pair of string, i.e
a string array with two elements. `attrs` is tranformed into a `Map`
at some point. `Map` constructor takes in `Iterable` object so has
no problem unifying with `attrs`. However, at some point `attrs` is
transfomed using `.map(...)` which is an array method, and `Iterable`
does not support `.map(...)`. So at this point, I cast `attrs` into
array before using `.map(...)` by this syntax:
`[..attrs].map(...)`
2023-07-24 16:49:53 -07:00
Karl Stolley 5d819ea254 grid: Remove unnecessary mobile-scale padding.
This also removes padding on .message_content that wasn't actually
rendered due to its low specificity. It was likely also leftover
from an earlier, non-grid-based layout.
2023-07-24 16:47:14 -07:00
Junyao Chen c693816d66 ts: Migrate `huddle_data.js` to TypeScript.
Added type annotations.
2023-07-24 16:45:30 -07:00
Anders Kaseorg bc1e953f0f dark_theme: Remove Firefox override for dropdown appearance.
We get the right background-color from line 487 in the same way as
Chrome.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-24 13:43:17 -07:00
lapaz 5d5e1963b9 settings: Add "Copied" tooltip in bots/streams copy feedback.
This provides a bit nicer feedback to the user that the copy worked.

Fixes #26181
2023-07-24 13:21:43 -07:00
Anders Kaseorg 1b72d5c413 styles: Remove Firefox override for dropdown appearance.
The default appearance in modern Firefox is totally fine, and our
override was incorrectly changing the dropdown triangle to black for
the dark theme.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-24 13:10:03 -07:00
Hardik Dharmani cd24620c4a js: Rename top_left_corner.js to left_sidebar_navigation_area.js.
This provides a much clearer and more consistent codebase name for
this part of the app.

Fixes part of #25902.
2023-07-24 13:02:28 -07:00
Lalit bd6184305a realm_playground: Iterate over `playgrounds_data` directly.
Using `Object.values(playgrounds_data)` for iterating over an array is
unnecessary when we can just directly loop over the array here.
2023-07-24 12:49:53 -07:00
Lalit 829caae189 ts: Migrate `realm_playground` to typescript. 2023-07-24 12:49:53 -07:00
Lalit 4a4d23a548 realm_playground: Remove `generated_pygments_data` parameter for
initialization function.

We are already importing `generated_pygments_data.json` directly in
`realm_playground.js` so there is no need to pass it via initialization
method.
2023-07-24 12:49:53 -07:00
Lalit 8c12494c16 realm_playground: Cut dependency on `typeahead_helper.js`. 2023-07-24 12:49:53 -07:00
Sahil Batra 6cb080c447 bootstrap: Remove bootstrap CSS for blockquote elements.
We have added the bootstrap CSS rules for blockquote elements
to the specific elements in previous commits and thus we can
safely remove these from bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 2926337404 templates: Re-add bootstrap CSS for tweet blockquote elements.
This CSS will only be used if somehow the tweet is renderd as
a simple quote without iframe either due to network problem
or if the actual tweet is deleted.
2023-07-23 15:44:58 -07:00
Sahil Batra fdc0fc9d97 markdown: Re-add bootstrap CSS for blockquote used in markdown.
This commit re-adds bootstrap CSS rules for blockquote elements
used in various markdown pages including the ones which are
rendered during message formatting like when quoting a message.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00
Sahil Batra 30dec9822b landing_page: Re-add bootstrap CSS for blockquote in testimonials.
This commit re-adds bootstrap CSS rules for blockquote elements
used for testimonials in the landing page.

This is a prep commit to remove the blockquote CSS rules from
bootstrap.css.
2023-07-23 15:44:58 -07:00