Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored May 27, 2024
1 parent d55712a commit edaebee
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
9 changes: 6 additions & 3 deletions clients/vscode/assets/chat-panel.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
html, body {
html,
body {
background: transparent;
}
html, body, iframe {
html,
body,
iframe {
padding: 0;
margin: 0;
box-sizing: border-box;
Expand All @@ -11,4 +14,4 @@ iframe {
border-width: 0;
width: 100%;
height: 100vh;
}
}
6 changes: 3 additions & 3 deletions clients/vscode/src/ChatViewProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class ChatViewProvider implements WebviewViewProvider {

private async _getWebviewContent() {
const { server } = agent().getConfig();
const styleUri = this.webview?.webview.asWebviewUri(Uri.joinPath(this.context.extensionUri, 'assets', 'chat-panel.css'));
const styleUri = this.webview?.webview.asWebviewUri(
Uri.joinPath(this.context.extensionUri, "assets", "chat-panel.css"),
);
return `
<!DOCTYPE html>
<html lang="en">
Expand Down Expand Up @@ -109,8 +111,6 @@ export class ChatViewProvider implements WebviewViewProvider {
`;
}



public getWebview() {
return this.webview;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function activate(context: ExtensionContext) {
const chatViewProvider = new ChatViewProvider(context);
context.subscriptions.push(
window.registerWebviewViewProvider("tabby.chatView", chatViewProvider, {
webviewOptions: { retainContextWhenHidden: true }
webviewOptions: { retainContextWhenHidden: true },
}),
);

Expand Down
26 changes: 13 additions & 13 deletions ee/tabby-ui/app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export default function ChatPage() {
document.documentElement.className = data.themeClass
}
})


}, [])

const sendMessage = (message: ChatMessage) => {
Expand Down Expand Up @@ -103,17 +101,19 @@ export default function ChatPage() {

// VSCode bug: not support shortcuts like copy/paste
// @see - https://github.com/microsoft/vscode/issues/129178
const onInputKeyDown = isFromVSCode ? (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
if ((event.ctrlKey || event.metaKey) && event.code === "KeyC") {
document.execCommand("copy");
} else if ((event.ctrlKey || event.metaKey) && event.code === "KeyX") {
document.execCommand("cut");
} else if ((event.ctrlKey || event.metaKey) && event.code === "KeyV") {
document.execCommand("paste");
} else if ((event.ctrlKey || event.metaKey) && event.code === "KeyA") {
document.execCommand("selectAll");
}
} : undefined
const onInputKeyDown = isFromVSCode
? (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
if ((event.ctrlKey || event.metaKey) && event.code === 'KeyC') {
document.execCommand('copy')
} else if ((event.ctrlKey || event.metaKey) && event.code === 'KeyX') {
document.execCommand('cut')
} else if ((event.ctrlKey || event.metaKey) && event.code === 'KeyV') {
document.execCommand('paste')
} else if ((event.ctrlKey || event.metaKey) && event.code === 'KeyA') {
document.execCommand('selectAll')
}
}
: undefined

if (!isInit || !fetcherOptions) return <></>
const headers = {
Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/chat/chat-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ChatPanelProps
className?: string
onSubmit: (content: string) => Promise<any>
reload: () => void
chatMaxWidthClass: string,
chatMaxWidthClass: string
onInputKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void
}

Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ interface ChatProps extends React.ComponentProps<'div'> {
container?: HTMLDivElement
docQuery?: boolean
generateRelevantQuestions?: boolean
maxWidth?: string,
maxWidth?: string
onInputKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void
}

Expand Down
2 changes: 1 addition & 1 deletion ee/tabby-ui/components/chat/prompt-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
export interface PromptProps
extends Pick<UseChatHelpers, 'input' | 'setInput'> {
onSubmit: (value: string) => Promise<void>
isLoading: boolean,
isLoading: boolean
onInputKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void
}

Expand Down

0 comments on commit edaebee

Please sign in to comment.