Skip to content

Commit ea105b9

Browse files
committed
fix(mobile): preserve touch attachment and reduced-motion behavior
1 parent 2c3f2f1 commit ea105b9

3 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -935,10 +935,7 @@ export function MothershipChat({
935935
</div>
936936

937937
<div
938-
className={cn(
939-
styles.footer,
940-
animateInput && 'animate-slide-in-bottom motion-reduce:animate-none'
941-
)}
938+
className={cn(styles.footer, animateInput && 'animate-slide-in-bottom')}
942939
onAnimationEnd={animateInput ? onInputAnimationEnd : undefined}
943940
>
944941
<div className={styles.footerInner}>

‎apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/constants.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export interface PlusMenuHandle {
5656
}
5757

5858
/** Shared draft typography for Build and Search composers. */
59-
export const PROMPT_TEXT_CLASSES = 'font-body text-md leading-[24px] tracking-[-0.015em] md:text-sm'
59+
export const PROMPT_TEXT_CLASSES =
60+
'font-body text-md leading-[24px] tracking-[-0.015em] md:pointer-fine:text-sm'
6061

6162
/**
6263
* Box and typography shared by the textarea and its mirror overlay — both must
6364
* produce identical line wrapping so the overlay text sits exactly over the
64-
* (transparent) textarea text. The scale is the chat input's native prompt
65-
* scale (`text-[14px]`, `-0.015em` tracking); the task modal's body inherits it
66-
* so the editor reads the same whether it's the chat input or inside the modal.
65+
* (transparent) textarea text. The task modal inherits the same responsive
66+
* prompt scale so its editor and the chat input wrap identically.
6767
*/
6868
export const PROMPT_FIELD_CLASSES = cn(
6969
'm-0 box-border min-h-[24px] w-full [overflow-wrap:anywhere] border-0 bg-transparent',

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/chat.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,18 @@ function ChatFilePreview({ file, onRemove }: ChatFilePreviewProps) {
119119
return (
120120
<div
121121
className={cn(
122-
'group relative shrink-0 overflow-hidden rounded-md bg-[var(--surface-2)]',
122+
'group relative pointer-coarse:flex shrink-0 pointer-coarse:items-center overflow-hidden rounded-md bg-[var(--surface-2)]',
123123
previewUrl
124-
? '@max-[960px]/workflow:pointer-coarse:size-12 size-[40px]'
125-
: 'flex @max-[960px]/workflow:pointer-coarse:min-h-12 min-w-[80px] max-w-[120px] items-center justify-center px-2 py-0.5 @max-[960px]/workflow:pointer-coarse:pr-12'
124+
? 'size-[40px] pointer-coarse:h-12 pointer-coarse:w-auto'
125+
: 'flex pointer-coarse:min-h-12 min-w-[80px] max-w-[120px] items-center justify-center px-2 py-0.5'
126126
)}
127127
>
128128
{previewUrl ? (
129-
<img src={previewUrl} alt={file.name} className='size-full object-cover' />
129+
<img
130+
src={previewUrl}
131+
alt={file.name}
132+
className='pointer-coarse:size-12 size-full pointer-coarse:shrink-0 object-cover'
133+
/>
130134
) : (
131135
<div className='min-w-0 flex-1'>
132136
<div className='truncate font-medium text-[var(--text-body)] text-micro'>{file.name}</div>
@@ -142,7 +146,7 @@ function ChatFilePreview({ file, onRemove }: ChatFilePreviewProps) {
142146
event.stopPropagation()
143147
onRemove(file.id)
144148
}}
145-
className='absolute top-0.5 right-0.5 @max-[960px]/workflow:pointer-coarse:size-11 @min-[960px]/workflow:opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100'
149+
className='pointer-coarse:static absolute top-0.5 right-0.5 pointer-coarse:size-11 pointer-coarse:shrink-0 @min-[960px]/workflow:pointer-fine:opacity-0 transition-opacity focus-visible:opacity-100 group-hover:opacity-100'
146150
>
147151
<span
148152
className={cn(

0 commit comments

Comments
 (0)