This commit disables the save button when the topic name is considered
as empty as part of the `realm_mandatory_topics` being set to True.
Since disabled elements do not fire events, it is not possible to
trigger tippy tooltips on disabled elements – such as the Save button
in the inline topic edit UI. Thus this commit adds a tooltip to the
disabled save button by wrapping/unwrapping it inside a `span` wrapper
pragmatically via the `ui_util.disable_element_and_add_tooltip` and
`ui_util.enable_element_and_remove_tooltip` helper methods.
This commit adds the `invalid-input` class to the inline topic edit
input element when the new topic name is considered empty as a result
of realm_mandatory_topics property being set to True. This adds the
red glow borders to the invalid input field, which visually
communicates that some thing is wrong with the new topic name.
Previously, anytime Enter was pressed anywhere inside the inline topic
edit UI, it led to the submission of the form. This logic resulted in
the unintentional saving of the new topic name when Enter was pressed
even on the cancel button; which should have actually closed the inline
topic edit UI instead.
This commit makes sure to only save the new topic name when the user
presses enter when focused on the text input element or the save button.
This commit improves the design of the inline topic edit UI by making
the following changes:
- Increases the dimensions of the text input element.
- Fixes the font scaling inside text input element.
- Replaces the old save and cancel buttons with the new icon buttons.
Fixes#33155.
This commit hides all the recipient bar controls from the recipient
bar when the topic edit UI opens.
Previously we used to only hide some of the controls while some other
were still visible alongside the save and cancel buttons from the
inline topic edit UI which led to confusion.
With the larger, flexibly sized right sidebar, we want to allow
for the middle column to expand to fill its place even outside of
the "Use full width on wide screens" setting.
Some browsers, notably Safari on both iOS and macOS, are not yet
aligned with the CSS specification, which does not force layout
containment but does force an independent formatting context
(see https://github.com/w3c/csswg-drafts/issues/10544).
The little test here will allow us to deliver em-aware container
queries to browsers that are spec aligned, and fall back to media
queries in browsers that are lagging.
In our css variables, we were using sidebar and column interchangably.
But, sidebar is 10px less wider than the column. This commit makes no
behaviour change, but renames variables to use column where necessary
and uses variable for sidebar instead of a fixed 240px value.
Use a more instructive placeholder instead of "Topic" when
topic is not mandatory in a realm.
Updated placeholder:
'Enter a topic (skip for general chat)'.
Previously, the topic / direct message recipient input box was always
focused when the compose select recipient dropdown got closed, even if
the user clicked elsewhere. This resulted in unwanted trigger of
onFocus event listener etc.
This adds an early return to ensure focus updates only when an item
is clicked.
This commit adds support to show `realm_empty_topic_display_name`
value in the composebox topic typeahead for empty string topic.
The item is italicized.
The 'New' label is not shown for empty string topic.
This commit also attempts to fix a bug, present in main, where a
draft restored directly to the compose box loses its original topic
upon switching to other topic narrows.
Co-authored-by: Prakhar Pratyush <prakhar@zulip.com>
Previously, the typeahead's header html used to be updated only
once -- after it is shown.
This caused stale state in compose box typeaheads -- when user
starts with an `@`, the typeahead is shown for the first time,
and the header html is rendered. Then when next character is
`_` (silent mention), the header html is no longer updated since
it is already updated once when `@` is used.
This is fixed by updating the typeahead everytime the user string
is updated.
Note that the puppeteer tests only tested
copying whereas the node tests only tested
pasting, which is why the puppeteer tests
for pasting and node tests for copying are
absent after this split.
This commit fixes the inconsistent positioning of the unread dot
on the left sidebar toggle button. Instead of using fixed pixel
values, the position is now defined using a relative percentage,
ensuring consistent alignment.
The unread dot's dimensions are also expressed in ems for better
scaling and alignment at different font-sizes. And an unnecessary
(and confusing) 0 was removed from the templates.
Co-Authored-By: harshbansal8705 <harsh@harshbansal.in>
There's a rare possibility for a user to have no last_active_time. In
such a case, we always want to fall back to date_joined for displaying
"Last active" in the UI.
Co-authored-by: Tim Abbott <tabbott@zulip.com>