diff --git a/vscode/webviews/chat/cells/messageCell/human/editor/toolbar/SubmitButton.tsx b/vscode/webviews/chat/cells/messageCell/human/editor/toolbar/SubmitButton.tsx index 9086e6678ac4..1d83f3e06d82 100644 --- a/vscode/webviews/chat/cells/messageCell/human/editor/toolbar/SubmitButton.tsx +++ b/vscode/webviews/chat/cells/messageCell/human/editor/toolbar/SubmitButton.tsx @@ -402,6 +402,10 @@ export const PopoverItem: FunctionComponent< onKeyDown={onKeyDownInPopoverContent} ref={popoverContentRef} {...popoverContentProps} + className={clsx( + 'tw-w-[350px] !tw-p-0 tw-z-10 tw-my-2 tw-shadow-lg tw-border tw-border-button-border tw-rounded-md', + popoverContentProps?.className + )} > {popoverContent(close)} diff --git a/vscode/webviews/chat/components/WelcomeFooter.tsx b/vscode/webviews/chat/components/WelcomeFooter.tsx index ae33dbbd0c9e..6509039511fb 100644 --- a/vscode/webviews/chat/components/WelcomeFooter.tsx +++ b/vscode/webviews/chat/components/WelcomeFooter.tsx @@ -1,9 +1,10 @@ -import type { CodyIDE } from '@sourcegraph/cody-shared' +import { CodyIDE } from '@sourcegraph/cody-shared' import { QuickStart } from './QuickStart' import styles from './WelcomeFooter.module.css' import { BookOpenText, type LucideProps, MessageCircleQuestion } from 'lucide-react' import type { ForwardRefExoticComponent } from 'react' +import { ExtensionPromotionalBanner } from '../../components/ExtensionPromotionalBanner' interface ChatViewLink { icon: ForwardRefExoticComponent> @@ -24,9 +25,10 @@ const chatLinks: ChatViewLink[] = [ }, ] -export default function WelcomeFooter({ IDE }: { IDE: CodyIDE }) { +export default function WelcomeFooter({ IDE }: { IDE: CodyIDE }): JSX.Element { return (
+ {IDE === CodyIDE.Web && }
{chatLinks.map(link => ( diff --git a/vscode/webviews/components/ExtensionPromotionalBanner.module.css b/vscode/webviews/components/ExtensionPromotionalBanner.module.css new file mode 100644 index 000000000000..a4a38c90c16a --- /dev/null +++ b/vscode/webviews/components/ExtensionPromotionalBanner.module.css @@ -0,0 +1,38 @@ +.banner { + display: flex; + flex-flow: row nowrap; + justify-content: space-between; + padding: 0.5rem 1rem; + background: var(--vscode-editor-background); + border: 1px solid var(--vscode-widget-border); + margin: 0 auto; + border-radius: 6px; + + h3 { + margin: 0; + font-size: 0.875rem; + color: var(--vscode-editor-foreground); + font-weight: 500; + } +} + +.download-button { + display: flex; + align-items: center; + padding: 0.25rem 0.75rem; + font-weight: 500; + background: var(--vscode-button-secondaryBackground); + color: var(--vscode-editor-foreground); + text-decoration: none; + border-radius: 4px; + height: 32px; +} + +.download-button:hover { + background: var(--vscode-button-hoverBackground); + color: var(--vscode-editor-foreground); +} + +.banner { + position: relative; +} diff --git a/vscode/webviews/components/ExtensionPromotionalBanner.tsx b/vscode/webviews/components/ExtensionPromotionalBanner.tsx new file mode 100644 index 000000000000..20cb331370a9 --- /dev/null +++ b/vscode/webviews/components/ExtensionPromotionalBanner.tsx @@ -0,0 +1,76 @@ +import type { CodyIDE } from '@sourcegraph/cody-shared' +import { useState } from 'react' +import styles from './ExtensionPromotionalBanner.module.css' + +const BANNER_DISMISSED_KEY = 'cody-extension-banner-dismissed' + +export const ExtensionPromotionalBanner: React.FC<{ IDE: CodyIDE }> = ({ IDE }) => { + const [isVisible, setIsVisible] = useState(() => { + // Initialize state from localStorage + return localStorage.getItem(BANNER_DISMISSED_KEY) !== 'true' + }) + const [isClosing, setIsClosing] = useState(false) + + const handleDismiss = () => { + setIsClosing(true) + // Wait for animation to complete before hiding + setTimeout(() => { + setIsVisible(false) + // Save dismissed state to localStorage + localStorage.setItem(BANNER_DISMISSED_KEY, 'true') + }, 300) + } + + if (!isVisible) { + return null + } + + return ( +
+
+
+

Get Sourcegraph for your favorite editor

+

+ Download the extension to get the power of Sourcegraph right where you code +

+
+
+
+
+ VS Code + All JetBrains IDEs +
+ + Download + + +
+
+ ) +} diff --git a/vscode/webviews/components/codeSnippet/CodeSnippet.module.css b/vscode/webviews/components/codeSnippet/CodeSnippet.module.css index e9854460d825..ab098a1f744d 100644 --- a/vscode/webviews/components/codeSnippet/CodeSnippet.module.css +++ b/vscode/webviews/components/codeSnippet/CodeSnippet.module.css @@ -47,6 +47,7 @@ .result { border-bottom: solid 1px var(--cody-chat-code-border-color); + background-color: var(--vscode-editor-background); code { padding: 0 !important; diff --git a/vscode/webviews/components/codeSnippet/CodeSnippet.tsx b/vscode/webviews/components/codeSnippet/CodeSnippet.tsx index 46c1238c5e13..4a8bf7ff87af 100644 --- a/vscode/webviews/components/codeSnippet/CodeSnippet.tsx +++ b/vscode/webviews/components/codeSnippet/CodeSnippet.tsx @@ -337,7 +337,7 @@ const ResultContainer: ForwardReferenceExoticComponent<