Commit Graph

109 Commits

Author SHA1 Message Date
Sayam Samal 6bf9c2bdfc popovers: Rename "navbar-dropdown-menu" theme to "popover-menu" theme.
Also renames the navbar dropdown related CSS terms, to their equivalent
popover related terms to accompany the name change of the theme.
2024-04-11 15:57:24 -07:00
Sayam Samal d469d37d14 personal_menu: Add theme switcher to personal menu popover.
This commit introduces a theme switcher feature within the personal
menu popover. The implementation begins with the development of a
tab picker, which has the following features:

* Utilization of radio buttons to emulate the tab picker.
    Radio input buttons provides the native way in HTML to select one
    value out of a set.

* Support for both horizontal (default) and vertical orientations.
    Vertical orientation can be achieved by appending the
    `.tab-picker-vertical` class.

* Respects the `prefers-reduced-motion` option set by the user.
    Disables the sliding tab animation to improve accessibility.

Additionally, the theme switcher component incorporates error handling
mechanisms. In the event of a server/network error, the tab slider
reverts to the previous theme option after a delay of 500ms. This
behavior visually communicates the occurrence of an error to the user,
improving the UX.

Fixes: #22803.
2024-03-25 16:31:55 -07:00
Mahhheshh 1c48ed0a1c stream picker: Remove stream colorblock.
To achive this the `stream_header_colorblock` div was removed from
`dropdown_widget_with_stream_colorblock.hbs` template. this change made
the file name irelevenet so it was necessary to rename the file to
`dropdown_widget_wrapper.hbs`. After removing the html strcuture for
colorblock from templates the css for colorblock was also removed.
followed by the javascript which was used to add colorblock to the
stream picker. After removing javascript tests were updated.
Fixes: #28796.
2024-03-15 11:11:04 -07:00
shashank-23002 d6219e93a8 popover: Rename user-card-status-text. 2024-02-20 18:10:38 -08:00
Aman Agrawal e6718369d6 css: Apply fa-chevron-down CSS to zulip-icon-chevron-down.
This was missed as part of #27577 migration.
2024-02-20 15:16:56 -08:00
Pratik 4f89a0f605 user_profile: Add "copy link to profile" button in user_profile_modal.
This commit adds a "copy link to profile" button in user_profile_modal.
Clicking on this button copies the user's profile link and displays a
"Copied!" tooltip.
2024-02-15 17:17:38 -08:00
Sayam Samal e3878cf64a popovers: Add structural changes and fix CSS overlap.
The paragraph tag was being used along with the bold tag to style the
topic and stream in the popovers. The semantic meaning of these tags
are more specialized and should not be used in this context. Replaced
the <p> tags with the more general <div> tags and accounted for the
bold text via the `font-weight` CSS property.

The `.topic-name` class, used to style the topic/stream name in the
topic list in the left sidebar, was also being used to the style the
topic/stream name in the topic/stream popover. This lead to irrelevant
properties being applied to the popover > topic/stream name. Through
this commit, the styling for both of these different cases are now
separated using the appropriate selectors.

Fixes #27562.
2023-12-11 12:55:25 -08:00
Sayam Samal be31f7a5e6 streams_popover: Change stream name alignment from center to left.
Introduced `display: flex` to help with the align of the stream privacy
icon with the stream name text.
2023-12-11 12:55:25 -08:00
Sayam Samal 10aad0a9f3 streams_popover: Allow soft wrap opportunities for stream name.
When a stream name becomes very long, it may stretch the popover menu
by a lot. We prevent this by allowing the stream name to wrap onto
multiple lines.
2023-12-11 12:55:25 -08:00
Sayam Samal a2733c7bc3 streams_popover: Set popover width equal to width of longest menu item.
We set the streams popover width to be equal to the width of the longest
menu item, via the min-content intrinsic sizing. We also set all the
menu items to `white-space: nowrap` to prevent them wrapping. These
two changes allow the menu items to dictate the width of the popover
instead of a static max-width property, and thus helps with languages
where the length of the translated item may be long enough to wrap.
2023-12-11 12:55:25 -08:00
Sayam Samal 27ca8b0360 topics_popover: Remove '>' icon adjacent to the topic name. 2023-12-11 12:55:25 -08:00
Sayam Samal a9e0871f59 topics_popover: Change topic name alignment from center to left. 2023-12-11 12:55:25 -08:00
Sayam Samal b8fee4f176 topics_popover: Allow soft wrap opportunities for topic name.
When a topic name becomes very long, it may stretch the popover menu
by a lot. We prevent this by allowing the topic name to wrap onto
multiple lines.
2023-12-11 12:55:25 -08:00
Sayam Samal 8b128f4b59 topics_popover: Set popover width equal to width of longest menu item.
We set the topics popover width to be equal to the width of the longest
menu item, via the min-content intrinsic sizing. We also set all the
menu items to `white-space: nowrap` to prevent them wrapping. These
two changes allow the menu items to dictate the width of the popover
instead of a static max-width property, and thus helps with languages
where the length of the translated item may be long enough to wrap.
2023-12-11 12:55:25 -08:00
Sayam Samal e5f2211397 gear_menu_popover: Align org info menu items to the left. 2023-12-11 12:25:09 -08:00
Sayam Samal 1f417b6a43 gear_menu_popover: Fix font size of org plan.
As per the intended design, the font size of the org plan should
be equal to the font size of other similar links such as org version.

It should not be one size smaller than it, such as those of the
upgrade links.
2023-12-11 12:25:09 -08:00
Sayam Samal 48bbf1cc6c gear_menu_popover: Add text wrapping to long org names.
Some organizations may have long names that could blow up the gear
menu width, in those cases we want to prevent it by wrapping the
org name by explicitly setting the white-space property, and thus
enabling any soft-wrap opportunities.
2023-12-11 12:25:09 -08:00
Sayam Samal ca9b1060b7 navbar_dropdowns: Let menu items control the width of dropdown menus.
Through this commit, we set the width of the navbar dropdowns to be
equal to the longest menu item, via the min-content intrinsic sizing.

Note, that the min-content width takes into account all soft-wrapping
opportunities, which could result in the wrapping of the menu items in
many cases. To prevent this, we use the white-space property to prevent
menu items from wrapping in any case.
2023-12-11 12:25:09 -08:00
Sayam Samal ada73eb6e0 gear_menu_popover: Fix padding of items in org info section.
We currently don't have appropriate padding applied to the lists and
links in the org info section of the gear menu popover. This becomes
an issue when we have a long org name, org url or org version, as
text starts touching the edges of the popover.

This commit adds the missing padding to the items in the org info
section of the gear menu popover.
2023-12-11 12:25:09 -08:00
Sayam Samal c2dec1e152 visibility_policy_popover: Set cursor to pointer for the whole option.
The cursor should be a pointer for the whole visibility policy options;
since the whole option is selectable and not just for the anchor tag
within it.
2023-12-08 13:00:12 -08:00
Sahil Batra c4ec18bc61 popovers: Improve user group popovers.
This commit updates the user group popovers to change the icon
and text of ".manage-group" option to match what we have in
gear menu and also change the heading and ".manage-group"
option to be left-aligned.
2023-12-07 06:35:38 -08:00
Sahil Batra 381670d2b6 user_group_popover: Fix scrollbar present outside the popover.
We already had the code to override the margin but it was not
being applied due to CSS specificity. This commit fixes it.

Due to this change, there was too much space on the left of
member names, so this commit also decreases the left padding.
2023-12-07 06:35:38 -08:00
Aman Agrawal c55eaf2bec css: Set tippy-arrow color same as background in light theme. 2023-11-23 10:33:23 -08:00
Sahil Batra ada0fcf299 popovers: Increase popover width to fit avatar inside it.
The user avatar flowed out of the popover and this commit
fixes it by increasing the popover width by 2px and making
it 242px (240px for avatar and 2px for borders). This
also changes the width of user group popovers, but it is
only a slight change so should be fine.
2023-11-21 12:20:25 -08:00
Aman Agrawal f6516cba89 personal_menu: Add opacity hover effect on clear status button. 2023-11-08 10:19:24 -08:00
Aman Agrawal 66276d88ef personal_menu: Add different colors for status text. 2023-11-08 10:19:24 -08:00
Prakhar Pratyush 5697084832 css: Improve the css of popover used to change visibility policy.
This commit improves the CSS of popovers in the recipient bar,
recent conversations, and Inbox, which are used to change the
visibility policy.
2023-11-06 10:16:53 -08:00
Vector73 6dd7efae85 user_profile: Fix alignment and color of edit icon. 2023-10-26 13:17:28 -07:00
Vector73 4a4b8dff99 user_profile: Add deactivated user indicator in the profile header.
Fixes: #26861
2023-10-26 13:17:28 -07:00
Aman Agrawal 18a165fa97 personal_menu: Indicate no status text in italics.
If user has only set emoji as status, we show a placeholder
text to indicate no status text has been set.

Fixes #27362
2023-10-25 11:09:08 -07:00
Aman Agrawal 6f6a53c909 help-menu: Center align keyboard shortcut hint. 2023-10-24 13:06:11 -07:00
Aman Agrawal 75c874fef6 personal_menu: Fix focus outline of clear status icon. 2023-10-23 14:15:13 -07:00
Aman Agrawal 87c87ed41f personal_menu: Rename clear_status class. 2023-10-23 14:15:13 -07:00
Aman Agrawal c5564668c5 help_menu: Use new style to show hotkey.
This is according to Vlad's design in figma which differs from the
style we have in `tooltip-hotkey-hint`.

I used font-weight: 500 instead of 400 as it looked nicer and since
Vlad used Source Sans Pro as font-family which we don't have.
2023-10-23 14:15:13 -07:00
Aman Agrawal 3d870a1f7d popovers: Use fixed height for navbar-dropdown items.
This helps us add elements like hotkey hint which can take more
space that available for text. There are no visual changes.

Removed some duplicate properties too.
2023-10-23 14:15:13 -07:00
Aman Agrawal 8f716cd64a help_menu: Extract help items from gear menu into a separate popover.
Fixes #27202
2023-10-23 14:15:13 -07:00
Aman Agrawal af271be1bd navbar-dropdowns: Use specific classes for everything.
Replaced element selectors with specific selectors, those that
remain are intentionally left.

This is to avoid inner-most selectors as element selectors.
The reason being is that browsers evaluate selectors from right
to left, meaning that every time a selector ends in an element,
the browser has to work that much harder whenever and wherever
on a page it encounters the element.
2023-10-20 12:36:39 -07:00
Aman Agrawal 2efc2a5eb5 gear_menu_dropdown: Use better class name for theme buttons. 2023-10-20 12:36:39 -07:00
Aman Agrawal f9e7b814d6 navbar-dropdown-menu: Use focus-visible instead of focus. 2023-10-20 12:36:39 -07:00
Aman Agrawal 1e3e70576b gear_menu: Extract the new gear and personal menu style as a theme.
This also fixes some misalignment happening at some widths for gear
menu. Like at XL widths for spectators.
2023-10-20 12:36:39 -07:00
Aman Agrawal bc3d48616e gear_menu: Migrate to use tippy. 2023-10-20 12:36:39 -07:00
Aman Agrawal d75df10729 gear_menu_popover: Move *-theme class to the li element.
It will help us hide the whole `li` element instead of just
`a` tag for spectators.
2023-10-20 12:36:39 -07:00
Aman Agrawal 897c19d17d css: Add box-shadow to navbar dropdown menu as per figma design. 2023-10-20 12:36:39 -07:00
Aman Agrawal 41c06e2989 CSS: Extract common CSS for .navbar-dropdown-menu. 2023-10-20 12:36:39 -07:00
Aman Agrawal b542984869 personal_menu: Fix semantics of personal menu HTML structure.
Only valid tag inside `ul` is `li`. So, we use `ul > li > ul > li`
structure here.
2023-10-18 22:02:38 -07:00
Aman Agrawal b2dd2d6d29 personal-menu: Rename dropdown-menu to navbar-dropdown-menu.
This will contain common css to be used between navbar dropdowns
gear menu and personal menu.
2023-10-18 22:02:38 -07:00
Prakhar Pratyush 5e3b8f5393 css: Improve the css of icon-based tab picker used in topic popover.
Remove the solid outline around hovered tabs.

Minor tweaks in height and padding for tabs.
2023-10-17 16:21:06 -07:00
Aman Agrawal 4db331ed21 empty_list_widget: Use class instead of id.
We were using id before to increase their specificity, but
since it is possible for multiple empty_list_widget_for_list/table
to be in DOM at the same time, we should use a class here. Used
`!important` here so that we can force our padding where these
classes are used.
2023-10-17 11:55:41 -07:00
Hardik Dharmani 49f7f02a0a personal_menu: Add tippy personal_menu dropdown.
Add a personal menu dropdown that opens on clicking user avatar icon
in navbar added in previous commit.

The args passed to render_personal_menu() in onShow() are returned by
get_personal_menu_content_context() in popover_menus_data.js so that
they can be unit tested.

Additionally, added CSS to get a custom arrow for dropdown menu.

Added a `?` hotkey in keyboard shortcuts option in personal_menu
dropdown in a style similar to our tooltip's hotkey by adding
? in a span with class .tooltip-hotkey-hint and adding some CSS.

Fixes part of #22802.
2023-10-12 15:31:01 -07:00
Sahil Batra 49a047c27f users: Add "(guest)" to names for guest users.
This commit adds code to add "(guest)" to user names of guest
users in the following places -
- right sidebar
- user pills, including the pills in search suggestion typehaead
- typeaheads for user
- sender names in message feed
- user profile popover and modals.
- user name in not subscribed warning banner.

Note that the indicator is shown only if enable_guest_user_indicator
setting is set to true.

As a result of this change, we now translate "deactivated" text
shown in user pills for deactivated users.

Fixes part of #26700.
2023-10-12 12:06:10 -07:00