Commit Graph

57598 Commits

Author SHA1 Message Date
Karl Stolley 68ea6704a4 widgets: Unify spacing beneath widgets and spoilers. 2024-04-22 10:33:47 -07:00
Karl Stolley a3476af97c markdown: Move all inter-element spacing to bottom. 2024-04-22 10:33:47 -07:00
Karl Stolley fc8e16f5e4 markdown: Set 5px for bottom margin on p, blockquote.
This establishes the same 5px bottom margin on all Markdown
elements, which will aid in converting such values to variables
as part of the information-density project.
2024-04-22 10:33:47 -07:00
Karl Stolley 6e32ce9084 markdown: Clarify and reorder margin and padding on KaTeX. 2024-04-22 10:33:47 -07:00
Karl Stolley 282d900bea markdown: Remove unnecessary inheritance declarations. 2024-04-22 10:33:47 -07:00
Karl Stolley f97cecdfe2 markdown: Remove inapplicable margin-top values.
Because paragraphs have a 3px bottom margin, the 2px top margin
on ordered and unordered lists would collapse into it, for 3px
of space total. So setting 0 on these special selectors has no
effect.
2024-04-22 10:33:47 -07:00
Lauryn Menard b45c5a30c8 api-docs: Update API feature level 249 documentation.
Updates the API changelog entry and changes notes for feature level
249 to match other API updates to narrow filters, and links to the
help center article on emoji reactions in these notes.

Feature level 249 changes were originally in commit c3408b56f0.
2024-04-22 09:27:39 -07:00
Aman Agrawal 89127dadd6 upgrade: Avoid event_status redirect. 2024-04-22 09:23:12 -07:00
Aman Agrawal 9702ff3539 message_list_view: Clarify imprecise performance comment.
A single call to this function doesn't have a material performance
impact when tested with 20k messages while scrolling in combined feed
view; likely because only 400 messages can be in the structure at any
give time given render windows.

But calling this in a loop somewhere would be a bad idea.
2024-04-22 09:21:43 -07:00
Aman Agrawal 2d824e85cc stripe: Remove invalid comment.
We use `error_description` in upgrade.ts to determine if the error was
related to customer's card. Doesn't seem like there is any harm
in doing so since we are explicitly handling "stripe.CardError" and
raising these errors with "card error" description.
2024-04-22 09:20:17 -07:00
Shubham Padia 6d4541a1eb custom_profile_fields: Don't show display summary tooltip on `required`.
Fixes #29814.
2024-04-22 09:16:31 -07:00
Kenneth Rodrigues 326944542e views: Use ApnsAppId for validation. 2024-04-21 11:09:32 -07:00
Kenneth Rodrigues 081119f461 push-notifications: Migrate to typed endpoint. 2024-04-21 11:09:32 -07:00
Kenneth Rodrigues d03659ee1c read-receipts: Migrate to typed endpoint. 2024-04-21 11:09:32 -07:00
Kenneth Rodrigues 6704faf3cd reactions: Migrate to typed_endpoint. 2024-04-21 11:09:32 -07:00
Lauryn Menard c0be6c6b98 api-docs: Clean up feature level 233 and 230 documentation.
Updates the API changelog entries and changes notes for feature
levels 233 and 230, which both are related to the onboarding
steps (hotspots and one-time notices) updates.

Feature level 233 was originally documented in commit 83bd9955e3
and ac8af3d6de.

Feature level 230 was originally documented in commit 8d633cc36.
2024-04-21 11:07:18 -07:00
Lauryn Menard 02e98f7fa2 api-docs: Tweak newly documented invites endpoints documentation.
Makes a few small tweaks on the newly documented invites endpoints
for current API documentation conventions that were missed in the
review process.
2024-04-21 11:04:35 -07:00
Lauryn Menard cc5b846410 api-docs: Make small clean-ups to feature level 254 updates.
Updates the changelog entry to use "ID" instead of "id".

Revises text for "null" value to match other field descriptions
in these stream/subscription objects.
2024-04-21 11:03:39 -07:00
tnmkr bc8e6a86b5 stream_settings: Add new "Stream details" section in General tab.
We want to make it easier to find stream details such as creator,
creation date and stream id. The commit replaces the "Email address"
section in General tab of stream overlay with a new section called
"Stream details", "Email address" is now a field in this section.

If the stream does not have a creator, we only show the stream creation
date in creation details.

Fixes: #25648.
2024-04-20 19:03:43 -07:00
tnmkr c31016cac3 user_display_only_pill: Improve partial structure and css.
This is a prep commit to add a .pill-label wrapper around .pill-value
and other flair text. This extra flexbox structure will help us
vertically align this pill with surrounding text when adopting it to be
used inline.

We also introduce a new class to target this pill. The intention is that
this will more descriptive than contextually styling .pill-container.
2024-04-20 19:03:43 -07:00
tnmkr d934da7afe stream_settings: Remove custom styling from "Generate email" button.
This is so that it better matches existing buttons in this overlay. For
example the "Reset to default notifications" button in Personal tab.

This is a prep commit.
2024-04-20 19:03:43 -07:00
tnmkr 5128d8f9af streams: Add creator field.
Adds nullable creator field, containing a reference to the user who
created the stream. When creating a stream, acting user is set as
the creator of the stream. Since API calls to create streams always
have an acting user, this field should always be set when streams
are created using the API.

Because streams can be created with no acting user, this field is
nullable. We try to backfill existing streams using RealmAuditLog table,
but not all streams are guaranteed to have a recorded create log. Thus
this new field is left null when it cannot be backfilled. We also set
this field to null when the creator user is deleted.
2024-04-20 19:03:43 -07:00
Tim Abbott 9fa7f71125 import_realm: Include UserProfile in early update_model_ids. 2024-04-20 19:03:43 -07:00
Vector73 0f97733687 api_documentation: Document "/invites/{prereg_id}" endpoint. 2024-04-20 18:12:04 -07:00
sujal eba0097c7f message_feed: Modify tooltips to clarify draft saving.
Update the tooltips for the "Cancel" and "Spinner".  Provide clear
information about the draft saving behavior when a message fails to
send successfully.

Fixes part of #29100.
2024-04-20 18:00:22 -07:00
sujal shah f144400d46 settings: Change links to user_pills in invitations seciton.
Previously, links were displayed for the user's name,
but now they are presented as pills. These pills are rendered
using the user_display_only_pill.hbs template.
To obtain the avatar of a user,
the small_avatar_url_for_person function is utilized.
2024-04-20 16:59:45 -07:00
sujal shah 16db1df416 templates: Use 'panel_user_list' as classname.
The term 'subscriber' might be misleading as it doesn't accurately
reflect the purpose of the list, which simply contains all users
within the organization. To enhance clarity and maintain consistency,
I've replaced the classname 'panel_subscriber_member_list'
with 'panel_user_list'.
2024-04-20 16:59:45 -07:00
Kislay Verma 156c708614 compose: Refactor create_message_object.
This function now accepts an argument for message content in the
message object returned and use compose_state.message_content()
to preserve the behavior for existing callers.

Preparation for #28626
2024-04-20 16:24:54 -07:00
Kislay Verma ecac0d6c80 compose_ui: Refactor cursor_inside_code_block.
Renamed the function to position_inside_code_block and changed the
parameters to accept a string and number (index), and check if the
position in the string is inside a code block (as per previous logic).

Preparation for #28626.
2024-04-20 16:24:50 -07:00
Tim Abbott 7beea02660 compose_state: Reuse has_savable_message_content. 2024-04-20 13:29:22 -07:00
evykassirer 2c2dfa4c3d draft: Only auto-restore drafts edited since adding the feature. 2024-04-20 13:27:25 -07:00
evykassirer 43120709f7 narrow: Move clear_message_sent_banners into reset_ui_state. 2024-04-20 13:27:25 -07:00
evykassirer 160b78a7e9 drafts: Don't restore drafts being actively sent or scheduled. 2024-04-20 13:27:25 -07:00
evykassirer 45a81650f4 compose: Add option to not restore drafts, to avoid overwriting.
This could happen e.g. when quote-replying a message,
because we open the composebox before adding the quote
reply content. We need to make sure that we don't restore
a draft when opening the composebox, because otherwise
that draft will be replaced with the quote reply.
2024-04-20 13:27:25 -07:00
evykassirer 14d83458c8 drafts: Separate initialize function into data and UI pieces.
This will let us initialize the data before the UI is ready
to be initialized. We'll need to do this in an upcoming commit
where we clear a flag on page load before the reload code
initializes.
2024-04-20 13:27:25 -07:00
evykassirer 0e369e7ff3 compose_send_menu_popover: Rename module to reflect broader uses. 2024-04-20 13:27:25 -07:00
evykassirer 3ef4e80dff compose: Add button to save draft and start a new message. 2024-04-20 13:27:24 -07:00
evykassirer fd4246def5 drafts: Append a space to draft when restoring it.
If a user starts typing before they see that a draft was restored,
this makes that experience a little smoother by adding some
separation between the old draft and the new text.
2024-04-20 12:31:51 -07:00
Riken Shah d48de6da08 compose: Restore the last draft when compose box is opened.
Now when the user opens a narrow that has a draft saved for
that particular conversation, the draft will automatically
be restored in the compose box. This will make it easy to
return to a draft after clicking away, and also will make
it less confusing when people close the compose box by
accident. Note that this only restores the draft when
there is a full recipient specified (stream and topic,
or at least one PM recipient).

Fixes part of #18555.
Fixes #11218 and #17396.
2024-04-20 12:31:51 -07:00
evykassirer cb3f22c30e drafts: Delete a draft if it is cleared from the compose box.
We used to keep the draft, assuming that clearing the composebox
was an accident. Now we want to delete the draft, in preparation
for auto-restoring drafts when opening the composebox for narrows
with drafts associated with them. If a user opens the composebox
and sees a draft they don't want anymore, clearing the box is a
way we expect them to try to delete it.
2024-04-20 12:31:51 -07:00
sujal shah 01e898252b setting_ui: Fix sorting by "Invited by" column.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "referrer_name"
property instead of "ref".
2024-04-20 12:28:39 -07:00
Kenneth Rodrigues 5db24e002c narrow-parameter: Add validation for the narrow parameters. 2024-04-20 09:04:26 -07:00
Kenneth Rodrigues def2d402f4 message-flags: Migrate message flag endpoints to typed_endpoint. 2024-04-20 09:04:26 -07:00
Aman Agrawal 07699eb1d2 message_fetch: Allow updating fetch status without updating messages.
It's possible that for a given narrow event if we didn't fetch any
messages in the `num_after` or `num_before` space, we could have
arrived at `newest` or `oldest` messaged based on the `anchor` used.

This fixes the bug where `fetch_status` for `found_newest` didn't
update to be `true` when using `newest` anchor and `num_after = 0`.
2024-04-20 08:49:54 -07:00
Aman Agrawal fb8a05a683 server_events: Rename home_view_loaded related variables.
Gave them a more general name which reflected what they were
really doing.
2024-04-20 08:49:54 -07:00
Aman Agrawal 6d7856fa37 message_list_data: Move comments to the type definitions. 2024-04-20 08:49:54 -07:00
Lauryn Menard 1d5897060a audit-logs: Add index to RealmAuditLog for realm and event type.
Adds an index on RealmAuditLog for the realm, event_type, and
event_time in order to improve database queries on these audit logs.

tabbott verified using EXPLAIN ANALYZE that this also considerably
speeds up queries that order by ID rather than event_time, but
event_time is how these should be ordered given the possibility of
backfills.
2024-04-19 17:58:59 -07:00
Mateusz Mandera 962ab13203 push_notifs: Make push_notifications_enabled more resistant to flapping.
Fixes #28403

Uses redis to remember the last time push notifications were experienced
working. This needs to work across processes, so can't be done just in
memory.
As this is transient data that's fairly harmless to lose and thus
doesn't require the persistence benefits of the database, and we're
keeping a single "row", so don't need an entire new db table, we settle
on using redis instead of postgres. This is also consistent with how we
store other kinds of such transient data.
2024-04-19 10:25:34 -07:00
Mateusz Mandera 630335142a rate_limiter: Extract KEY_PREFIX to redis_utils. 2024-04-19 10:25:34 -07:00
Ujjawal Modi 706c380971 audit_log: Update audit log entries created while creating a group.
Earlier a extra audit log entry of type
USER_GROUP_GROUP_BASED_SETTING_CHANGED was made when a new user
group is created. This commit updates the code to not create
that audit log entry.

There is no need to create these entry as we would still
have the required data from the "OLD_VALUE" field in the
audit log entry created when changing the setting and this
also makes it consistent with the entries created for
other operations like stream creation.
2024-04-19 10:18:45 -07:00