feat: add navigation link to history tab in HistoryPreview

- Add subtle 'View all history →' link at bottom of HistoryPreview component
- Link navigates to history tab using existing switchTab message system
- Styled with VSCode theme variables for consistent appearance
- Improves accessibility to history tab now that it's behind overflow menu
This commit is contained in:
Roo Code 2025-07-12 17:02:22 +00:00
parent 5bffebde58
commit 4dbf6d4d0a

View file

@ -1,11 +1,16 @@
import { memo } from "react"
import { vscode } from "@/utils/vscode"
import { useTaskSearch } from "./useTaskSearch"
import TaskItem from "./TaskItem"
const HistoryPreview = () => {
const { tasks } = useTaskSearch()
const handleViewAllHistory = () => {
vscode.postMessage({ type: "switchTab", tab: "history" })
}
return (
<div className="flex flex-col gap-3">
{tasks.length !== 0 && (
@ -13,6 +18,13 @@ const HistoryPreview = () => {
{tasks.slice(0, 3).map((item) => (
<TaskItem key={item.id} item={item} variant="compact" />
))}
<div className="flex justify-center mt-2">
<button
onClick={handleViewAllHistory}
className="text-vscode-descriptionForeground hover:text-vscode-foreground text-sm cursor-pointer transition-colors duration-200 flex items-center gap-1">
View all history
</button>
</div>
</>
)}
</div>