Skip to content

[WIP] refactor: narrow plan, currency, chart, and video preview values - #103226

Draft
KJ21-ENG wants to merge 5 commits into
Expensify:mainfrom
KJ21-ENG:seatbelt-v2/fresh-20261006-9-3361c0df
Draft

KJ21-ENG wants to merge 5 commits into
Expensify:mainfrom
KJ21-ENG:seatbelt-v2/fresh-20261006-9-3361c0df

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Remove unsafe type assertions from five production paths: workspace plan selection, upgrade artwork lookup, preferred currency, video attachment preview, and chart label units. Preserve the supported plan choices, currency precedence, artwork lookup, and chart formatting. The video preview accepts a nullable source-load event before requesting a thumbnail. Focused tests cover these paths, including the selected player, sourceLoad event, and null default in the attachment preview.

Changed files
  • src/pages/workspace/DynamicWorkspaceOverviewPlanTypePage.tsx
  • src/pages/workspace/upgrade/UpgradeIntro.tsx
  • src/hooks/usePreferredCurrency.ts
  • src/components/AttachmentPreview.tsx
  • src/components/Charts/hooks/useChartLabelFormats.ts
  • tests/unit/DynamicWorkspaceOverviewPlanTypePageTest.tsx
  • tests/unit/UpgradeIntroTest.tsx
  • tests/unit/usePreferredCurrencyTest.tsx
  • tests/unit/AttachmentPreviewTest.tsx
  • tests/unit/components/Charts/useChartLabelFormats.test.ts

Fixed Issues

General type-safety cleanup across these five production files.

Tests

On the local candidate, the five focused Jest suites passed all 27 tests. Focused App lint passed on the ten changed paths with zero errors and two allowed warnings. The cleanup rule reported zero findings on each of the five production targets. Formatting, spelling, and React Compiler checks passed on the ten-path scope. Focused TypeScript reported zero diagnostics on the changed test root. The attachment test checks the selected player, sourceLoad, and null, then checks thumbnail generation after a source event and no generation for a non-video attachment.

Run the human cases on a candidate development build with authorized ordinary test accounts. Plan-picker, currency, and chart edge cases are covered by the focused tests.

Advanced Approvals artwork

Setup: Sign in to an account with an ordinary eligible Collect workspace. Have published-base and candidate builds that can open that same workspace with the same data and viewport. Do not complete an upgrade.

  1. In the candidate workspace, open Workflows and select the Advanced Approvals upgrade preview. The title, description, price, and illustration load.
  2. Open the same preview on the base build. The candidate illustration, size, and clipping match the loaded base appearance.
  3. Return to the workspace. No upgrade is applied.

Native shared-video preview

Setup: On Android native and iOS native candidate builds, sign in to an ordinary writable test chat. Have a valid MP4 of at least three seconds available in the device's files or photo app.

  1. Use the device's system Share action for the MP4, choose Expensify, and select the test chat. Share Details opens for that file.
  2. Wait for the preview. A video thumbnail appears with a play indicator.
  3. Tap the preview. The viewer opens the same video.
  4. Back out before pressing Share. The video is not sent.
  • Verify that no errors appear in the JS console

Offline tests

N/A for additional offline testing: the changes do not alter a network, persistence, retry, or reconnect path.

QA Steps

Same as tests on a build containing this candidate, with the stated workspace, chat, and device prerequisites.

  • 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 verified any copy / text that was added to the app 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 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 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

Screenshots/Videos

https://github.com/KJ21-ENG/App/releases/download/chrome-qa-batch-20261015/PR-103226-Chrome-QA-unmasked-2x.mp4

Selected recording lanes are Windows Chrome desktop and Windows Chrome with mobile viewport emulation. The mobile viewport is desktop Chrome emulation, not Android Chrome, iOS Safari, or native coverage; it cannot exercise the system Share action or native video decoding. This Chrome recording reports console errors and circular clipping on earlier revision f66be448cb893be18395528ba72922cb380c07d2; it does not verify this candidate. The clipping view is unchanged across the audited base and published head, so square corners are not a pass criterion. Candidate artwork comparison, Android and iOS native MP4 preview, console behavior, and actual mobile browser and Safari coverage remain unverified. Mocked tests do not establish native event delivery or decoding. Focused TypeScript found 55 diagnostics in imported files outside the changed test root; no clean full-App typecheck is claimed. Checked checklist boxes are presentation only and do not establish manual passes.

Seatbelt-Operation: 4026f6b9-f9fe-4443-8cfd-07e619ccd7e8
Seatbelt-Operation: f8a19569-0abb-429e-a2e3-094cbd2debbc
Seatbelt-Operation: c422ddda-3c1b-403c-b8a4-eba3a6a14e3b
Seatbelt-Operation: 6df47529-1e13-4f81-ad41-bc184395612d
Seatbelt-Operation: 9ebe2014-21ca-44ee-b434-1dca06dab3fa
@KJ21-ENG KJ21-ENG changed the title Remove unsafe type assertions from workspace plans, currency, charts, and video preview [WIP] refactor: narrow plan, currency, chart, and video preview values Oct 23, 2026

This branch has not been deployed

No deployments
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.

1 participant