Commit Graph

6565 Commits

Author SHA1 Message Date
Sayam Samal 1cc66fbad4 settings_profile_fields: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal 4105fc4e77 settings_org: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal 6e9ad8607e settings_linkifiers: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal bc1306f26b settings_exports: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal c79d0c4cfd settings_emoji: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal f529c992f5 settings_components: Rename btn -> button in JS variables.
This commit is a part of the efforts to rename btn-related classes
and variables to align with Zulip's no-abbreviations policy and
streamline the search results.
2024-11-14 12:03:36 -08:00
Sayam Samal 6664672dc8 settings_playgrounds: Rename btn -> button in JS variables. 2024-11-14 12:03:36 -08:00
evykassirer 76d3bf2532 stream_list: Use delegate instead of default for tippy. 2024-11-14 10:09:41 -08:00
Sahil Batra dccf39a245 settings: Fix checking max values for message move limit settings.
The setting value for message move limit seconds was not being
converted to seconds before checking if the value was allowed or
not and that resulted in requests being made for values greater
than the allowed values.
2024-11-14 10:08:00 -08:00
Anders Kaseorg 06a9600aa7 bundles: Remove unnecessary bootstrap_typeahead import.
Commit db24df488c (#29286) made this a
normal function rather than a jQuery plugin, so it doesn’t need to be
imported for side effects.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 17:08:37 -08:00
Anders Kaseorg e82b7641c6 giphy: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 11:56:57 -08:00
opmkumar c4ad9d8e09 tooltip: Remove "last active" time from deactivated user tooltip.
Removes "last active" time from deactivated user tooltip and instead adds
"This user has been deactivated." Also, in the deactivated bot tooltip,
"This bot has been deactivated." has been added.

Fixes #32136.
2024-11-13 10:39:09 -08:00
Anders Kaseorg e3118d8fc9 Revert "settings_account: Move async call into ui_init."
This reverts commit 8eb0ca3a7c (#32068).

We fixed the TypeScript configuration in #32327.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 10:15:29 -08:00
Anders Kaseorg 01540b45b0 web: Set "type": "module" and convert various CJS files to ESM.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg 905fc3b50e marked: Rename to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg daa9552548 zulip-icons: Rename to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg 73f7818510 debug-require: Rename to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg 687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg 26c72bf7ec test-js-with-puppeteer: Run with node --experimental-strip-types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg 45de69465a webpack: Run with node --experimental-strip-types.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg e73f1a74f3 webpack: Remove resolve.extensions from config.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Anders Kaseorg ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Shubham Padia a297ce7371 mention: Remove extra whitespace from mentions.
This was introduced in 5b70775ab6.
2024-11-13 09:13:38 -08:00
evykassirer 048387da05 stream_edit: Fix bug where personal settings weren't being saved. 2024-11-12 23:33:03 -08:00
Anders Kaseorg ffc99d2025 webpack: Remove unused hexoid alias.
koa-body was switched to @koa/bodyparser during development of #29198,
so this was never used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-12 15:03:29 -08:00
Karl Stolley 3c9c6f0a3b settings: Improve layout of user-list style previews. 2024-11-12 14:40:45 -08:00
Karl Stolley eb89719221 settings: Simplify user-list preview styles. 2024-11-12 14:40:45 -08:00
Anders Kaseorg 3cf7513498 babel: Remove transform-optional-chaining workaround.
This was a workaround for a bug in babel-plugin-rewire-ts, which we’ve
now removed.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-12 12:31:55 -08:00
Sahil Batra 54595f80cc settings: Fix filtering users based on role.
This bug was introduced in 174a458928 as `this` parameter
passed to role_selected_handler was DropdownWidget instance
and not the Jquery element for the selected role option.
2024-11-12 09:49:36 -08:00
Lalit Singh 8eab7591a3 ts: Convert `portico/google_analytics.js` to TypeScript.
Created a custom type declaration file `ga-gtag.d.ts` for
`ga-gtag` npm module.

`@types/gtag.js` is installed as a devDependency so that the type
for `gtag` function can be provided.
2024-11-12 09:48:52 -08:00
Vishesh Singh 5b70775ab6 mention_pill: Show bot icon in bot mention pill.
Render a bot icon to the right of bot name, in case
it is a bot.
2024-11-12 09:34:07 -08:00
evykassirer 482f6c5449 stream_list: Add tooltip in left sidebar when clicking opens feed. 2024-11-11 16:41:30 -08:00
evykassirer 8a0063f641 stream_sidebar_row: Remove title for topic name. 2024-11-11 16:41:30 -08:00
evykassirer d8a4ca38ab stream_sidebar_row: Remove title for channel name. 2024-11-11 16:41:30 -08:00
evykassirer f29f1299aa stream_list: Use more specific classname for click handler.
This avoids this code being fragile with any future refactoring.
2024-11-11 16:41:30 -08:00
Aman Agrawal e734694229 message_header: Fix message content visible above sticky header.
This was due to `box-shadow` used to hide the content was incorrectly
overridden in `.sticky_header` from the `.message_header` just above.

The bug is highly reproducible since it happens due to minor pixel
differences when rendering.
2024-11-11 14:19:20 -08:00
Aman Agrawal 6fe3ceb0ee recent_view: Fix backfill data not updated after reload.
This fixes backfill data not being inserted in recent view if
recent view was open when it received the backfill data.

Fixed by inserted rows in the sorted order instead of inserting
them randomly which caused rows to not be inserted if there were
no rows around the row being inserted.
2024-11-11 12:07:23 -08:00
Aman Agrawal b85dcd0175 webpack: Remove unused landing_page dependency on event status page.
Event status page no longer uses any styles from this page.

Fixes #23629
2024-11-10 22:42:42 -08:00
Anders Kaseorg ff70ab441d dependencies: Remove three JS argument parsing libraries.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 16:00:29 -08:00
Anders Kaseorg da749d1c94 mdiff: Add missing exit for --help.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 16:00:29 -08:00
Anders Kaseorg efd7c06e30 lint: Recognize more JavaScript file extensions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-09 23:09:46 -08:00
Anders Kaseorg b020d5e2e8 tests: Remove deprecated Sentry.addTracingExtensions() call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-09 22:18:10 -08:00
evykassirer 424e5d6ad0 buddy_list: Add background color placeholder to loading avatar. 2024-11-08 15:44:14 -08:00
evykassirer cb6c60ef7a stream_create: Fix puppeteer test flake from modal reopening.
In 245357c868 we added a redirect
after stream creation, to go to the stream feed. This means
the stream settings modal was closed partway through the tests.
This caused a flake where when the modal was reopened it was
not always open by the time we fetched the stream name.

The main fix in this commit is changing the classname for
the stream in the modal to be more specific (`stream-name`
can also be found in the left sidebar in many places) and
waiting for it to be visible again before getting text from
it.

More discussion here:
https://chat.zulip.org/#narrow/channel/43-automated-testing/topic/stream.20create.20puppeteer.20failure/near/1976724

Co-authored-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 14:12:24 -08:00
Anders Kaseorg 2f2a207ae0 tests: Remove babel-plugin-rewire-ts.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg aab541bd4e namespace: Recognize immutable ES modules without checking __Rewire__.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg 8c60b66a95 tests: Use setters instead of __Rewire__.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg 52e59a9605 web: Add setters for rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg a208870b59 tests: Fix override of immutable ES module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg df6bcf6d3d tests: Avoid override_rewire of overloaded function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg ee52618e1b namespace: Require rewired variables to be exported.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg db2723036f tests: Export rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg a37aab19ed tests: Avoid override_rewire of imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg c57f12a792 tests: Remove override_rewire of nonexistent variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Karl Stolley 4038832889 unread_count: Set class for legacy quiet counters. 2024-11-07 14:56:38 -08:00
Karl Stolley 0e3be942b9 unread_count: Introduce classes for different counts.
This includes more prominent quiet counts, with increased
font-weight and, in dark mode, a brighter text color.
2024-11-07 14:56:38 -08:00
bedo a632948482 left_sidebar: Fix keyboard accessibility.
Fixes #31823

When home view changes, CSS just puts the selected home view
at the top of the left_sidebar navigation list (expanded)
or to the left (collapsed), but the rendered <li> elements
stay in the same order in DOM, so regarldess of current home view,
keyboard navigation always follows the order in which the <li>
elements appear in DOM.

Changes:
- Reorder <li> navigation elements in DOM based on current home view.

- Remove tabindex=0 from <a> elements, because they are now ordered
correctly in DOM.

- Add (tabindex="0" role="button") to the <i> collapsable VIEWS, to be
keyboard accessibile.
2024-11-07 11:55:48 -08:00
Tim Abbott fce6f4ef66 topic_list: Harden topic clicks against propagation.
I saw some profiling traces where it appears multiple copies of this
click handler got processed when clicking on a topic in the left
sidebar.

I suspect that was a profiling artifact, but the intent is for
on_topic_click to fully process clicks on topics in the sidebar, and
we should write the code to say that.
2024-11-07 10:46:30 -08:00
evykassirer a1e31a44bd buddy_list: Tweak spacing of rows, line-height, and circle placement.
This commit adds more space between rows, increases the line height
so that the status message doesn't touch the status emoji, and makes
the status circle a little bigger.
2024-11-07 10:33:04 -08:00
evykassirer bd10923f13 settings_realm_user_settings_default: Convert module to typescript. 2024-11-06 17:55:55 -08:00
Anders Kaseorg cd701c8468 webpack: Disable CompressionPlugin for Puppeteer tests.
Zopfli is very slow and the development server does not use its output
anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-06 16:47:30 -08:00
evykassirer 898af8a9af user_circles: Fix bug causing incorrect colors in typeahead.
c39ae45d95 was incorrect, and should
only have been applied to the circles in the buddy list avatars.
In other places in the app, the transparency was over other colors
of background.
2024-11-06 16:36:40 -08:00
evykassirer 45d9c04e8e buddy_list: Fix vertical spacing issue. 2024-11-06 16:36:40 -08:00
evykassirer 174a458928 settings_users: Convert module to typescript. 2024-11-05 17:50:17 -08:00
evykassirer 6aa08b9c50 settings_users: Remove unnecessary bot user undefined check.
Users are fetched from `people_by_user_id_dict`.

`bot_info` is only called from:

* `bots_create_table`, with ids from `get_bot_ids` which are
  from this `people_by_user_id_dict`.
* `update_bot_data`, which is called in two places that check
  `is_valid_bot_user` on the bot id first.

So we should always get a `bot_user` back, and we're already relying
on the bot users being defined in several methods of the
`bot_list_widget`.
2024-11-05 17:50:17 -08:00
evykassirer 0e3374dc1b settings_users: Don't use `text()` with undefined value.
`text(undefined)` is a noop, and also isn't validly typed.
2024-11-05 17:50:17 -08:00
evykassirer 7fbdefcfc0 settings_users: Initialize full section objects.
Typescript likes objects to be fully initialized up front,
instead of adding functions to them later.
2024-11-05 17:50:17 -08:00
evykassirer 7ca644b905 settings_users: Make separate variables for each section.
This will help with the conversion to typescript.
2024-11-05 17:50:17 -08:00
evykassirer 85f8665851 util: Move compare_a_b from user_sort and generalize it. 2024-11-05 17:50:17 -08:00
evykassirer 01b1a51a86 stream_edit: Convert module to typescript. 2024-11-05 17:41:31 -08:00
evykassirer 16e3894bfa stream_edit: Remove use of e.trigger for copy link button.
This will help with the typescript conversion for this file.
2024-11-05 17:41:31 -08:00
evykassirer de8caa1b43 stream_edit: Use `this` instead of `e.target`.
These were all manually checked to still work.
`e.currentTarget` is equivalent to `this`, and
all instance of `e.target` were either the same
as `this` or used with a `closest` function that
still got the same value.
2024-11-05 17:41:31 -08:00
evykassirer 287c7e8f05 stream_edit: Pass string instead of function as html_body.
It seems like this was working fine, thanks to some internal
workings of Handlebars, but when we convert this file to
typescript, it will want a string for `html_body`.
2024-11-05 17:41:31 -08:00
evykassirer 686372e8a2 stream_edit: Parse notification labels instead of checking substrings. 2024-11-05 17:41:31 -08:00
evykassirer e739e9ae29 stream_edit: Don't set undefined text for email address.
`sub.email_address` can be `undefined`, `$foo.text(undefined)` has
no effect (it doesn't clear the text), and `text()` doesn't formally
accept `undefined`, so here we only call `text()` if the new value
isn't undefined.
2024-11-05 17:41:31 -08:00
evykassirer 924ebee421 stream_edit: Remove unecessary checks for invalid stream id.
None of these have showed up in Sentry in the last 90 days, and
it will be easier to type this file if we can assume we always
get a valid stream id and a valid sub for that stream id.
2024-11-05 17:41:31 -08:00
evykassirer 527d4672f8 settings_components: Fix types in save_discard_stream_settings_widget_status_handler.
This had been getting undefined `sub` already, in the modal to create
a new channel, but managed to not cause errors because
`properties_elements` was empty and `button_state` didn't equal
`"unsaved"`, leaving areas that treated `sub` as defined not accessible.
This commit fixes the type and handles the `undefined` case more directly.
2024-11-05 17:41:31 -08:00
evykassirer e50a51a8e1 settings: Convert general_notifications_table_labels.stream to tuples.
This will help with the typescript conversion.
2024-11-05 17:41:31 -08:00
Anders Kaseorg 799e59bb8f dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 6037230ea8 eslint: Fix @typescript-eslint/consistent-indexed-object-style.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 03c3bb31dc settings_linkifiers: Remove dead code.
It’s been dead since d7e1e4a2c0 (#2261)
introduced it.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 0bd9f4f674 install-node: Upgrade Node.js from 20.18.0 to 22.11.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
evykassirer 782fe316ca buddy_list: Support unread marker for avatar mode. 2024-11-05 15:10:29 -08:00
Aman Agrawal ca20a4df38 narrow_active: Remove broken tests.
These tests have been broken since long ago, we don't see any
errors since they are wrapped in `Sentry`. Also, We have a great
puppeteer test suite for the verification of loading current narrow.
2024-11-05 12:25:28 -08:00
Aman Agrawal e6113b0dd4 message_events: Discard message list that cannot be live updated.
Since we cannot cheaply live update `is-followed` narrow, we
discard any message list or data with that narrow if we
received a message event that changes topic visibility
from or to `FOLLOWED`.
2024-11-05 12:25:28 -08:00
Aman Agrawal 517fabd123 message_events: Extract function to check if filter has term type.
Not added to `Filter` library since this function is a bit
localized to message_events us case in the sense that it
checks for existence of `not-` prefix of the term type too.
2024-11-05 12:25:28 -08:00
Aman Agrawal 662f364283 fetch_status: Add function to copy current status of msg list data.
This will be used to copy over status of superset data to the
newly populated message list data.
2024-11-05 12:25:28 -08:00
Aman Agrawal 1f11650275 filter: Fix search narrow not live updated on topic move.
Since stream / topic change involves change in topic name, it could
involve new messages being included and some being discarded. Also,
messages could have been moved from an inaccessible stream to now
accessible stream for the user.
2024-11-05 12:25:28 -08:00
Aman Agrawal 06a50eaa78 echo: Update cached message data for locally echoed messages.
Since we only pass non echo messages to
message_events.insert_new_messages, where message lists get
updated, it is important to update locally echoed messages here.
2024-11-05 12:25:28 -08:00
Karl Stolley 96b62a5372 left_sidebar: Correct unread alignment in condensed popover. 2024-11-05 12:20:23 -08:00
Karl Stolley 331004f025 popovers: Add em conversion and missing annotation. 2024-11-05 12:20:23 -08:00
Karl Stolley bcaea0a6af left_sidebar: Better align low-attention unreads in nav area. 2024-11-05 12:20:23 -08:00
Karl Stolley 1984333454 left_sidebar: Scope line-height adjustment to low-res screens. 2024-11-05 12:20:23 -08:00
Sahil Batra c7ede831aa stream_settings: Update channel creation permission text.
This commit updates text shown in the right panel when
user does not have permission to create streams.
2024-11-05 11:14:02 -08:00
Sahil Batra 067e5a46c3 settings: Show stream and group info in a banner at the top.
Instead of having information about streams and groups below the
create button, we show that in a banner at the top irrespective
of whether user has permission to create them or not.

Fixes part of #32212.
2024-11-05 11:14:02 -08:00
Sahil Batra 9a50fae25a group-settings: Update right pannel for user without creation permission.
This commit updates the right panel for groups to be same as we
have it for stream settings when the user does not have permission
to create groups.

Fixes part of #32212.
2024-11-05 11:14:02 -08:00
Sahil Batra 9b6cb5b9dc group-settings: Rename "Who can manage this group" setting label.
This makes the naming consistent with the realm setting for
managing all groups.
2024-11-05 11:14:02 -08:00
Sahil Batra d63ae11551 settings: Make separate section for organization group settings.
Fixes #32214.
2024-11-05 11:14:02 -08:00
evykassirer 2b636e64ec buddy_list: Make avatar display option only visible in dev. 2024-11-05 10:48:15 -08:00
evykassirer 99856327f0 buddy_list: Clicking avatar opens menu instead of using ... icon. 2024-11-05 10:48:15 -08:00