From f6c1e02eb46f3f5b5a120ec14afddb3af9af4281 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 03:39:48 +0000 Subject: [PATCH 1/3] fix(web): remove Ask suggested example queries Co-authored-by: Michael Sukkarieh --- .../src/app/(app)/chat/chatLandingPage.tsx | 7 -- .../components/exampleQuestionBadges.test.tsx | 78 ----------------- .../chat/components/exampleQuestionBadges.tsx | 76 ---------------- .../chat/components/exampleQuestions.test.ts | 18 ---- .../(app)/chat/components/exampleQuestions.ts | 86 ------------------- 5 files changed, 265 deletions(-) delete mode 100644 packages/web/src/app/(app)/chat/components/exampleQuestionBadges.test.tsx delete mode 100644 packages/web/src/app/(app)/chat/components/exampleQuestionBadges.tsx delete mode 100644 packages/web/src/app/(app)/chat/components/exampleQuestions.test.ts delete mode 100644 packages/web/src/app/(app)/chat/components/exampleQuestions.ts diff --git a/packages/web/src/app/(app)/chat/chatLandingPage.tsx b/packages/web/src/app/(app)/chat/chatLandingPage.tsx index 3b0ff0342..e0658e889 100644 --- a/packages/web/src/app/(app)/chat/chatLandingPage.tsx +++ b/packages/web/src/app/(app)/chat/chatLandingPage.tsx @@ -10,8 +10,6 @@ import { env } from "@sourcebot/shared"; import { auth } from "@/auth"; import { hasEntitlement } from "@/lib/entitlements"; import { listAgentSkillCommandsOrEmpty } from "@/ee/features/chat/skills/skillCommands.server"; -import { ExampleQuestionBadges } from "./components/exampleQuestionBadges"; -import { selectRandomExampleQuestions } from "./components/exampleQuestions"; export async function ChatLandingPage() { const languageModels = await getConfiguredLanguageModelsInfo(); @@ -22,7 +20,6 @@ export async function ChatLandingPage() { const askCommands = session?.user && hasAskEntitlement ? await listAgentSkillCommandsOrEmpty() : []; - const exampleQuestions = selectRandomExampleQuestions(3); if (isServiceError(allRepos)) { throw new ServiceErrorException(allRepos); @@ -50,10 +47,6 @@ export async function ChatLandingPage() { isLoginWallEnabled={env.EXPERIMENT_ASK_GH_ENABLED === 'true'} maxImageBytes={env.SOURCEBOT_CHAT_ATTACHMENT_MAX_IMAGE_BYTES} /> - diff --git a/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.test.tsx b/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.test.tsx deleted file mode 100644 index dc0a0ee7c..000000000 --- a/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.test.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { cleanup, fireEvent, render, screen } from "@testing-library/react"; -import { useEffect } from "react"; -import { Node } from "slate"; -import { ReactEditor, useSlate } from "slate-react"; -import { afterEach, describe, expect, test, vi } from "vitest"; -import { CustomSlateEditor } from "@/features/chat/customSlateEditor"; -import type { CustomEditor } from "@/features/chat/types"; -import { ExampleQuestionBadges } from "./exampleQuestionBadges"; -import type { ExampleQuestion } from "./exampleQuestions"; - -const questions = [ - { - label: "Entry points", - question: "Find the main entry points across the indexed repositories.", - icon: "search", - }, - { - label: "Configuration", - question: "Where is configuration defined and loaded?", - icon: "settings", - }, - { - label: "Testing", - question: "Find examples of how this code is tested.", - icon: "flask", - }, -] as const satisfies readonly ExampleQuestion[]; - -const EditorValue = ({ - onEditor, -}: { - onEditor: (editor: CustomEditor) => void; -}) => { - const editor = useSlate(); - - useEffect(() => { - onEditor(editor); - }, [editor, onEditor]); - - return null; -}; - -afterEach(() => { - cleanup(); - vi.restoreAllMocks(); -}); - -describe("ExampleQuestionBadges", () => { - test("inserts the selected question and replaces the previous prompt", () => { - vi.spyOn(ReactEditor, "focus").mockImplementation(() => undefined); - const onEditor = vi.fn<(editor: CustomEditor) => void>(); - render( - - - - , - ); - const editor = onEditor.mock.calls[0]?.[0]; - expect(editor).toBeDefined(); - - expect(screen.getByText("Ask questions about:")).toBeTruthy(); - expect(screen.getByRole("button", { name: "Ask about entry points" })).toBeTruthy(); - expect(screen.getByRole("button", { name: "Ask about configuration" })).toBeTruthy(); - expect(screen.getByRole("button", { name: "Ask about testing" })).toBeTruthy(); - - fireEvent.click(screen.getByRole("button", { - name: "Ask about entry points", - })); - expect(Node.string(editor!)).toBe( - "Find the main entry points across the indexed repositories.", - ); - - fireEvent.click(screen.getByRole("button", { - name: "Ask about testing", - })); - expect(Node.string(editor!)).toBe("Find examples of how this code is tested."); - }); -}); diff --git a/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.tsx b/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.tsx deleted file mode 100644 index f3236d0fe..000000000 --- a/packages/web/src/app/(app)/chat/components/exampleQuestionBadges.tsx +++ /dev/null @@ -1,76 +0,0 @@ -'use client'; - -import { Button } from "@/components/ui/button"; -import { - BookOpen, - CircleAlert, - Database, - FlaskConical, - ListTodo, - Logs, - Package, - Search, - Settings, - Variable, - type LucideIcon, -} from "lucide-react"; -import { Editor, Transforms } from "slate"; -import { ReactEditor, useSlate } from "slate-react"; -import type { ExampleQuestion, ExampleQuestionIcon } from "./exampleQuestions"; - -const icons: Record = { - book: BookOpen, - database: Database, - error: CircleAlert, - flask: FlaskConical, - list: ListTodo, - logs: Logs, - package: Package, - search: Search, - settings: Settings, - variable: Variable, -}; - -interface ExampleQuestionBadgesProps { - questions: readonly ExampleQuestion[]; - disabled?: boolean; -} - -export function ExampleQuestionBadges({ - questions, - disabled = false, -}: ExampleQuestionBadgesProps) { - const editor = useSlate(); - - const insertQuestion = (question: string) => { - Transforms.select(editor, Editor.range(editor, [])); - Transforms.insertText(editor, question); - ReactEditor.focus(editor); - }; - - return ( -
- - Ask questions about: - - {questions.map(({ label, question, icon }) => { - const Icon = icons[icon]; - return ( - - ); - })} -
- ); -} diff --git a/packages/web/src/app/(app)/chat/components/exampleQuestions.test.ts b/packages/web/src/app/(app)/chat/components/exampleQuestions.test.ts deleted file mode 100644 index 9ce7a03d8..000000000 --- a/packages/web/src/app/(app)/chat/components/exampleQuestions.test.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { describe, expect, test } from "vitest"; -import { - exampleQuestions, - selectRandomExampleQuestions, -} from "./exampleQuestions"; - -describe("selectRandomExampleQuestions", () => { - test("selects three unique questions from the larger pool", () => { - const selectedQuestions = selectRandomExampleQuestions(3, () => 0); - - expect(exampleQuestions.length).toBeGreaterThan(3); - expect(selectedQuestions).toHaveLength(3); - expect(new Set(selectedQuestions.map(({ label }) => label)).size).toBe(3); - expect(selectedQuestions.every((question) => - exampleQuestions.some(({ label }) => label === question.label) - )).toBe(true); - }); -}); diff --git a/packages/web/src/app/(app)/chat/components/exampleQuestions.ts b/packages/web/src/app/(app)/chat/components/exampleQuestions.ts deleted file mode 100644 index 3cd4a17ad..000000000 --- a/packages/web/src/app/(app)/chat/components/exampleQuestions.ts +++ /dev/null @@ -1,86 +0,0 @@ -export type ExampleQuestionIcon = - | "book" - | "database" - | "error" - | "flask" - | "list" - | "logs" - | "package" - | "search" - | "settings" - | "variable"; - -export interface ExampleQuestion { - label: string; - question: string; - icon: ExampleQuestionIcon; -} - -export const exampleQuestions = [ - { - label: "Entry points", - question: "Find the main entry points across all repositories.", - icon: "search", - }, - { - label: "Configuration", - question: "Where is configuration defined and loaded?", - icon: "settings", - }, - { - label: "Testing", - question: "Find examples of how this code is tested.", - icon: "flask", - }, - { - label: "Error handling", - question: "Find common error-handling patterns across the codebase.", - icon: "error", - }, - { - label: "Data models", - question: "Where are the main data models defined?", - icon: "database", - }, - { - label: "TODOs", - question: "Find TODOs and summarize the unfinished work.", - icon: "list", - }, - { - label: "Dependencies", - question: "Where are project dependencies declared and configured?", - icon: "package", - }, - { - label: "Environment", - question: "Where are environment variables read and used?", - icon: "variable", - }, - { - label: "Logging", - question: "Where and how is logging used?", - icon: "logs", - }, - { - label: "Documentation", - question: "Find the most useful developer documentation.", - icon: "book", - }, -] as const satisfies readonly ExampleQuestion[]; - -export const selectRandomExampleQuestions = ( - count: number, - random: () => number = Math.random, -): ExampleQuestion[] => { - const shuffled: ExampleQuestion[] = [...exampleQuestions]; - for (let index = shuffled.length - 1; index > 0; index -= 1) { - const swapIndex = Math.floor(random() * (index + 1)); - [shuffled[index], shuffled[swapIndex]] = [ - shuffled[swapIndex]!, - shuffled[index]!, - ]; - } - - return shuffled.slice(0, Math.max(0, count)); -}; From cb1a1ab748be29ad9b89b4d4914707773c2dc869 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 03:52:35 +0000 Subject: [PATCH 2/3] docs: add Ask suggestions changelog entry Co-authored-by: Michael Sukkarieh --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddde1ac85..660c86ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [EE] Fixed missing account-linking prompts during OAuth authorization and restored prompts when new optional providers are configured. [#1663](https://github.com/sourcebot-dev/sourcebot/pull/1663) - Prevented browser performance instrumentation from breaking code views when `performance.measure()` returns no value. [#1665](https://github.com/sourcebot-dev/sourcebot/pull/1665) - Added specific authentication error messages and recovery guidance shared by the login form and error page. [#1669](https://github.com/sourcebot-dev/sourcebot/pull/1669) +- Removed suggested example queries from the Ask landing page. [#1674](https://github.com/sourcebot-dev/sourcebot/pull/1674) ## [5.1.13] - 2026-09-12 From 9a97e4e503410ad187440eac4218949096fc97df Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 22 Sep 2026 04:19:06 +0000 Subject: [PATCH 3/3] docs: place Ask changelog entry under unreleased Co-authored-by: Michael Sukkarieh --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 660c86ccd..8411d61f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Removed the Ask Sourcebot first-visit tutorial banner. [#1675](https://github.com/sourcebot-dev/sourcebot/pull/1675) +### Fixed +- Removed suggested example queries from the Ask landing page. [#1674](https://github.com/sourcebot-dev/sourcebot/pull/1674) + ## [5.1.14] - 2026-09-17 ### Added @@ -20,7 +23,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [EE] Fixed missing account-linking prompts during OAuth authorization and restored prompts when new optional providers are configured. [#1663](https://github.com/sourcebot-dev/sourcebot/pull/1663) - Prevented browser performance instrumentation from breaking code views when `performance.measure()` returns no value. [#1665](https://github.com/sourcebot-dev/sourcebot/pull/1665) - Added specific authentication error messages and recovery guidance shared by the login form and error page. [#1669](https://github.com/sourcebot-dev/sourcebot/pull/1669) -- Removed suggested example queries from the Ask landing page. [#1674](https://github.com/sourcebot-dev/sourcebot/pull/1674) ## [5.1.13] - 2026-09-12