Skip to content

Commit 103e2ae

Browse files
committed
More tweaks.
1 parent 93263bc commit 103e2ae

File tree

7 files changed

+27
-58
lines changed

7 files changed

+27
-58
lines changed

webview-ui/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ const App = () => {
123123
isHidden={tab !== "chat"}
124124
showAnnouncement={showAnnouncement}
125125
hideAnnouncement={() => setShowAnnouncement(false)}
126-
showHistoryView={() => switchTab("history")}
127126
/>
128127
<HumanRelayDialog
129128
isOpen={humanRelayDialogState.isOpen}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import { useAppTranslation } from "@/i18n/TranslationContext"
44
import { Trans } from "react-i18next"
55

66
interface AnnouncementProps {
7-
version: string
87
hideAnnouncement: () => void
98
}
109
/*
1110
You must update the latestAnnouncementId in ClineProvider for new announcements to show to users. This new id will be compared with whats in state for the 'last announcement shown', and if it's different then the announcement will render. As soon as an announcement is shown, the id will be updated in state. This ensures that announcements are not shown more than once, even if the user doesn't close it themselves.
1211
*/
13-
const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
12+
const Announcement = ({ hideAnnouncement }: AnnouncementProps) => {
1413
const { t } = useAppTranslation()
1514

1615
const discordLink = (
@@ -71,6 +70,7 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
7170
i18nKey="chat:announcement.feature1"
7271
components={{
7372
bold: <b />,
73+
code: <code />,
7474
}}
7575
/>
7676
</li>
@@ -80,6 +80,7 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
8080
i18nKey="chat:announcement.feature2"
8181
components={{
8282
bold: <b />,
83+
code: <code />,
8384
}}
8485
/>
8586
</li>
@@ -89,6 +90,7 @@ const Announcement = ({ version, hideAnnouncement }: AnnouncementProps) => {
8990
i18nKey="chat:announcement.feature3"
9091
components={{
9192
bold: <b />,
93+
code: <code />,
9294
}}
9395
/>
9496
</li>

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

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export interface ChatViewProps {
4444
isHidden: boolean
4545
showAnnouncement: boolean
4646
hideAnnouncement: () => void
47-
showHistoryView: () => void
4847
}
4948

5049
export interface ChatViewRef {
@@ -56,13 +55,12 @@ export const MAX_IMAGES_PER_MESSAGE = 20 // Anthropic limits to 20 images
5655
const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0
5756

5857
const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewProps> = (
59-
{ isHidden, showAnnouncement, hideAnnouncement, showHistoryView },
58+
{ isHidden, showAnnouncement, hideAnnouncement },
6059
ref,
6160
) => {
6261
const { t } = useAppTranslation()
6362
const modeShortcutText = `${isMac ? "⌘" : "Ctrl"} + . ${t("chat:forNextMode")}`
6463
const {
65-
version,
6664
clineMessages: messages,
6765
taskHistory,
6866
apiConfiguration,
@@ -1213,6 +1211,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12131211

12141212
return (
12151213
<div className={isHidden ? "hidden" : "fixed top-0 left-0 right-0 bottom-0 flex flex-col overflow-hidden"}>
1214+
{showAnnouncement && <Announcement hideAnnouncement={hideAnnouncement} />}
12161215
{task ? (
12171216
<>
12181217
<TaskHeader
@@ -1245,7 +1244,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12451244
<div className="flex-1 min-h-0 overflow-y-auto flex flex-col gap-4">
12461245
{/* Moved Task Bar Header Here */}
12471246
{tasks.length !== 0 && (
1248-
<div className="flex items-center justify-end text-vscode-descriptionForeground w-full mx-auto max-w-[600px] px-5 pt-3">
1247+
<div className="flex text-vscode-descriptionForeground w-full mx-auto px-5 pt-3">
12491248
<div className="flex items-center gap-1 cursor-pointer" onClick={toggleExpanded}>
12501249
{tasks.length < 10 && (
12511250
<span className={`font-medium text-xs `}>{t("history:recentTasks")}</span>
@@ -1256,35 +1255,28 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
12561255
</div>
12571256
</div>
12581257
)}
1259-
<div className={` flex flex-col gap-4 m-auto ${isExpanded ? "mt-0" : ""} p-10 pt-5"`}>
1260-
{showAnnouncement && <Announcement version={version} hideAnnouncement={hideAnnouncement} />}
1261-
1258+
<div
1259+
className={` w-full flex flex-col gap-4 m-auto ${isExpanded && tasks.length > 0 ? "mt-0" : ""} p-10 pt-5"`}>
12621260
<RooHero />
1263-
{/* Always show the hero. */}
1264-
12651261
{telemetrySetting === "unset" && <TelemetryBanner />}
12661262
{/* Show the task history preview if expanded and tasks exist */}
12671263
{taskHistory.length > 0 && isExpanded && <HistoryPreview />}
1268-
{/* If the user has no task history, we can show the onboarding message */}
1269-
{taskHistory.length > -1 && (
1270-
<p className="ext-vscode-editor-foreground leading-tight font-vscode text-center">
1271-
<Trans
1272-
i18nKey="chat:about"
1273-
components={{
1274-
DocsLink: (
1275-
<a
1276-
href="https://docs.roocode.com/getting-started/your-first-task"
1277-
target="_blank"
1278-
rel="noopener noreferrer">
1279-
the docs
1280-
</a>
1281-
),
1282-
}}
1283-
/>
1284-
</p>
1285-
)}
1286-
{/* Finally, if there less than 3 tasks, we can show the tips */}
1287-
{tasks.length > -1 && <RooTips cycle={false} />}
1264+
<p className="ext-vscode-editor-foreground leading-tight font-vscode text-center">
1265+
<Trans
1266+
i18nKey="chat:about"
1267+
components={{
1268+
DocsLink: (
1269+
<a
1270+
href="https://docs.roocode.com/getting-started/your-first-task"
1271+
target="_blank"
1272+
rel="noopener noreferrer">
1273+
the docs
1274+
</a>
1275+
),
1276+
}}
1277+
/>
1278+
</p>
1279+
<RooTips cycle={false} />
12881280
</div>
12891281
</div>
12901282
)}

webview-ui/src/components/chat/__tests__/ChatView.auto-approve.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ const defaultProps: ChatViewProps = {
9595
isHidden: false,
9696
showAnnouncement: false,
9797
hideAnnouncement: () => {},
98-
showHistoryView: () => {},
9998
}
10099

101100
const renderChatView = (props: Partial<ChatViewProps> = {}) => {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ const defaultProps: ChatViewProps = {
153153
isHidden: false,
154154
showAnnouncement: false,
155155
hideAnnouncement: () => {},
156-
showHistoryView: () => {},
157156
}
158157

159158
const queryClient = new QueryClient()

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

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,14 @@ import { formatLargeNumber, formatDate } from "@/utils/format"
66
import { CopyButton } from "./CopyButton"
77
import { useTaskSearch } from "./useTaskSearch"
88

9-
import { Trans } from "react-i18next"
109
import { Coins } from "lucide-react"
1110

1211
const HistoryPreview = () => {
1312
const { tasks, showAllWorkspaces } = useTaskSearch()
1413

1514
return (
1615
<>
17-
<div className="flex flex-col gap-3 shrink-0 ">
18-
{tasks.length === 0 && (
19-
<>
20-
<p className="opacity-50 p-2 text-center my-0 mx-auto max-w-80">
21-
<Trans
22-
i18nKey="chat:onboarding"
23-
components={{
24-
DocsLink: (
25-
<a
26-
href="https://docs.roocode.com/getting-started/your-first-task"
27-
target="_blank"
28-
rel="noopener noreferrer">
29-
the docs
30-
</a>
31-
),
32-
}}
33-
/>
34-
</p>
35-
</>
36-
)}
37-
16+
<div className="flex flex-col gap-3">
3817
{tasks.length !== 0 && (
3918
<>
4019
{tasks.slice(0, 3).map((item) => (

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
5454
<div
5555
className={clsx(
5656
"flex flex-col items-center justify-center px-5 py-2.5 gap-4",
57-
cycle && "h-[5em] overflow-visible m-5", // Apply styles only when cycle is true (removed bg-red-500)
57+
cycle && "h-[5em] overflow-visible m-5",
5858
)}>
5959
{/* If we need real estate, we show a compressed version of the tips. Otherwise, we expand it. */}
6060
{cycle ? (
@@ -66,7 +66,6 @@ const RooTips = ({ cycle = false }: RooTipsProps) => {
6666
isFading ? "opacity-0" : "opacity-70",
6767
)}>
6868
{" "}
69-
{/* Corrected backtick to parenthesis */}
7069
<span className={`codicon ${currentTip.icon}`}></span>
7170
<span>
7271
<VSCodeLink href={currentTip.href}>{t(currentTip.titleKey)}</VSCodeLink>:{" "}

0 commit comments

Comments
 (0)