Rename the mobile_guide_app_variant config values to be clearer. (#30258)

* Fix the default mobile_guide links.

Whilst the script should update these if it fails these should link to Element X which is now the default app that we link out to from this page.

* Rename the mobile_guide_app_variant values to be clearer.

Also handle invalid config values by defaulting to Element X.

* Rename snapshots to match new app variant identifiers.
This commit is contained in:
Doug 2025-07-04 13:27:30 +01:00 committed by GitHub
parent 9095ebdb1b
commit 5dd31685bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 14 additions and 14 deletions

View File

@ -132,9 +132,9 @@ complete re-branding/private labeling, a more personalised experience can be ach
download the app instead. download the app instead.
8. `mobile_guide_app_variant`: Optional. The mobile app that the user is prompted to download from the `/mobile_guide` page. When omitted 8. `mobile_guide_app_variant`: Optional. The mobile app that the user is prompted to download from the `/mobile_guide` page. When omitted
the mobile guide will be configured for the new Element X apps. Allowed values are as follows: the mobile guide will be configured for the new Element X apps. Allowed values are as follows:
1. `classic`: Element Android/iOS. 1. `element`: Element X Android/iOS.
2. `x`: Element X Android/iOS. 2. `element-classic`: Element Classic Android/iOS.
3. `pro`: Element Pro Android/iOS. 3. `element-pro`: Element Pro Android/iOS.
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 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
containing `macos` and `win32` directories, with the update packages within. Defaults to `https://packages.element.io/desktop/update/` containing `macos` and `win32` directories, with the update packages within. Defaults to `https://packages.element.io/desktop/update/`
in production. in production.

View File

@ -81,7 +81,7 @@ export interface IConfigOptions {
}; };
mobile_guide_toast?: boolean; mobile_guide_toast?: boolean;
mobile_guide_app_variant?: "classic" | "x" | "pro"; mobile_guide_app_variant?: "element" | "element-classic" | "element-pro";
default_theme?: "light" | "dark" | string; // custom themes are strings default_theme?: "light" | "dark" | string; // custom themes are strings
default_country_code?: string; // ISO 3166 alpha2 country code default_country_code?: string; // ISO 3166 alpha2 country code

View File

@ -7,7 +7,7 @@
<head> <head>
<title>Element Mobile Guide</title> <title>Element Mobile Guide</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-itunes-app" content="app-id=id1083446067" /> <meta name="apple-itunes-app" content="app-id=id1631335820" />
</head> </head>
<body> <body>
@ -44,7 +44,7 @@
<h1 id="step1_heading">Download Element</h1> <h1 id="step1_heading">Download Element</h1>
<div class="mx_StoreLinks"> <div class="mx_StoreLinks">
<a <a
href="https://apps.apple.com/app/element-messenger/id1083446067" href="https://apps.apple.com/app/element-x-secure-chat-call/id1631335820"
target="_blank" target="_blank"
class="mx_StoreBadge" class="mx_StoreBadge"
id="app_store_link" id="app_store_link"
@ -57,7 +57,7 @@
/> />
</a> </a>
<a <a
href="https://play.google.com/store/apps/details?id=im.vector.app" href="https://play.google.com/store/apps/details?id=io.element.android.x"
target="_blank" target="_blank"
class="mx_StoreBadge" class="mx_StoreBadge"
id="play_store_link" id="play_store_link"
@ -73,7 +73,7 @@
<p id="f_droid_section"> <p id="f_droid_section">
Also available on Also available on
<a <a
href="https://f-droid.org/packages/im.vector.app" href="https://f-droid.org/packages/io.element.android.x"
target="_blank" target="_blank"
class="mx_ClearDecoration" class="mx_ClearDecoration"
id="f_droid_link" id="f_droid_link"

View File

@ -12,7 +12,7 @@ import "@fontsource/inter/600.css";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import { getVectorConfig } from "../getconfig"; import { getVectorConfig } from "../getconfig";
import { type MobileAppVariant, mobileApps, updateMobilePage } from "./mobile-apps.ts"; import { MobileAppVariant, mobileApps, updateMobilePage } from "./mobile-apps.ts";
function onBackToElementClick(): void { function onBackToElementClick(): void {
// Cookie should expire in 4 hours // Cookie should expire in 4 hours
@ -53,8 +53,8 @@ async function initPage(): Promise<void> {
const defaultHsUrl = config?.["default_hs_url"]; const defaultHsUrl = config?.["default_hs_url"];
const defaultIsUrl = config?.["default_is_url"]; const defaultIsUrl = config?.["default_is_url"];
const appVariant = (config?.["mobile_guide_app_variant"] ?? "x") as MobileAppVariant; const appVariant = (config?.["mobile_guide_app_variant"] as MobileAppVariant) ?? MobileAppVariant.X;
const metadata = mobileApps[appVariant]; const metadata = mobileApps[appVariant] ?? mobileApps[MobileAppVariant.X]; // Additional fallback in case mobile_guide_app_variant has an unexpected value.
const incompatibleOptions = [wkConfig, serverName, defaultHsUrl].filter((i) => !!i); const incompatibleOptions = [wkConfig, serverName, defaultHsUrl].filter((i) => !!i);
if (defaultHsUrl && (wkConfig || serverName)) { if (defaultHsUrl && (wkConfig || serverName)) {

View File

@ -10,9 +10,9 @@ Please see LICENSE files in the repository root for full details.
*/ */
export enum MobileAppVariant { export enum MobileAppVariant {
Classic = "classic", Classic = "element-classic",
X = "x", X = "element",
Pro = "pro", Pro = "element-pro",
} }
export interface MobileAppMetadata { export interface MobileAppMetadata {