Skip to content

Commit 90f4d34

Browse files
pixlwavet3chguy
andauthored
Update the mobile_guide page to the new design and link out to Element X by default. (#30172)
* Reapply "Update the mobile_guide page to the new design. (#30006)" (#30104) This reverts commit c51823d. * Use Element X as the default mobile_guide_app_variant when omitted. * Fix a build error on Windows. Additionally revert "Remove unnecessary <%= require %> usages" and let webpack handle all of the assets (without a manual copy rule). * Exclude mobile_guide from coverage gate It has playwright tests * Revert the re-introduction of <%= require %> * Fix snapshot tests on mobile_guide. --------- Co-authored-by: Michael Telatynski <[email protected]>
1 parent e1fea71 commit 90f4d34

File tree

16 files changed

+578
-800
lines changed

16 files changed

+578
-800
lines changed

docs/config.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,32 +130,37 @@ complete re-branding/private labeling, a more personalised experience can be ach
130130
6. `mobile_builds`: Optional. Like `desktop_builds`, except for the mobile apps. Also described in more detail down below.
131131
7. `mobile_guide_toast`: When `true` (default), users accessing the Element Web instance from a mobile device will be prompted to
132132
download the app instead.
133-
8. `update_base_url`: For the desktop app only, the URL where to acquire update packages. If specified, must be a path to a directory
133+
8. `mobile_guide_app_variant`: Optional. The mobile app that the user is prompted to download from the `/mobile_guide` page. When omitted
134+
the mobile guide will be configured for the new Element X apps. Allowed values are as follows:
135+
1. `classic`: Element Android/iOS.
136+
2. `x`: Element X Android/iOS.
137+
3. `pro`: Element Pro Android/iOS.
138+
9. `update_base_url`: For the desktop app only, the URL where to acquire update packages. If specified, must be a path to a directory
134139
containing `macos` and `win32` directories, with the update packages within. Defaults to `https://packages.element.io/desktop/update/`
135140
in production.
136-
9. `map_style_url`: Map tile server style URL for location sharing. e.g. `https://api.maptiler.com/maps/streets/style.json?key=YOUR_KEY_GOES_HERE`
137-
This setting is ignored if your homeserver provides `/.well-known/matrix/client` in its well-known location, and the JSON file
138-
at that location has a key `m.tile_server` (or the unstable version `org.matrix.msc3488.tile_server`). In this case, the
139-
configuration found in the well-known location is used instead.
140-
10. `welcome_user_id`: **DEPRECATED** An optional user ID to start a DM with after creating an account. Defaults to nothing (no DM created).
141-
11. `custom_translations_url`: An optional URL to allow overriding of translatable strings. The JSON file must be in a format of
141+
10. `map_style_url`: Map tile server style URL for location sharing. e.g. `https://api.maptiler.com/maps/streets/style.json?key=YOUR_KEY_GOES_HERE`
142+
This setting is ignored if your homeserver provides `/.well-known/matrix/client` in its well-known location, and the JSON file
143+
at that location has a key `m.tile_server` (or the unstable version `org.matrix.msc3488.tile_server`). In this case, the
144+
configuration found in the well-known location is used instead.
145+
11. `welcome_user_id`: **DEPRECATED** An optional user ID to start a DM with after creating an account. Defaults to nothing (no DM created).
146+
12. `custom_translations_url`: An optional URL to allow overriding of translatable strings. The JSON file must be in a format of
142147
`{"affected|translation|key": {"languageCode": "new string"}}`. See https://github.com/matrix-org/matrix-react-sdk/pull/7886 for details.
143-
12. `branding`: Options for configuring various assets used within the app. Described in more detail down below.
144-
13. `embedded_pages`: Further optional URLs for various assets used within the app. Described in more detail down below.
145-
14. `disable_3pid_login`: When `false` (default), **enables** the options to log in with email address or phone number. Set to
148+
13. `branding`: Options for configuring various assets used within the app. Described in more detail down below.
149+
14. `embedded_pages`: Further optional URLs for various assets used within the app. Described in more detail down below.
150+
15. `disable_3pid_login`: When `false` (default), **enables** the options to log in with email address or phone number. Set to
146151
`true` to hide these options.
147-
15. `disable_login_language_selector`: When `false` (default), **enables** the language selector on the login pages. Set to `true`
152+
16. `disable_login_language_selector`: When `false` (default), **enables** the language selector on the login pages. Set to `true`
148153
to hide this dropdown.
149-
16. `disable_guests`: When `false` (default), **enable** guest-related functionality (peeking/previewing rooms, etc) for unregistered
154+
17. `disable_guests`: When `false` (default), **enable** guest-related functionality (peeking/previewing rooms, etc) for unregistered
150155
users. Set to `true` to disable this functionality.
151-
17. `user_notice`: Optional notice to show to the user, e.g. for sunsetting a deployment and pushing users to move in their own time.
156+
18. `user_notice`: Optional notice to show to the user, e.g. for sunsetting a deployment and pushing users to move in their own time.
152157
Takes a configuration object as below:
153158
1. `title`: Required. Title to show at the top of the notice.
154159
2. `description`: Required. The description to use for the notice.
155160
3. `show_once`: Optional. If true then the notice will only be shown once per device.
156-
18. `help_url`: The URL to point users to for help with the app, defaults to `https://element.io/help`.
157-
19. `help_encryption_url`: The URL to point users to for help with encryption, defaults to `https://element.io/help#encryption`.
158-
20. `force_verification`: If true, users must verify new logins (eg. with another device / their recovery key)
161+
19. `help_url`: The URL to point users to for help with the app, defaults to `https://element.io/help`.
162+
20. `help_encryption_url`: The URL to point users to for help with encryption, defaults to `https://element.io/help#encryption`.
163+
21. `force_verification`: If true, users must verify new logins (eg. with another device / their recovery key)
159164

160165
### `desktop_builds` and `mobile_builds`
161166

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2025 New Vector Ltd.
3+
4+
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
5+
Please see LICENSE files in the repository root for full details.
6+
*/
7+
8+
import { test, expect } from "../../element-web-test";
9+
import { MobileAppVariant } from "../../../src/vector/mobile_guide/mobile-apps";
10+
11+
const variants = [MobileAppVariant.Classic, MobileAppVariant.X, MobileAppVariant.Pro];
12+
13+
test.describe("Mobile Guide Screenshots", { tag: "@screenshot" }, () => {
14+
for (const variant of variants) {
15+
test.describe(`for variant ${variant}`, () => {
16+
test.use({
17+
config: {
18+
default_server_config: {
19+
"m.homeserver": {
20+
base_url: "https://matrix.server.invalid",
21+
server_name: "server.invalid",
22+
},
23+
},
24+
mobile_guide_app_variant: variant,
25+
},
26+
viewport: { width: 390, height: 844 }, // iPhone 16e
27+
});
28+
29+
test("should match the mobile_guide screenshot", async ({ page, axe }) => {
30+
await page.goto("/mobile_guide/");
31+
await expect(page).toMatchScreenshot(`mobile-guide-${variant}.png`);
32+
await expect(axe).toHaveNoViolations();
33+
});
34+
});
35+
}
36+
});
Loading
Loading
Loading

sonar-project.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ sonar.coverage.exclusions=\
1919
src/vector/modernizr.js,\
2020
src/components/views/dialogs/devtools/**/*,\
2121
src/utils/SessionLock.ts,\
22-
src/**/*.d.ts
22+
src/**/*.d.ts,\
23+
src/vector/mobile_guide/**/*
2324
sonar.testExecutionReportPaths=coverage/jest-sonar-report.xml

src/IConfigOptions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export interface IConfigOptions {
8181
};
8282

8383
mobile_guide_toast?: boolean;
84+
mobile_guide_app_variant?: "classic" | "x" | "pro";
8485

8586
default_theme?: "light" | "dark" | string; // custom themes are strings
8687
default_country_code?: string; // ISO 3166 alpha2 country code
Lines changed: 46 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)