Skip to content

Commit b029ff6

Browse files
committed
Top layout, expanded tips.
1 parent a588dc9 commit b029ff6

File tree

4 files changed

+41
-45
lines changed

4 files changed

+41
-45
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ import ChatTextArea from "./ChatTextArea"
3838
import TaskHeader from "./TaskHeader"
3939
import AutoApproveMenu from "./AutoApproveMenu"
4040
import SystemPromptWarning from "./SystemPromptWarning"
41-
42-
import { useTaskSearch } from "@/components/history/useTaskSearch"
4341
interface ChatViewProps {
4442
isHidden: boolean
4543
showAnnouncement: boolean
@@ -86,8 +84,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
8684
hasSystemPromptOverride,
8785
} = useExtensionState()
8886

89-
const { tasks } = useTaskSearch()
90-
9187
//const task = messages.length > 0 ? (messages[0].say === "task" ? messages[0] : undefined) : undefined) : undefined
9288
const task = useMemo(() => messages.at(0), [messages]) // leaving this less safe version here since if the first message is not a task, then the extension is in a bad state and needs to be debugged (see Cline.abort)
9389
const modifiedMessages = useMemo(() => combineApiRequests(combineCommandSequences(messages.slice(1))), [messages])
@@ -1231,36 +1227,39 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12311227
)}
12321228
</>
12331229
) : (
1234-
<div className="flex-1 min-h-0 overflow-y-auto flex flex-col justify-center p-10 gap-4 pb-[10px]">
1235-
{telemetrySetting === "unset" && <TelemetryBanner />}
1236-
{showAnnouncement && <Announcement version={version} hideAnnouncement={hideAnnouncement} />}
1237-
1238-
{/* Always show the hero. */}
1239-
<RooHero />
1240-
{/* If the user has no task history, we can show the onboarding message */}
1241-
{!taskHistory.length && (
1242-
<p className="ext-vscode-editor-foreground leading-tight font-vscode text-center">
1243-
<Trans
1244-
i18nKey="chat:about"
1245-
components={{
1246-
DocsLink: (
1247-
<a
1248-
href="https://docs.roocode.com/getting-started/your-first-task"
1249-
target="_blank"
1250-
rel="noopener noreferrer">
1251-
the docs
1252-
</a>
1253-
),
1254-
}}
1255-
/>
1256-
</p>
1257-
)}
1258-
1259-
{/* Show the task history if there are any for this workspace. */}
1230+
<>
12601231
{taskHistory.length > 0 && <HistoryPreview showHistoryView={showHistoryView} />}
1261-
{/* Finally, if there less than 3 tasks, we can show the tips */}
1262-
{tasks.length < 3 && <RooTips cycle={!!(tasks.length < 3 && taskHistory.length > 0)} />}
1263-
</div>
1232+
<div className="flex-1 min-h-0 overflow-y-auto flex flex-col justify-center p-10 gap-1 pb-[10px]">
1233+
{/* Show the task history if there are any for this workspace. */}
1234+
1235+
{telemetrySetting === "unset" && <TelemetryBanner />}
1236+
{showAnnouncement && <Announcement version={version} hideAnnouncement={hideAnnouncement} />}
1237+
1238+
{/* Always show the hero. */}
1239+
<RooHero />
1240+
{/* If the user has little task history, we can show the onboarding message */}
1241+
{taskHistory.length < 10 && (
1242+
<p className="ext-vscode-editor-foreground leading-tight font-vscode text-center">
1243+
<Trans
1244+
i18nKey="chat:about"
1245+
components={{
1246+
DocsLink: (
1247+
<a
1248+
href="https://docs.roocode.com/getting-started/your-first-task"
1249+
target="_blank"
1250+
rel="noopener noreferrer">
1251+
the docs
1252+
</a>
1253+
),
1254+
}}
1255+
/>
1256+
</p>
1257+
)}
1258+
1259+
{/* Finally, always show the tips */}
1260+
<RooTips cycle={false} />
1261+
</div>
1262+
</>
12641263
)}
12651264

12661265
{/*

webview-ui/src/components/history/HistoryPreview.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ const HistoryPreview = ({ showHistoryView }: HistoryPreviewProps) => {
3636
<div className="flex flex-col gap-3 shrink-0 mx-5">
3737
{tasks.length !== 0 && (
3838
<div className="flex items-center justify-between text-vscode-descriptionForeground w-full mx-auto max-w-[600px]">
39+
{/* Keep the history button, but maybe it should just show the full view? Or remove it if header is clicked? Let's keep it for now. */}
40+
<div className="font-bold">{t("chat:greeting")}</div>
41+
3942
<div className="flex items-center gap-1 cursor-pointer" onClick={toggleExpanded}>
40-
<span className={`codicon codicon-chevron-${isExpanded ? "down" : "right"} scale-90`} />
41-
<span className="font-medium text-xs uppercase">{t("history:recentTasks")}</span>
43+
<span className={`codicon codicon-chevron-${isExpanded ? "up" : "down"} scale-90`} />
44+
<span className="font-medium text-xs uppercase">
45+
{isExpanded ? "" : t("history:recentTasks")}
46+
</span>
4247
</div>
43-
{/* Keep the history button, but maybe it should just show the full view? Or remove it if header is clicked? Let's keep it for now. */}
44-
<Button variant="ghost" size="sm" onClick={() => showHistoryView()} className="uppercase">
45-
<span className="codicon codicon-history size-[1rem]" />
46-
</Button>
4748
</div>
4849
)}
4950

webview-ui/src/components/welcome/RooHero.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import { useState } from "react"
2-
import { useAppTranslation } from "../../i18n/TranslationContext"
32

43
const RooHero = () => {
5-
const { t } = useAppTranslation()
6-
74
const [imagesBaseUri] = useState(() => {
85
const w = window as any
96
return w.IMAGES_BASE_URI || ""
107
})
118

129
return (
13-
<div className="flex flex-col items-center justify-center pb-0">
10+
<div className="flex flex-col items-center justify-center pb-4">
1411
<div
1512
style={{
1613
backgroundColor: "var(--vscode-foreground)",
@@ -24,8 +21,6 @@ const RooHero = () => {
2421
className="mx-auto">
2522
<img src={imagesBaseUri + "/roo-logo.svg"} alt="Roo logo" className="h-8 opacity-0" />
2623
</div>
27-
28-
<h2 className="">{t("chat:greeting")}</h2>
2924
</div>
3025
)
3126
}

webview-ui/src/components/welcome/WelcomeView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const WelcomeView = () => {
3838
<Tab>
3939
<TabContent className="flex flex-col gap-5">
4040
<RooHero />
41+
<h2 className="mx-auto">{t("chat:greeting")}</h2>
4142

4243
<div className="outline rounded p-4">
4344
<Trans i18nKey="welcome:introduction" />

0 commit comments

Comments
 (0)