Skip to content

Commit b47a772

Browse files
fix(mobile): use available space for composer model names
1 parent 150cd04 commit b47a772

3 files changed

Lines changed: 21 additions & 20 deletions

File tree

‎apps/mobile/src/components/ComposerToolbar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function ComposerInlineControl(props: {
3232
readonly icon?: ComponentProps<typeof SymbolView>["name"];
3333
readonly iconNode?: ReactNode;
3434
readonly label: string;
35-
readonly maxWidth?: number;
35+
readonly maxWidth?: ViewStyle["maxWidth"];
3636
readonly onPress?: () => void;
3737
readonly selected?: boolean;
3838
readonly static?: boolean;

‎apps/mobile/src/features/threads/NewTaskDraftScreen.tsx‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import {
3030
ComposerActionButton,
3131
ComposerInlineControl,
3232
ComposerToolbarRow,
33-
ComposerToolbarScroller,
3433
} from "../../components/ComposerToolbar";
3534
import { AndroidScreenHeader } from "../../components/AndroidScreenHeader";
3635
import { ComposerAttachmentButton } from "../../components/ComposerAttachmentButton";
@@ -1345,21 +1344,23 @@ export function NewTaskDraftScreen(props: {
13451344
onPickMedia={handlePickMedia}
13461345
onPickFiles={handlePickFiles}
13471346
/>
1348-
<ComposerToolbarScroller align="end" contentPaddingRight={0} fadeSurface="sheet">
1349-
<ComposerInlineControl
1350-
accessibilityLabel="Model and reasoning settings"
1351-
disabled={isComposerInteractionLocked}
1352-
emphasized
1353-
iconNode={
1354-
<ProviderIcon
1355-
provider={flow.selectedModelOption?.providerDriver}
1356-
size={16}
1357-
/>
1358-
}
1359-
label={flow.selectedModelOption?.label ?? "Choose model"}
1360-
maxWidth={152}
1361-
onPress={settingsSheetPresentation.open}
1362-
/>
1347+
<View className="min-w-0 flex-1 flex-row items-center justify-end gap-2">
1348+
<View className="min-w-0 shrink">
1349+
<ComposerInlineControl
1350+
accessibilityLabel="Model and reasoning settings"
1351+
disabled={isComposerInteractionLocked}
1352+
emphasized
1353+
iconNode={
1354+
<ProviderIcon
1355+
provider={flow.selectedModelOption?.providerDriver}
1356+
size={16}
1357+
/>
1358+
}
1359+
label={flow.selectedModelOption?.label ?? "Choose model"}
1360+
maxWidth="100%"
1361+
onPress={settingsSheetPresentation.open}
1362+
/>
1363+
</View>
13631364
{flow.planModeEnabled ? (
13641365
<ComposerInlineControl
13651366
accessibilityHint={`Switches to ${flow.interactionMode === "plan" ? "Build" : "Plan"} mode`}
@@ -1380,7 +1381,7 @@ export function NewTaskDraftScreen(props: {
13801381
showChevron={false}
13811382
/>
13821383
) : null}
1383-
</ComposerToolbarScroller>
1384+
</View>
13841385
</>
13851386
)}
13861387
<ComposerDictationPrimaryAction

‎apps/mobile/src/features/threads/ThreadComposer.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,15 +780,15 @@ export const ThreadComposer = memo(function ThreadComposer(props: ThreadComposer
780780
onPickMedia={props.onPickDraftMedia}
781781
onPickFiles={props.onPickDraftFiles}
782782
/>
783-
<View className="min-w-0 shrink" style={{ maxWidth: 152 }}>
783+
<View className="min-w-0 shrink">
784784
<ComposerInlineControl
785785
accessibilityLabel="Model and reasoning settings"
786786
emphasized
787787
iconNode={
788788
<ProviderIcon provider={currentModelOption?.providerDriver} size={16} />
789789
}
790790
label={currentModelOption?.label ?? currentModelSelection.model}
791-
maxWidth={152}
791+
maxWidth="100%"
792792
onPress={openSettings}
793793
/>
794794
</View>

0 commit comments

Comments
 (0)