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

Commit 2a77800

Browse files
author
Germain
authored
Compound Typography pass regression fixes (#11189)
* Compound Typography pass regression fixes * updates to the room list sizing * fix subtitle clipping * revert display name to use medium variant
1 parent 3ad9a8f commit 2a77800

32 files changed

+50
-44
lines changed

res/css/components/views/settings/shared/_SettingsSubsection.pcss

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ limitations under the License.
2626
.mx_SettingsSubsection_text {
2727
width: 100%;
2828
box-sizing: inherit;
29-
font-size: $font-15px;
3029
color: $secondary-content;
3130
}
3231

res/css/views/rooms/_RoomTile.pcss

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ limitations under the License.
2424
contain: content; /* Not strict as it will break when resizing a sublist vertically */
2525
box-sizing: border-box;
2626

27-
font-size: $font-13px;
27+
font-size: var(--cpd-font-size-body-sm);
2828

2929
&.mx_RoomTile_selected,
3030
&:hover,
@@ -60,7 +60,7 @@ limitations under the License.
6060
color: $secondary-content;
6161
display: flex;
6262
gap: $spacing-4;
63-
line-height: $font-18px;
63+
line-height: 1.2;
6464
}
6565

6666
.mx_RoomTile_title,
@@ -71,15 +71,17 @@ limitations under the License.
7171
}
7272

7373
.mx_RoomTile_title {
74-
font: var(--cpd-font-heading-sm-medium);
74+
font: var(--cpd-font-body-md-regular);
75+
line-height: 1;
7576

7677
&.mx_RoomTile_titleHasUnreadEvents {
7778
font-weight: var(--cpd-font-weight-semibold);
7879
}
7980
}
8081

8182
.mx_RoomTile_titleWithSubtitle {
82-
margin-top: -3px; /* shift the title up a bit more */
83+
margin-top: -2px; /* shift the title up a bit more */
84+
margin-bottom: 1px;
8385
}
8486
}
8587

res/css/views/settings/_NotificationSettings2.pcss

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ limitations under the License.
6969

7070
.mx_Tag {
7171
border-radius: 18px;
72-
line-height: 2.4rem;
7372
padding: 6px 12px;
7473
background: $panel-actions;
7574
margin: 0;

res/css/views/settings/tabs/_SettingsSection.pcss

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
.mx_SettingsSection {
1818
--SettingsTab_section-margin-bottom-preferences-labs: 30px;
1919
--SettingsTab_heading_nth_child-margin-top: 30px;
20-
--SettingsTab_tooltip-max-width: 120px; /* So it fits in the space provided by the page */
20+
--SettingsTab_tooltip-max-width: 20px; /* So it fits in the space provided by the page */
2121

2222
color: $primary-content;
2323

src/components/views/dialogs/BaseDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ export default class BaseDialog extends React.Component<IProps> {
174174
>
175175
{!!(this.props.title || headerImage) && (
176176
<Heading
177+
size="3"
177178
as="h2"
178-
size="4"
179179
className={classNames("mx_Dialog_title", this.props.titleClass)}
180180
id="mx_BaseDialog_title"
181181
>

src/components/views/rooms/RoomTileSubtitle.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const RoomTileSubtitle: React.FC<Props> = ({
5757
"mx_RoomTile_subtitle--thread-reply": messagePreview.isThreadReply,
5858
});
5959

60-
const icon = messagePreview.isThreadReply ? <ThreadIcon className="mx_Icon mx_Icon_16" /> : null;
60+
const icon = messagePreview.isThreadReply ? <ThreadIcon className="mx_Icon mx_Icon_12" /> : null;
6161

6262
return (
6363
<div className={className} id={messagePreviewId(roomId)} title={messagePreview.text}>

src/components/views/settings/shared/SettingsSection.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ export interface SettingsSectionProps extends HTMLAttributes<HTMLDivElement> {
4343
*/
4444
export const SettingsSection: React.FC<SettingsSectionProps> = ({ className, heading, children, ...rest }) => (
4545
<div {...rest} className={classnames("mx_SettingsSection", className)}>
46-
{typeof heading === "string" ? <Heading size="2">{heading}</Heading> : <>{heading}</>}
46+
{typeof heading === "string" ? (
47+
<Heading as="h2" size="3">
48+
{heading}
49+
</Heading>
50+
) : (
51+
<>{heading}</>
52+
)}
4753
<div className="mx_SettingsSection_subSections">{children}</div>
4854
</div>
4955
);

test/components/structures/__snapshots__/MatrixChat-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports[`<MatrixChat /> with an existing session onAction() room actions leave_r
3232
class="mx_Dialog_header mx_Dialog_headerWithCancel"
3333
>
3434
<h2
35-
class="mx_Heading_h4 mx_Dialog_title"
35+
class="mx_Heading_h3 mx_Dialog_title"
3636
id="mx_BaseDialog_title"
3737
>
3838
Leave room
@@ -89,7 +89,7 @@ exports[`<MatrixChat /> with an existing session onAction() room actions leave_r
8989
class="mx_Dialog_header mx_Dialog_headerWithCancel"
9090
>
9191
<h2
92-
class="mx_Heading_h4 mx_Dialog_title"
92+
class="mx_Heading_h3 mx_Dialog_title"
9393
id="mx_BaseDialog_title"
9494
>
9595
Leave space

test/components/views/dialogs/UserSettingsDialog-test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("<UserSettingsDialog />", () => {
7575
const getActiveTabLabel = (container: Element) =>
7676
container.querySelector(".mx_TabbedView_tabLabel_active")?.textContent;
7777
const getActiveTabHeading = (container: Element) =>
78-
container.querySelector(".mx_SettingsSection .mx_Heading_h2")?.textContent;
78+
container.querySelector(".mx_SettingsSection .mx_Heading_h3")?.textContent;
7979

8080
it("should render general settings tab when no initialTabId", () => {
8181
const { container } = render(getComponent());

test/components/views/dialogs/__snapshots__/ChangelogDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`<ChangelogDialog /> should fetch github proxy url for each repo with ol
1818
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1919
>
2020
<h2
21-
class="mx_Heading_h4 mx_Dialog_title"
21+
class="mx_Heading_h3 mx_Dialog_title"
2222
id="mx_BaseDialog_title"
2323
>
2424
Changelog

test/components/views/dialogs/__snapshots__/DevtoolsDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`DevtoolsDialog renders the devtools dialog 1`] = `
1717
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1818
>
1919
<h2
20-
class="mx_Heading_h4 mx_Dialog_title"
20+
class="mx_Heading_h3 mx_Dialog_title"
2121
id="mx_BaseDialog_title"
2222
>
2323
Developer Tools

test/components/views/dialogs/__snapshots__/ExportDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`<ExportDialog /> renders export dialog 1`] = `
1212
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1313
>
1414
<h2
15-
class="mx_Heading_h4 mx_Dialog_title"
15+
class="mx_Heading_h3 mx_Dialog_title"
1616
id="mx_BaseDialog_title"
1717
>
1818
Export Chat

test/components/views/dialogs/__snapshots__/FeedbackDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`FeedbackDialog should respect feedback config 1`] = `
1818
class="mx_Dialog_header"
1919
>
2020
<h2
21-
class="mx_Heading_h4 mx_Dialog_title"
21+
class="mx_Heading_h3 mx_Dialog_title"
2222
id="mx_BaseDialog_title"
2323
>
2424
Feedback

test/components/views/dialogs/__snapshots__/ManualDeviceKeyVerificationDialog-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`ManualDeviceKeyVerificationDialog should display the device 1`] = `
1818
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1919
>
2020
<h2
21-
class="mx_Heading_h4 mx_Dialog_title"
21+
class="mx_Heading_h3 mx_Dialog_title"
2222
id="mx_BaseDialog_title"
2323
>
2424
Verify session
@@ -133,7 +133,7 @@ exports[`ManualDeviceKeyVerificationDialog should display the device of another
133133
class="mx_Dialog_header mx_Dialog_headerWithCancel"
134134
>
135135
<h2
136-
class="mx_Heading_h4 mx_Dialog_title"
136+
class="mx_Heading_h3 mx_Dialog_title"
137137
id="mx_BaseDialog_title"
138138
>
139139
Verify session

test/components/views/dialogs/__snapshots__/MessageEditHistoryDialog-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`<MessageEditHistory /> should match the snapshot 1`] = `
1717
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1818
>
1919
<h2
20-
class="mx_Heading_h4 mx_Dialog_title"
20+
class="mx_Heading_h3 mx_Dialog_title"
2121
id="mx_BaseDialog_title"
2222
>
2323
Message edits
@@ -133,7 +133,7 @@ exports[`<MessageEditHistory /> should support events with 1`] = `
133133
class="mx_Dialog_header mx_Dialog_headerWithCancel"
134134
>
135135
<h2
136-
class="mx_Heading_h4 mx_Dialog_title"
136+
class="mx_Heading_h3 mx_Dialog_title"
137137
id="mx_BaseDialog_title"
138138
>
139139
Message edits

test/components/views/dialogs/__snapshots__/ServerPickerDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`<ServerPickerDialog /> should render dialog 1`] = `
1818
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1919
>
2020
<h2
21-
class="mx_Heading_h4 mx_Dialog_title"
21+
class="mx_Heading_h3 mx_Dialog_title"
2222
id="mx_BaseDialog_title"
2323
>
2424
Sign into your homeserver

test/components/views/dialogs/security/__snapshots__/CreateKeyBackupDialog-test.tsx.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`CreateKeyBackupDialog should display the error message when backup crea
1717
class="mx_Dialog_header"
1818
>
1919
<h2
20-
class="mx_Heading_h4 mx_Dialog_title"
20+
class="mx_Heading_h3 mx_Dialog_title"
2121
id="mx_BaseDialog_title"
2222
>
2323
Starting backup…
@@ -77,7 +77,7 @@ exports[`CreateKeyBackupDialog should display the spinner when creating backup 1
7777
class="mx_Dialog_header"
7878
>
7979
<h2
80-
class="mx_Heading_h4 mx_Dialog_title"
80+
class="mx_Heading_h3 mx_Dialog_title"
8181
id="mx_BaseDialog_title"
8282
>
8383
Starting backup…
@@ -124,7 +124,7 @@ exports[`CreateKeyBackupDialog should display the success dialog when the key ba
124124
class="mx_Dialog_header mx_Dialog_headerWithCancel"
125125
>
126126
<h2
127-
class="mx_Heading_h4 mx_Dialog_title"
127+
class="mx_Heading_h3 mx_Dialog_title"
128128
id="mx_BaseDialog_title"
129129
>
130130
Success!

test/components/views/dialogs/security/__snapshots__/ImportE2eKeysDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports[`ImportE2eKeysDialog renders 1`] = `
1717
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1818
>
1919
<h2
20-
class="mx_Heading_h4 mx_Dialog_title"
20+
class="mx_Heading_h3 mx_Dialog_title"
2121
id="mx_BaseDialog_title"
2222
>
2323
Import room keys

test/components/views/settings/notifications/__snapshots__/Notifications2-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ exports[`<Notifications /> correctly handles the loading/disabled state 1`] = `
99
class="mx_SettingsSection"
1010
>
1111
<h2
12-
class="mx_Heading_h2"
12+
class="mx_Heading_h3"
1313
>
1414
Notifications
1515
</h2>
@@ -728,7 +728,7 @@ exports[`<Notifications /> matches the snapshot 1`] = `
728728
class="mx_SettingsSection"
729729
>
730730
<h2
731-
class="mx_Heading_h2"
731+
class="mx_Heading_h3"
732732
>
733733
Notifications
734734
</h2>

test/components/views/settings/tabs/room/__snapshots__/AdvancedRoomSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`AdvancedRoomSettingsTab should render as expected 1`] = `
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Advanced
1818
</h2>

test/components/views/settings/tabs/room/__snapshots__/BridgeSettingsTab-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`<BridgeSettingsTab /> renders when room is bridging messages 1`] = `
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Bridges
1818
</h2>
@@ -101,7 +101,7 @@ exports[`<BridgeSettingsTab /> renders when room is not bridging messages to any
101101
class="mx_SettingsSection"
102102
>
103103
<h2
104-
class="mx_Heading_h2"
104+
class="mx_Heading_h3"
105105
>
106106
Bridges
107107
</h2>

test/components/views/settings/tabs/room/__snapshots__/SecurityRoomSettingsTab-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ exports[`<SecurityRoomSettingsTab /> join rule handles error when updating join
122122
class="mx_Dialog_header mx_Dialog_headerWithCancel"
123123
>
124124
<h2
125-
class="mx_Heading_h4 mx_Dialog_title"
125+
class="mx_Heading_h3 mx_Dialog_title"
126126
id="mx_BaseDialog_title"
127127
>
128128
Failed to update the join rules
@@ -164,7 +164,7 @@ exports[`<SecurityRoomSettingsTab /> join rule warns when trying to make an encr
164164
class="mx_Dialog_header mx_Dialog_headerWithCancel"
165165
>
166166
<h2
167-
class="mx_Heading_h4 mx_Dialog_title"
167+
class="mx_Heading_h3 mx_Dialog_title"
168168
id="mx_BaseDialog_title"
169169
>
170170
Are you sure you want to make this encrypted room public?

test/components/views/settings/tabs/user/__snapshots__/AppearanceUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
1313
class="mx_SettingsSection"
1414
>
1515
<h2
16-
class="mx_Heading_h2"
16+
class="mx_Heading_h3"
1717
>
1818
Customise your appearance
1919
</h2>

test/components/views/settings/tabs/user/__snapshots__/GeneralUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ exports[`<GeneralUserSettingsTab /> deactive account should render section when
6060
class="mx_SettingsSection"
6161
>
6262
<h2
63-
class="mx_Heading_h2"
63+
class="mx_Heading_h3"
6464
>
6565
Deactivate account
6666
</h2>

test/components/views/settings/tabs/user/__snapshots__/KeyboardUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`KeyboardUserSettingsTab renders list of keyboard shortcuts 1`] = `
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Keyboard
1818
</h2>

test/components/views/settings/tabs/user/__snapshots__/LabsUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`<LabsUserSettingsTab /> renders settings marked as beta as beta cards 1
55
class="mx_SettingsSection"
66
>
77
<h2
8-
class="mx_Heading_h2"
8+
class="mx_Heading_h3"
99
>
1010
Upcoming features
1111
</h2>

test/components/views/settings/tabs/user/__snapshots__/MjolnirUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`<MjolnirUserSettingsTab /> renders correctly when user has no ignored u
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Ignored users
1818
</h2>

test/components/views/settings/tabs/user/__snapshots__/PreferencesUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports[`PreferencesUserSettingsTab should render 1`] = `
1313
class="mx_SettingsSection"
1414
>
1515
<h2
16-
class="mx_Heading_h2"
16+
class="mx_Heading_h3"
1717
>
1818
Preferences
1919
</h2>

test/components/views/settings/tabs/user/__snapshots__/SecurityUserSettingsTab-test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`<SecurityUserSettingsTab /> renders security section 1`] = `
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Encryption
1818
</h2>
@@ -315,7 +315,7 @@ exports[`<SecurityUserSettingsTab /> renders security section 1`] = `
315315
class="mx_SettingsSection"
316316
>
317317
<h2
318-
class="mx_Heading_h2"
318+
class="mx_Heading_h3"
319319
>
320320
Advanced
321321
</h2>

test/components/views/settings/tabs/user/__snapshots__/SidebarUserSettingsTab-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ exports[`<SidebarUserSettingsTab /> renders sidebar settings 1`] = `
1212
class="mx_SettingsSection"
1313
>
1414
<h2
15-
class="mx_Heading_h2"
15+
class="mx_Heading_h3"
1616
>
1717
Sidebar
1818
</h2>

test/components/views/spaces/__snapshots__/AddExistingToSpaceDialog-test.tsx.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ exports[`<AddExistingToSpaceDialog /> looks as expected 1`] = `
1818
class="mx_Dialog_header mx_Dialog_headerWithCancel"
1919
>
2020
<h2
21-
class="mx_Heading_h4 mx_Dialog_title"
21+
class="mx_Heading_h3 mx_Dialog_title"
2222
id="mx_BaseDialog_title"
2323
>
2424
<div

0 commit comments

Comments
 (0)