Commit Graph

1432 Commits

Author SHA1 Message Date
Karl Stolley cd0ae56ad4 icons: Implement new gold star color and states.
This not only introduces a new gold color that works across light
and dark modes, but it also separates out the hover and focus-
visible styles for stars--regardless of whether a star has been
filled or not.
2023-08-21 17:13:43 -07:00
Karl Stolley adb3b24cb2 icons: Display focused icons only without default outline.
The :focus-visible selector is more appropriate here, as that
enables browsers to determine whether focus should be displayed
or not. That's generally the case with keyboard-achieved focus,
but pointers and fingers generally do not need focus to be
displayed.

By not displaying a different icon color on simple :focus, this
will also ensure that star icons behave predictably when hovered
or focused via keyboard in both starred and unstarred states.
2023-08-21 17:13:43 -07:00
Karl Stolley 2ac578537c icons: Remove :focus-within styles on hover controls.
This corrects for an issue where hover controls would remain
visible after multiple clicks on one of the hover control icons,
despite the mouse pointer leaving the area.

This does not really create a regression for keyboard focus, as
there is currently no reasonable way to get a Tab key into the
hover controls area.

However, if one clicks multiple times on the vdots icon, and uses
Tab to move back and forth, the icons still remain visible--thanks
to the mouse pointer still being in the hover area.
2023-08-21 17:13:43 -07:00
Karl Stolley 14e9f65349 grid: Apply mobile-style grid when middle column is small.
This introduces a new breakpoint. In the future, this kind of
round-about sizing will be made unncessary by container queries,
but while those ship in all modern browsers, their availability
is quite recent:

https://developer.mozilla.org/en-US/docs/Web/CSS/@container
2023-08-21 17:13:43 -07:00
Karl Stolley 60aa58dfb9 icons: Test out second alternate vdots icon.
See CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1626845

TODO: If this alternate version moves forward, there are still styles
in this PR referring to the other vdots version. So be sure to clean
those up.
2023-08-21 17:13:43 -07:00
Karl Stolley 68ac18a338 time: Increase font-size to 13px.
This is an effort to better unify the size of the timestamp text
with the redesigned hover controls.

CZO discussion:
https://chat.zulip.org/#narrow/stream/6-frontend/topic/redesigned.20hover.20icons.20.2326283/near/1621756
2023-08-21 17:13:43 -07:00
Karl Stolley 5d293c82cd icons: Size vdots icon for greater prominence. 2023-08-21 17:13:43 -07:00
Karl Stolley 152722cbed popovers: Use new Zulip icons in actions popover. 2023-08-21 17:13:43 -07:00
Karl Stolley 6380184973 time: Align :hover color with message controls. 2023-08-21 17:13:43 -07:00
Karl Stolley 59e9849a7f icons: Improve hover, focus states and target areas. 2023-08-21 17:13:43 -07:00
Karl Stolley 3c729b60b4 icons: Display alternate move and source icons. 2023-08-21 17:13:43 -07:00
Karl Stolley b0c428edf1 icons: Add microlayout for new icons.
This, along with the preceding commits, fixes #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley b05f76c29e icons: Implement monochrome colors and scaled active state. 2023-08-21 17:13:43 -07:00
Karl Stolley 2a8f14e40a icons: Add icon-independent .message-actions-menu-button class.
Behavior shouldn't depend on the specific names of icon classes.
2023-08-21 17:13:43 -07:00
Karl Stolley 735a42d037 icons: Reference new icons from templates and JS. 2023-08-21 17:13:43 -07:00
Karl Stolley bf7cdc8f7a icons: Add new custom icons for message hover buttons.
Files are those posted with #25903.
2023-08-21 17:13:43 -07:00
Karl Stolley 058d21c4e2 css: Rename .message_table to .message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley c741c43800 css: Rename .focused_table to .focused-message-list. 2023-08-21 15:17:45 -07:00
Karl Stolley e68af8a48d css: Rename .message_list to .message-feed. 2023-08-21 15:17:45 -07:00
evykassirer 37ce223b91 drafts: Use stream_id instead of stream names.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 846b470b99 messages: Use stream_id instead of stream name.
This should cause no functional changes.

This is part of a multi-step effort to move away
from using stream names to reference streams, now
that it's impossible for a user to write a message
with an invalid stream name (since switching to
the dropdown).
2023-08-21 15:10:17 -07:00
evykassirer 45af8a9406 stream_data: Get is_invite_only by stream_id instead of name. 2023-08-21 15:10:17 -07:00
evykassirer 8e33b7a3a7 recent topics: Use stream_name instead of stream for clarity. 2023-08-21 15:10:17 -07:00
Sahil Batra 882663394a settings: Reduce width of "Actions" column in tables.
This commit reduces the width of "Actions" column in tables so
that they do not take any unnecessary space.
2023-08-21 15:00:39 -07:00
Sahil Batra 75126c96a4 settings: Make custom profile fields table similar to other tables.
This commit updates the admin custom profile fields table to be
similar to other tables in settings page. After this change,
the table will be horizontally scrollable for narrow screens
and the buttons in actions column will not wrap to multiple lines.

This increases the width of "Actions" column and it takes some
unnecessary space, but this will be handled in the next commit
which will adjust "Actions" column in all the tables.
2023-08-21 15:00:39 -07:00
Sahil Batra ebdd63f327 settings: Fix heading borders for striped tables.
The bottom border of heading row in striped (and not bordered)
tables was thicker than needed due to two borders being present -
one from the bottom border for heading element and one from top
border for the first row in the table.

This commit changes the CSS to remove the top border of the first
row.
2023-08-21 15:00:39 -07:00
Sahil Batra 16bf9e7600 templates: Remove table-condensed class for <table> elements.
The table-condensed class was used by bootstrap to add padding
to the table cells. But since we want padding in cells for all
tables, we added the padding CSS to the other existing CSS for
tables while removing the bootstrap CSS for tables and
"table-condensed" is not required anymore.
2023-08-21 15:00:39 -07:00
Sahil Batra 154f4f16b5 css: Remove unnecessary CSS defined using table-condensed class.
This commit removes unnecessary CSS defined for tables using
table-condensed class.

The vertical-align property for "td" elements is not needed
since by default the vertical-align property for "td" elements
is inherited and is set to "middle".

The margin properties set for the tables in informational
overlay is also not needed since we have set the width
to 100% and setting the margin to auto does not result in
anything different.
2023-08-21 15:00:39 -07:00
Anders Kaseorg 4b87a79a7e help: Apply noscroll class on server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 1244c066ad help: Highlight current article on the server side.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Anders Kaseorg 8dba4cbba6 help: Stop pretending to be a single page application.
The API and user documentation pages gain nothing from being a single
page application other than a bunch of random errors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-21 14:32:19 -07:00
Karl Stolley 13311ef91d reactions: Present alt-code emoji like other reaction emoji. 2023-08-21 11:38:39 -07:00
Karl Stolley 65466cec44 reactions: Let emoji and count act as simple flex items.
This commit uses a `gap` property on the containing reactions
flexbox to recreate space previously set by margins.
2023-08-21 11:38:39 -07:00
Karl Stolley 69413fe887 reactions: Mirror reaction_button styles with message_reaction. 2023-08-21 11:38:39 -07:00
Karl Stolley c0c62e477c reactions: Use a flex layout for reactions. 2023-08-21 11:38:39 -07:00
Karl Stolley 34928407cf grid: Remove message content from document flow when editing.
This effectively reverts a change introduced in #26260 that used
the original message to maintain the basline grid. With more
robust control over first-row line-heights, it is now safe to
fullyl hide the message again.

This also fixes a regression where messages with images would have
additional whitespace beneath the message edit box; see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/message.20edit.20form.20height/near/1621758
2023-08-21 11:29:00 -07:00
Karl Stolley c25da457e5 grid: Allow message toggles to occupy message area. 2023-08-21 11:29:00 -07:00
Karl Stolley 72119d161b grid: Use message_time to maintain baseline group. 2023-08-21 11:29:00 -07:00
Karl Stolley ce7f5ba785 message_edit: Hide length controller when editing. 2023-08-21 11:29:00 -07:00
Daniil Fadeev d4ef28bc8d unread_count: Remove letter spacing for better horizontal alignment. 2023-08-21 11:23:35 -07:00
Aman Agrawal f7b0282a0d navbar: Hide right arrow displayed by Safari on summary elements. 2023-08-20 23:15:18 -07:00
evykassirer 76d9b1d9d0 message scroll: Check message feed visibility instead of recent topics.
This is functionally the same, but semantically more relevant.
It will also be helpful if some day in the future these two
function calls are no longer perfect opposites of each other.
2023-08-17 15:48:53 -07:00
Prakhar Pratyush f8f2af5ebe recent_topics_ui: Add support to follow topic via recent conversations.
This commit replaces the mute/unmute topic button in the recent
conversations UI with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the recent conversations UI has an icon corresponding to
the current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute,
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' option. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted
in the popover.

Fixes #25915.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 41697f2663 message_header: Add support to follow topic from the message header bar.
This commit replaces the mute/unmute topic button in the message
header bar with a button that allows the user to set the
visibility_policy of the topic to muted, unmuted, followed or inherit.

The button in the message header bar has an icon corresponding to the
current visibility policy of the topic.

In a muted stream:
A click on the button opens a popover with 'Mute', 'Default', 'Unmute',
and 'Follow' options.

In a not muted stream:
A click on the button opens a popover with 'Mute', 'Default', and
'Follow' options. 'Unmute' option is available only when the
visibility_policy is set to 'Unmute'.

The current visibility_policy of the topic is highlighted in the
popover.
2023-08-17 13:30:24 -07:00
Prakhar Pratyush 07186e8de1 topic_popover: Fix the 'Mute' topic icon.
Earlier, the icon was half-filled instead of being transparent.
2023-08-17 13:30:24 -07:00
Junyao Chen d8c6311e33 bot_data: Eliminate owner field.
`owner` is a legacy key in one of bot data field. We would like to
remove this field as it's not used in the codebase. `owner_id` is
the identifier to find the owner of a bot.

CZO discussion: https://chat.zulip.org/#narrow/stream/6-frontend/topic/Can.20we.20mark.20.60owner.60.20field.20in.20bot.20data.20optional.3F/near/1625968
2023-08-17 11:53:34 -07:00
Junyao Chen 983c6b74ab ts: Migrate `user_group_create_members_data.js` to TypeScript. 2023-08-17 11:38:13 -07:00
Junyao Chen 6178a245b0 ts: Migrate `stream_create_subscribers_data.js` to TypeScript.
While `user_id` from `page_params` is marked as `number | undefined`,
when fuctions in this file are called, `page_params.user_id` will
never be undefined. Verifying from all of callers of
`initialize_with_current_user`, this is because when user is able
to create and initialize a stream, this user is authenticated and
thus a `user_id` is always available. Therefore, adding an assertion
when undefined user id is detected to handle a confirmed error.
2023-08-17 11:38:13 -07:00
Junyao Chen 80d0813dea people: Narrow the return type of `get_users_from_ids` function
`get_users_from_ids` is a function that map an array of user ids to
`User` object. According to `get_by_user_id` for mapping, every
id should be mapped to a valid `User` object. Thus removed
`undefined` annotation in this commit.
2023-08-17 11:38:13 -07:00
Junyao Chen 59aa62a36f stats: Add `zod` validation to server data and misc data.
Data retrieved from the backend using `get_chart_data` is validated
in the expected form for frontend usage. Used `zod` schemas to
validate data.
2023-08-17 11:35:00 -07:00