Commit Graph

4114 Commits

Author SHA1 Message Date
Lauryn Menard 36e00308b8 web-compose-warnings: Update banners for stream rename channel.
Updates warning string when linking to a private stream/channel when
composing a message in the web app to use channel instead of stream.

Updates error banner when using a stream/channel wildcard mention
when composing a message in the web app to use channel instead of
stream.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard ff98758ed0 web-compose-typeahead: Update wildcard string for stream rename channel.
Updates "Notify stream" string in the stream wildcard typeahead to
be "Notify channel" instead.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard c874183ea8 web-filter: Update translated strings for stream rename channel.
Updates the translated strings in filter.ts to use channel instead
of stream.

The updates to the untranslated search streams will be done in a
separate commit.

Part of the stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard d7f9f8333e web-stream-settings: Update strings for stream rename channel.
Updates a chunk of translated strings that overlap between files,
with the streams settings overlay being the starting point for
finding these strings, to use channel instead of stream.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard ba766a564a web-stream-create: Update frontend errors for stream rename channel.
Updates translated error and warning strings when creating a new
stream in the web app to use channel instead of stream.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 13299577da web-empty-narrow: Update translated banners for stream rename channel.
Updates the translated empty narrow messages in the web app to use
channel instead of stream.

Updates the message view header that has the same text as the empty
narrow when a stream/channel does not exist or the user does not
have access to the stream/channel because it is private.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 8bc183e16e web-i18n-test: Update translation data for stream rename channel.
Updates the page_params.translation_data that's set in this test
for renaming stream to channel.

Part of stream to channel rename project.
2024-04-24 14:35:04 -07:00
Lauryn Menard 556629add0 web-hash-util: Decode URL with channel and encoded stream ID.
Updates hash_util.decode_operand to handle a URL with channel and
the stream name and ID encoded in the URL.

For example "/#narrow/channel/12-test" where 12 is the ID of the
stream named "test".

Part of stream to channel rename project.
2024-04-24 14:33:57 -07:00
tnmkr 225e004bba stream_settings: Remove "Stream events" field.
"Stream events" field in "Stream details" section uses hardcoded
link for "stream events" topic. This link breaks if the organization
language is set to something other than English and the "stream events"
topic has a translated name. The field also does not handle scenarios
where the organization switched languages and thus "stream events"
topic is in different languages depending on when the stream was created.

Additionaly, we are currently undergoing a major change to rename
"Streams" to "Channels" and as part of this change "stream events" will
be renamed to "channel events". We currently don't have a plan for
linking these together or moving messages to the new topic.

Keeping these points in mind, it is best to remove this field for now.
2024-04-24 08:55:53 -07:00
Karl Stolley bb5db2cc4b message_row: Replace sender-line margins with grid-coordinated line height.
This expresses the height of the message row without need of
margical margins.

Extending the correct line-height to timestamps also means that
single-line messages will be the height of their combined content
and padding, and not erroneously held open by an oversize 28px
timestamp line-height.

Those corrections mean, too, that .message-time only needs to have
its line-height declared a single place, regardless of context.
2024-04-22 14:17:39 -07:00
Karl Stolley 3c5adfe440 message_row: Introduce CSS variable for vertical margin. 2024-04-22 14:17:39 -07:00
Karl Stolley 31865db5c9 message_row: Introduce CSS variable for avatar column width. 2024-04-22 14:17:39 -07:00
Karl Stolley 085abf9c35 message_row: Remove unused variable. 2024-04-22 14:17:39 -07:00
Kislay Verma cb65b617fb message_move: Show confirmation toast.
A confirmation toast is shown when a message is moved
using the "Move only this message" option. The toast
contains the link to the new location of the message.

Fixes #29702
2024-04-22 10:57:52 -07:00
Kislay Verma cdb06ff9f0 stream_popover: Fix type bug.
The variable `select_stream_id` was assumed to be of type number when
it actually was of type string. A strict equality check was performed later
down in the code between `select_stream_id` and `current_stream_id`
(which is of type number).

This commit converts the variable `select_stream_id` to type number.
2024-04-22 10:57:52 -07:00
Adnan Shabbir Husain 9aa6bbcee0
modal: Fix invite link overflow in mobile view.
Added a flex div into the copy invite link dialog box.

Fixes #29524.
2024-04-22 10:48:31 -07:00
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
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
Shubham Padia 6d4541a1eb custom_profile_fields: Don't show display summary tooltip on `required`.
Fixes #29814.
2024-04-22 09:16:31 -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
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
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
Aman Agrawal ca0f79ce34 message_list_view: Restore date on previous sticky header.
We forgot to restore the date on sticky header if the header
is no longer sticky.

Reproducer:
* Have two messages with same sender on different dates next to
  each other in a stream narrow.
* Scroll so that sticky header is on the 2nd message.
* Scroll down fast so that to avoid us capturing the sticky header
  over the first message.
* Scroll up slowly so to see the group header of the messages have
  the date of the second message.
2024-04-18 11:52:59 -07:00
Lauryn Menard b71f4b9342 stream-settings: Remove unused tooltip for announcement stream.
In commit 449febf036, the tooltip that provided information about
the announcement stream was replace with inline text on the form.

Removes the now unused template and code in stream_create for this
tooltip.
2024-04-18 08:52:53 -07:00