mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
feat: change default workspace filter to "All" in task history view
This commit is contained in:
parent
78821a3951
commit
6e1e820995
2 changed files with 15 additions and 14 deletions
|
|
@ -63,29 +63,30 @@ describe("useTaskSearch", () => {
|
|||
it("returns all tasks by default", () => {
|
||||
const { result } = renderHook(() => useTaskSearch())
|
||||
|
||||
expect(result.current.tasks).toHaveLength(2) // Only tasks from current workspace
|
||||
expect(result.current.tasks).toHaveLength(3) // All tasks from all workspaces
|
||||
expect(result.current.tasks[0].id).toBe("task-2") // Newest first
|
||||
expect(result.current.tasks[1].id).toBe("task-1")
|
||||
expect(result.current.tasks[2].id).toBe("task-3")
|
||||
})
|
||||
|
||||
it("filters tasks by current workspace by default", () => {
|
||||
it("shows all workspaces by default", () => {
|
||||
const { result } = renderHook(() => useTaskSearch())
|
||||
|
||||
expect(result.current.tasks).toHaveLength(2)
|
||||
expect(result.current.tasks.every((task) => task.workspace === "/workspace/project1")).toBe(true)
|
||||
})
|
||||
|
||||
it("shows all workspaces when showAllWorkspaces is true", () => {
|
||||
const { result } = renderHook(() => useTaskSearch())
|
||||
|
||||
act(() => {
|
||||
result.current.setShowAllWorkspaces(true)
|
||||
})
|
||||
|
||||
expect(result.current.tasks).toHaveLength(3)
|
||||
expect(result.current.showAllWorkspaces).toBe(true)
|
||||
})
|
||||
|
||||
it("filters tasks by current workspace when showAllWorkspaces is false", () => {
|
||||
const { result } = renderHook(() => useTaskSearch())
|
||||
|
||||
act(() => {
|
||||
result.current.setShowAllWorkspaces(false)
|
||||
})
|
||||
|
||||
expect(result.current.tasks).toHaveLength(2)
|
||||
expect(result.current.tasks.every((task) => task.workspace === "/workspace/project1")).toBe(true)
|
||||
})
|
||||
|
||||
it("sorts by newest by default", () => {
|
||||
const { result } = renderHook(() => useTaskSearch())
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export const useTaskSearch = () => {
|
|||
const [searchQuery, setSearchQuery] = useState("")
|
||||
const [sortOption, setSortOption] = useState<SortOption>("newest")
|
||||
const [lastNonRelevantSort, setLastNonRelevantSort] = useState<SortOption | null>("newest")
|
||||
const [showAllWorkspaces, setShowAllWorkspaces] = useState(false)
|
||||
const [showAllWorkspaces, setShowAllWorkspaces] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
if (searchQuery && sortOption !== "mostRelevant" && !lastNonRelevantSort) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue