mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-10 22:41:14 +00:00
Handles long lists of tasks in the home page
This commit is contained in:
parent
b1bc7ce4a6
commit
61a57108a2
1 changed files with 12 additions and 7 deletions
|
|
@ -10,7 +10,9 @@ import TaskItem from "./TaskItem"
|
|||
const HistoryPreview = () => {
|
||||
const { tasks } = useTaskSearch()
|
||||
const { t } = useAppTranslation()
|
||||
const { maxTasksHomeScreen } = useExtensionState()
|
||||
let { maxTasksHomeScreen } = useExtensionState()
|
||||
|
||||
maxTasksHomeScreen = 100
|
||||
|
||||
const handleViewAllHistory = () => {
|
||||
vscode.postMessage({ type: "switchTab", tab: "history" })
|
||||
|
|
@ -22,7 +24,7 @@ const HistoryPreview = () => {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="flex flex-col gap-1 h-full">
|
||||
<div className="flex flex-wrap items-center justify-between mt-4 mb-2">
|
||||
<h2 className="font-semibold text-lg grow m-0">{t("history:recentTasks")}</h2>
|
||||
<button
|
||||
|
|
@ -33,11 +35,14 @@ const HistoryPreview = () => {
|
|||
</button>
|
||||
</div>
|
||||
{tasks.length !== 0 && (
|
||||
<>
|
||||
{tasks.slice(0, maxTasksHomeScreen).map((item) => (
|
||||
<TaskItem key={item.id} item={item} variant="compact" />
|
||||
))}
|
||||
</>
|
||||
<div className="relative w-full">
|
||||
<div className="absolute w-full bg-gradient-to-t from-vscode-sideBar-background to-vscode-sideBar-background/0 z-5 bottom-0 h-6" />
|
||||
<div className="overflow-y-auto space-y-1 -mx-6 px-6 pb-6 max-h-[calc(100vh-280px)] relative z-4">
|
||||
{tasks.slice(0, maxTasksHomeScreen).map((item) => (
|
||||
<TaskItem key={item.id} item={item} variant="compact" />
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue