Commit Graph

5916 Commits

Author SHA1 Message Date
Inge ffbf2aaaff right-sidebar: Others collapsed by default
"Others" will on default be collapsed. If it is expanded it will be preserved when switching view.

Fixes #31628
2024-09-20 09:09:03 -07:00
Sayam Samal 19c29af4bb icons: Cleanup redundant `.fa-group` related styling.
This also fixes the opacity of the `.zulip-icon-triple-users` icon in
the recent view.
2024-09-20 09:07:05 -07:00
Sayam Samal 030f93595e icons: Replace previous bot icon with new single antenna bot icon.
Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-09-20 09:07:05 -07:00
evykassirer 3e2efc736c stream_data: Add test cases for getting stream id from slug. 2024-09-19 19:52:18 -07:00
evykassirer 50b43421f1 search: Hide outline unless focus-visible.
Followup to https://github.com/zulip/zulip/pull/31647#discussion_r1767352535
2024-09-19 19:51:43 -07:00
Karl Stolley d73044ee57 compose: Decouple compose buttons from button classes.
In the 2024 redesigned button configurations, the compose buttons
become outliers. This retains their previous style inherited from
.button, allowing that base component class to move forward.
2024-09-19 16:16:11 -07:00
evykassirer 5ddcbb8516 buddy_list: Show offline subscribed users for small channels in big orgs.
Previously, for big orgs, we hid all offline users in the buddy list to cut down
its size. But this can be weird for small channels where you might want to see
who's in the channel. This commit makes a tweak to show offline users in big
orgs for channels of size <= 50.
2024-09-19 15:43:28 -07:00
Tim Abbott 9dd8de64a9 message_list: Add should_trigger_message_selected_event to type. 2024-09-19 15:43:28 -07:00
evykassirer deb5d90941 message_list: Convert module to typescript. 2024-09-19 15:31:16 -07:00
evykassirer 620db3057b message_list: Fix bug accessing filter incorrectly.
I checked this with Aman who wrote this originally, and he said
this is what he meant to write.
2024-09-19 15:31:16 -07:00
evykassirer c9f49cefdd message_list: Remove unused preserve_rendered_state attribute.
Aman said  we should be running this even if it wasn’t running before.
https://github.com/zulip/zulip/pull/31591#pullrequestreview-2300886181
2024-09-19 15:31:16 -07:00
Aman Agrawal fd441fd3d3 hashchange: Extract function to get home view hash. 2024-09-19 13:50:47 -07:00
Aman Agrawal 02f84bda34 message_list: Avoid recursive calls to message_selected event.
Note that even though we no longer trigger message selection
events from within the rerender calls with their different `opts`,
it doesn't effect the scroll position and selected id since
the events are triggered synchronously and the final message
selection event call has the opts of the initial caller.
2024-09-19 13:20:49 -07:00
Alex Vandiver 94dad72b75 upload: Use @uppy/tus to upload files through tusd.
Replace the XHRUpload plugin for Uppy with the Tus plugin, to make use
of the new tusd endpoint.  This allows for resumable files, as well as
files which are larger than comfortably fit in memory (the source of
the old 25MB limit).

MAX_FILE_UPLOAD_SIZE is still applied, but can safely be raised above
25MB.

Fixes: #9391.

Co-authored-by: Brijmohan Siyag <brijsiyag@gmail.com>
2024-09-19 11:37:29 -07:00
evykassirer 56adeb335f search: Fix cutoff focus outline. 2024-09-19 10:50:21 -07:00
Sahil Batra 1f16c0fdb7 popovers: Increase contrast of deactivated information text.
This commit increases the contrast for "This user has been deactivated"
text in user popover and "This group has been deactivated" text in
group popover in both light and dark mode by making the opacity 1 as
this is important information and should be clearly visible.

The text color and opacity matches with the role text shown in user
popover.
2024-09-19 10:50:02 -07:00
Sayam Samal 4ed27a9a5f tooltips: Fix hotkey hints wrapping when next to longer tooltip labels.
Earlier, mostly in non-English languages, the tooltip labels would
force the tooltip hotkey hints to wrap. This commit adds the
`white-space: nowrap` property to ensure that the hotkey hint texts
are forced to be in a single line.
2024-09-19 10:49:15 -07:00
evykassirer 86564381cf message_view_header: Rename current_stream to more accurate current_sub. 2024-09-19 10:06:57 -07:00
Sahil Batra 63a7c9061b settings: Use new pills UI for can_manage_group setting.
This UI enables the user to set can_manage_group setting to a
combination of users and groups, replacing the old dropdown UI
which just allowed setting user to a single system group.

Fixes part of #28808.
2024-09-19 09:08:33 -07:00
Sahil Batra 8068b6e55e group_setting_pill: Add code for showing typeahead.
This commit adds code to show typeahead for group setting
pill container. We add a separate function as we only
want to show groups and users in the typeahead and the
options are also sorted in a different order compared
to other typeaheads.
2024-09-19 09:08:33 -07:00
Sahil Batra 053686669a composebox_typeahead: Use query_matches_group_name to match group.
Though we can use query_matches_name for groups as we do not allow
system groups in the composebox typeahead and the other groups have
same display_name and name values, but still would be better for
consistency.

And with this change, query_matches_name function is only used for
streams, so updated that accordingly.
2024-09-19 09:08:33 -07:00
Sahil Batra def78ddf09 user_groups: Do not show "role:" prefix for system groups.
Instead of showing the actual names like "role:everyone",
"role:moderators", etc. for system groups, we show
"Everyone", "Moderators", etc. for system user group in
pills, typeaheads and popovers.

Though system groups are not shown in typeahead as of
this commit, we update the typeahead code as well to
not conside "role:" prefix while matching with the
query as we would soon show system groups in typeahead
when we would add new UI for group-based settings.

Previously, only "role:everyone" group was shown as
"Everyone" in popover and pills but for other system
groups their original names for shown and this commit
changes that behavior to be same for all system groups.

The original display_name field for
settings_config.system_user_groups_list objects, which
was used for dropdown widgets, is also renamed so that
we can use display_name field for the names to be used
in other places.
2024-09-19 09:08:33 -07:00
Sahil Batra 2fff124ec9 settings: Add new module to handle pills for group settings.
This commit creates a new module similar to add_subscribers_pill
for handling the pill widget to be used for group settings.
2024-09-19 09:08:33 -07:00
Anders Kaseorg 2c8ad219b1 styles: Fix invalid CSS generated due to @extend misusage.
@extend can only be used in an element selector, not directly within
@media.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:33:28 -07:00
Anders Kaseorg dc6ba1c9e2 localstorage: Remove unused expiry feature.
This was introduced by commit 8b22b94ab1
with no actual cleanup mechanism, and has never been used.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:32:07 -07:00
Anders Kaseorg 97ffccb45f reload: Convert module to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Anders Kaseorg 0be5cc232c reload: Remove obsolete location.reload(true) usage.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Anders Kaseorg 16d37eb80a tests: Call reload.is_stale_refresh_token correctly.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 15:31:41 -07:00
Karl Stolley c3b13654a7 left_sidebar: Ensure brackets are not shown while zoomed in. 2024-09-18 15:29:20 -07:00
Sahil Batra 5f3a8334be user_groups: Do not allow deleting user groups. 2024-09-18 13:41:13 -07:00
Sahil Batra 6a739e263f user_groups: Allow deactivating groups from webapp. 2024-09-18 13:41:13 -07:00
Sahil Batra c53563d0e7 user_groups: Handle deactivated groups in webapp. 2024-09-18 13:41:13 -07:00
Anders Kaseorg 782fa2a803 localstorage: Fix removeDataRegexWithCondition to check parsed data.
Commit bca41fd29f (#23028) introduced
this for reload.is_stale_refresh_token, which had always returned true
because it was operating on the raw JSON string rather than the parsed
data.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-18 13:16:25 -07:00
evykassirer dba1af84e0 filter: Use stream id instead of stream name. 2024-09-18 13:08:14 -07:00
evykassirer 2be181c367 stream_data: Check for null more explicitly.
Otherwise 0 is treated specially, different from other numbers.
2024-09-18 13:08:14 -07:00
evykassirer 2ad1dc7014 stream_data: Make slug regex a bit more readable.
This clarifies that the second group is purely for use internal
to the regexp (it's there for the ? to act on) and won't be saved
as a substring for the surrounding code to look at (like match[2]).
In a hot path that could be a performance savings; here it just
makes things a bit more explicit for the reader.
2024-09-18 13:08:14 -07:00
Sahil Batra 7a6135371e settings: Handle guests separately for group-based settings.
This commit adds code to handle guests separately for group
based settings, where guest will only have permission if
that particular setting can be set to "role:everyone" group
even if the guest user is part of the group which is used
for that setting. This is to make sure that guests do not
get permissions for actions that we generally do not want
guests to have.

Currently the guests do not have permission for most of them
except for "Who can delete any message", where guest could
delete a message if the setting was set to a user defined
group with guest being its member. But this commit still
update the code to use the new function for all the settings
as we want to have a consistent pattern of how to check whether
a user has permission for group-based settings.
2024-09-18 11:51:11 -07:00
sujal shah fcbb1cd558 todo_widget: Add `type`` as Optional in `new_task_inbound_data_schema`.
This commit corrects the `type` parameter in
`new_task_inbound_data_schema`, which was previously optional
but not added as such.
2024-09-18 10:06:00 -07:00
evykassirer 13e3ced486 message edit: Fix bug preventing messages from being edited.
More context in this thread on CZO:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Blueslip.20error.20on.20editing.20a.20message/near/1943476
2024-09-17 15:50:33 -07:00
Karl Stolley 708d07a885 lightbox: Address edge case where media may be unavailable. 2024-09-17 11:55:18 -07:00
Karl Stolley ead6f29200 lightbox: Restore centered media list. 2024-09-17 11:55:18 -07:00
Aman Agrawal 5e084a2128 message_view: Fix load_local_messages called without superset_data.
This was missed in the migration that happend in #31326.

Fixes error when pressing `Home` button in message list.
2024-09-17 09:14:36 -07:00
Sahil Batra ccddbba7a3 user_groups: Extract code to check system groups allowed for setting. 2024-09-16 16:28:52 -07:00
Sahil Batra 5fda195eab user_groups: Refactor function to get groups to be used for settings.
This commit refactors the code to get groups to be used for settings
as we would now have two UIs for settings for some time - dropdown
widget and pills, so we can just have a single function which just
returns the valid UserGroup objects and then a separate function to
get the appropriate format to be used for dropdown widgets and pills.
2024-09-16 16:28:52 -07:00
Sahil Batra 6482f0c2ea user_groups: Pass correct group object for adding new group to UI.
We previously passed the UserGroupRaw type object received in
the user group creation event to user_group_edit.add_group_to_table
instead of the UserGroup type object.

The add_group_to_table function is called after receiving creation
event only, but other functions called later in the flow are called
at other times as well like when opening edit panel for a particular
group and they expect UserGroup type object, so this commit fixes it.
2024-09-16 16:28:52 -07:00
Sahil Batra f3fafc719f settings: Add function to check permission for anonymous setting group. 2024-09-16 16:28:52 -07:00
Sahil Batra ffeb542b22 settings_components: Remove unnecessary toString calls.
The value for which the toString is called is already a string, so
there is no need to call it. It would have been added to make sure
that linter does not complain, so added an assert statement for it.
2024-09-16 16:28:52 -07:00
Prakhar Pratyush 764083d31b settings: Add 'allow_private_data_export' user setting.
This commit adds a user-setting to allow users to decide
whether to let administrators export their private data.

Fixes part of #31201.
2024-09-16 15:48:40 -07:00
Karl Stolley da91ebc592 checkboxes: Render border-color-matched SVGs in light and dark modes.
This obviates the need for the buggy use of a brightness filter,
which causes rendering problems on iOS devices and possibly others.
2024-09-16 15:43:47 -07:00
Karl Stolley 8741c9e43f dark_mode: Introduce higher-contrast, opaque text.
Fixes: #31615
2024-09-16 15:43:47 -07:00