Skip to content

Commit 4dbf6d4

Browse files
committed
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
1 parent 5bffebd commit 4dbf6d4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
import { memo } from "react"
22

3+
import { vscode } from "@/utils/vscode"
34
import { useTaskSearch } from "./useTaskSearch"
45
import TaskItem from "./TaskItem"
56

67
const HistoryPreview = () => {
78
const { tasks } = useTaskSearch()
89

10+
const handleViewAllHistory = () => {
11+
vscode.postMessage({ type: "switchTab", tab: "history" })
12+
}
13+
914
return (
1015
<div className="flex flex-col gap-3">
1116
{tasks.length !== 0 && (
1217
<>
1318
{tasks.slice(0, 3).map((item) => (
1419
<TaskItem key={item.id} item={item} variant="compact" />
1520
))}
21+
<div className="flex justify-center mt-2">
22+
<button
23+
onClick={handleViewAllHistory}
24+
className="text-vscode-descriptionForeground hover:text-vscode-foreground text-sm cursor-pointer transition-colors duration-200 flex items-center gap-1">
25+
View all history →
26+
</button>
27+
</div>
1628
</>
1729
)}
1830
</div>

0 commit comments

Comments
 (0)