Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Use semantic headings in user settings Appearance #10827

Merged
merged 37 commits into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
036e1f9
split SettingsSection out of SettingsTab, replace usage
Apr 28, 2023
8e4f061
correct copyright
Apr 28, 2023
77f046e
use semantic headings in GeneralRoomSettingsTab
Apr 28, 2023
2b251b4
use SettingsTab and SettingsSubsection in room settings
Apr 28, 2023
7d94b71
fix VoipRoomSettingsTab
Apr 28, 2023
d011479
Merge branch 'kerry/24922/settings-section-component' into kerry/2492…
Apr 28, 2023
0bf54f3
Merge branch 'develop' into kerry/24922/room-settings-headings
Apr 30, 2023
7354c05
use SettingsSection components in space settings
May 1, 2023
0d0aed5
settingssubsection text component
May 1, 2023
8086361
use semantic headings in HelpUserSetttings tab
May 1, 2023
f7cc24f
use ExternalLink components for external links
May 2, 2023
8e74b74
test
May 2, 2023
4519726
strict
May 2, 2023
74789d9
Merge branch 'develop' into kerry/24932/use-external-link
May 2, 2023
7eca36f
Merge branch 'develop' into kerry/24932/use-external-link
May 3, 2023
9dbe2ce
Merge branch 'kerry/24932/use-external-link' into kerry/24922/user-se…
May 3, 2023
5ff3266
lint
May 3, 2023
fb1ace5
semantic heading in labs settings
May 3, 2023
ea5edeb
semantic headings in keyboard settings tab
May 3, 2023
3a28816
semantic heading in preferencesusersettingstab
May 3, 2023
50d7629
tidying
May 3, 2023
d466887
use new settings components in eventindexpanel
May 3, 2023
953b6db
Merge branch 'develop' into kerry/24922/user-settings-headings-1
May 3, 2023
de109c6
Merge branch 'kerry/24922/user-settings-headings-1' into kerry/24922/…
May 3, 2023
e1d7ab5
Merge branch 'develop' into kerry/24922/user-settings-headings-labs
May 4, 2023
5cf9071
findByTestId
May 4, 2023
6d2d8ca
prettier
May 4, 2023
ff66c05
Merge branch 'kerry/24922/user-settings-headings-labs' into kerry/249…
May 4, 2023
3a78757
semantic headings and style refresh for crypto settings
May 4, 2023
da0cf93
Merge branch 'kerry/24922/user-settings-headings-security' of https:/…
May 4, 2023
7b04972
e2e panel
May 4, 2023
cfdb774
use semantic headings in User settings appearance tab
May 9, 2023
4ac8e0d
Merge branch 'develop' into kerry/24922/user-settings-headings-appear…
May 19, 2023
410d51d
update selectors in tests
May 19, 2023
6c3b18e
tidy
May 19, 2023
97e0cda
Merge branch 'develop' into kerry/24922/user-settings-headings-appear…
May 19, 2023
248d1a0
Merge branch 'develop' into kerry/24922/user-settings-headings-appear…
May 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/e2e/audio-player/audio-player.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe("Audio player", () => {

// Enable high contrast manually
cy.openUserSettings("Appearance")
.get(".mx_ThemeChoicePanel")
.findByTestId("mx_ThemeChoicePanel")
.findByLabelText("Use high contrast")
.click({ force: true }); // force click because the size of the checkbox is zero

Expand Down
53 changes: 21 additions & 32 deletions cypress/e2e/settings/appearance-user-settings-tab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ describe("Appearance user settings tab", () => {
it("should be rendered properly", () => {
cy.openUserSettings("Appearance");

cy.get(".mx_SettingsTab.mx_AppearanceUserSettingsTab").within(() => {
// Assert that the top heading is rendered
cy.findByTestId("appearance").should("have.text", "Customise your appearance").should("be.visible");
cy.findByTestId("mx_AppearanceUserSettingsTab").within(() => {
cy.get("h2").should("have.text", "Customise your appearance").should("be.visible");
});

cy.get(".mx_SettingsTab.mx_AppearanceUserSettingsTab").percySnapshotElement(
cy.findByTestId("mx_AppearanceUserSettingsTab").percySnapshotElement(
"User settings tab - Appearance (advanced options collapsed)",
{
// Emulate TabbedView's actual min and max widths
Expand All @@ -57,7 +56,7 @@ describe("Appearance user settings tab", () => {
// Assert that "Hide advanced" link button is rendered
cy.findByRole("button", { name: "Hide advanced" }).should("exist");

cy.get(".mx_SettingsTab.mx_AppearanceUserSettingsTab").percySnapshotElement(
cy.findByTestId("mx_AppearanceUserSettingsTab").percySnapshotElement(
"User settings tab - Appearance (advanced options expanded)",
{
// Emulate TabbedView's actual min and max widths
Expand All @@ -74,7 +73,7 @@ describe("Appearance user settings tab", () => {

cy.openUserSettings("Appearance");

cy.get(".mx_AppearanceUserSettingsTab .mx_LayoutSwitcher_RadioButtons").within(() => {
cy.get(".mx_LayoutSwitcher_RadioButtons").within(() => {
// Assert that the layout selected by default is "Modern"
cy.get(".mx_LayoutSwitcher_RadioButton_selected .mx_StyledRadioButton_enabled").within(() => {
cy.findByLabelText("Modern").should("exist");
Expand All @@ -84,7 +83,7 @@ describe("Appearance user settings tab", () => {
// Assert that the room layout is set to group (modern) layout
cy.get(".mx_RoomView_body[data-layout='group']").should("exist");

cy.get(".mx_AppearanceUserSettingsTab .mx_LayoutSwitcher_RadioButtons").within(() => {
cy.get(".mx_LayoutSwitcher_RadioButtons").within(() => {
// Select the first layout
cy.get(".mx_LayoutSwitcher_RadioButton").first().click();

Expand All @@ -97,7 +96,7 @@ describe("Appearance user settings tab", () => {
// Assert that the room layout is set to IRC layout
cy.get(".mx_RoomView_body[data-layout='irc']").should("exist");

cy.get(".mx_AppearanceUserSettingsTab .mx_LayoutSwitcher_RadioButtons").within(() => {
cy.get(".mx_LayoutSwitcher_RadioButtons").within(() => {
// Select the last layout
cy.get(".mx_LayoutSwitcher_RadioButton").last().click();

Expand All @@ -114,7 +113,7 @@ describe("Appearance user settings tab", () => {
it("should support changing font size by clicking the font slider", () => {
cy.openUserSettings("Appearance");

cy.get(".mx_SettingsTab.mx_AppearanceUserSettingsTab").within(() => {
cy.findByTestId("mx_AppearanceUserSettingsTab").within(() => {
cy.get(".mx_FontScalingPanel_fontSlider").within(() => {
cy.findByLabelText("Font size").should("exist");
});
Expand Down Expand Up @@ -150,7 +149,7 @@ describe("Appearance user settings tab", () => {
it("should disable font size slider when custom font size is used", () => {
cy.openUserSettings("Appearance");

cy.get(".mx_FontScalingPanel").within(() => {
cy.findByTestId("mx_FontScalingPanel").within(() => {
cy.findByLabelText("Use custom size").click({ force: true }); // force click as checkbox size is zero

// Assert that the font slider is disabled
Expand All @@ -167,24 +166,16 @@ describe("Appearance user settings tab", () => {
// Click "Show advanced" link button
cy.findByRole("button", { name: "Show advanced" }).click();

cy.get(".mx_AppearanceUserSettingsTab_Advanced").within(() => {
// force click as checkbox size is zero
cy.findByLabelText("Use a more compact 'Modern' layout").click({ force: true });
});
// force click as checkbox size is zero
cy.findByLabelText("Use a more compact 'Modern' layout").click({ force: true });

// Assert that the room layout is set to compact group (modern) layout
cy.get("#matrixchat .mx_MatrixChat_wrapper.mx_MatrixChat_useCompactLayout").should("exist");
});

it("should disable compact group (modern) layout option on IRC layout and bubble layout", () => {
const checkDisabled = () => {
cy.get(".mx_AppearanceUserSettingsTab_Advanced").within(() => {
cy.get(".mx_Checkbox")
.first()
.within(() => {
cy.get("input[type='checkbox'][disabled]").should("exist");
});
});
cy.findByLabelText("Use a more compact 'Modern' layout").should("be.disabled");
};

cy.openUserSettings("Appearance");
Expand All @@ -193,7 +184,7 @@ describe("Appearance user settings tab", () => {
cy.findByRole("button", { name: "Show advanced" }).click();

// Enable IRC layout
cy.get(".mx_AppearanceUserSettingsTab .mx_LayoutSwitcher_RadioButtons").within(() => {
cy.get(".mx_LayoutSwitcher_RadioButtons").within(() => {
// Select the first layout
cy.get(".mx_LayoutSwitcher_RadioButton").first().click();

Expand All @@ -206,7 +197,7 @@ describe("Appearance user settings tab", () => {
checkDisabled();

// Enable bubble layout
cy.get(".mx_AppearanceUserSettingsTab .mx_LayoutSwitcher_RadioButtons").within(() => {
cy.get(".mx_LayoutSwitcher_RadioButtons").within(() => {
// Select the first layout
cy.get(".mx_LayoutSwitcher_RadioButton").last().click();

Expand All @@ -225,10 +216,8 @@ describe("Appearance user settings tab", () => {
// Click "Show advanced" link button
cy.findByRole("button", { name: "Show advanced" }).click();

cy.get(".mx_AppearanceUserSettingsTab_Advanced").within(() => {
// force click as checkbox size is zero
cy.findByLabelText("Use a system font").click({ force: true });
});
// force click as checkbox size is zero
cy.findByLabelText("Use a system font").click({ force: true });

// Assert that the font-family value was removed
cy.get("body").should("have.css", "font-family", '""');
Expand All @@ -242,7 +231,7 @@ describe("Appearance user settings tab", () => {

it("should be rendered with the light theme selected", () => {
cy.openUserSettings("Appearance")
.get(".mx_ThemeChoicePanel")
.findByTestId("mx_ThemeChoicePanel")
.within(() => {
cy.findByTestId("checkbox-use-system-theme").within(() => {
cy.findByText("Match system theme").should("be.visible");
Expand All @@ -252,7 +241,7 @@ describe("Appearance user settings tab", () => {
cy.get(".mx_Checkbox_checkmark").should("not.be.visible");
});

cy.get(".mx_ThemeSelectors").within(() => {
cy.findByTestId("theme-choice-panel-selectors").within(() => {
cy.get(".mx_ThemeSelector_light").should("exist");
cy.get(".mx_ThemeSelector_dark").should("exist");

Expand All @@ -274,11 +263,11 @@ describe("Appearance user settings tab", () => {
"the system theme is clicked",
() => {
cy.openUserSettings("Appearance")
.get(".mx_ThemeChoicePanel")
.findByTestId("mx_ThemeChoicePanel")
.findByLabelText("Match system theme")
.click({ force: true }); // force click because the size of the checkbox is zero

cy.get(".mx_ThemeChoicePanel").within(() => {
cy.findByTestId("mx_ThemeChoicePanel").within(() => {
// Assert that the labels for the light theme and dark theme are disabled
cy.get(".mx_ThemeSelector_light.mx_StyledRadioButton_disabled").should("exist");
cy.get(".mx_ThemeSelector_dark.mx_StyledRadioButton_disabled").should("exist");
Expand Down Expand Up @@ -321,7 +310,7 @@ describe("Appearance user settings tab", () => {
});

cy.openUserSettings("Appearance")
.get(".mx_ThemeChoicePanel")
.findByTestId("mx_ThemeChoicePanel")
.findByLabelText("Use high contrast")
.click({ force: true }); // force click because the size of the checkbox is zero

Expand Down
1 change: 0 additions & 1 deletion res/css/_components.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
@import "./views/elements/_Dropdown.pcss";
@import "./views/elements/_EditableItemList.pcss";
@import "./views/elements/_ErrorBoundary.pcss";
@import "./views/elements/_EventTilePreview.pcss";
@import "./views/elements/_ExternalLink.pcss";
@import "./views/elements/_FacePile.pcss";
@import "./views/elements/_Field.pcss";
Expand Down
21 changes: 0 additions & 21 deletions res/css/views/elements/_EventTilePreview.pcss

This file was deleted.

83 changes: 34 additions & 49 deletions res/css/views/settings/_FontScalingPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,48 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_FontScalingPanel {
color: $primary-content;
.mx_FontScalingPanel_preview {
--FontScalingPanel_preview-padding-block: 9px;

.mx_FontScalingPanel_preview,
.mx_FontScalingPanel_fontSlider {
margin-inline-end: var(--SettingsTab_fullWidthField-margin-inline-end);
}

.mx_FontScalingPanel_preview {
--FontScalingPanel_preview-padding-block: 9px;

border: 1px solid $quinary-content;
border-radius: 10px;
padding: 0 $spacing-16 var(--FontScalingPanel_preview-padding-block) $spacing-16;
pointer-events: none;
display: flow-root;

&.mx_IRCLayout {
padding-top: 9px; /* TODO: Use a spacing variable */
}

.mx_EventTile[data-layout="bubble"] {
margin-top: 30px; /* TODO: Use a spacing variable */
}
border: 1px solid $quinary-content;
border-radius: 10px;
padding: 0 $spacing-16 var(--FontScalingPanel_preview-padding-block) $spacing-16;
pointer-events: none;
display: flow-root;

.mx_EventTile_msgOption {
display: none;
}
&.mx_IRCLayout {
padding-top: 9px; /* TODO: Use a spacing variable */
}

.mx_FontScalingPanel_fontSlider {
display: flex;
align-items: center;
padding: 15px $spacing-20 35px; /* TODO: Use spacing variables */
background: rgba($quinary-content, 0.2);
border-radius: 10px;
font-size: $font-10px;
margin-top: $spacing-24;
margin-bottom: $spacing-24;
.mx_EventTile[data-layout="bubble"] {
margin-top: 30px; /* TODO: Use a spacing variable */
}

.mx_FontScalingPanel_fontSlider_smallText,
.mx_FontScalingPanel_fontSlider_largeText {
font-weight: 500;
}
.mx_EventTile_msgOption {
display: none;
}
}

.mx_FontScalingPanel_fontSlider_smallText {
font-size: $font-15px;
padding-inline-end: $spacing-20;
}
.mx_FontScalingPanel_fontSlider {
display: flex;
align-items: center;
padding: 15px $spacing-20 35px; /* TODO: Use spacing variables */
background: rgba($quinary-content, 0.2);
border-radius: 10px;
font-size: $font-10px;

.mx_FontScalingPanel_fontSlider_smallText,
.mx_FontScalingPanel_fontSlider_largeText {
font-weight: 500;
}

.mx_FontScalingPanel_fontSlider_largeText {
font-size: $font-18px;
padding-inline-start: $spacing-20;
}
.mx_FontScalingPanel_fontSlider_smallText {
font-size: $font-15px;
padding-inline-end: $spacing-20;
}

.mx_FontScalingPanel_customFontSizeField {
margin-inline-start: var(--AppearanceUserSettingsTab_Field-margin-inline-start);
.mx_FontScalingPanel_fontSlider_largeText {
font-size: $font-18px;
padding-inline-start: $spacing-20;
}
}
47 changes: 22 additions & 25 deletions res/css/views/settings/_ImageSizePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,31 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_ImageSizePanel {
color: $primary-content;

.mx_ImageSizePanel_radios {
display: flex;
margin-top: 16px; /* move away from header a bit */
.mx_ImageSizePanel_radios {
display: flex;
flex-direction: row;
gap: $spacing-16;

> label {
margin-right: 68px; /* keep the boxes separate */
cursor: pointer;
}

> label {
margin-right: 68px; /* keep the boxes separate */
cursor: pointer;
.mx_ImageSizePanel_size {
background-color: $quinary-content;
mask-repeat: no-repeat;
mask-size: 221px;
mask-position: center;
width: 221px;
height: 148px;
margin-bottom: 14px; /* move radio button away from bottom edge a bit */

&.mx_ImageSizePanel_sizeDefault {
mask: url("$(res)/img/element-icons/settings/img-size-normal.svg");
}

.mx_ImageSizePanel_size {
background-color: $quinary-content;
mask-repeat: no-repeat;
mask-size: 221px;
mask-position: center;
width: 221px;
height: 148px;
margin-bottom: 14px; /* move radio button away from bottom edge a bit */

&.mx_ImageSizePanel_sizeDefault {
mask: url("$(res)/img/element-icons/settings/img-size-normal.svg");
}

&.mx_ImageSizePanel_sizeLarge {
mask: url("$(res)/img/element-icons/settings/img-size-large.svg");
}
&.mx_ImageSizePanel_sizeLarge {
mask: url("$(res)/img/element-icons/settings/img-size-large.svg");
}
}
}
Loading