Skip to content

[CP Staging] Fix AttachmentCamera UI rotation in landscape - #101526

Merged
mountiny merged 6 commits into
Expensify:mainfrom
ShridharGoel:fix-camera-ui-rotation
Sep 18, 2026
Merged

mountiny merged 6 commits into
Expensify:mainfrom
ShridharGoel:fix-camera-ui-rotation

Conversation

@ShridharGoel

@ShridharGoel ShridharGoel commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adapts the AttachmentCamera UI when rotating to landscape mode to follow the pattern used in IOURequestStepScan (receipt scanning camera):

  • Container flex direction switches to row (styles.flexRow) in landscape mode so the camera viewfinder remains on the left while controls stay on the right.
  • Controls bar switches from a horizontal row into a vertical column on the right side (!isLandscape && styles.flexRow), preventing UI controls from rotating awkwardly across the bottom in landscape.
  • Wraps the permission prompt view in a ScrollView with styles.permissionViewLandscape when in landscape mode to prevent content cutoff and allow scrolling.

Related to #96458

Fixed Issues

$ #101518

Tests

  1. On a mobile device or tablet (iOS / Android), navigate to any chat.
  2. Tap + -> Add attachment -> Take photo.
  3. In portrait mode, verify the camera viewfinder is on top and controls (Flash, Shutter, Flip) are arranged horizontally at the bottom.
  4. Rotate the device to landscape mode.
  5. Verify the camera preview occupies the left side of the screen and controls are arranged vertically in a column on the right side.
  6. Verify taking a photo, toggling flash, flipping camera, and tapping close all function properly in landscape mode.
  7. Disallow / reset camera permissions, open Take photo in landscape mode, and verify the permission prompt is scrollable and readable.
  • Verify that no errors appear in the JS console

Offline tests

Same as tests.

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 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 Screenshot 2026-09-18 at 1 19 26 PM
Screen.Recording.2026-09-18.at.1.20.25.PM.mov

@ShridharGoel
ShridharGoel marked this pull request as ready for review September 18, 2026 07:33
@ShridharGoel
ShridharGoel requested review from a team as code owners September 18, 2026 07:33
@melvin-bot
melvin-bot Bot requested review from heyjennahay and huult and removed request for a team September 18, 2026 07:33
@melvin-bot

melvin-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

@huult 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 removed the request for review from a team September 18, 2026 07:33
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@ShridharGoel

Copy link
Copy Markdown
Contributor Author

@huult This is ready for review

@huult

huult commented Sep 18, 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 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
    • 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
    • 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 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
Screen.Recording.2026-09-18.at.21.11.46.mp4

@huult

huult commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

@ShridharGoel #101499 We’ll fix this ticket in another PR, right?

Comment thread src/components/AttachmentPicker/AttachmentCamera.tsx
@ShridharGoel

Copy link
Copy Markdown
Contributor Author

#101499 We’ll fix this ticket in another PR, right?

Had thought that initially, but I think we should do in this PR itself

@ShridharGoel
ShridharGoel requested a review from huult September 18, 2026 08:23
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

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/CONST/index.ts 91.52% <ø> (ø)
...c/components/AttachmentPicker/AttachmentCamera.tsx 88.42% <89.65%> (-2.79%) ⬇️
... and 129 files with indirect coverage changes

@ShridharGoel

Copy link
Copy Markdown
Contributor Author

@huult Did you get a chance to review?

@huult

huult commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

I’ll continue reviewing it in the next hour.

@huult

huult commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Reviewing...

Comment thread src/components/AttachmentPicker/AttachmentCamera.tsx Outdated
Comment thread src/components/AttachmentPicker/AttachmentCamera.tsx Outdated
@ShridharGoel
ShridharGoel requested a review from huult September 18, 2026 13:49
Comment thread src/components/AttachmentPicker/AttachmentCamera.tsx Outdated
@ShridharGoel
ShridharGoel requested a review from huult September 18, 2026 14:31

@huult huult 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.

@mountiny mountiny changed the title Fix AttachmentCamera UI rotation in landscape [CP Staging] Fix AttachmentCamera UI rotation in landscape Sep 18, 2026

@mountiny mountiny 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.

Thanks for the fix

@mountiny
mountiny merged commit 472c858 into Expensify:main Sep 18, 2026
37 of 39 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

✋ 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 pushed a commit that referenced this pull request Sep 18, 2026
[CP Staging] Fix AttachmentCamera UI rotation in landscape

(cherry picked from commit 472c858)

(cherry-picked to staging by mountiny)
@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Sep 18, 2026
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.85-1 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes are required for this PR — no draft docs PR was created.

This change is a layout-only fix: it switches the AttachmentCamera container to a row in landscape, moves the Flash / Shutter / Flip camera controls into a vertical column on the right, wraps the camera-permission prompt in a ScrollView, and replaces hardcoded Sentry labels with CONST.SENTRY_LABEL.ATTACHMENT_CAMERA constants. No user-facing copy, feature, setting, tab, or button label changed.

What I checked in App/docs/articles

The only article that documents this flow is docs/articles/new-expensify/chat/Chat-Features-and-Moderation-Tools.md:22, which says only: "To add an attachment, click the plus icon and select Add attachment." It does not describe the camera screen's control positions or device orientation, so it stays accurate.

I also swept the docs for camera, take photo, add attachment, landscape, and rotate:

The help site documents what users can do, not per-orientation screen layout, so there is nothing to update here.

Since no docs change is needed, there is no help site PR to link, label HelpDot, or assign — I skipped those steps rather than opening an empty PR.

@ShridharGoel, please confirm you agree that no help site update is needed. If you think an article should call out the landscape camera layout, reply with @MelvinBot and the article you want changed and I'll open the draft PR.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.86-0 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.89-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Re-checked — still no help site changes required. No draft docs PR was created.

The merged diff is unchanged since my earlier review: the same three files (src/CONST/index.ts, src/components/AttachmentPicker/AttachmentCamera.tsx, tests/ui/components/AttachmentCameraTest.tsx), all layout, test-ID, and error-guard changes. No user-facing copy, feature, tab, setting, or button label changed, so nothing in App/docs/articles became inaccurate.

What the PR actually changes, and why the docs are unaffected
  • The AttachmentCamera container switches to a row in landscape, and the Flash / Shutter / Flip camera controls move into a vertical column on the right — src/components/AttachmentPicker/AttachmentCamera.tsx:244.
  • The camera-permission prompt is wrapped in a ScrollView so it stays readable in landscape. Its copy (receipt.takePhoto, receipt.cameraAccess, common.continue) is untouched.
  • Hardcoded Sentry labels move into CONST.SENTRY_LABEL.ATTACHMENT_CAMERAsrc/CONST/index.ts:9073. Internal only.

The only article covering this flow is docs/articles/new-expensify/chat/Chat-Features-and-Moderation-Tools.md:22, which says only: "To add an attachment, click the plus icon and select Add attachment." It never describes the camera screen's control positions or device orientation, so it stays correct.

I also swept the docs for camera, take photo, add attachment, landscape, and rotate. The two near-matches are both unrelated:

The help site documents what users can do, not per-orientation screen layout, so there is nothing to update.

Because no docs change is needed, there is no help site PR to link, label HelpDot, or assign — I skipped those steps rather than opening an empty PR.

@ShridharGoel, please confirm you agree that no help site update is needed. If you think an article should call out the landscape camera layout, reply with @MelvinBot naming the article and I'll open the draft PR.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/luacmartins in version: 9.4.89-0 🚀

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

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.4.90-0 🚀

platform result
🕸 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

CP Staging marks PRs that have been CP'd to staging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants