Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/mobile/src/j5/agents/AgentCreateScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function AgentCreateScreen() {
<TextInput
accessibilityLabel="Instructions"
multiline
autoCapitalize="none"
autoCapitalize="sentences"
autoCorrect={false}
style={{ minHeight: 160 }}
placeholder="# Who this persona is"
Expand Down
2 changes: 2 additions & 0 deletions apps/mobile/src/j5/agents/AgentDefinitionFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export function AgentRoutePolicyFields(props: {
actions={modelGroups.map((harness) => ({
id: harness.driver,
title: harness.label,
// iOS shows each provider as a section, avoiding the submenu transition.
displayInline: true,
attributes: {
disabled: disabled || harness.models.length === 0,
},
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/j5/agents/AgentEditorScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function AgentEditorScreen() {
<TextInput
accessibilityLabel="Instructions"
multiline
autoCapitalize="none"
autoCapitalize="sentences"
autoCorrect={false}
style={{ minHeight: 160 }}
placeholder={instructions === null ? "Loading…" : undefined}
Expand Down
36 changes: 29 additions & 7 deletions apps/mobile/src/j5/agents/SettingsFormScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
import type { AgentPersonaCreateDraft } from "@t3tools/client-runtime/j5/agent-personas";
import type { AgentPersonaEditInput, EnvironmentId, ProjectId } from "@t3tools/contracts";
import { useRef, type ReactNode } from "react";
import { KeyboardAvoidingView, Platform } from "react-native";
import { Platform } from "react-native";
import { KeyboardAwareScrollView, useKeyboardState } from "react-native-keyboard-controller";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import * as Dialog from "../../components/ui/Dialog";
Expand Down Expand Up @@ -91,6 +92,7 @@ export function SettingsFormScreen(props: {
}) {
const navigation = useNavigation();
const insets = useSafeAreaInsets();
const keyboardVisible = useKeyboardState((state) => state.isVisible);
return (
<SettingsScreen title={props.title}>
{Platform.OS === "ios" ? (
Expand Down Expand Up @@ -120,20 +122,40 @@ export function SettingsFormScreen(props: {
}
/>
) : null}
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior={Platform.OS === "ios" ? "padding" : undefined}
>
{/* iOS keeps upstream's scroll view, which registers with the native header and insets for the
keyboard; with it up, the home indicator area is already covered, so Save gets no extra
padding. Android has no header marker, so keyboard-controller's scroll view lets the form
scroll clear of the keyboard, as the Inbox does. */}
{Platform.OS === "ios" ? (
<ScrollView
automaticallyAdjustKeyboardInsets
keyboardShouldPersistTaps="handled"
contentInsetAdjustmentBehavior="automatic"
className="flex-1"
contentContainerClassName="gap-4 px-5 pt-4"
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 18) + 18 }}
contentContainerStyle={{
paddingBottom: keyboardVisible ? 0 : Math.max(insets.bottom, 18) + 18,
}}
>
{props.children}
</ScrollView>
</KeyboardAvoidingView>
) : (
<KeyboardAwareScrollView
bottomOffset={80}
keyboardShouldPersistTaps="handled"
className="flex-1"
contentContainerClassName="gap-4 px-5 pt-4"
// Android's content width cap, as upstream's ScreenScrollView applies it.
contentContainerStyle={{
width: "100%",
maxWidth: 720,
alignSelf: "center",
paddingBottom: Math.max(insets.bottom, 18) + 18,
}}
>
{props.children}
</KeyboardAwareScrollView>
)}
</SettingsScreen>
);
}
Loading