The 'tutorial_status' field on 'UserProfile' model is
no longer used to show onboarding tutorial.
This commit removes the 'tutorial_status' field,
'POST users/me/tutorial_status' endpoint, and
'needs_tutorial' parameter in 'page_params'.
Fixes part of zulip#30043.
We plan to remove the 'tutorial_status' field from UserProfile
table as it is no longer used to show tutorial.
The field is also used to narrow a new user in DM with
welcome bot on the first load.
This prep commit updates the logic to use a new OnboardingStep
for the narrowing behaviour on the first load. This will help
in removing the 'tutorial_status' field.
In our web client code we use email as the operand for
'dm' operator. Later user_ids_array is set as operand
in 'handle_operators_supporting_id_based_api' before
making the API call.
Earlier, using user_id as the operand was resulting in
the following error during user signup:
data=b'{"result":"error","msg":"Invalid narrow[0]: Value error,
operand is missing","code":"BAD_REQUEST"}
This commit replaces user_id with email as operand.
This commit changes some event handlers to pass in relevant
JQuery objects instead of using `e.target`. This will be
necessary for converting message_edit to typescript.
`message_edit_topic_propagate` is only used in the template for
moving messages, separate from the message edit template, and
`message_edit_topic` doesn't show up anywhere anymore. Editing
the topic of a message used to be part of the message edit file,
and was removed in 0fc19732bc (diff-c68d68d71e21a4d22f39212a43e4f66ecc774bd17109963fe017d9878aace9bf)
In an earlier refactor, `removePill` was being called with the exit
button element instead of the pill. This change fixes that bug by
using similar code to what we previously did (and still do in
input_pill for cases without on_pill_exit).
This commit extracts the "waiting_for_id" and "waiting_for_ack"
data structures of "echo.js" into a separate module in "echo_state".
This is a preparatory commit so as to be able to use them for
"stream_topic_history" module, without causing import cycles.
This replaces a :disabled selector with individual ones for each
element type; I verified in CSS selector profiling that this change
removes lines that were previously about 10% of profiled CSS selector
processing time for rendering the combined feed.
The reason being that the rendered elements have very few disable-able
elements, but the browser was spending a lot of time trying to match
**every** element for whether it might have been disabled, which was
slow.
This probably reflects a browser bug.
This commit updates the stale logic in 'toggle_topic_visibility_policy'
function. It was not updated after the addition of 'follow' visibility
policy resulting in buggy behavior.
Earlier, 'Shift + M' hotkey was working in unsubscribed channels.
This commit updates the logic to make it non-functional. This
helps to keep the UI consistent as we don't offer a way to
change visibility_policy in unsubscribed channels via
recipient_bar_controls or other UI elements.
Note: We don't implement this restriction in server because
we don't delete the user-topic states in db when a channel is
unsubscribed as it helps to retain those states when re-subscribed.
And implementing this restriction at server level can create
a confusion of why such states exists in db when API doesn't allow.
Even though the border-color was set for `#subscriptions_overlay
.subsection-parent div`, since the border-style was not set. It did not
have any effect on the appearance of the children div of
.subsection-parent.
These were added in ae7fe85ec5, and
should have been deleted in 333b8b095c.
Having those rules did not make any difference to the subscription and
user group list items.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
We've introduced a new class called `.client-logos-div`.
In `hello.ts` we just manually append the name of this new class for the
logo changing logic since that felt more readable than adding the class
programmatically.
What was happening:
* Focus being in the search input text box made Up/Down be handled
by the browser and move the cursor. This is default browser behavior,
and not useful to us (you can use home/end for the same goal, but
also one just doesn't put much text in that input given the pills
system).
* We probably don't want to push keyboard focus out of the search box
after completing a search, since that would make it annoying to type
a new search term or whatnot.
The fix is to just make the existing Up/Down keyboard handler apply
even if the search input is focused.
More context here:
https://chat.zulip.org/#narrow/stream/9-issues/topic/Can't.20navigate.20search.20results.20using.20the.20keyboard.20.2331291/near/1913535
The class was named `typeahead-option-label` for the element containing
the actual option label. We renamed it to
`typeahead-option-label-container` to give it a more appropriate name.
Zopfli[^1] performs very good, but time-intensive, zlib compression.
It is hence only suitable for pre-compressing objects, not on-the-fly
compression.
Use a webpack plugin to write pre-compressed versions of JS and CSS
assets using Zopfli, and configure nginx to serve those assets when
`Accept-Encoding: gzip` is provided.
This reduces the size of the JS and CSS assets on initial pageload
from 1422872 bytes to 1108267 bytes, or about a 22% savings.
[^1]: https://github.com/google/zopfli
This parameter is unused for Zulip avatars, and results in a smaller
(pixel-wise) Gravatar than we use for Zulip "small" avatars. Omitting
the `s=50` parameter results in a 80x80 image, which is closer to the
100x100 image that Zulip thumbnails avatars to. Ironically, using the
default (larger) Gravatar dimensions also results in _smaller_
responses (in bytes) from Gravatar.
We are using `.val` to set compose box content which is very fast vs
`setFieldText` which is very slow due to it doing a lot of
forced repaints. The major downside of using `val` here is that
user will not able to perform `undo` operation on this which doesn't
seem something user would want to do here.
Note that this effects compose content restored from drafts,
scheduled messages and on reload.
Previously no message was being shown in the group popover,
when group had no members, this commit intends to fix this
by displaying an approriate message when group is empty.
Fixes#30830.
Note that the link in zulip_update_announcements.py is not updated
so that the content in the source code reflects what users actually
received in the update announcement message.
To enhance the readability and operand handling of the
get_custom_profile_field_data function in user_profile, avoid the
unnecessary passing of objects inget_external_account_link.
Instead, pass only the required field_data and value.
Also remove the unnecessary field_type key stored in profile_field in
get_custom_profile_field_data data function.
On clicking the "Edit your profile" option in the user popover,
profile section is opened directly for narrow screens as well
instead of just showing the left panel list of sections.
For narrow screens, we only show left side panel list on
opening the overlay. Previously, we showed the right section
if the overlay was closed with a right-side section opened.
Currently if the settings overlay is opened on narrow screen,
where only left side panels are shown, and then the screen
width is increased, the right side shows "Profile" and
"Account and privacy" sections of personal settings together
everytime.
This fixes it to show the last opened section or the first
section or the section used in url.
Have one inbox row and focus on it. Mark the message as read in
another tab. Press `r` in the first tab will return an error as
the row_focus didn't change but there is no present. So, we
fix it by updating the row_focus if it can get out of bounds
when updating inbox view.
This commit refactors the common function used for test in
such a way that we can test more cases for a group setting
along with the ones tested by the common function.
This commit is part of a bigger project to remove custom logic in
the input_pill module. This commit move us away from a world where
we have a `display_value` that's used as identifying information
for a pill as well as for what we display to the user. Now individual
widgets can configure how they come up with a display value based
on the data of that type of pill.
Note: The change in the stream pill test for setting subscribers
for denmark is fixing an issue that wasn't discoverable before.
There always should have been three subscribers.
We no longer need to do `robust_url_decode` because we're
creating the display value ourselves, whereas previously
we were using `Filter.unparse` which does encoding.
By using a custom `generate_pill_html`, we can remove the
`has_stream` logic in `input_pill`, as part of a wider effort
to remove custom pill logic in `input_pill`.
This is part of a larger effort to refactor input_pill to
remove custom logic and move it into relevant modules.
This commit completely removes group_id from all modules, but
there's another module that uses stream that must be refactored
before that can be removed from input_pill.
This is part of a larger project to move custom
logic out of input_pill. The `generate_pill_html`
function will be used for other modules in upcoming
commits.
This keeps colors uniform between edit and preview modes, and also
ensures no bleedthrough of the editor when in preview mode.
ID selectors have been used for those colors to both keep the text
color declaration in the same place, and to avoid a dark-theme
specificity problem where the generic textarea took precedence over
the colors specified on the compose box's own textarea.
Function `message_helper.process_new_message` takes a
`RawMessage` and throws out `Message`. But here we are
passing it an already processed msg of type `Message`.
This is completely type unsafe. Since our purpose here is to
replace our old message object with a latest copy from
`message_store`.
We can do this directly without calling `process_new_message`.
With the refactoring of the rendered-Markdown area to use only
margin bottom, including in message-edit previewsk, these expensive,
general selectors are unnecessary.
Headings and horizontal rules, which do have margin-top, are zeroed
out elsewhere in the rendered-markdown file.
Because the compose-box resize logic is tied to the size of the
textarea, it's possible when resizing in preview mode that the
state of the compose box is not properly tracked. That's because
the height logic in `autosize_message_content` assumes a visible
textarea.
However, because both the textarea and the message preview area
occupy the same named grid area (`message-content`), and because
the preview area comes after the textarea in the DOM, when visible,
the preview area will automatically cover (and be sized to) the
textarea. And because the textarea remains observable in the DOM,
the compose box will obey the same expansion logic in preview mode
as it does in edit mode.
This check been present since
466beef6fe, but it seems unnecessary in
that the main logic handles there being 0 channels just fine, that's a
rare case (so not a useful optimization), and importantly, not calling
stream_list_sort.sort_groups for that transition resulted in
`stream_list_sort` having stale data structures, resulting in
exceptions if one tried to open the CHANNELS filter widget in the
newly-no-channels state.
When the caret in textarea is around the right end of the screen,
typeahead can overflow the window. To fix it, we use tippy's
mechanism to keep the tooltip inside the visible boundary.
Scroll to bottom button is visible for a few ms when switching
narrow to Inbox / Recent view while scrolling in message feed.
While we can end the transition faster to completely avoid the issue
for now but this seems like a more permanent and simpler fix
than to fiddle with CSS.
Using the existing tooltip template for the other "add emoji reaction"
element in message_controls results in the keyboard shortcut being
shown and avoids doing work to translate the string for every single
message containing emoji reactions.
Here we want to rerender the current narrow after receiving an
event which moves messages. We have mechanisms to keep using
the cached list if we are narrowing to the same narrow which
we want to avoid in this case.
This reworks canonical_url_of_media to work with HTMLMediaElement,
making it possible to do cross-browser inspection of media sources.
(Firefox and Chrome disagree on whether to return the "href"
attribute as the path in the source, or a full URL).
Additionally, we ensure non-empty cache keys on media so
unexpected results from the DOM do not get cached.
Co-Authored-By: Alex Vandiver <alexmv@zulip.com>
Co-Authored-By: roanster007 <rohan.gudimetla07@gmail.com>
Using different punctuation for the aria-label from the tooltip is
silly. Additionally, we don't need to repeat the channel name in
aria-label; it essentially will never be seen and the message list
copy of getting the channel name was buggy.
Tested by deleting a DM and navigating to recent view. No error
is thrown and dm row is correctly placed.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
Earlier tooltip info for the default topic menu notification option
had static string to display.
This commit changes the string info and includes channel name and its
corresponding privacy icon to display in the tooltip.
Earlier tooltips for topic menu button had inconsistent context with
that of other tooltips. In topic menu tooltip, action was described in
first line which different from that of other tooltips.
This commit changes the tooltip context and rearranges them to match
the format of action on first line and more context on second line.
Using "*" selector is inefficient as they require checking every
element because of the browser's bottom-up matching process.
This commit instead updates the selector to use individual
classes for elements to apply the CSS rules keeping in mind
to use unique class names instead of general class names.
Earlier, the `Add Channel` button was being focused even after the
modal was open, causing multiple modals to open on pressing enter
repeatedly.
This commit fixes the issue by removing the focus from the `Add
Channel` button after the modal is open by focusing the dropdown on the
modal.
Earlier the focus remained on the button to open the modal,
causing multiple modals to open on pressing enter repeatedly.
This commit fixes the issue by removing the focus from the button
by focusing on the first input field of the modal.
When moving message while compose box has content, stream was not
updated to the new stream if it was changed.
Tested by moving message with stream changed and with / without topic
changed.
This commit makes pasting formatted text a two-step process:
- Insert unformatted text
- Insert formatting
This way, undo (Ctrl+Z) will restore the original pre-formatting
syntax.
This is the same as the approach taken with
auto-formatting in #29302.
Fixes#31061
This commit fixes the overflowing issue for long bot owner names in the
user card popover, and also repositions the bot owner user card popover
to align with the bot owner name on the bot user card popover.
The `.popover-menu-user-avatar` selector being used to replace the small
avatar with the medium avatar was a broad selector, which also targeted
the bot's avatar when the bot owner's user card was opened. This commit
fixes this bug by scoping the selector to the current popover instance.
This CSS was needed when there was label along with the buttons
on the same line when this was originally added in 626c5ef55e.
But there is no label with the buttons now, so this CSS is not
needed.
I'm not aware of us using any of these; we don't generate the class
names involved, and we're not using `uppy.use` on any of their UI
components.
I confirmed that the only use of an Uppy UI component was the progress
bar, which was stopped using in
b01ac3623f.
We previously did not allow users to deactivate themselves from users
list to avoid users deactivating themselves accidentally. But we now
show a confirmation modal before deactivating, so it is fine to allow
it.
When the user card is displayed via right sidebar, the reference
can be lost due to it being updated or hidden on window resize.
To fix it, we show user card as an overlay when we cannot find
the reference.
Another solution would have been to relocate the reference and
update it for the popover but that is not naturally supported by
tippy once the popover has been displayed.