Commit Graph

58922 Commits

Author SHA1 Message Date
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
Mateusz Mandera 512f4d1476 presence: Backend implementation of the last_update_id API.
This builds on top of 016880f54d which
maintains correct .last_update_id for UserPresence objects; now we add
the related API changes to utilize it.
2024-06-06 17:25:54 -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
Kenneth Rodrigues 731c940654 user_topics: Migrate to typed_endpoint. 2024-06-06 16:50:56 -07:00
Kenneth Rodrigues 428ca713d0 users: Migrate to typed_endpoint. 2024-06-06 16:50:56 -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
Alex Vandiver 51b7a2fb23 zilencer: Do not error on old stats which we no longer have. 2024-06-06 13:26:21 -04: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
Alex Vandiver 50c3dd88e6 models: Migrate ids of all non-Message-related tables to bigint.
Migrate all `ids` of anything which does not have a foreign key from
the Message or UserMessage table (and would thus require walking
those) to be `bigint`.  This is done by removing explicit
`BigAutoField`s, trading them for explicit `AutoField`s on the tables
to not be migrated, while updating `DEFAULT_AUTO_FIELD` to the new
default.

In general, the tables adjusted in this commit are small tables -- at
least compared to Messages and UserMessages.

Many-to-many tables without their own model class are adjusted by a
custom Operation, since they do not automatically pick up migrations
when `DEFAULT_AUTO_FIELD` changes[^1].

Note that this does multiple scans over tables to update foreign
keys[^2].  Large installs may wish to hand-optimize this using the
output of `./manage.py sqlmigrate` to join multiple `ALTER TABLE`
statements into one, to speed up the migration.  This is unfortunately
not possible to do generically, as constraint names may differ between
installations.

This leaves the following primary keys as non-`bigint`:
- `auth_group.id`
- `auth_group_permissions.id`
- `auth_permission.id`
- `django_content_type.id`
- `django_migrations.id`
- `otp_static_staticdevice.id`
- `otp_static_statictoken.id`
- `otp_totp_totpdevice.id`
- `two_factor_phonedevice.id`
- `zerver_archivedmessage.id`
- `zerver_client.id`
- `zerver_message.id`
- `zerver_realm.id`
- `zerver_recipient.id`
- `zerver_userprofile.id`

[^1]: https://code.djangoproject.com/ticket/32674
[^2]: https://code.djangoproject.com/ticket/24203
2024-06-05 11:48:27 -07:00
Alex Vandiver 04450389e1 push_notifications: Provide a stable ordering.
Otherwise, this can cause test failures based on internals of the database.
2024-06-05 11:48:27 -07:00
Alex Vandiver 53b30ed65d confirmation: Migrate Confirmation to bigint.
This model has no external references, and is among the larger
tables.  Migrate it to bigint.
2024-06-05 11:48:27 -07:00
Alex Vandiver 37803406e5 models: Migrate ids of UserActivity and UserActivityInterval to bigint.
These models have no external references, and are among the larger
tables.  Migrate them to bigints, starting with `useractivityinterval`
which is less likely to be being touched.
2024-06-05 11:48:27 -07:00
Alex Vandiver 4f4725f810 analytics: Migrate models' id columns to bigint.
This helps prevent wraparound on exceedingly large and old installs,
particularly Zulip Cloud.  These are relatively simple migrations
since they are not referenced by any other tables; however, they are
quite large, and are actively used from Django by running servers,
making this not a migration which is possible to run without stopping
the server.

Use the escape hatch in the previous commit to temporarily pause
analytics writes while the migration happens.  This should make the
migration transparent to users, at the small cost of an artificial dip
in statistics (specifically, to push notification counts, and unread
message counts) while the migration runs.
2024-06-05 11:48:27 -07:00
Alex Vandiver 04022353fa zerver: Move fts_update_log table id to bigint.
This table, while it does not contain a large number of rows, consumes
a primary key for every message send and update.  Since it is not
referenced by any other table, the migration is simple; and since it
does not contain many rows at any time, it should be fast.
2024-06-05 11:48:27 -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
Alex Vandiver 0e19302c67 locale: Strip trailing whitespace in "Zulip" translation. 2024-06-05 10:44:53 -07:00
Alex Vandiver 03864db5a2 streams: Move enforcement of stripped-stream-names lower.
This catches things like trailing spaces in internationalized
default-stream names.
2024-06-05 10:44:53 -07:00