feat(app): gate return-key submit icon to new workspace composer

The new-workspace composer is a one-shot "create" submit, not a chat send, so
a return-key glyph reads more accurately there than an arrow. Add a submitIcon
prop on Composer/MessageInput (defaulting to "arrow") and opt NewWorkspace
into "return".
This commit is contained in:
Mohamed Boudra
2026-04-18 16:03:08 +07:00
parent b0e0786419
commit 5d76cc8840
6 changed files with 44 additions and 6 deletions
@@ -20,7 +20,7 @@ import {
forwardRef,
} from "react";
import { StyleSheet, useUnistyles } from "react-native-unistyles";
import { Mic, MicOff, CornerDownLeft, Plus, Square } from "lucide-react-native";
import { ArrowUp, Mic, MicOff, CornerDownLeft, Plus, Square } from "lucide-react-native";
import Animated, { useSharedValue, useAnimatedStyle, withTiming } from "react-native-reanimated";
import { useDictation } from "@/hooks/use-dictation";
import { DictationOverlay } from "./dictation-controls";
@@ -85,6 +85,7 @@ export interface MessageInputProps {
allowEmptySubmit?: boolean;
/** Optional accessibility label for the primary submit button. */
submitButtonAccessibilityLabel?: string;
submitIcon?: "arrow" | "return";
isSubmitDisabled?: boolean;
isSubmitLoading?: boolean;
attachments: ComposerAttachment[];
@@ -217,6 +218,7 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
hasExternalContent = false,
allowEmptySubmit = false,
submitButtonAccessibilityLabel,
submitIcon = "arrow",
isSubmitDisabled = false,
isSubmitLoading = false,
attachments,
@@ -1180,8 +1182,10 @@ export const MessageInput = forwardRef<MessageInputRef, MessageInputProps>(funct
>
{isSubmitLoading ? (
<ActivityIndicator size="small" color="white" />
) : (
) : submitIcon === "return" ? (
<CornerDownLeft size={buttonIconSize} color="white" />
) : (
<ArrowUp size={buttonIconSize} color="white" />
)}
</TooltipTrigger>
<TooltipContent side="top" align="center" offset={8}>