Commit Graph

6474 Commits

Author SHA1 Message Date
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