Skip to content

Commit 36fb1c0

Browse files
Merge pull request #16 from chriswritescode-dev/fix-mobile-input
Fix mobile input
2 parents b739c52 + 42f604c commit 36fb1c0

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

frontend/src/components/message/PromptInput.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { useModelSelection } from '@/hooks/useModelSelection'
88

99
import { useUserBash } from '@/stores/userBashStore'
1010
import { useMobile } from '@/hooks/useMobile'
11-
import { ChevronDown } from 'lucide-react'
11+
import { useSessionStatusForSession } from '@/stores/sessionStatusStore'
12+
import { ChevronDown, Square } from 'lucide-react'
1213

1314
import { CommandSuggestions } from '@/components/command/CommandSuggestions'
1415
import { MentionSuggestions, type MentionItem } from './MentionSuggestions'
@@ -451,7 +452,9 @@ export function PromptInput({
451452
const { model: selectedModel, modelString } = useModelSelection(opcodeUrl, directory)
452453
const currentModel = modelString || ''
453454
const isMobile = useMobile()
454-
const hideSecondaryButtons = isMobile && (hasActiveStream || showScrollButton)
455+
const sessionStatus = useSessionStatusForSession(sessionID)
456+
const showStopButton = hasActiveStream && (sessionStatus.type === 'busy' || sessionStatus.type === 'retry')
457+
const hideSecondaryButtons = isMobile && hasActiveStream
455458

456459
useEffect(() => {
457460
const loadModelName = async () => {
@@ -485,7 +488,7 @@ export function PromptInput({
485488
return (
486489
<div className="relative backdrop-blur-md bg-background opacity-95 border border-border rounded-xl p-2 md:p-3 mx-2 md:mx-4 mb-2 md:mb-5 w-[90%] md:max-w-4xl">
487490
{hasActiveStream && (
488-
<div className="mb-2">
491+
<div className="">
489492
<SessionStatusIndicator sessionID={sessionID} />
490493
</div>
491494
)}
@@ -566,14 +569,14 @@ export function PromptInput({
566569
<ChevronDown className="w-5 h-5" />
567570
</button>
568571
)}
569-
{hasActiveStream && (
572+
{showStopButton && (
570573
<button
571574
onClick={handleStop}
572575
disabled={disabled}
573-
className="px-3 md:px-4 py-1.5 rounded-lg text-sm font-medium transition-colors bg-destructive hover:bg-destructive/90 text-destructive-foreground"
576+
className="p-1.5 px-4 md:p-2 rounded-lg transition-colors bg-destructive hover:bg-destructive/90 text-destructive-foreground"
574577
title="Stop"
575578
>
576-
Stop
579+
<Square className="w-4 h-4" />
577580
</button>
578581
)}
579582
<button

0 commit comments

Comments
 (0)