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 c51823db5e.

* 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 <7t3chguy@gmail.com>
This commit is contained in:
Doug
2025-07-03 08:28:07 +00:00
committed by GitHub
co-authored by Michael Telatynski
parent e1fea71c97
commit 90f4d34fbb
16 changed files with 578 additions and 800 deletions
+13
View File
@@ -679,6 +679,12 @@ module.exports = (env, argv) => {
context: path.resolve(__dirname, "node_modules/@element-hq/element-call-embedded/dist"),
to: path.join(__dirname, "webapp", "widgets", "element-call"),
},
// Mobile guide assets
{
from: "assets/**",
context: path.resolve(__dirname, "src/vector/mobile_guide"),
to: "mobile_guide",
},
],
}),
@@ -771,6 +777,8 @@ module.exports = (env, argv) => {
function getAssetOutputPath(url, resourcePath) {
const isKaTeX = resourcePath.includes("KaTeX");
const isFontSource = resourcePath.includes("@fontsource");
const mobileGuideAssetsPath = path.join("mobile_guide", "assets");
const isMobileGuide = resourcePath.includes(mobileGuideAssetsPath);
// `res` is the parent dir for our own assets in various layers
// `dist` is the parent dir for KaTeX assets
// `files` is the parent dir for @fontsource assets
@@ -804,6 +812,11 @@ function getAssetOutputPath(url, resourcePath) {
outputDir = "fonts";
}
if (isMobileGuide) {
// Specific handling for the mobile guide assets, as they live alongside the page sources.
outputDir = mobileGuideAssetsPath;
}
if (isKaTeX) {
// Add a clearly named directory segment, rather than leaving the KaTeX
// assets loose in each asset type directory.