Use landscape-aware scrollable layout on Edit Agent and AI Rule pages#93446
Use landscape-aware scrollable layout on Edit Agent and AI Rule pages#93446MelvinBot wants to merge 1 commit into
Conversation
…e pages In landscape on native, un-dock the footer button into the scrollable view and give the multiline prompt input a minimum height, matching AddAgentPage. Portrait behavior is unchanged. Co-authored-by: mkhutornyi <mkhutornyi@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
I analyzed the checks — there's no code failure to fix. The only red check is Everything substantive is green:
The Next step: complete the |
Explanation of Change
On the Edit Agent instructions page and the Add/Edit AI Rule pages, the footer (Save/Delete) button was docked to the bottom of the screen and the multiline prompt input had no minimum height. In landscape orientation on iOS/Android this docked footer ate into the already-limited vertical space, making the input hard to see and use, and the page could not be scrolled to reach the full view.
AddAgentPagealready solved this by deriving ashouldUseScrollableLayoutflag from the device orientation and threading it throughScreenWrapperandFormProviderso that, in landscape, the footer joins the scroll content and the input keeps a minimum height. This change applies the exact same landscape-aware pattern to the three sibling pages that share the same form layout:src/pages/settings/Agents/Fields/EditPromptPage.tsxsrc/pages/workspace/rules/AIRules/AddAIRulePage.tsxsrc/pages/workspace/rules/AIRules/EditAIRulePage.tsxOn each page:
const shouldUseScrollableLayout = useIsInLandscapeMode() || (isMobile() && windowWidth > windowHeight);shouldEnableMaxHeight={shouldUseScrollableLayout}toScreenWrapper.shouldUseScrollView={false}/submitFlexEnabled={false}onFormProviderwithshouldUseScrollView={shouldUseScrollableLayout}/submitFlexEnabled={shouldUseScrollableLayout ? undefined : false}, so in landscape the footer renders inside the ScrollView and the whole page scrolls.Viewthat getsstyles.minHeight42only in landscape, giving the input a sensible minimum height.Because the flag is
falsein portrait, the props collapse back to the current non-scroll / docked-footer / no-min-height behavior, so portrait is unaffected — only native landscape changes, as scoped in the issue.Fixed Issues
$ #93182
PROPOSAL:
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionScreenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari