Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Added ask sidebar to homepage. [#721](https://github.com/sourcebot-dev/sourcebot/pull/721)

## [4.10.17] - 2026-01-23

### Fixed
Expand Down
94 changes: 60 additions & 34 deletions packages/web/src/app/[domain]/chat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getRepos, getReposStats, getSearchContexts } from "@/actions";
import { SourcebotLogo } from "@/app/components/sourcebotLogo";
import { getConfiguredLanguageModelsInfo } from "@/features/chat/actions";
import { getConfiguredLanguageModelsInfo, getUserChatHistory } from "@/features/chat/actions";
import { CustomSlateEditor } from "@/features/chat/customSlateEditor";
import { ServiceErrorException } from "@/lib/serviceError";
import { isServiceError, measure } from "@/lib/utils";
Expand All @@ -12,6 +12,10 @@ import { DemoCards } from "./components/demoCards";
import { env } from "@sourcebot/shared";
import { loadJsonFile } from "@sourcebot/shared";
import { DemoExamples, demoExamplesSchema } from "@/types";
import { auth } from "@/auth";
import { ResizablePanel, ResizablePanelGroup } from "@/components/ui/resizable";
import { ChatSidePanel } from "./components/chatSidePanel";
import { AnimatedResizableHandle } from "@/components/ui/animatedResizableHandle";

interface PageProps {
params: Promise<{
Expand All @@ -24,6 +28,8 @@ export default async function Page(props: PageProps) {
const languageModels = await getConfiguredLanguageModelsInfo();
const searchContexts = await getSearchContexts(params.domain);
const allRepos = await getRepos();
const session = await auth();
const chatHistory = session ? await getUserChatHistory() : [];

const carouselRepos = await getRepos({
where: {
Expand Down Expand Up @@ -52,6 +58,10 @@ export default async function Page(props: PageProps) {
throw new ServiceErrorException(repoStats);
}

if (isServiceError(chatHistory)) {
throw new ServiceErrorException(chatHistory);
}

const demoExamples = env.SOURCEBOT_DEMO_EXAMPLES_PATH ? await (async () => {
try {
return (await measure(() => loadJsonFile<DemoExamples>(env.SOURCEBOT_DEMO_EXAMPLES_PATH!, demoExamplesSchema), 'loadExamplesJsonFile')).data;
Expand All @@ -62,45 +72,61 @@ export default async function Page(props: PageProps) {
})() : undefined;

return (
<div className="flex flex-col items-center overflow-hidden min-h-screen">
<div className="flex flex-col items-center min-h-screen overflow-hidden">
<NavigationMenu
domain={params.domain}
/>
<ResizablePanelGroup
direction="horizontal"
className="flex-1"
>
<ChatSidePanel
order={1}
chatHistory={chatHistory}
isAuthenticated={!!session}
isCollapsedInitially={true}
/>
<AnimatedResizableHandle />
<ResizablePanel
order={2}
id="chat-home-panel"
defaultSize={85}
>
<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-16 w-full px-5">
<div className="max-h-44 w-auto">
<SourcebotLogo
className="h-18 md:h-40 w-auto"
/>
</div>
<CustomSlateEditor>
<LandingPageChatBox
languageModels={languageModels}
repos={allRepos}
searchContexts={searchContexts}
/>
</CustomSlateEditor>

<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-18 w-full px-5">
<div className="max-h-44 w-auto">
<SourcebotLogo
className="h-18 md:h-40 w-auto"
/>
</div>
<CustomSlateEditor>
<LandingPageChatBox
languageModels={languageModels}
repos={allRepos}
searchContexts={searchContexts}
/>
</CustomSlateEditor>

<div className="mt-8">
<RepositoryCarousel
numberOfReposWithIndex={repoStats.numberOfReposWithIndex}
displayRepos={carouselRepos}
/>
</div>

{demoExamples && (
<>
<div className="flex flex-col items-center w-fit gap-6">
<Separator className="mt-5 w-[700px]" />
</div>

<DemoCards
demoExamples={demoExamples}
<div className="mt-8">
<RepositoryCarousel
numberOfReposWithIndex={repoStats.numberOfReposWithIndex}
displayRepos={carouselRepos}
/>
</>
)}
</div>

</div>
{demoExamples && (
<>
<div className="flex flex-col items-center w-fit gap-6">
<Separator className="mt-5 w-[700px]" />
</div>

<DemoCards
demoExamples={demoExamples}
/>
</>
)}
</div>
</ResizablePanel>
</ResizablePanelGroup>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SearchLandingPage = async ({
domain={domain}
/>

<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-18 w-full px-5">
<div className="flex flex-col justify-center items-center mt-8 mb-8 md:mt-16 w-full px-5">
<div className="max-h-44 w-auto">
<SourcebotLogo
className="h-18 md:h-40 w-auto"
Expand Down