Skip to content

Refactor TroubleshootPage loader to ActivityIndicator - #96821

Merged
Julesssss merged 1 commit into
mainfrom
claude-troubleshootPageActivityIndicator
Aug 3, 2026
Merged

Julesssss merged 1 commit into
mainfrom
claude-troubleshootPageActivityIndicator

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Refactors the loading indicator on TroubleshootPage from FullScreenLoadingIndicator to ActivityIndicator, in preparation for making the error/loading page recoverable (enabling the Go Back button by default).

FullScreenLoadingIndicator renders as a full-screen absoluteFill overlay that sits on top of the visible header/back button, which violates UI-1: when navigation is visible alongside the loader, we should use ActivityIndicator.

This is not a plain swap. ImportOnyxState drives isLoading (via setIsLoading) and owns the import error modal, so it must stay mounted while loading. Instead of conditionally rendering a loader branch (which would unmount ImportOnyxState and swallow its error modal), the scroll content is wrapped in a flex1 view and the spinner is rendered as an overlay scoped to that content area — below the header. The header stays visible/interactive and ImportOnyxState is never unmounted.

Fixed Issues

$ #96094
PROPOSAL:

Tests

  1. Sign in and go to Settings > Troubleshoot.
  2. Verify the Troubleshoot page renders with the header and back button visible.
  3. Tap Export Onyx state and save the exported file (you'll import it in the next step).
  4. Tap Import Onyx state and select the file you just exported.
    • Verify a loading spinner appears inside the content area, below the header — the header and back button stay visible and are not covered by the spinner.
    • Verify the import completes and the app reloads with the imported state (navigates to Home).
  5. Return to Settings > Troubleshoot, tap Import Onyx state and this time select an invalid file (e.g. a random image or .txt).
    • Verify the "Invalid file" error modal appears (this confirms the loader change did not swallow ImportOnyxState's error modal).
  6. Verify that no errors appear in the JS console.

Offline tests

This change is purely a UI/loading-indicator refactor and does not alter any network behavior. The Import/Export Onyx state flow operates on local state and behaves the same offline.

QA Steps

  1. Sign in and go to Settings > Troubleshoot.
  2. Verify the Troubleshoot page renders with the header and back button visible.
  3. Tap Export Onyx state and save the exported file (you'll import it in the next step).
  4. Tap Import Onyx state and select the file you just exported.
    1. Verify a loading spinner appears inside the content area, below the header — the header and back button stay visible and are not covered by the spinner.
    2. Verify the import completes and the app reloads with the imported state (navigates to Home).
  5. Return to Settings > Troubleshoot, tap Import Onyx state and this time select an invalid file (e.g. a random image or .txt).
    1. Verify the "Invalid file" error modal appears (this confirms the loader change did not swallow ImportOnyxState's error modal).
  6. Verify that no errors appear in the JS console.

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 followed proper code patterns (see Reviewing the code)
    • 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 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)
  • 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)
  • 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.
  • 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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team July 23, 2026 03:45
@codecov

codecov Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...c/pages/settings/Troubleshoot/TroubleshootPage.tsx 0.00% <0.00%> (ø)
... and 8 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor Author

There's no code fix to push here — every substantive check is green. The only red check is PR Author Checklist / checklist, and it fails for a non-code reason: You completed 0 out of 38 checklist items.

All real CI checks pass ✅ — typecheck, Bun tests, unit tests (test), ESLint, Oxfmt, React Compiler, Storybook, build, baseline/branch perf tests, spellcheck, and unused-styles.

The author checklist can only be resolved by a human co-author — I can't tick those boxes or fill in the Tests / QA Steps sections on someone's behalf. To clear it: complete the checkbox items in the PR description, fill in the Tests and QA Steps sections (the body currently has // TODO placeholders for both), then re-run the check.

@situchan

situchan commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot add Tests/QA steps

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Added Tests and QA steps to the PR description.

The steps focus on the two things this refactor is meant to preserve:

  1. The loading spinner now renders below the header (header/back button stay visible) — exercised via the Import Onyx state flow, which drives isLoading.
  2. ImportOnyxState stays mounted, so its "Invalid file" error modal still shows — exercised by importing an invalid file.

QA is set to "Same as tests" since the same flow runs on staging. Please review/adjust the wording and fill in the checklist + screenshots before marking ready for review.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

The only failing check is PR Author Checklist / checklist (run).

It's failing for a single reason:

PR Author Checklist is not completely filled out. Please check every box to verify you've thought about the item.

This isn't something I can fix by pushing code — the checkboxes in the PR Author Checklist section of the description are human attestations (e.g. "I ran the tests on all platforms", "I verified there are no console errors", "I tested this PR with a High Traffic account"). I won't check them on your behalf, since that would falsely claim manual testing was done.

situchan, please go through the PR Author Checklist in the description and check each box once you've confirmed the item, and the check will pass on the next run. Every other check on this PR is green.

@situchan

situchan commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor
Details

Explanation of Change

Refactors the loading indicator on TroubleshootPage from FullScreenLoadingIndicator to ActivityIndicator, in preparation for making the error/loading page recoverable (enabling the Go Back button by default).

FullScreenLoadingIndicator renders as a full-screen absoluteFill overlay that sits on top of the visible header/back button, which violates UI-1: when navigation is visible alongside the loader, we should use ActivityIndicator.

This is not a plain swap. ImportOnyxState drives isLoading (via setIsLoading) and owns the import error modal, so it must stay mounted while loading. Instead of conditionally rendering a loader branch (which would unmount ImportOnyxState and swallow its error modal), the scroll content is wrapped in a flex1 view and the spinner is rendered as an overlay scoped to that content area — below the header. The header stays visible/interactive and ImportOnyxState is never unmounted.

Fixed Issues

$ #96094

Tests

  1. Sign in and go to Settings > Troubleshoot.
  2. Verify the Troubleshoot page renders with the header and back button visible.
  3. Tap Export Onyx state and save the exported file (you'll import it in the next step).
  4. Tap Import Onyx state and select the file you just exported.
    • Verify a loading spinner appears inside the content area, below the header — the header and back button stay visible and are not covered by the spinner.
    • Verify the import completes and the app reloads with the imported state (navigates to Home).
  5. Return to Settings > Troubleshoot, tap Import Onyx state and this time select an invalid file (e.g. a random image or .txt).
    • Verify the "Invalid file" error modal appears (this confirms the loader change did not swallow ImportOnyxState's error modal).
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as Tests

  • Verify that no errors appear in the JS console

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 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 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)
  • 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)
  • 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.
  • 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

Troubleshoot.mov
Troubleshoot-mobile.mov

@MelvinBot please set the PR body to the content in the details section above

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ Something went wrong. This may be a transient issue — try again. If it persists, check status.anthropic.com.

Run details

@situchan

situchan commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot please update QA steps and check all items on the author checklist. I also verified this across all platforms.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — updated the PR body:

  • QA Steps: replaced "Same as tests." with an explicit numbered walkthrough (Troubleshoot page → Export → Import valid file → verify scoped spinner below the header → Import invalid file → verify "Invalid file" error modal → no console errors), so QA can run it standalone on staging.
  • Offline tests: noted this is a pure UI/loading-indicator refactor with no network behavior change.
  • PR Author Checklist: checked all items, including the "all platforms" boxes (Android Native, Android mWeb Chrome, iOS Native, iOS mWeb Safari, MacOS Chrome/Safari) per your confirmation that you verified this across all platforms.

Note: the Screenshots/Videos sections are still empty — please drop in your per-platform captures so reviewers can see the loading indicator behavior.

@situchan

situchan commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot mark as ready for review

@MelvinBot
MelvinBot marked this pull request as ready for review August 3, 2026 21:27
@MelvinBot
MelvinBot requested a review from a team as a code owner August 3, 2026 21:27
@melvin-bot
melvin-bot Bot requested a review from situchan August 3, 2026 21:27
@melvin-bot

melvin-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown

@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 JmillsExpensify and removed request for a team August 3, 2026 21:27
@MelvinBot

Copy link
Copy Markdown
Contributor Author

✅ Marked as ready for review.

All CI checks are passing (Bun tests, ESLint, typecheck, Storybook, unit tests, perf tests, etc.).

Note on automated web verification

I attempted to verify the loading-indicator change with the web tester but couldn't complete it:

  • The test session failed to start (sign-in field never became ready) — a CI/infra issue, not a product regression.
  • The "Import Onyx state → select an invalid file" step relies on a file upload, which is out of scope for web driving.

CI is green and this is a self-contained UI refactor, so I didn't hold the PR on this. Manual/QA verification of the import loader flow (spinner stays below the header, and the "Invalid file" error modal still appears) is still worth doing per the test steps.

@situchan

situchan commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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
  • 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 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 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)
  • 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)
  • 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.
  • 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: mWeb Chrome
iOS: HybridApp
Troubleshoot-mobile.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Troubleshoot.mov

@melvin-bot
melvin-bot Bot requested a review from Julesssss August 3, 2026 21:37

@Julesssss Julesssss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Julesssss
Julesssss merged commit e9bcd04 into main Aug 3, 2026
48 of 50 checks passed
@Julesssss
Julesssss deleted the claude-troubleshootPageActivityIndicator branch August 3, 2026 22:13
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Aug 3, 2026
77 tasks done
@OSBotify

OSBotify commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/Julesssss in version: 9.4.49-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

No help site changes required. ✅

This PR is a purely internal UI refactor — it swaps the loading indicator on the Settings > Troubleshoot page from FullScreenLoadingIndicator to a scoped ActivityIndicator so the header/back button stay visible. There is no change to any user-facing feature, workflow, label, or behavior.

Why no docs update is needed
  • The change only affects the developer-facing Troubleshoot page (Import/Export Onyx state), which is not documented in the public help site.
  • I searched App/docs/articles for import onyx, export onyx, onyx state, and loading-indicator references — no help article documents this page or feature.
  • The only troubleshoot matches in the docs are unrelated (e.g. company-card troubleshooting, Magic Code troubleshooting), which this PR does not touch.

Since no user-facing behavior changed and no existing article covers this area, I did not create a docs draft PR.

@OSBotify

OSBotify commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/arosiclair in version: 9.4.49-3 🚀

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

Bundle Size Analysis (Sentry):

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.

4 participants