diff --git a/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png b/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png index 884b10b038..b3ecf2c281 100644 Binary files a/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png and b/playwright/snapshots/settings/preferences-user-settings-tab.spec.ts/Preferences-user-settings-tab-should-be-rendered-properly-1-linux.png differ diff --git a/playwright/snapshots/settings/quick-settings-menu.spec.ts/quick-settings-linux.png b/playwright/snapshots/settings/quick-settings-menu.spec.ts/quick-settings-linux.png index 2992e35d60..bd95b29bfa 100644 Binary files a/playwright/snapshots/settings/quick-settings-menu.spec.ts/quick-settings-linux.png and b/playwright/snapshots/settings/quick-settings-menu.spec.ts/quick-settings-linux.png differ diff --git a/playwright/snapshots/spaces/spaces.spec.ts/space-panel-expanded-linux.png b/playwright/snapshots/spaces/spaces.spec.ts/space-panel-expanded-linux.png index 59d3f87bb2..6ebcb8635f 100644 Binary files a/playwright/snapshots/spaces/spaces.spec.ts/space-panel-expanded-linux.png and b/playwright/snapshots/spaces/spaces.spec.ts/space-panel-expanded-linux.png differ diff --git a/playwright/snapshots/spaces/spaces.spec.ts/space-room-view-linux.png b/playwright/snapshots/spaces/spaces.spec.ts/space-room-view-linux.png index f313bde9c4..fcee2c1d8c 100644 Binary files a/playwright/snapshots/spaces/spaces.spec.ts/space-room-view-linux.png and b/playwright/snapshots/spaces/spaces.spec.ts/space-room-view-linux.png differ diff --git a/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-button-expanded-linux.png b/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-button-expanded-linux.png index 30c7b662c5..5d47b6b9b5 100644 Binary files a/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-button-expanded-linux.png and b/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-button-expanded-linux.png differ diff --git a/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-hovered-expanded-linux.png b/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-hovered-expanded-linux.png index 30c7b662c5..5d47b6b9b5 100644 Binary files a/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-hovered-expanded-linux.png and b/playwright/snapshots/spaces/threads-activity-centre/threadsActivityCentre.spec.ts/tac-hovered-expanded-linux.png differ diff --git a/res/css/components/views/elements/_FilterDropdown.pcss b/res/css/components/views/elements/_FilterDropdown.pcss index 22eb5f2ff1..5385a614cc 100644 --- a/res/css/components/views/elements/_FilterDropdown.pcss +++ b/res/css/components/views/elements/_FilterDropdown.pcss @@ -40,7 +40,7 @@ Please see LICENSE files in the repository root for full details. } .mx_Dropdown_arrow { - background: $secondary-content; + color: $secondary-content; } } diff --git a/res/css/structures/_GenericDropdownMenu.pcss b/res/css/structures/_GenericDropdownMenu.pcss index 1d0fb79648..a2aa022eee 100644 --- a/res/css/structures/_GenericDropdownMenu.pcss +++ b/res/css/structures/_GenericDropdownMenu.pcss @@ -13,6 +13,12 @@ Please see LICENSE files in the repository root for full details. user-select: none; font-size: $font-12px; color: $secondary-content; + + svg { + width: 18px; + height: 18px; + float: right; + } } .mx_GenericDropdownMenu_button:hover, @@ -20,17 +26,6 @@ Please see LICENSE files in the repository root for full details. background: $quinary-content; } -.mx_GenericDropdownMenu_button::before { - content: ""; - width: 18px; - height: 18px; - background: currentColor; - mask-image: url("@vector-im/compound-design-tokens/icons/chevron-down.svg"); - mask-size: 100%; - mask-repeat: no-repeat; - float: right; -} - .mx_ContextualMenu_wrapper.mx_GenericDropdownMenu_wrapper { .mx_ContextualMenu { position: initial; @@ -97,16 +92,12 @@ Please see LICENSE files in the repository root for full details. background-color: $menu-selected-color; } - &[aria-checked="true"]::before { - content: ""; + .mx_GenericDropdownMenu_Option--checkIcon { width: 16px; height: 16px; margin-left: -22px; margin-right: 6px; - mask-image: url("@vector-im/compound-design-tokens/icons/check.svg"); - mask-size: 100%; - mask-repeat: no-repeat; - background-color: $primary-content; + color: $primary-content; display: inline-block; vertical-align: middle; } diff --git a/res/css/structures/_QuickSettingsButton.pcss b/res/css/structures/_QuickSettingsButton.pcss index f4b881f955..7fe7c5f35c 100644 --- a/res/css/structures/_QuickSettingsButton.pcss +++ b/res/css/structures/_QuickSettingsButton.pcss @@ -7,39 +7,54 @@ Please see LICENSE files in the repository root for full details. */ .mx_QuickSettingsButton { - flex: 0 0 auto; border-radius: 8px; - position: relative; - margin: 12px auto; - color: $secondary-content; - min-width: 32px; - min-height: 32px; - line-height: 32px; + margin: 12px auto 12px; - &.expanded { - margin-left: 20px; - padding-left: 44px; /* align with toggle collapse button text */ - padding-right: 8px; - } - - &::before { - content: ""; - position: absolute; - width: 32px; - height: 32px; - left: 0; - mask-image: url("@vector-im/compound-design-tokens/icons/settings-solid.svg"); - mask-repeat: no-repeat; - mask-position: center; - mask-size: 24px; - background: $secondary-content; + svg { + fill: $secondary-content; } &:not(.expanded):hover { - background-color: $quaternary-content; + /** + * override compound default background color when hovered + * should disappear when the space panel will be migrated to compound + */ + background-color: $quaternary-content !important; + color: $primary-content; - &::before { - background-color: $primary-content; + svg { + fill: $primary-content; + } + } + + &.expanded { + /** + * override compound default background color when hovered + * should disappear when the space panel will be migrated to compound + */ + background-color: transparent !important; + + /* align with settings icon */ + margin-left: 21px; + + /** + * modify internal css of the compound component + * dirty but we need to add the label into the indicator icon button + **/ + & > div { + display: flex; + align-items: center; + } + + svg { + /* align with settings label */ + margin-right: 14px; + /* required to set the icon width when into a flex container */ + min-width: 24px; + } + + & .mx_QuickSettingsButton_label { + color: $secondary-content; } } } diff --git a/res/css/structures/_RoomSearch.pcss b/res/css/structures/_RoomSearch.pcss index 8c82f73ea4..beb60e7ef9 100644 --- a/res/css/structures/_RoomSearch.pcss +++ b/res/css/structures/_RoomSearch.pcss @@ -26,10 +26,7 @@ Please see LICENSE files in the repository root for full details. .mx_RoomSearch_icon { width: 20px; height: 20px; - mask-image: url("@vector-im/compound-design-tokens/icons/search.svg"); - mask-repeat: no-repeat; - mask-size: contain; - background-color: $secondary-content; + color: $secondary-content; margin-left: var(--cpd-space-2x); flex-shrink: 0; } @@ -90,7 +87,7 @@ Please see LICENSE files in the repository root for full details. } .mx_RoomSearch_icon { - background-color: $background; + color: $background; } } } diff --git a/res/css/structures/_SpaceHierarchy.pcss b/res/css/structures/_SpaceHierarchy.pcss index 88c40b6fab..50f13e4d6f 100644 --- a/res/css/structures/_SpaceHierarchy.pcss +++ b/res/css/structures/_SpaceHierarchy.pcss @@ -109,22 +109,14 @@ Please see LICENSE files in the repository root for full details. border-radius: 4px; background-color: $background; - &::before { - content: ""; - position: absolute; - top: 0; - left: 0; - height: 16px; - width: 16px; - mask-repeat: no-repeat; - mask-position: center; - background-color: $tertiary-content; - mask-size: 16px; + svg { + width: inherit; + height: inherit; + color: $tertiary-content; transform: rotate(270deg); - mask-image: url("@vector-im/compound-design-tokens/icons/chevron-down.svg"); } - &.mx_SpaceHierarchy_subspace_toggle_shown::before { + &.mx_SpaceHierarchy_subspace_toggle_shown svg { transform: rotate(0deg); } } @@ -196,22 +188,14 @@ Please see LICENSE files in the repository root for full details. } .mx_SpaceHierarchy_roomTile_joined { - display: inline; - position: relative; - padding-left: 16px; + display: inline-flex; + align-items: center; + vertical-align: middle; - &::before { - content: ""; + svg { width: 20px; height: 20px; - top: -2px; - left: -4px; - position: absolute; - mask-position: center; - mask-size: contain; - mask-repeat: no-repeat; - background-color: $accent; - mask-image: url("@vector-im/compound-design-tokens/icons/check.svg"); + color: $accent; } } } diff --git a/res/css/views/auth/_AuthBody.pcss b/res/css/views/auth/_AuthBody.pcss index 062885f003..ad47ca8dc3 100644 --- a/res/css/views/auth/_AuthBody.pcss +++ b/res/css/views/auth/_AuthBody.pcss @@ -119,7 +119,7 @@ Please see LICENSE files in the repository root for full details. } .mx_Dropdown_arrow { - background: $authpage-primary-color; + color: $authpage-primary-color; } .mx_Dropdown_menu { diff --git a/res/css/views/auth/_LanguageSelector.pcss b/res/css/views/auth/_LanguageSelector.pcss index d5002d00b2..e620cd8ab5 100644 --- a/res/css/views/auth/_LanguageSelector.pcss +++ b/res/css/views/auth/_LanguageSelector.pcss @@ -17,5 +17,5 @@ Please see LICENSE files in the repository root for full details. } .mx_AuthBody_language .mx_Dropdown_arrow { - background: $authpage-lang-color; + color: $authpage-lang-color; } diff --git a/res/css/views/directory/_NetworkDropdown.pcss b/res/css/views/directory/_NetworkDropdown.pcss index 47180e3c2f..dc2a12ab41 100644 --- a/res/css/views/directory/_NetworkDropdown.pcss +++ b/res/css/views/directory/_NetworkDropdown.pcss @@ -39,12 +39,11 @@ Please see LICENSE files in the repository root for full details. .mx_GenericDropdownMenu_divider { margin-top: $spacing-4; margin-bottom: $spacing-4; - } -} -.mx_NetworkDropdown_addServer { - font-weight: normal; - font-size: $font-15px; + & + .mx_GenericDropdownMenu_Option .mx_GenericDropdownMenu_Option--label { + font-size: $font-15px; + } + } } .mx_NetworkDropdown_removeServer { diff --git a/res/css/views/elements/_Dropdown.pcss b/res/css/views/elements/_Dropdown.pcss index 355d79d569..158aa79275 100644 --- a/res/css/views/elements/_Dropdown.pcss +++ b/res/css/views/elements/_Dropdown.pcss @@ -38,15 +38,11 @@ Please see LICENSE files in the repository root for full details. filter: none; } -.mx_Dropdown_arrow { - width: 16px; - height: 16px; - margin-right: 4px; - mask: url("@vector-im/compound-design-tokens/icons/chevron-down.svg"); - mask-repeat: no-repeat; - mask-position: center; - mask-size: 18px; - background: $primary-content; +svg.mx_Dropdown_arrow { + width: 18px; + height: 18px; + margin-right: 3px; + color: $primary-content; } .mx_Dropdown_option { diff --git a/res/css/views/rooms/_JumpToBottomButton.pcss b/res/css/views/rooms/_JumpToBottomButton.pcss index 912dda0f67..fbcfcf4b9f 100644 --- a/res/css/views/rooms/_JumpToBottomButton.pcss +++ b/res/css/views/rooms/_JumpToBottomButton.pcss @@ -42,21 +42,17 @@ Please see LICENSE files in the repository root for full details. position: relative; display: block; height: 38px; - border-radius: 19px; + border-radius: 50%; box-sizing: border-box; background: $background; border: 1.3px solid var(--cpd-color-icon-tertiary); cursor: pointer; -} -.mx_JumpToBottomButton_scrollDown::before { - content: ""; - position: absolute; - inset: 0; - mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg"); - mask-repeat: no-repeat; - mask-size: 24px; - mask-position: center 6px; - transform: rotate(180deg); - background: var(--cpd-color-icon-tertiary); + svg { + height: inherit; + width: inherit; + box-sizing: border-box; + padding: 7px 8px 7px 6px; + color: var(--cpd-color-icon-tertiary); + } } diff --git a/res/css/views/rooms/_MessageComposerFormatBar.pcss b/res/css/views/rooms/_MessageComposerFormatBar.pcss index 233fda1aff..41a5adad5e 100644 --- a/res/css/views/rooms/_MessageComposerFormatBar.pcss +++ b/res/css/views/rooms/_MessageComposerFormatBar.pcss @@ -38,54 +38,26 @@ Please see LICENSE files in the repository root for full details. vertical-align: middle; background: none; border: none; + padding: 0; + + svg { + width: inherit; + height: inherit; + box-sizing: border-box; + padding: var(--cpd-space-1x); + color: var(--cpd-color-icon-secondary); + } &:hover { background: var(--cpd-color-bg-subtle-secondary); border-radius: 6px; z-index: 1; + + svg { + color: var(--cpd-color-icon-primary); + } } } - - .mx_MessageComposerFormatBar_button::after { - content: ""; - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - mask-repeat: no-repeat; - mask-position: center; - mask-size: 20px; - background-color: var(--cpd-color-icon-secondary); - } - - .mx_MessageComposerFormatBar_button:hover::after { - background-color: var(--cpd-color-icon-primary); - } - - .mx_MessageComposerFormatBar_buttonIconBold::after { - mask-image: url("@vector-im/compound-design-tokens/icons/bold.svg"); - } - - .mx_MessageComposerFormatBar_buttonIconItalic::after { - mask-image: url("@vector-im/compound-design-tokens/icons/italic.svg"); - } - - .mx_MessageComposerFormatBar_buttonIconStrikethrough::after { - mask-image: url("@vector-im/compound-design-tokens/icons/strikethrough.svg"); - } - - .mx_MessageComposerFormatBar_buttonIconQuote::after { - mask-image: url("@vector-im/compound-design-tokens/icons/quote.svg"); - } - - .mx_MessageComposerFormatBar_buttonIconCode::after { - mask-image: url("@vector-im/compound-design-tokens/icons/inline-code.svg"); - } - - .mx_MessageComposerFormatBar_buttonIconInsertLink::after { - mask-image: url("@vector-im/compound-design-tokens/icons/link.svg"); - } } .mx_MessageComposerFormatBar_buttonTooltip { diff --git a/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.pcss b/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.pcss index 82f839042b..d3a5f6178f 100644 --- a/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.pcss +++ b/res/css/views/settings/tabs/user/_SecurityUserSettingsTab.pcss @@ -27,20 +27,11 @@ Please see LICENSE files in the repository root for full details. .mx_SecurityUserSettingsTab_warning { color: $alert; - position: relative; - padding-left: 40px; - &::before { - mask-repeat: no-repeat; - mask-position: 0 center; - mask-size: $font-24px; - position: absolute; - width: $font-24px; - height: $font-24px; - content: ""; - top: 0; - left: 0; - background-color: $alert; - mask-image: url("@vector-im/compound-design-tokens/icons/warning.svg"); + svg { + width: 24px; + height: 24px; + margin-right: var(--cpd-space-4x); + color: $alert; } } diff --git a/src/components/structures/GenericDropdownMenu.tsx b/src/components/structures/GenericDropdownMenu.tsx index 78cd3d3ad4..f76e43c108 100644 --- a/src/components/structures/GenericDropdownMenu.tsx +++ b/src/components/structures/GenericDropdownMenu.tsx @@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details. import classNames from "classnames"; import React, { type JSX, type FunctionComponent, type Key, type PropsWithChildren, type ReactNode } from "react"; +import { ChevronDownIcon, CheckIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { MenuItemRadio } from "../../accessibility/context_menu/MenuItemRadio"; import { type ButtonEvent } from "../views/elements/AccessibleButton"; @@ -42,9 +43,10 @@ export function GenericDropdownMenuOption({ className="mx_GenericDropdownMenu_Option mx_GenericDropdownMenu_Option--item" onClick={onClick} > + {isSelected && }
{label} - {description} + {description && {description}}
{adornment} @@ -202,6 +204,7 @@ export function GenericDropdownMenu({ }} > {selectedLabel(selected)} + {contextMenu} diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 2130f4fa21..4c8329b6dd 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details. import classNames from "classnames"; import React from "react"; +import { SearchIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { ALTERNATE_KEY_NAME } from "../../accessibility/KeyboardShortcuts"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -34,8 +35,6 @@ export default class RoomSearch extends React.PureComponent { "mx_RoomSearch_spotlightTrigger", ); - const icon =
; - const shortcutPrompt = ( {IS_MAC ? "⌘ K" : _t(ALTERNATE_KEY_NAME[Key.CONTROL]) + " K"} @@ -44,7 +43,7 @@ export default class RoomSearch extends React.PureComponent { return ( - {icon} + {!this.props.isMinimized && (
{_t("action|search")}
)} diff --git a/src/components/structures/SpaceHierarchy.tsx b/src/components/structures/SpaceHierarchy.tsx index 9a6fd85bdb..ef4f46df96 100644 --- a/src/components/structures/SpaceHierarchy.tsx +++ b/src/components/structures/SpaceHierarchy.tsx @@ -40,6 +40,7 @@ import classNames from "classnames"; import { sortBy, uniqBy } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; import { KnownMembership, type SpaceChildEventContent } from "matrix-js-sdk/src/types"; +import { ChevronDownIcon, CheckIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { _t } from "../../languageHandler"; @@ -251,7 +252,12 @@ const Tile: React.FC = ({ let joinedSection: ReactElement | undefined; if (joinedRoom) { - joinedSection =
{_t("common|joined")}
; + joinedSection = ( +
+ + {_t("common|joined")} +
+ ); } let suggestedSection: ReactElement | undefined; @@ -294,7 +300,9 @@ const Tile: React.FC = ({ ev.stopPropagation(); toggleShowChildren(); }} - /> + > + +
); if (showChildren) { diff --git a/src/components/views/directory/NetworkDropdown.tsx b/src/components/views/directory/NetworkDropdown.tsx index e46b89578a..71debfff9c 100644 --- a/src/components/views/directory/NetworkDropdown.tsx +++ b/src/components/views/directory/NetworkDropdown.tsx @@ -10,7 +10,6 @@ import { without } from "lodash"; import React, { useCallback, useEffect, useState } from "react"; import { MatrixError } from "matrix-js-sdk/src/matrix"; -import { MenuItemRadio } from "../../../accessibility/context_menu/MenuItemRadio"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Modal from "../../../Modal"; @@ -22,6 +21,7 @@ import { type AdditionalOptionsProps, GenericDropdownMenu, type GenericDropdownMenuItem, + GenericDropdownMenuOption, } from "../../structures/GenericDropdownMenu"; import TextInputDialog from "../dialogs/TextInputDialog"; import AccessibleButton from "../elements/AccessibleButton"; @@ -200,9 +200,8 @@ export const NetworkDropdown: React.FC = ({ protocols, config, setConfig ({ closeMenu }: AdditionalOptionsProps) => ( <> - => { closeMenu(); const { finished } = Modal.createDialog( @@ -229,13 +228,9 @@ export const NetworkDropdown: React.FC = ({ protocols, config, setConfig }); } }} - > -
- - {_t("spotlight|public_rooms|network_dropdown_add_server_option")} - -
-
+ isSelected={false} + label={_t("spotlight|public_rooms|network_dropdown_add_server_option")} + /> ), [allServers, setConfig, setUserDefinedServers, userDefinedServers], diff --git a/src/components/views/elements/Dropdown.tsx b/src/components/views/elements/Dropdown.tsx index 1ab563d43a..cc298cd2a6 100644 --- a/src/components/views/elements/Dropdown.tsx +++ b/src/components/views/elements/Dropdown.tsx @@ -17,6 +17,7 @@ import React, { type Ref, } from "react"; import classnames from "classnames"; +import { ChevronDownIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; import { _t } from "../../../languageHandler"; @@ -411,7 +412,7 @@ export default class Dropdown extends React.Component { onKeyDown={this.onKeyDown} > {currentValue} - + {menu} diff --git a/src/components/views/rooms/JumpToBottomButton.tsx b/src/components/views/rooms/JumpToBottomButton.tsx index b2a69cb5fe..7ea7a7c692 100644 --- a/src/components/views/rooms/JumpToBottomButton.tsx +++ b/src/components/views/rooms/JumpToBottomButton.tsx @@ -7,6 +7,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; +import { ChevronDownIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../languageHandler"; import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; @@ -32,7 +33,9 @@ const JumpToBottomButton: React.FC = (props) => { className="mx_JumpToBottomButton_scrollDown" title={_t("room|jump_to_bottom_button")} onClick={props.onScrollToBottomClick} - /> + > + + {badge} ); diff --git a/src/components/views/rooms/MessageComposerFormatBar.tsx b/src/components/views/rooms/MessageComposerFormatBar.tsx index 855c7c1d40..0957aa9721 100644 --- a/src/components/views/rooms/MessageComposerFormatBar.tsx +++ b/src/components/views/rooms/MessageComposerFormatBar.tsx @@ -6,8 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com Please see LICENSE files in the repository root for full details. */ -import React, { createRef } from "react"; +import React, { createRef, type JSX } from "react"; import classNames from "classnames"; +import { + BoldIcon, + ItalicIcon, + StrikethroughIcon, + InlineCodeIcon, + QuoteIcon, + LinkIcon, +} from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../languageHandler"; import { RovingAccessibleButton } from "../../../accessibility/RovingTabIndex"; @@ -54,41 +62,41 @@ export default class MessageComposerFormatBar extends React.PureComponent this.props.onAction(Formatting.Bold)} - icon="Bold" + icon={} shortcut={this.props.shortcuts.bold} visible={this.state.visible} /> this.props.onAction(Formatting.Italics)} - icon="Italic" + icon={} shortcut={this.props.shortcuts.italics} visible={this.state.visible} /> this.props.onAction(Formatting.Strikethrough)} - icon="Strikethrough" + icon={} visible={this.state.visible} /> this.props.onAction(Formatting.Code)} - icon="Code" + icon={} shortcut={this.props.shortcuts.code} visible={this.state.visible} /> this.props.onAction(Formatting.Quote)} - icon="Quote" + icon={} shortcut={this.props.shortcuts.quote} visible={this.state.visible} /> this.props.onAction(Formatting.InsertLink)} - icon="InsertLink" + icon={} shortcut={this.props.shortcuts.insert_link} visible={this.state.visible} /> @@ -116,7 +124,7 @@ export default class MessageComposerFormatBar extends React.PureComponent { public render(): React.ReactNode { - const className = `mx_MessageComposerFormatBar_button mx_MessageComposerFormatBar_buttonIcon${this.props.icon}`; - // element="button" and type="button" are necessary for the buttons to work on WebKit, // otherwise the text is deselected before onClick can ever be called return ( @@ -136,8 +142,10 @@ class FormatButton extends React.PureComponent { aria-label={this.props.label} title={this.props.label} caption={this.props.shortcut} - className={className} - /> + className="mx_MessageComposerFormatBar_button" + > + {this.props.icon} + ); } } diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index 1c85aada34..c0e63f6f04 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -11,6 +11,7 @@ import { sleep } from "matrix-js-sdk/src/utils"; import { type Room, RoomEvent, type IServerVersions } from "matrix-js-sdk/src/matrix"; import { KnownMembership, type Membership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; +import { WarningIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../../../languageHandler"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; @@ -305,6 +306,7 @@ export default class SecurityUserSettingsTab extends React.Component + {_t("settings|security|e2ee_default_disabled_warning")} ); diff --git a/src/components/views/spaces/QuickSettingsButton.tsx b/src/components/views/spaces/QuickSettingsButton.tsx index 1bde2afef9..95171bb957 100644 --- a/src/components/views/spaces/QuickSettingsButton.tsx +++ b/src/components/views/spaces/QuickSettingsButton.tsx @@ -13,7 +13,9 @@ import { UserProfileSolidIcon, FavouriteSolidIcon, PinSolidIcon, + SettingsSolidIcon, } from "@vector-im/compound-design-tokens/assets/web/icons"; +import { IconButton, Text, Tooltip } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; import ContextMenu, { alwaysAboveRightOf, ChevronFace, useContextMenu } from "../../structures/ContextMenu"; @@ -34,7 +36,7 @@ import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement"; const QuickSettingsButton: React.FC<{ isPanelCollapsed: boolean; }> = ({ isPanelCollapsed = false }) => { - const [menuDisplayed, handle, openMenu, closeMenu] = useContextMenu(); + const [menuDisplayed, handle, openMenu, closeMenu] = useContextMenu(); const { [MetaSpace.Favourites]: favouritesEnabled, [MetaSpace.People]: peopleEnabled } = useSettingValue("Spaces.enabledMetaSpaces"); @@ -136,6 +138,35 @@ const QuickSettingsButton: React.FC<{ ); } + let button = ( + + <> + + {/* This is dirty, but we need to add the label to the indicator icon */} + {!isPanelCollapsed && ( + + {_t("common|settings")} + + )} + + + ); + + if (isPanelCollapsed) { + button = ( + + {button} + + ); + } + return ( <> - - {!isPanelCollapsed ? _t("common|settings") : null} - + {button} {contextMenu} diff --git a/test/unit-tests/components/structures/GenericDropdownMenu-test.tsx b/test/unit-tests/components/structures/GenericDropdownMenu-test.tsx new file mode 100644 index 0000000000..e2ea1c5a75 --- /dev/null +++ b/test/unit-tests/components/structures/GenericDropdownMenu-test.tsx @@ -0,0 +1,48 @@ +/* +Copyright 2025 Element Creations Ltd. + +SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial +Please see LICENSE files in the repository root for full details. +*/ + +import React from "react"; +import { render, screen, fireEvent } from "jest-matrix-react"; + +import { + GenericDropdownMenu, + type GenericDropdownMenuItem, +} from "../../../../src/components/structures/GenericDropdownMenu.tsx"; + +describe("GenericDropdownMenu", () => { + it("should render check icon for checked option", async () => { + const options: GenericDropdownMenuItem[] = [ + { + key: "selected", + label: "Selected", + description: "This item is selected", + }, + { + key: "not-selected", + label: "Not selected", + }, + ]; + + render( + "Selected"} + />, + ); + + const trigger = screen.getByRole("button"); + fireEvent.click(trigger); + + const dropdown = await screen.findByRole("menu"); + expect( + dropdown.querySelector('[aria-checked="true"]')?.querySelector(".mx_GenericDropdownMenu_Option--checkIcon"), + ).toBeTruthy(); + expect(dropdown).toMatchSnapshot(); + }); +}); diff --git a/test/unit-tests/components/structures/__snapshots__/GenericDropdownMenu-test.tsx.snap b/test/unit-tests/components/structures/__snapshots__/GenericDropdownMenu-test.tsx.snap new file mode 100644 index 0000000000..e7e2c8618a --- /dev/null +++ b/test/unit-tests/components/structures/__snapshots__/GenericDropdownMenu-test.tsx.snap @@ -0,0 +1,52 @@ +// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing + +exports[`GenericDropdownMenu should render check icon for checked option 1`] = ` + +`; diff --git a/test/unit-tests/components/structures/__snapshots__/MatrixChat-test.tsx.snap b/test/unit-tests/components/structures/__snapshots__/MatrixChat-test.tsx.snap index 5aa149d284..d5ed4f79ce 100644 --- a/test/unit-tests/components/structures/__snapshots__/MatrixChat-test.tsx.snap +++ b/test/unit-tests/components/structures/__snapshots__/MatrixChat-test.tsx.snap @@ -162,9 +162,18 @@ exports[` Multi-tab lockout waits for other tab to stop during sta English - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + @@ -278,9 +287,18 @@ exports[` with a soft-logged-out session should show the soft-logo English - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap b/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap index ac25954916..b1bafda8ed 100644 --- a/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap +++ b/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap @@ -390,46 +390,118 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] = >
renders 1`] = `
+ > + + + +
should not render cycles 1`] = `
+ > + + + +
for a private room should create a private room 1` Private room (invite only)
- + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + +

@@ -277,9 +286,18 @@ exports[` for a private room should render not the advanced Private room (invite only) - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + +

diff --git a/test/unit-tests/components/views/elements/__snapshots__/Dropdown-test.tsx.snap b/test/unit-tests/components/views/elements/__snapshots__/Dropdown-test.tsx.snap index f5f364dd1c..5f399616c0 100644 --- a/test/unit-tests/components/views/elements/__snapshots__/Dropdown-test.tsx.snap +++ b/test/unit-tests/components/views/elements/__snapshots__/Dropdown-test.tsx.snap @@ -21,9 +21,18 @@ exports[` renders with placeholder 1`] = ` > Select an option - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/elements/__snapshots__/FilterDropdown-test.tsx.snap b/test/unit-tests/components/views/elements/__snapshots__/FilterDropdown-test.tsx.snap index 607d2ae7c2..5d76e95d24 100644 --- a/test/unit-tests/components/views/elements/__snapshots__/FilterDropdown-test.tsx.snap +++ b/test/unit-tests/components/views/elements/__snapshots__/FilterDropdown-test.tsx.snap @@ -83,9 +83,18 @@ exports[` renders selected option 1`] = ` > Option one - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + @@ -112,9 +121,18 @@ exports[` renders selected option with selectedLabel 1`] = ` > Show: Option one - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + @@ -139,9 +157,18 @@ exports[` renders when selected option is not in options 1`] = class="mx_Dropdown_option" id="test_value" /> - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/elements/__snapshots__/SettingsDropdown-test.tsx.snap b/test/unit-tests/components/views/elements/__snapshots__/SettingsDropdown-test.tsx.snap index 8d98da68e5..2ecb0a7038 100644 --- a/test/unit-tests/components/views/elements/__snapshots__/SettingsDropdown-test.tsx.snap +++ b/test/unit-tests/components/views/elements/__snapshots__/SettingsDropdown-test.tsx.snap @@ -38,9 +38,18 @@ exports[` should render a disabled setting 1`] = ` No - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/elements/__snapshots__/SpellCheckLanguagesDropdown-test.tsx.snap b/test/unit-tests/components/views/elements/__snapshots__/SpellCheckLanguagesDropdown-test.tsx.snap index 749cf07733..d558bf3192 100644 --- a/test/unit-tests/components/views/elements/__snapshots__/SpellCheckLanguagesDropdown-test.tsx.snap +++ b/test/unit-tests/components/views/elements/__snapshots__/SpellCheckLanguagesDropdown-test.tsx.snap @@ -23,9 +23,18 @@ exports[` renders as expected 1`] = ` English - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/settings/__snapshots__/AddRemoveThreepids-test.tsx.snap b/test/unit-tests/components/views/settings/__snapshots__/AddRemoveThreepids-test.tsx.snap index 6a5635cdb6..c77a16ed7f 100644 --- a/test/unit-tests/components/views/settings/__snapshots__/AddRemoveThreepids-test.tsx.snap +++ b/test/unit-tests/components/views/settings/__snapshots__/AddRemoveThreepids-test.tsx.snap @@ -140,9 +140,18 @@ exports[`AddRemoveThreepids should render phone numbers 1`] = ` +1 - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/AccountUserSettingsTab-test.tsx.snap b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/AccountUserSettingsTab-test.tsx.snap index e5af42d8f8..c6a31f0b12 100644 --- a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/AccountUserSettingsTab-test.tsx.snap +++ b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/AccountUserSettingsTab-test.tsx.snap @@ -137,9 +137,18 @@ exports[` 3pids should display 3pid email addresses an +1 - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap index 65b8049fc1..6fb3eec888 100644 --- a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap +++ b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap @@ -247,9 +247,18 @@ exports[`PreferencesUserSettingsTab should render 1`] = ` > Browser default (UTC) - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap index 34ca53a684..a0d4a13c70 100644 --- a/test/unit-tests/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap +++ b/test/unit-tests/components/views/settings/tabs/user/__snapshots__/SessionManagerTab-test.tsx.snap @@ -451,9 +451,18 @@ exports[` goes to filtered list from security recommendatio > Show: Unverified - + fill="currentColor" + height="1em" + viewBox="0 0 24 24" + width="1em" + xmlns="http://www.w3.org/2000/svg" + > + + diff --git a/test/unit-tests/components/views/spaces/QuickSettingsButton-test.tsx b/test/unit-tests/components/views/spaces/QuickSettingsButton-test.tsx index af3fe770ff..7ca3d573bb 100644 --- a/test/unit-tests/components/views/spaces/QuickSettingsButton-test.tsx +++ b/test/unit-tests/components/views/spaces/QuickSettingsButton-test.tsx @@ -28,7 +28,7 @@ describe("QuickSettingsButton", () => { const openQuickSettings = async () => { await userEvent.click(getQuickSettingsButton()); - await screen.findByText("Quick settings"); + await screen.findByRole("heading", { name: "Quick settings" }); }; it("should render the quick settings button", () => { diff --git a/test/unit-tests/components/views/spaces/__snapshots__/QuickSettingsButton-test.tsx.snap b/test/unit-tests/components/views/spaces/__snapshots__/QuickSettingsButton-test.tsx.snap index 66f686449c..c1e8027d2b 100644 --- a/test/unit-tests/components/views/spaces/__snapshots__/QuickSettingsButton-test.tsx.snap +++ b/test/unit-tests/components/views/spaces/__snapshots__/QuickSettingsButton-test.tsx.snap @@ -2,15 +2,38 @@ exports[`QuickSettingsButton should render the quick settings button in expanded mode 1`] = ` -

- Settings -
+
+ + + + + Settings + +
+ `; diff --git a/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap b/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap index 56859965d2..1b15e90960 100644 --- a/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap +++ b/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap @@ -266,14 +266,34 @@ exports[` should show all activated MetaSpaces in the correct orde -