Skip to content

Commit 749e927

Browse files
committed
Removing Focused state
1 parent 6289006 commit 749e927

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

packages/jupyter-chat/src/components/attachments.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import CloseIcon from '@mui/icons-material/Close';
77
import { Box, Button, Tooltip } from '@mui/material';
88
import React from 'react';
99
import { PathExt } from '@jupyterlab/coreutils';
10+
import { UUID } from '@lumino/coreutils';
1011

1112
import { useChatContext } from '../context';
1213
import { IAttachment } from '../types';
@@ -65,7 +66,7 @@ export function AttachmentPreviewList(props: AttachmentsProps): JSX.Element {
6566
>
6667
{props.attachments.map(attachment => (
6768
<AttachmentPreview
68-
key={attachment.value}
69+
key={`${PathExt.basename(attachment.value)}-${UUID.uuid4()}`}
6970
{...props}
7071
attachment={attachment}
7172
/>

packages/jupyter-chat/src/components/input/chat-input.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
4646
const [toolbarElements, setToolbarElements] = useState<
4747
InputToolbarRegistry.IToolbarItem[]
4848
>([]);
49-
const [isFocused, setIsFocused] = useState<boolean>(false);
5049
const [writers, setWriters] = useState<IChatModel.IWriter[]>([]);
5150

5251
/**
@@ -214,9 +213,7 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
214213
<Box
215214
sx={{
216215
border: '1px solid',
217-
borderColor: isFocused
218-
? 'var(--jp-brand-color1)'
219-
: 'var(--jp-border-color1)',
216+
borderColor: 'var(--jp-border-color1)',
220217
borderRadius: 2,
221218
transition: 'border-color 0.2s ease',
222219
display: 'flex',
@@ -262,8 +259,6 @@ export function ChatInput(props: ChatInput.IProps): JSX.Element {
262259
onKeyDown={handleKeyDown}
263260
placeholder="Type a chat message, @ to mention..."
264261
inputRef={inputRef}
265-
onFocus={() => setIsFocused(true)}
266-
onBlur={() => setIsFocused(false)}
267262
onSelect={() =>
268263
(model.cursorIndex = inputRef.current?.selectionStart ?? null)
269264
}

0 commit comments

Comments
 (0)