Storybooks for commit 256c72497d2d7ced3b38073bdcfafe5e64c7af24

Date
8/11/2026, 6:09:55 PM UTC
Summary
fix(settings): serve the account recovery key as a plain text file
Description
Because:
  * @react-pdf/textkit drops source-character mapping when fontkit
    returns a glyph with empty codePoints, corrupting non-Latin text
    in the generated PDF. The upstream fix is unreviewed.
  * Any WASM-based PDF renderer needs a wasm-unsafe-eval CSP
    exception, which we will not add on an auth surface.

This commit:
  * Replaces PDF generation with a text/plain download of the key.
    Plain text cannot express bidi or shaping, so the file holds the
    key alone; the guidance the PDF carried is already on the download
    screen, apart from the support link, which is dropped.
  * Adds a downloadTextFile util. The object URL is revoked a task
    after the click, since revoking within it can abort the download.
  * Reports a failed download in an inline banner and stays on the
    screen. <AlertBar /> is only mounted by SettingsLayout, so on the
    two screens rendering under AppLayout the old alert went nowhere,
    and navigating forward hid it on all three. The key, the error and
    the retry now stay together, and "Continue without downloading"
    is still there for a persistent failure.
  * Sends the failure to Sentry. The catch still fires on synchronous
    faults, and the key is the only way back into encrypted Sync data.
  * Sanitises the email before using it as a filename; FxA permits "/"
    in a local part.
  * Records the click through Glean via data-glean-id instead of the
    legacy Amplitude logViewEvent, which also retires the viewName
    prop. A failed download can no longer be detected client-side, so
    there is no success/failure event.
  * Removes @react-pdf/renderer, file-saver, pdf-parse, both
    @react-pdf resolution pins, and 74 MB of bundled Noto fonts.
  * Renames ButtonDownloadRecoveryKeyPDF to ButtonDownloadRecoveryKey
    and drops the lazy/Suspense wrappers the font bundle required.
  * Stubs URL.createObjectURL/revokeObjectURL in setupTests; jsdom
    implements neither, so download tests silently ran the error path.
    Drops the per-file stubs this replaces, most of which returned
    undefined and so shadowed it with a worse one.

Closes: FXA-14334