Skip to content

Persist PDF modal and let user trigger download manually to fix transient activation bug#76766

Merged
puneetlath merged 14 commits intoExpensify:mainfrom
LorenzoBloedow:pdf-rework
Dec 5, 2025
Merged

Persist PDF modal and let user trigger download manually to fix transient activation bug#76766
puneetlath merged 14 commits intoExpensify:mainfrom
LorenzoBloedow:pdf-rework

Conversation

@LorenzoBloedow
Copy link
Contributor

@LorenzoBloedow LorenzoBloedow commented Dec 4, 2025

Explanation of Change

Sometimes the download can't be automatically triggered because ExportReportToPDF takes longer than the browser's transient activation time.
To fix this, we're persisting the PDF modal to allow the user to trigger the download if it didn't automatically get triggered.

We'll persist the modal until the user closes it because there's no API to know if the download was successful, we also can't guess it because transient activation is not deterministic.

Fixed Issues

$ #76172
PROPOSAL: #76172 (comment)

Tests

  1. Open a report.
  2. Click the option to export the report as a PDF.
  3. Make sure the PDF was automatically downloaded OR make sure you can click the "Download" button and the download is then successful.

Offline tests

N/A (This feature requires an internet connection).

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android.-.Native.mov
Android: mWeb Chrome
Android.-.Chrome.mov
iOS: Native
iOS.-.Native.mov
iOS: mWeb Safari
iOS.-.Safari.mov
MacOS: Chrome / Safari
macOS.-.Chrome.mov

@LorenzoBloedow LorenzoBloedow requested review from a team as code owners December 4, 2025 20:24
@melvin-bot melvin-bot bot requested a review from situchan December 4, 2025 20:25
@melvin-bot
Copy link

melvin-bot bot commented Dec 4, 2025

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@melvin-bot melvin-bot bot requested review from heyjennahay and removed request for a team and heyjennahay December 4, 2025 20:25
@melvin-bot
Copy link

melvin-bot bot commented Dec 4, 2025

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot requested review from a team, heyjennahay and puneetlath and removed request for a team December 4, 2025 20:25
@melvin-bot
Copy link

melvin-bot bot commented Dec 4, 2025

@puneetlath Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@OSBotify
Copy link
Contributor

OSBotify commented Dec 4, 2025

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index a0c363e4..643d885f 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2288,9 +2288,10 @@ ${amount} für ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `in ${policyName}`,
-        generatingPDF: 'PDF wird generiert...',
+        generatingPDF: 'PDF wird erstellt',
         waitForPDF: 'Bitte warten Sie, während wir das PDF erstellen.',
         errorPDF: 'Beim Versuch, Ihr PDF zu erstellen, ist ein Fehler aufgetreten.',
+        successPDF: 'Ihr PDF wurde erstellt! Falls es nicht automatisch heruntergeladen wurde, verwenden Sie die Schaltfläche unten.',
     },
     reportDescriptionPage: {
         roomDescription: 'Zimmerbeschreibung',
@@ -2554,13 +2555,13 @@ ${amount} für ${merchant} - ${date}`,
                         4. Suche nach ${integrationName}.
                         5. Klicke auf *Connect*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Zur Buchhaltung](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Zur Buchhaltung](${workspaceAccountingLink}).
 
                         ![Mit ${integrationName} verbinden](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Zur Buchhaltung](${workspaceAccountingLink}).`
-                        }`),
+        : `[Zur Buchhaltung](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Verbinden Sie [Ihre Firmenkarten](${corporateCardLink})`,
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 485dc3fb..a8e350a6 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -2288,9 +2288,10 @@ ${amount} pour ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `dans ${policyName}`,
-        generatingPDF: 'Génération du PDF...',
+        generatingPDF: 'Génération du PDF',
         waitForPDF: 'Veuillez patienter pendant que nous générons le PDF',
         errorPDF: "Une erreur s'est produite lors de la tentative de génération de votre PDF.",
+        successPDF: 'Votre PDF a été généré ! S’il ne s’est pas téléchargé automatiquement, utilisez le bouton ci-dessous.',
     },
     reportDescriptionPage: {
         roomDescription: 'Description de la chambre',
@@ -2554,13 +2555,13 @@ ${amount} pour ${merchant} - ${date}`,
                         4. Recherchez ${integrationName}.
                         5. Cliquez sur *Connect*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Accéder à la comptabilité](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Accéder à la comptabilité](${workspaceAccountingLink}).
 
                         ![Se connecter à ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Accéder à la comptabilité](${workspaceAccountingLink})`
-                        }`),
+        : `[Accéder à la comptabilité](${workspaceAccountingLink})`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Connectez [vos cartes d’entreprise](${corporateCardLink})`,
diff --git a/src/languages/it.ts b/src/languages/it.ts
index f105be40..9bc214d7 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2280,9 +2280,10 @@ ${amount} per ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `in ${policyName}`,
-        generatingPDF: 'Generazione PDF...',
+        generatingPDF: 'Generazione del PDF',
         waitForPDF: 'Attendere mentre generiamo il PDF',
         errorPDF: 'Si è verificato un errore durante il tentativo di generare il tuo PDF.',
+        successPDF: 'Il tuo PDF è stato generato! Se non si è scaricato automaticamente, usa il pulsante qui sotto.',
     },
     reportDescriptionPage: {
         roomDescription: 'Descrizione della stanza',
@@ -2542,13 +2543,13 @@ ${amount} per ${merchant} - ${date}`,
                         4. Trova ${integrationName}.
                         5. Fai clic su *Connect*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Portami alla contabilità](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Portami alla contabilità](${workspaceAccountingLink}).
 
                         ![Connetti a ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Portami alla contabilità](${workspaceAccountingLink}).`
-                        }`),
+        : `[Portami alla contabilità](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Collega [le tue carte aziendali](${corporateCardLink})`,
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index fcc2b863..f910d827 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -2270,9 +2270,10 @@ ${date} - ${merchant}に${amount}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `${policyName} 内`,
-        generatingPDF: 'PDFを生成中...',
+        generatingPDF: 'PDFを生成中',
         waitForPDF: 'PDFを生成するまでお待ちください',
         errorPDF: 'PDFの生成中にエラーが発生しました。',
+        successPDF: 'PDFの生成が完了しました!自動的にダウンロードされない場合は、下のボタンを使用してください。',
     },
     reportDescriptionPage: {
         roomDescription: '部屋の説明',
@@ -2523,7 +2524,7 @@ ${date} - ${merchant}に${amount}`,
                     `${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? '' : 'と'}[${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの' : ''} ${integrationName}](${workspaceAccountingLink})と接続する`,
                 description: ({integrationName, workspaceAccountingLink}) =>
                     dedent(`
-                        ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの' : 'まで'} の ${integrationName} を接続して、経費の自動分類と同期で月末締めをスムーズに。
+${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの' : 'まで'} の ${integrationName} を接続して、経費の自動分類と同期で月末締めをスムーズに。
 
                         1. *Workspaces* をクリックします。
                         2. ワークスペースを選択します。
@@ -2531,13 +2532,13 @@ ${date} - ${merchant}に${amount}`,
                         4. ${integrationName} を見つけます。
                         5. *Connect* をクリックします。
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[会計に移動](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[会計に移動](${workspaceAccountingLink}).
 
                         ![${integrationName} に接続](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[会計に移動](${workspaceAccountingLink}).`
-                        }`),
+        : `[会計に移動](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `[法人カード](${corporateCardLink})を連携する`,
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 213b44bd..dfc14a9a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -2278,9 +2278,10 @@ ${amount} voor ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `in ${policyName}`,
-        generatingPDF: 'PDF genereren...',
+        generatingPDF: 'PDF wordt gegenereerd',
         waitForPDF: 'Even geduld terwijl we de PDF genereren.',
         errorPDF: 'Er is een fout opgetreden bij het genereren van uw PDF.',
+        successPDF: 'Je PDF is gegenereerd! Als het niet automatisch is gedownload, gebruik dan de knop hieronder.',
     },
     reportDescriptionPage: {
         roomDescription: 'Kamerbeschrijving',
@@ -2541,13 +2542,13 @@ ${amount} voor ${merchant} - ${date}`,
                         4. Zoek ${integrationName}.
                         5. Klik op *Verbinden*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Breng me naar de boekhouding](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Breng me naar de boekhouding](${workspaceAccountingLink}).
 
                         ![Verbinding maken met ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Breng me naar de boekhouding](${workspaceAccountingLink}).`
-                        }`),
+        : `[Breng me naar de boekhouding](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Koppel [je bedrijfskaarten](${corporateCardLink})`,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 5543e376..07548632 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2274,9 +2274,10 @@ ${amount} dla ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `w ${policyName}`,
-        generatingPDF: 'Generowanie PDF...',
+        generatingPDF: 'Generowanie pliku PDF',
         waitForPDF: 'Proszę czekać, generujemy PDF',
         errorPDF: 'Wystąpił błąd podczas próby wygenerowania Twojego PDF-a.',
+        successPDF: 'Twój plik PDF został wygenerowany! Jeśli nie pobrał się automatycznie, użyj przycisku poniżej.',
     },
     reportDescriptionPage: {
         roomDescription: 'Opis pokoju',
@@ -2536,13 +2537,13 @@ ${amount} dla ${merchant} - ${date}`,
                         4. Znajdź ${integrationName}.
                         5. Kliknij *Connect*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Przejdź do księgowości](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Przejdź do księgowości](${workspaceAccountingLink}).
 
                         ![Połącz z ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Przejdź do księgowości](${workspaceAccountingLink}).`
-                        }`),
+        : `[Przejdź do księgowości](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Połącz [swoje karty firmowe](${corporateCardLink})`,
@@ -5253,7 +5254,7 @@ ${amount} dla ${merchant} - ${date}`,
                 cardType: 'Typ karty',
                 limit: 'Limit',
                 limitType: 'Typ limitu',
-                name: 'Imię',
+                name: 'Nazwa',
                 disabledApprovalForSmartLimitError: 'Proszę włączyć zatwierdzenia w <strong>Przepływy pracy > Dodaj zatwierdzenia</strong> przed skonfigurowaniem inteligentnych limitów',
             },
             deactivateCardModal: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 45859d32..680e76b6 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -2274,9 +2274,10 @@ ${amount} para ${merchant} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `em ${policyName}`,
-        generatingPDF: 'Gerando PDF...',
+        generatingPDF: 'Gerando PDF',
         waitForPDF: 'Por favor, aguarde enquanto geramos o PDF.',
         errorPDF: 'Ocorreu um erro ao tentar gerar seu PDF.',
+        successPDF: 'Seu PDF foi gerado! Se não foi baixado automaticamente, use o botão abaixo.',
     },
     reportDescriptionPage: {
         roomDescription: 'Descrição do quarto',
@@ -2536,13 +2537,13 @@ ${amount} para ${merchant} - ${date}`,
                         4. Encontre ${integrationName}.
                         5. Clique em *Conectar*.
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[Ir para a contabilidade](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[Ir para a contabilidade](${workspaceAccountingLink}).
 
                         ![Conectar ao ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[Ir para a contabilidade](${workspaceAccountingLink}).`
-                        }`),
+        : `[Ir para a contabilidade](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `Conecte [seus cartões corporativos](${corporateCardLink})`,
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index ca03bff5..3741cc86 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -2243,9 +2243,10 @@ ${merchant}的${amount} - ${date}`,
     },
     reportDetailsPage: {
         inWorkspace: ({policyName}: ReportPolicyNameParams) => `在${policyName}中`,
-        generatingPDF: '生成PDF...',
+        generatingPDF: '正在生成 PDF',
         waitForPDF: '请稍候,我们正在生成 PDF。',
         errorPDF: '生成PDF时出现错误。',
+        successPDF: '您的 PDF 已生成!如果没有自动下载,请使用下方按钮。',
     },
     reportDescriptionPage: {
         roomDescription: '房间描述',
@@ -2504,13 +2505,13 @@ ${merchant}的${amount} - ${date}`,
                         4. 找到 ${integrationName}。
                         5. 点击*连接*。
 
-                        ${
-                            integrationName && CONST.connectionsVideoPaths[integrationName]
-                                ? `[前往会计](${workspaceAccountingLink}).
+${
+    integrationName && CONST.connectionsVideoPaths[integrationName]
+        ? `[前往会计](${workspaceAccountingLink}).
 
                         ![连接到 ${integrationName}](${CONST.CLOUDFRONT_URL}/${CONST.connectionsVideoPaths[integrationName]})`
-                                : `[前往会计](${workspaceAccountingLink}).`
-                        }`),
+        : `[前往会计](${workspaceAccountingLink}).`
+}`),
             },
             connectCorporateCardTask: {
                 title: ({corporateCardLink}) => `连接[您的公司卡](${corporateCardLink})`,
@@ -5159,7 +5160,7 @@ ${merchant}的${amount} - ${date}`,
                 cardType: '卡类型',
                 limit: '限制',
                 limitType: '限制类型',
-                name: '名称',
+                name: '姓名',
                 disabledApprovalForSmartLimitError: '请在<strong>工作流程 > 添加审批</strong>中启用审批,然后再设置智能限制',
             },
             deactivateCardModal: {

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

@puneetlath
Copy link
Contributor

@situchan are you able to review ASAP?

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/components/MoneyReportHeader.tsx 0.16% <0.00%> (-0.01%) ⬇️
... and 108 files with indirect coverage changes

@situchan
Copy link
Contributor

situchan commented Dec 4, 2025

reviewing...

Please fix lint errors

Copy link
Contributor

@situchan situchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Forbidden non-null assertion
  • This assertion is unnecessary since it does not change the type of the expression
  • Unnecessary 'else' after 'return'
  • React Hook useMemo has a missing dependency: 'hasFinishedPDFDownload'. Either include it or remove the dependency array
  • React Hook useEffect has missing dependencies: 'moneyRequestReport?.reportName' and 'reportPDFFilename'. Either include them or remove the dependency array
  • Do not use negated variable names

Please address all these check failures

reportDetailsPage: {
inWorkspace: ({policyName}: ReportPolicyNameParams) => `in ${policyName}`,
generatingPDF: 'Generating PDF...',
generatingPDF: 'Generating PDF',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trjExpensify are we removing ...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think so... @jamesdeanexpensify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trjExpensify Just for context, I removed it because that's how it looks in the reference image for OD.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is it expected that there's ... even when the generation already completed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the second point is fair tbh. We're persisting this modal now even after completion, so we probably should drop the ... In fact, maybe we should just call it "Generate PDF" at this point?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like PDF generated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fine to go with @trjExpensify suggestion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up going with @trjExpensify's suggestion:

Screenshot 2025-12-04 at 6 43 58 PM Screenshot 2025-12-04 at 6 47 02 PM

Should I keep the other languages as "Generating PDF"? 🤔

Copy link
Contributor

@trjExpensify trjExpensify Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was just thinking of making the logic easier by having something static. The other option maybe is "Download PDF" - bit more evergreen?

Download PDF
Please wait while we generate the PDF.

Download PDF
Your PDF has been generated! If it didn't automatically download, use the button below.
[Download]

Copy link
Contributor

@jamesdeanexpensify jamesdeanexpensify Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that, just added a period in the first body. The option itself in the More dropdown should be named that, too, but that's another issue 😆

@LorenzoBloedow
Copy link
Contributor Author

Looks like the AI modified some other translations in the patch and I didn't notice, working on reverting them now.

@LorenzoBloedow
Copy link
Contributor Author

Ready for a review.

@LorenzoBloedow
Copy link
Contributor Author

@situchan Did you delete a comment about using Button instead of PressableWithFeedback? I received an email but I can't find it here.

@situchan
Copy link
Contributor

situchan commented Dec 5, 2025

@situchan Did you delete a comment about using Button instead of PressableWithFeedback? I received an email but I can't find it here.

Ignore that. We can use Pressable to be consistent.

<PressableWithoutFeedback
onPress={onCloseButtonPress}
style={[styles.touchableButtonImage]}
role={CONST.ROLE.BUTTON}
accessibilityLabel={translate('common.close')}
>
<Icon
src={Expensicons.Close}
fill={iconFill ?? theme.icon}
/>
</PressableWithoutFeedback>

@situchan
Copy link
Contributor

situchan commented Dec 5, 2025

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android.mov
Android: mWeb Chrome
mchrome.mov
iOS: HybridApp
ios.mov
iOS: mWeb Safari
msafari.mov
MacOS: Chrome / Safari
web.mov

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🚧 @puneetlath has triggered a test Expensify/App build. You can view the workflow run here.

@LorenzoBloedow
Copy link
Contributor Author

@situchan I think you forgot to upload the video for Android: mWeb Chrome.

@situchan
Copy link
Contributor

situchan commented Dec 5, 2025

@situchan I think you forgot to upload the video for Android: mWeb Chrome.

Done.

Btw download cannot be tested properly on dev as it's redirected to internal link (expensify.com.dev)

@situchan
Copy link
Contributor

situchan commented Dec 5, 2025

@LorenzoBloedow can you re-upload videos against latest commit? Text is still centered in your videos.

@LorenzoBloedow
Copy link
Contributor Author

@situchan When I upload the new videos, should I change this line to test download like I did before or just let the download fail?

return OLDDOT_ENVIRONMENT_URLS[environment];

return OLDDOT_ENVIRONMENT_URLS["production"];

@situchan
Copy link
Contributor

situchan commented Dec 5, 2025

@situchan When I upload the new videos, should I change this line to test download like I did before or just let the download fail?

return OLDDOT_ENVIRONMENT_URLS[environment];

return OLDDOT_ENVIRONMENT_URLS["production"];

no problem at all. you can hardcode that locally to make sure that download works

@LorenzoBloedow
Copy link
Contributor Author

Just updated the videos.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #76766.

Android 🤖 iOS 🍎
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/76766/index.html https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/76766/index.html
Android iOS
Web 🕸️
https://76766.pr-testing.expensify.com
Web

👀 View the workflow run that generated this build 👀

Copy link
Contributor

@trjExpensify trjExpensify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great! I think we can change the title to "Download PDF" in a follow-up, no problem.

2025-12-05_17-04-16.mp4

@puneetlath puneetlath merged commit e7344a6 into Expensify:main Dec 5, 2025
37 of 39 checks passed
@trjExpensify
Copy link
Contributor

Nice work, thanks! This'll make the deploy today if we get one out. 🎉

@OSBotify
Copy link
Contributor

OSBotify commented Dec 5, 2025

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Dec 5, 2025

🚀 Deployed to staging by https://github.com/puneetlath in version: 9.2.73-0 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented Dec 9, 2025

🚀 Deployed to production by https://github.com/thienlnam in version: 9.2.73-5 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants