From 740d47529a95b7b0ffc06a9e0718c8b6ab421fbb Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 12 Apr 2024 05:40:15 +0000 Subject: [PATCH] fix: [code-1756]: fix aida btn (#1210) --- .../MarkdownEditorWithPreview.tsx | 2 +- .../PullRequest/Conversation/Conversation.module.scss | 10 ++++++++++ .../Conversation/Conversation.module.scss.d.ts | 1 + .../pages/PullRequest/Conversation/DescriptionBox.tsx | 5 ++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx b/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx index 46fa24b44..492f6ffec 100644 --- a/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx +++ b/web/src/components/MarkdownEditorWithPreview/MarkdownEditorWithPreview.tsx @@ -270,7 +270,7 @@ export function MarkdownEditorWithPreview({ } setFlag?.(false) } - }, [handleCopilotClick]) // eslint-disable-line react-hooks/exhaustive-deps + }, [handleCopilotClick, flag]) // eslint-disable-line react-hooks/exhaustive-deps useEffect(() => { if (!isEmpty(data)) { diff --git a/web/src/pages/PullRequest/Conversation/Conversation.module.scss b/web/src/pages/PullRequest/Conversation/Conversation.module.scss index 185828789..ef911a73d 100644 --- a/web/src/pages/PullRequest/Conversation/Conversation.module.scss +++ b/web/src/pages/PullRequest/Conversation/Conversation.module.scss @@ -268,6 +268,16 @@ } } +.popoverDescriptionbox { + :global { + .bp3-popover-content { + padding: var(--spacing-small); + max-width: 700px; + word-break: break-all; + } + } +} + .copyButton { --button-height: 14px !important; } diff --git a/web/src/pages/PullRequest/Conversation/Conversation.module.scss.d.ts b/web/src/pages/PullRequest/Conversation/Conversation.module.scss.d.ts index 6e18d107c..e6cecfb3b 100644 --- a/web/src/pages/PullRequest/Conversation/Conversation.module.scss.d.ts +++ b/web/src/pages/PullRequest/Conversation/Conversation.module.scss.d.ts @@ -38,6 +38,7 @@ export declare const mergeContainer: string export declare const mergedBox: string export declare const optionMenuIcon: string export declare const popover: string +export declare const popoverDescriptionbox: string export declare const refreshIcon: string export declare const repeatBtn: string export declare const rightTextPadding: string diff --git a/web/src/pages/PullRequest/Conversation/DescriptionBox.tsx b/web/src/pages/PullRequest/Conversation/DescriptionBox.tsx index fbd354c4b..f87691b77 100644 --- a/web/src/pages/PullRequest/Conversation/DescriptionBox.tsx +++ b/web/src/pages/PullRequest/Conversation/DescriptionBox.tsx @@ -97,6 +97,9 @@ export const DescriptionBox: React.FC = ({ repoMetadata={repoMetadata} value={content} flag={flag} + targetGitRef={pullReqMetadata?.target_branch} + sourceGitRef={pullReqMetadata?.source_branch} + handleCopilotClick={handleCopilotClick} setFlag={setFlag} outlets={{ [CommentBoxOutletPosition.START_OF_MARKDOWN_EDITOR_TOOLBAR]: ( @@ -125,7 +128,7 @@ export const DescriptionBox: React.FC = ({ interactionKind: 'hover', usePortal: true, position: PopoverPosition.BOTTOM_LEFT, - popoverClassName: cx(css.popover) + popoverClassName: cx(css.popoverDescriptionbox) }} /> ) : null}