Skip to content

Revert #94565 and #97214 (Agents input auto scroll + CollapsibleHeaderOnKeyboard rotation fix) - #97298

Merged
NicolasBonet merged 2 commits into
mainfrom
nicolas-revert-94565
Jul 29, 2026
Merged

NicolasBonet merged 2 commits into
mainfrom
nicolas-revert-94565

Conversation

@NicolasBonet

@NicolasBonet NicolasBonet commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Reverts two PRs:

The revert of #94565 had one conflict in src/pages/settings/Agents/AddAgentPage.tsx because the file was later refactored (agent template pre-fill and the AddAgentPageContent split). The conflict was resolved by keeping the newer structure and removing only what that PR introduced: the CollapsibleHeaderOnKeyboard wrapper around the header, the scrollToMultilineInput focus handler, and the keyboard-driven prompt-input shrinking.

The revert of #97214 is clean and only touches src/components/CollapsibleHeaderOnKeyboard/index.native.tsx.

Fixed Issues

For #93631
For #97196
PROPOSAL: N/A

Tests

  1. Go to Settings > Agents and add a new agent.
  2. Verify the Add agent page renders correctly (avatar, name input, prompt input) and the agent can be created.
  3. On a mobile device in landscape mode, focus the prompt input and verify the page remains usable (behavior from before the reverted PRs is expected).
  4. Repeat for the workspace Rules > Agent rules add/edit pages.
  5. On a native device, open a screen that uses CollapsibleHeaderOnKeyboard (e.g. the split expense page), focus an input so the header collapses, dismiss the keyboard, and verify the header is restored.
  • 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.

…k/landscape-mode/agent-prompt-multiline-input"

This reverts commit a733d23, reversing
changes made to 557846e.
@NicolasBonet
NicolasBonet requested review from a team as code owners July 29, 2026 01:25
@melvin-bot

melvin-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@melvin-bot
melvin-bot Bot requested review from pecanoro and trjExpensify and removed request for a team July 29, 2026 01:25
@melvin-bot

melvin-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

@pecanoro 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 July 29, 2026 01:26
…k/landscape-mode/fix-collapsiple-header-not-restoring-header-height"

This reverts commit d51fb36, reversing
changes made to d73f809.
@NicolasBonet NicolasBonet changed the title Revert "Fix Agents - Input field does not auto scroll down when entering next line" (#94565) Revert #94565 and #97214 (Agents input auto scroll + CollapsibleHeaderOnKeyboard rotation fix) Jul 29, 2026
@codecov

codecov Bot commented Jul 29, 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/components/Form/FormProvider.tsx 65.94% <ø> (ø)
src/components/Form/FormWrapper.tsx 90.62% <ø> (-0.15%) ⬇️
src/components/FormAlertWithSubmitButton.tsx 97.14% <100.00%> (-0.36%) ⬇️
src/pages/settings/Agents/AddAgentPage.tsx 93.24% <100.00%> (-0.43%) ⬇️
...rc/pages/settings/Agents/Fields/EditPromptPage.tsx 70.00% <100.00%> (-0.74%) ⬇️
...ce/rules/AgentRules/AddAgentRuleSuggestionsTab.tsx 98.14% <100.00%> (-0.13%) ⬇️
src/pages/settings/Profile/ProfilePage.tsx 95.09% <60.00%> (ø)
...es/workspace/rules/AgentRules/AddAgentRulePage.tsx 0.00% <0.00%> (ø)
...orkspace/rules/AgentRules/AddAgentRuleWriteTab.tsx 0.00% <0.00%> (ø)
...nents/CollapsibleHeaderOnKeyboard/index.native.tsx 60.52% <41.66%> (-0.73%) ⬇️
... and 1 more
... and 9 files with indirect coverage changes

@NicolasBonet
NicolasBonet merged commit 8755ef7 into main Jul 29, 2026
44 checks passed
@NicolasBonet
NicolasBonet deleted the nicolas-revert-94565 branch July 29, 2026 01:37
@github-actions

Copy link
Copy Markdown
Contributor

🚧 NicolasBonet 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.

@truph01

truph01 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@NicolasBonet Why do we need to revert these changes? Could you link the bugs caused by the two PRs that were reverted?

@OSBotify OSBotify added the CP Staging marks PRs that have been CP'd to staging label Jul 29, 2026
@NicolasBonet

Copy link
Copy Markdown
Contributor Author

@NicolasBonet Why do we need to revert these changes? Could you link the bugs caused by the two PRs that were reverted?

We were blocking the release for the entire day, in the original PR you can find the bug.

NicolasBonet added a commit that referenced this pull request Jul 29, 2026
Revert #94565 and #97214 (Agents input auto scroll + CollapsibleHeaderOnKeyboard rotation fix)

(cherry picked from commit 8755ef7)

(cherry-picked to staging by mountiny)

(cherry-picked to staging by mountiny)
mountiny added a commit that referenced this pull request Jul 29, 2026
…458097637-1

🍒 Cherry pick PR #97298 to staging 🍒
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Cherry-picked to staging by https://github.com/NicolasBonet in version: 9.4.45-14 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — no changes required

I reviewed the changes in this PR against the help site articles under docs/articles.

Conclusion: No help site updates are required.

Why: This PR is a straight revert of two bug fixes:

All touched files are low-level UI/keyboard behavior — the CollapsibleHeaderOnKeyboard component, the scrollToMultilineInput focus handler, and the removal of those wrappers from the Agents / Agent Rules pages. None of this changes any documented, user-facing feature, setting, tab, or workflow.

The relevant help content (e.g. Create-and-Use-Custom-Agents.md, Create-Agent-Rules.md, How-to-Write-Agent-Rules.md) describes how to create and configure agents and rules conceptually. It does not document input auto-scroll or header-collapse-on-keyboard behavior, so reverting those mechanics has no impact on what the articles say.

Since no documentation changes are warranted, I did not create a draft PR (and therefore there is no help site PR to review or mark Ready for review).

@NicolasBonet, if you believe a documented behavior is affected and a help site update is needed, let me know and I'll create the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.45-14 🚀

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

Bundle Size Analysis (Sentry):

@OSBotify

Copy link
Copy Markdown
Contributor

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

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

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

This PR reverts two PRs (#94565 and #97214) that were purely internal UI/component behavior fixes:

  • Auto-scroll of the Agents input field when entering a new line
  • CollapsibleHeaderOnKeyboard collapse/restore behavior on native (landscape keyboard + rotation)
Why no docs are needed
  • The changes only affect on-device keyboard/scroll/layout behavior on native and landscape mode — no user-facing feature, setting, tab, button, or workflow was added, removed, or renamed.
  • The existing AI Agents help articles (Create-and-Use-Custom-Agents.md, Create-Agent-Rules.md, How-to-Write-Agent-Rules.md) document how to create and configure agents and agent rules. None of them describe input scrolling, keyboard behavior, or landscape/rotation behavior, so nothing in them becomes inaccurate as a result of this revert.
  • Confirmed by searching App/docs/articles for scroll, keyboard, landscape, and rotat — no matches in the agents articles.

Since no changes are required, I did not create a draft help-site PR. If you believe a documented behavior did change here, let me know and I'll take another look.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.46-10 🚀

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

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