@@ -274,6 +274,7 @@ export default function Composer(props: ComposerProps) {
274274 const [ history , setHistory ] = createSignal ( { prompt : [ ] as ComposerDraft [ ] , shell : [ ] as ComposerDraft [ ] } ) ;
275275 const [ variantMenuOpen , setVariantMenuOpen ] = createSignal ( false ) ;
276276 const activeVariant = createMemo ( ( ) => props . modelVariant ?? "none" ) ;
277+ const attachmentsDisabled = createMemo ( ( ) => props . isRemoteWorkspace ) ;
277278
278279 onMount ( ( ) => {
279280 queueMicrotask ( ( ) => focusEditorEnd ( ) ) ;
@@ -1140,6 +1141,7 @@ export default function Composer(props: ComposerProps) {
11401141 multiple
11411142 accept = { ACCEPTED_FILE_TYPES . join ( "," ) }
11421143 class = "hidden"
1144+ disabled = { attachmentsDisabled ( ) }
11431145 onChange = { ( event : Event ) => {
11441146 const target = event . currentTarget as HTMLInputElement ;
11451147 const files = Array . from ( target . files ?? [ ] ) ;
@@ -1149,15 +1151,21 @@ export default function Composer(props: ComposerProps) {
11491151 />
11501152 < button
11511153 type = "button"
1152- class = "p-2 rounded-xl border border-gray-6 text-gray-10 hover:text-gray-12 hover:border-gray-7 transition-colors"
1154+ class = { `p-2 rounded-xl border transition-colors ${
1155+ attachmentsDisabled ( )
1156+ ? "border-gray-6 text-gray-7 cursor-not-allowed"
1157+ : "border-gray-6 text-gray-10 hover:text-gray-12 hover:border-gray-7"
1158+ } `}
11531159 onClick = { ( ) => {
1154- if ( props . isRemoteWorkspace ) {
1155- props . onToast ( "Attachments are unavailable in remote workspaces." ) ;
1156- return ;
1157- }
1160+ if ( attachmentsDisabled ( ) ) return ;
11581161 fileInputRef ?. click ( ) ;
11591162 } }
1160- title = "Attach files"
1163+ disabled = { attachmentsDisabled ( ) }
1164+ title = {
1165+ attachmentsDisabled ( )
1166+ ? "Attachments are unavailable in remote workspaces."
1167+ : "Attach files"
1168+ }
11611169 >
11621170 < Paperclip size = { 16 } />
11631171 </ button >
0 commit comments