From 9baf40aa347e582b21c0408971408fe1fc8c1024 Mon Sep 17 00:00:00 2001 From: TaprootFreakAI Date: Thu, 27 Aug 2026 00:29:28 +0200 Subject: [PATCH] 01a03eba - Restore FAQ hash scrolling dropped by the html path rewrite (#143) * Restore FAQ hash scrolling dropped by the .html path rewrite VuePress maps /de/faq to /de/faq.html and strips the fragment, so deep links never leave the top of the page. Keep the original hash and scroll to it after the router is ready. Give the Trade Republic heading a stable id. * Use an HTML id for the Trade Republic FAQ heading VuePress 1.5 ships markdown-it-anchor 5, which does not parse {#custom-id}. A raw anchor keeps a stable #trade-republic without rendering the braces in the heading. * Put the FAQ hash back in the URL and retry after client navigation After the .html rewrite, restore the fragment with replaceState so reload and copy-paste still work. Scroll again on afterEach for in-app FAQ links, skip a broken percent-encoding, and aim at the next sibling when the empty id anchor has no box. * Restore the hash only after the target exists replaceState after a successful lookup so a dropped fragment is not written onto the next page. Chain the retries and name the navbar offset. In-app header-anchor clicks stay on VuePress. * Note that the faq.html rewrite applies in every locale * Scroll after Vue Router's initial reset and keep history.state Always queue a 0ms retry so handleScroll cannot leave the page at y=0. Keep history.state in replaceState. Ignore the stored hash if the path has already changed. --------- Co-authored-by: TaprootFreakAI <315477232+TaprootFreakAI@users.noreply.github.com> --- src/.vuepress/enhanceApp.js | 60 ++++++++++++++++++++++++++++++++----- src/de/faq.md | 2 ++ src/en/faq.md | 2 ++ src/fr/faq.md | 2 ++ src/it/faq.md | 2 ++ 5 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/.vuepress/enhanceApp.js b/src/.vuepress/enhanceApp.js index 8452a86..ddc082f 100755 --- a/src/.vuepress/enhanceApp.js +++ b/src/.vuepress/enhanceApp.js @@ -4,11 +4,55 @@ * https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements */ -export default ({ - Vue, // the version of Vue being used in the VuePress app - options, // the options for the root Vue instance - router, // the router instance for the app - siteData // site metadata -}) => { - // ...apply enhancements for the site. -} +export default ({ router }) => { + if (typeof window === "undefined") return; + + // VuePress rewrites /{lang}/faq -> /{lang}/faq.html and drops location.hash. + const initialHash = window.location.hash; + const NAVBAR_OFFSET_PX = 72; + const HASH_SCROLL_RETRY_DELAY_MS = 200; + + const decodeId = (hash) => { + const raw = hash.replace(/^#/, ""); + try { + return decodeURIComponent(raw); + } catch (e) { + return raw; + } + }; + + const scrollToHash = (hash) => { + if (!hash) return false; + const el = document.getElementById(decodeId(hash)); + if (!el) return false; + const target = + el.getBoundingClientRect().height === 0 && el.nextElementSibling + ? el.nextElementSibling + : el; + if (window.location.hash !== hash) { + history.replaceState( + history.state, + "", + window.location.pathname + window.location.search + hash + ); + } + window.scrollTo( + 0, + target.getBoundingClientRect().top + window.pageYOffset - NAVBAR_OFFSET_PX + ); + return true; + }; + + router.onReady(() => { + const startPath = window.location.pathname + window.location.search; + const hash = () => { + if (window.location.pathname + window.location.search !== startPath) return ""; + return window.location.hash || initialHash; + }; + scrollToHash(hash()); + setTimeout(() => { + if (scrollToHash(hash())) return; + setTimeout(() => scrollToHash(hash()), HASH_SCROLL_RETRY_DELAY_MS); + }, 0); + }); +}; diff --git a/src/de/faq.md b/src/de/faq.md index 1de5cb4..5602106 100755 --- a/src/de/faq.md +++ b/src/de/faq.md @@ -133,6 +133,8 @@ Nein. Die Blockierung kommt von Swissquote bzw. Yuh, nicht von DFX. Wir können Ist bereits eine Zahlung von einem Swissquote- oder Yuh-Konto bei uns eingegangen, überweisen wir diese auf ein anderes, auf deinen Namen lautendes Bankkonto zurück. Bitte wende dich dazu an unseren Support. + + ## Werden Auszahlungen auf ein Trade-Republic-Konto unterstützt? Nein. Die Einschränkung kommt von Trade Republic, nicht von DFX. Das Trade-Republic-Konto ist kein vollwertiges Bankkonto, sondern nur ein Konto für Wertpapierdienstleistungen. Es erlaubt deshalb nur Einzahlungen von einem Bankkonto, das auf den Namen des Kunden lautet. Das ergibt sich aus der [Kundenvereinbarung von Trade Republic](https://assets.traderepublic.com/assets/files/CA_DE-de.pdf) (Ziffer II.1). Wir können das von unserer Seite nicht ändern. diff --git a/src/en/faq.md b/src/en/faq.md index 8664dd9..d8e3ff4 100755 --- a/src/en/faq.md +++ b/src/en/faq.md @@ -133,6 +133,8 @@ We therefore cannot process transfers from accounts at Swissquote or Yuh. Please If a payment from a Swissquote or Yuh account has already reached us, we will transfer it back to another bank account in your name. Please contact our support for this. + + ## Are payouts to a Trade Republic account supported? No. The restriction comes from Trade Republic, not from DFX. A Trade Republic account is not a full bank account, but only an account for securities services. It therefore only accepts deposits from a bank account in the customer's name. See Trade Republic's [customer agreement](https://assets.traderepublic.com/assets/files/CA_DE-de.pdf) (section II.1). We cannot change this on our side. diff --git a/src/fr/faq.md b/src/fr/faq.md index 5035b60..09802ea 100755 --- a/src/fr/faq.md +++ b/src/fr/faq.md @@ -133,6 +133,8 @@ Nous ne pouvons donc pas traiter les virements provenant de comptes Swissquote o Si un paiement provenant d'un compte Swissquote ou Yuh nous est déjà parvenu, nous le reversons sur un autre compte bancaire à votre nom. Veuillez contacter notre support à ce sujet. + + ## Les paiements vers un compte Trade Republic sont-ils pris en charge ? Non. La restriction vient de Trade Republic, pas de DFX. Un compte Trade Republic n'est pas un compte bancaire à part entière, mais uniquement un compte pour les services en valeurs mobilières. Il n'accepte donc que les dépôts provenant d'un compte bancaire au nom du client. Cela ressort du [contrat client de Trade Republic](https://assets.traderepublic.com/assets/files/CA_DE-de.pdf) (chiffre II.1). Nous ne pouvons pas le modifier de notre côté. diff --git a/src/it/faq.md b/src/it/faq.md index 4387a15..c8225dd 100755 --- a/src/it/faq.md +++ b/src/it/faq.md @@ -133,6 +133,8 @@ Pertanto non possiamo elaborare i bonifici provenienti da conti Swissquote o Yuh Se un pagamento da un conto Swissquote o Yuh è già arrivato presso di noi, lo ritrasferiamo su un altro conto bancario a tuo nome. Contatta il nostro supporto a riguardo. + + ## I pagamenti verso un conto Trade Republic sono supportati? No. La limitazione viene da Trade Republic, non da DFX. Un conto Trade Republic non è un conto bancario a tutti gli effetti, ma solo un conto per i servizi in strumenti finanziari. Accetta quindi solo versamenti da un conto bancario intestato al cliente. Ciò risulta dall'[accordo con il cliente di Trade Republic](https://assets.traderepublic.com/assets/files/CA_DE-de.pdf) (sezione II.1). Non possiamo modificarlo da parte nostra.