You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes landscape layout on Agents/Agent Rules pages when the keyboard is open. Replaces the scrollable-form layout with a collapsing header, shrinks multiline prompt inputs to a fixed height while the keyboard is active, and renders Save/Delete in one row in landscape.
Also corrects the header collapse math for the top safe area inset. Fixes not restoring header height after device rotation to portrait mode. Also adding isKeyboardFullyOpen check and add naturalHeightRef.current !== height comparison in onLayout to make sure duplicated onLayout height updates do not cancel ongoing animationwhen rotating from portrait to landscape with opened keyboard
Go to Account settings > Workspaces > [workspace] > Agents > Add agent (or Settings > Agents > Add agent)
Tap the Prompt multiline input to open the keyboard
Verify that the prompt input shrinks to ~2 visible lines instead of stretching behind the keyboard, and that the input is scrolled into view (check specifically on iOS native)
Type a multi-line prompt and verify the text is visible while typing and the Save button remains reachable
Dismiss the keyboard and verify the header expands back to its full height and the prompt input grows back to fill the available space
Rotate back to portrait and verify the layout is unchanged from before this PR (full-height prompt input, no header collapsing)
Test 2: Edit agent rule in landscape (Save + Delete in one row)
In landscape mode, go to Workspace settings > Rules > Agent rules and open an existing rule (Edit rule page)
Focus the rule prompt input to open the keyboard
Verify the prompt input shrinks, and both the Delete and Save buttons are visible side by side in a single row
Dismiss the keyboard and verify the layout restores
Rotate to portrait and verify Delete and Save are stacked vertically as before
Test 3: Add agent rule tabs + Profile page
In landscape mode, go to Workspace settings > Rules > Agent rules > Add rule
On the Suggestions tab, focus the search input to open the keyboard and verify the header + tab selector collapse and the Next button scrolls inside the list content instead of being pinned as a fixed footer behind the keyboard
Switch to the Write tab, focus the prompt input, and verify the headline/description collapse, the prompt input shrinks, and the submit button stays visible
Go to Account settings > Profile, still in landscape, and focus any input on the page
Verify the profile header collapses on keyboard open and expands again on keyboard close, and that no content is clipped
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 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 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.
@m-natarajan would you be able to check if this is still happening for you here? I tested Android on different simulators and on my Android 16 physical device, but I'm not able to reproduce this bug so I just want to confirm this needs a separate fix
@m-natarajan thank you, from what I see you tested version without the changes from this PR, but the bug I linked in my previous comment is what caused the revert, so I wanted to make sure it is not reproducible on this PR. Are you able to do that in any way? I'd be really grateful as I can't reproduce it on my end, but you were able to first time these changes were merged to main. I can ask someone for an ad-hoc build if it's needed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Changes from #97214 and #94565 that were reverted because of this #97196 (comment)
Fixes landscape layout on Agents/Agent Rules pages when the keyboard is open. Replaces the scrollable-form layout with a collapsing header, shrinks multiline prompt inputs to a fixed height while the keyboard is active, and renders Save/Delete in one row in landscape.
Also corrects the header collapse math for the top safe area inset. Fixes not restoring header height after device rotation to portrait mode. Also adding isKeyboardFullyOpen check and add naturalHeightRef.current !== height comparison in onLayout to make sure duplicated onLayout height updates do not cancel ongoing animationwhen rotating from portrait to landscape with opened keyboard
Fixed Issues
$ #93631, #97196
PROPOSAL: N/A
Tests
Test 1: Add agent page in landscape
Test 2: Edit agent rule in landscape (Save + Delete in one row)
Test 3: Add agent rule tabs + Profile page
Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari