Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): show reasoning and fast mode in the composer #19419

Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/19419/headopened View on GitHub

Showing 6 changed files with 86 additions and 15 deletions (loading 3).

x
0 of 6 viewed, 6 left
76 additions and 0 deletionsapps/mobile/src/components/ComposerModelControl.tsxAdded
View file
@@ -0,0 +1,76 @@
+import type { ModelSelection } from "@t3tools/contracts";
+​
+import type { ModelOption } from "../lib/modelOptions";
+import {
+ composerModelOptionSummary,
+ resolveProviderOptionDescriptors,
+} from "../lib/providerOptions";
+import { AppText as Text } from "./ui/AppText";
+import { SymbolView } from "./ui/AppSymbol";
+import { ComposerInlineControl } from "./ComposerToolbar";
+import { ProviderIcon } from "./ProviderIcon";
+import { useAndroidControlSizing } from "./ui/useAndroidControlSizing";
+​
+/** Keeps option indicators fixed while the model name yields space in a narrow toolbar. */
+export function ComposerModelControl(props: {
+ readonly modelOption: ModelOption | null | undefined;
+ readonly selection: ModelSelection | null;
+ readonly reportedSelection?: ModelSelection | null | undefined;
+ readonly disabled?: boolean;
+ readonly onPress: () => void;
+}) {
+ const { scale } = useAndroidControlSizing();
+ const label = props.modelOption?.label ?? props.selection?.model ?? "Choose model";
+ const { reasoningLabel, speedLabel } = composerModelOptionSummary({
+ provider: props.modelOption?.providerDriver,
+ descriptors: resolveProviderOptionDescriptors({
+ capabilities: props.modelOption?.capabilities,
+ selections: props.selection?.options,
+ }),
+ selection: props.selection,