Commit Graph

58953 Commits

Author SHA1 Message Date
Prakhar Pratyush 7754483c3f user_topics: Clean up the 'duplicate_request' variable.
In the 'bulk_set_user_topic_visibility_policy_in_database' function,
the 'duplicate_request' variable wasn't improving any readability.

This commit cleans up that variable.
2024-06-17 11:21:30 -07:00
Prakhar Pratyush 55a8bdfbd9 push_notifications: Use is_same_server_message_link lib function.
This commit replaces the local 'is_same_server_message_link'
function used in 'get_mobile_push_content' with the
'is_same_server_message_link' lib function.

The lib function is the same logically but uses urllib instead
of regex for parsing and is backed by tests, hence more robust.
2024-06-17 10:42:32 -07:00
Prakhar Pratyush 484befe9ce url_decoding: Add 'is_same_server_message_link' function.
This prep commit adds a lib function 'is_same_server_message_link'.

This will be currently used while compressing quote and reply
in push notifications and later can be used at other places.
2024-06-17 10:42:32 -07:00
Prakhar Pratyush 5fd676c4e0 test_fixtures: Add 'message_link_test_cases' test fixture.
This is a prep commit to extract out the test cases
for 'test_is_same_server_message_link' in hash_util.test.js
as a test fixture.

This will help in reusing the same test cases in the node and
backend tests.

Also, it will help in making sure that the logic for
'is_same_server_message_link' is in sync, in both the
web client and server code.
2024-06-17 10:42:32 -07:00
Aman Agrawal 885957c529 resize_handler: Fix scroll jumps on iOS.
The URL bar in iOS shrinks / expands on scrolling causing change
in height. This triggers our resize handler and forces user to
jump to the selected message. This jump triggers before our
keep pointer in view logic kicks in which means user scrolls back
to the previous selected message instead of scrolling forward.

To fix this, we only do this jump when width changes on mobile
devices.

Note that modern devices support resizeable windows of all forms but
for most use cases where app is full expanded, this seems like the
right fix.
2024-06-17 09:28:09 -07:00
Shubham Padia a98363fe36 help: Do not allow autolinks for help center docs.
mdxjs does not allow autolinks.
See https://github.com/mdx-js/mdx/issues/1049.
We also added a linter check for the same.
Preparatory commit for #30451.
2024-06-17 09:27:19 -07:00
Mateusz Mandera 7ff1227984 presence: Improve INSERT conflict handling in do_update_user_presence.
This was discussed in the review of #29999:
https://github.com/zulip/zulip/pull/29999#discussion_r1620818568

The previous way of handling wasn't entirely correct, as unnecessary
events were omitted, with a bad guarantee of even being in the correct
order.

This is an improvement as now the function detects that it ended up
doing nothing and can skip sending an event.

The race condition is hard to make up in an automated test, but we can
hackily simulate it by injecting a side_effect which will create a
conflicting UserPresence row when the function requests a cursor. Aside
of that, the actual race was simulated in manual testing to verify the
expected behavior.
2024-06-16 11:57:47 -07:00
Kislay Verma 2feee9d756 right_sidebar: Remove realm description for spectators.
This commit removes the realm rendered description from
the right sidebar for spectators.

Fixes #30322
2024-06-16 11:56:11 -07:00
Sahil Batra ff8f797c5c test_event_system: Fix test_queries test.
Before this commit, 3 DB queries were actually needed for "realm"
event type but the test mentioned 1 because, the related stream
setting fields were already fetched when testing the case for all
event types above it.

So, when testing the query count for only "realm" event type the
cached realm object was used and no extra queries were made for
the stream settings.

This commit updates the test to refetch the realm before testing
each event type separately, so that we test the actual query count.
2024-06-16 11:55:28 -07:00
Sahil Batra e23af20079 realm: Prefetch group settings only for "/register" response.
This commit updates code to prefetch realm group settings like
"can_create_public_channel_group" only when computing settings
for "/register" response by refetching the realm object with
select_related instead of fetching those settings in UserProfile
query.

This change is done because we do not need to prefetch these
settings for every UserProfile object and for most of the cases
where these settings are actually accessed, we can afford extra
query like when checking permission to create streams. But we
cannot afford one query extra for each setting when computing
these settings for "/register" response, so we re-fetch the
realm object with select_related leading to only one extra
query.

The query count changes in tests are -
- Query count increases by 1 when calling fetch_initial_state_data
for computing can_create_public_streams because Realm object from
UserProfile does not have prefetched setting fields.

- Query count increases by one in test_subs where streams are
created which is as expected due to the setting not being prefetched.

- Query count increases by 2 in tests in test_home.py where one
query is to refetch the realm object and one for computing
can_create_public_streams as mentioned above.
2024-06-16 11:55:28 -07:00
Sahil Batra dea62a3fd9 events: Pass realm to fetch_initial_state_data always.
This commit makes passing realm mandatory to fetch_initial_state_data.

This is a prep commit for refetching the realm object with
select_related for group setting fields so that extra queries
can be avoided when computing "/registe" response.
2024-06-16 11:55:28 -07:00
Alex Vandiver 1455a68aef postgresql-init-dev-db: Add missing quotes.
These are necessary if the path contains spaces.
2024-06-16 11:36:58 -07:00
roanster007 ab6ae1099b refactor: Rename huddle to direct message group in web codebase.
This commit renames "huddle" to "direct_message_group" in the
web codebase. It also renames the file - "huddle_data.ts" to
"direct_message_group_data.ts"

Fixes part of #28640
2024-06-14 18:07:07 -07:00
roanster007 9f2eb329ef rename: Rename "huddle_data.ts" to "direct_message_group_data.ts".
This commit renames the file "huddle_data.ts" to
"direct_message_group_data.ts" in the web codespace.

This is a part of the migration of huddle to direct_message_group
of #28640.
2024-06-14 18:07:07 -07:00
Prakhar Pratyush de0c22592f push_notifications: Compress blockquotes when replying to a message.
To make better use of the limited characters in mobile push
notifications for messages quoting another message, we compress
the blockquotes and "user said" paragraphs to make space for the
actual message.

Fixes #28951.
2024-06-14 17:26:22 -07:00
Sahil Batra a70eb21ea1 settings: Use page_params.is_spectator field for spectator checks.
Instead of current_user.user_id we use page_params.is_spectator
field to check the spectator cases as it makes it more clear
to the reader about what is the condition checking.
2024-06-14 17:11:23 -07:00
Sahil Batra 3faaa5ecc8 settings: Use map to store setting dropdown widgets.
Instead of using different variables to store dropdown setting
widgets, we now store them in a map with setting name as key
and avoid duplicate switch cases in functions to get and set
the widget value.
2024-06-14 17:11:23 -07:00
Sahil Batra bf24d5b936 settings: Use common selector for dropdown widget CSS.
This commit updates CSS to use a common selector to set the
width and color properties for all dropdown widgets in the
"Organization permissions" panel as we expect all dropdown
widgets to have same width and color.

This helps in avoiding bug in UI if someone forgots to update
the CSS while adding a new setting using dropdown widget.
2024-06-14 17:11:23 -07:00
Sahil Batra 77f327260d settings: Fix public channel creation setting in dark theme.
The correct CSS was not being applied to the public channel
creation setting dropdown in dark theme and this commit fixes
it by just updating the CSS to use a common selector for all
dropdown widgets in "Organization permissions" panel, so that
we would avoid having this kind of bug in future when more
settings are added.

We do not update the CSS to use a common selector for all
dropdown widgets in the whole settings overlay because
the one used for notification stream settings use different
text color for now.
2024-06-14 17:11:23 -07:00
Karl Stolley 5c23d80db8 navbar: Consolidate view, channel structures and styles.
In addition to simplifying the code in this area, this has the
effect of correcting vertical alignment of icons on views.
2024-06-14 17:06:59 -07:00
Karl Stolley 270ba008d9 informational_overlay: Constrain to variablized width. 2024-06-14 16:43:05 -07:00
Anders Kaseorg 9b7f17eb72 state_data: Move comments back to the correct declarations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-06-14 16:19:02 -07:00
Kenneth Rodrigues 07d0854ed3 storage: Migrate to typed_endpoint. 2024-06-14 11:24:36 -07:00
Kenneth Rodrigues 199d641fae onboarding: Migrate to typed_endpoint. 2024-06-14 11:24:36 -07:00
Karl Stolley ec33bde88f org_settings: Improve organization preview button layout. 2024-06-14 11:04:18 -07:00
Kenneth Rodrigues 6364010df5 typing: Migrate to typed_endpoint. 2024-06-14 10:58:35 -07:00
PieterCK 56db3f3d12 informational_overlays: Fix CSS for tables in info_overlay.
This commit refactors the CSS for table in info_overlay
menus (keyboard_shortcuts, search_operators, markdown_help).

In #29859, we began organizing CSS into more specific
variables and selector, which led to the deprecation of
several general CSS rules that affected these tables. The
fix adds a new variable in app_variables.css which is used
at a wrapper div specificly targeting these tables.

Fixes #30428.
2024-06-14 10:50:45 -07:00
Karl Stolley 544d86646e recent_view: Improve alignment and grouping of status emoji. 2024-06-14 10:50:21 -07:00
Karl Stolley 25e19d8417 recent_view: Improve icon sizing and alignment. 2024-06-14 10:50:21 -07:00
Karl Stolley ee0d38166a recent_view: Remove unnecessary group icon styles. 2024-06-14 10:50:21 -07:00
Lauryn Menard 0bd2f0e545 api-docs: Extract logic for rendering events table and use templates.
Extracts code for generating the events table strings to a separate
function and uses templates so that the HTML is clearer.

Updates events table classes for CSS to start with "api-" for
clarity.
2024-06-14 10:29:53 -07:00
Lauryn Menard 963c871858 api-docs: Extract logic for generating individual event strings.
Creates a dataclass for getting the data needed for an individual
event's documentation and uses that dataclass in a separate
function for generating the strings for each event's documentation.

Uses templates for parts of event documentation with HTML and CSS,
and updates CSS classes to have clearer names.
2024-06-14 10:29:53 -07:00
Lauryn Menard b948217ade api-docs: Revise the "services" array and "config" object for bots.
Updates these descriptions to better fit current API documentation
conventions.
2024-06-14 10:27:01 -07:00
N-Shar-ma 50fcc740bc compose: Fix bug causing layout shift on expanding compose box.
The messagebox-wrapper div is removed, and it's only style `flex: 1` is
applied to the messagebox div. The `height: 100%` and `margin-top: 5px`
styles on the messagebox div were earlier causing it to move 5px down,
outside the messagebox-wrapper div, when the compose box was expanded.
2024-06-14 10:18:08 -07:00
N-Shar-ma af76d80856 compose: Fix bug where compose box was sometimes not scrollable.
Earlier, autosize wasn't updated for the compose box after resetting its
`max-height`, so in cases where the older `max-height` was more than the
height, and the current max-height was less than the height, the compose
box would not be scrollable.

We now always update the autosize after resetting the max-height.
2024-06-14 10:15:47 -07:00
Karl Stolley 90f6e19948 user_groups: Restore correct max-height value.
This restores a value that was erroneously changed in #30388.
2024-06-14 10:01:58 -07:00
Prakhar Pratyush f5a1869c5b puppeteer_tests: Update the instruction to view generated screenshots.
On puppeteer test failure, screenshots are generated which are
helpful in debugging.

Earlier, the instruction to see those screenshot in github actions
was not the easy way. It linked to a github doc which suggests to
make API calls using artifact ID (which can be confusing to find)
to download the artifact and extract it to see the screenshots.

The easier way is to download the artifact directly using the
download URL present in the "Store puppeteer artifacts" step of
the job.

This commit updates the instruction for the reason mentioned above.
2024-06-14 10:01:40 -07:00
Lauryn Menard 9caf8b8b2b help: Update billing articles for current billing management features.
Updates the self-hosted and Zulip Cloud billing articles for features
that have been added to billing management such as paying by invoice,
adding billing contact information, viewing past invoices, etc.

Revises text to be cleaner and clearer in some places.

More consistently uses bold (when not linked) for plan names.

Fixes a few errors or omissions in existing instructions.

Co-authored-by: Alya Abbott <alya@zulip.com>
2024-06-13 07:00:39 -07:00
Lauryn Menard ab5bf3faba help: Refer to automatic/manual "billing" as "license management". 2024-06-13 07:00:39 -07:00
Lauryn Menard 94ca95dc29 help: Use 'email' instead of 'e-mail' throughout help center.
Replaces the few instances of 'e-mail' with 'email' as that is
more consistently used in the help center documentation.
2024-06-13 07:00:39 -07:00
Aman Agrawal a361f2939a stream_edit: Fix user popover permanently displayed in stream settings.
If a user popover is open in stream settings, and user presses
`down/up` arrow to view settings for a different stream, the user
popover stay open.

Why we need to explicitly hide it?
We have click handlers to hide the popover and `data-reference-hidden`
to hide the popover if the reference goes offscreen via scrolling.

In this case, those events don't fire, there is no reason for tippy
to check if reference is visible and thus show / hide the popover.
2024-06-13 06:57:23 -07:00
Vector73 e8a5cb99bf api_docs: Improve events table and fix font style of events title. 2024-06-13 06:53:51 -07:00
Alya Abbott 985db50590 help: Add page documenting the left sidebar. 2024-06-13 06:53:08 -07:00
Lauryn Menard 06fa5b8327 images: Update channels and topics images for revisions. 2024-06-13 06:51:54 -07:00
Lauryn Menard f13efbd6df api-docs: Clean up descriptions of can_mention_group user group setting. 2024-06-13 06:51:42 -07:00
Kislay Verma 03f81eef07 navbar: Tweak Combined feed description for spectators.
Since spectators cannot mute channels or topics, the combined
feed description for spectators is tweaked to exclude that part.

Fixes #30321
2024-06-13 06:50:07 -07:00
Alya Abbott 95272f38b5 portico: Don't explain what channels are. 2024-06-12 09:32:00 -07:00
Lauryn Menard 6409285ff3 api-changelog: Make feature level lines consistent with no colon. 2024-06-12 06:46:35 -07:00
Lauryn Menard dc67caa7bb api-docs: Remove extra "Changes:" in cases with multiple updates.
The general format for our bold "Changes:" notes are to have the
most recent one start with the "Changes:" text and the older notes
following that with paragraph breaks for each note.
2024-06-12 06:46:35 -07:00
PieterCK dae4c28b5b css: Add new css for rendered markdown table in dark mode.
Add a new dark mode css in app_variable.css for rendered
markdown tables. This rule sets a brighter color for tables
in messages / chat to make it more visible when the user is
using dark theme.

Fixes zulip#29856.
2024-06-12 06:45:00 -07:00