Skip to content

Commit 8596542

Browse files
authored
Merge branch 'main' into jan/deep-search-6.5-updates
2 parents 7fef525 + 884dc9a commit 8596542

File tree

3 files changed

+95
-16
lines changed

3 files changed

+95
-16
lines changed

docs/cody/capabilities/supported-models.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ Cody uses a set of models for autocomplete which are suited for the low latency
6767

6868
Fireworks.ai is the default model for cody-gateway, but if you wish to switch to Claude models, Site admins can do it following these steps-
6969

70-
<Callout type="note">Go to "Site admin"</Callout>
70+
Go to "Site admin"
7171

72-
<Callout type="note">Click on the "Feature flags"</Callout>
72+
Click on the "Feature flags"
7373

74-
<Callout type="note">Search for cody-smart-apply-instant-mode-enabled feature flag</Callout>
74+
Search for cody-smart-apply-instant-mode-enabled feature flag
7575

76-
<Callout type="note">Turn off/delete the "cody-smart-apply-instant-mode-enabled" feature flag</Callout>
76+
Turn off/delete the "cody-smart-apply-instant-mode-enabled" feature flag

src/components/Layout.tsx

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
'use client';
22

3-
import { Hero } from '@/components/Hero';
4-
import { Logo } from '@/components/Logo';
5-
import { MobileNavigation } from '@/components/MobileNavigation';
6-
import { Navigation } from '@/components/Navigation';
7-
import { ThemeSelector } from '@/components/ThemeSelector';
3+
import {Hero} from '@/components/Hero';
4+
import {Logo} from '@/components/Logo';
5+
import {MobileNavigation} from '@/components/MobileNavigation';
6+
import {Navigation} from '@/components/Navigation';
7+
import {ThemeSelector} from '@/components/ThemeSelector';
88
import clsx from 'clsx';
99
import Link from 'next/link';
10-
import { usePathname } from 'next/navigation';
11-
import { useEffect, useState } from 'react';
12-
import { LogoMark } from './LogoMark';
10+
import {usePathname} from 'next/navigation';
11+
import {useEffect, useState} from 'react';
12+
import {LogoMark} from './LogoMark';
1313
import VersionSelector from './VersionSelector';
14-
import { Search } from './search/Search';
15-
import { DemoLayout } from '@/components/DemoLayout';
14+
import {Search} from './search/Search';
1615

1716
function GitHubIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
1817
return (
@@ -30,7 +29,7 @@ function Header() {
3029
setIsScrolled(window.scrollY > 0);
3130
}
3231
onScroll();
33-
window.addEventListener('scroll', onScroll, { passive: true });
32+
window.addEventListener('scroll', onScroll, {passive: true});
3433
return () => {
3534
window.removeEventListener('scroll', onScroll);
3635
};
@@ -100,14 +99,34 @@ function Header() {
10099
);
101100
}
102101

103-
export function Layout({ children }: { children: React.ReactNode }) {
102+
export function Layout({children}: {children: React.ReactNode}) {
104103
let pathname = usePathname();
105104
let isHomePage = pathname === '/';
105+
let isCodyDocs = pathname.includes('/cody');
106+
let isopenCtxDocs = pathname.includes('/cody/capabilities/openctx');
106107

107108
return (
108109
<div className="flex w-full flex-col">
109110
<Header />
110111

112+
{/* Cody docs banner */}
113+
{/* {isCodyDocs && !isopenCtxDocs && <TopBanner
114+
text="NEW: Introducing chat and search in a single input with Sourcegraph 6.0."
115+
link="https://sourcegraph.com/blog/combining-chat-and-search"
116+
linkText="Read here"
117+
textColor="#ffffff"
118+
backgroundColor="#F34E3F"
119+
/>} */}
120+
121+
{/* Openctx docs banner */}
122+
{/* {isopenCtxDocs && <TopBanner
123+
text="NEW: MCP is the recommended method for adding external context in Cody due to its broad community adoption and extensive tool support."
124+
link="https://sourcegraph.com/docs/cody/capabilities/agentic-context-fetching#mcp-support"
125+
linkText="Read docs to learn more about configuring MCP."
126+
textColor="#ffffff"
127+
backgroundColor="#F34E3F"
128+
/>} */}
129+
111130
{isHomePage && <Hero />}
112131
{/* {isHomePage && <DemoLayout />} */}
113132

src/components/TopBanner.tsx

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
'use client';
2+
3+
import Link from 'next/link';
4+
import { useState } from 'react';
5+
6+
interface TopBannerProps {
7+
text?: string;
8+
link?: string;
9+
backgroundColor?: string;
10+
textColor?: string;
11+
linkText?: string;
12+
}
13+
14+
export function TopBanner({
15+
text = "",
16+
link = "https://sourcegraph.com/",
17+
backgroundColor = "#F34E3F",
18+
textColor = "white",
19+
linkText = 'new docs',
20+
}: TopBannerProps) {
21+
const [isVisible, setIsVisible] = useState(true);
22+
23+
if (!isVisible) return null;
24+
25+
return (
26+
<div
27+
style={{ backgroundColor, color: textColor }}
28+
className="fixed top-0 z-[100] min-h-[42px] w-full flex items-center justify-center px-4 py-2 md:py-0 md:h-[42px]"
29+
>
30+
<div className="flex items-center gap-2 text-xs sm:text-sm max-w-[90%] md:max-w-none text-center">
31+
<span className="line-clamp-2 md:line-clamp-1">{text}</span>
32+
<Link href={link} target="_blank" className="flex items-center hover:opacity-80 whitespace-nowrap">
33+
{linkText && <span>{linkText}</span>}
34+
<svg className="lucide lucide-arrow-right w-3 h-3 ml-1 sm:w-4 sm:h-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" >
35+
<path d="M5 12h14" />
36+
<path d="m12 5 7 7-7 7" />
37+
</svg>
38+
</Link>
39+
</div>
40+
<button
41+
onClick={() => setIsVisible(false)}
42+
className="absolute right-2 sm:right-4 hover:opacity-80"
43+
>
44+
<svg
45+
className="h-3 w-3 sm:h-4 sm:w-4"
46+
fill="none"
47+
stroke="currentColor"
48+
viewBox="0 0 24 24"
49+
>
50+
<path
51+
strokeLinecap="round"
52+
strokeLinejoin="round"
53+
strokeWidth={2}
54+
d="M6 18L18 6M6 6l12 12"
55+
/>
56+
</svg>
57+
</button>
58+
</div>
59+
);
60+
}

0 commit comments

Comments
 (0)