diff --git a/apps/web/src/components/CommandPalette.tsx b/apps/web/src/components/CommandPalette.tsx index 1eb1a9bcba599..3d2ecb91a099c 100644 --- a/apps/web/src/components/CommandPalette.tsx +++ b/apps/web/src/components/CommandPalette.tsx @@ -63,6 +63,7 @@ import { ArrowLeftIcon, BugIcon, ChartNoAxesColumnIcon, + KanbanIcon, CheckIcon, ChevronRightIcon, CornerLeftUpIcon, @@ -1751,6 +1752,17 @@ function OpenCommandPaletteDialog(props: { }, }); + actionItems.push({ + kind: "action", + value: "action:board", + searchTerms: ["board", "kanban", "tasks", "status", "overview"], + title: gt("Open task board"), + icon: , + run: async () => { + await navigate({ to: "/board" }); + }, + }); + for (const direction of [1, -1] as const) { const title = direction === 1 ? gt("Focus Next Workspace Area") : gt("Focus Previous Workspace Area"); diff --git a/apps/web/src/components/HistorySwipeNavigation.browser.test.tsx b/apps/web/src/components/HistorySwipeNavigation.browser.test.tsx index d2a15729b0df2..32d05c915e876 100644 --- a/apps/web/src/components/HistorySwipeNavigation.browser.test.tsx +++ b/apps/web/src/components/HistorySwipeNavigation.browser.test.tsx @@ -27,6 +27,13 @@ describe("HistorySwipeNavigation", () => { ["swiping back at a shadow-root scroller's left edge navigates", "shadow", 0, -130, true], ["swiping back over a panel without overflow navigates", "none", 0, -130, true], ["a swipe that started in a closed dialog keeps the thread", "closed-dialog", 0, -130, false], + [ + "swiping back at the edge of an opted-out scroller keeps the thread", + "opt-out", + 0, + -130, + false, + ], ] as const)("%s", async (_name, scroller, scrollLeft, deltaX, navigates) => { navigateHistory.mockReset(); using _platform = vi.spyOn(navigator, "platform", "get").mockReturnValue("MacIntel"); @@ -39,6 +46,7 @@ describe("HistorySwipeNavigation", () => { const content = viewport.appendChild(document.createElement("div")); content.style.cssText = `height: 20px; width: ${noOverflow ? 100 : 1000}px`; viewport.scrollLeft = scrollLeft; + if (scroller === "opt-out") viewport.dataset.historySwipe = "off"; if (scroller === "closed-dialog") { panel.setAttribute("role", "dialog"); diff --git a/apps/web/src/components/HistorySwipeNavigation.tsx b/apps/web/src/components/HistorySwipeNavigation.tsx index 2924f82cd3136..a7120917f3a40 100644 --- a/apps/web/src/components/HistorySwipeNavigation.tsx +++ b/apps/web/src/components/HistorySwipeNavigation.tsx @@ -71,7 +71,9 @@ function lockSwipeAxis( if (Math.abs(sumX) <= Math.abs(sumY) || isVerticalScroll(Math.abs(sumX), Math.abs(sumY))) { return { kind: "ignored" }; } - if (path.some((node) => node instanceof Element && node.matches('[role="dialog"]'))) { + // `data-history-swipe="off"` marks a horizontal scroller whose edges must not navigate. + const blocksSwipe = '[role="dialog"], [data-history-swipe="off"]'; + if (path.some((node) => node instanceof Element && node.matches(blocksSwipe))) { return { kind: "ignored" }; } if (canScrollHorizontally(path, sumX)) return { kind: "ignored" }; diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx index 86a2d04c53eef..28929f96fef50 100644 --- a/apps/web/src/components/Sidebar.tsx +++ b/apps/web/src/components/Sidebar.tsx @@ -272,6 +272,10 @@ import { type SidebarSweepAction, } from "./sidebar/SidebarThreadRow"; import { SidebarDraftBlock } from "./sidebar/SidebarDraftBlock"; +import { + type ThreadContextMenuOptions, + useProvideThreadContextMenu, +} from "./sidebar/threadContextMenu"; import { SidebarProjectFolderHeader, sidebarFolderRowId, @@ -2611,26 +2615,27 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve threadRef: ScopedThreadRef, position: { x: number; y: number }, source: ContextMenuSource, - fromSearch = false, + options?: ThreadContextMenuOptions, ) => { void (async () => { const api = readLocalApi(); if (!api) return; const threadKey = scopedThreadKey(threadRef); const selectionState = useThreadSelectionStore.getState(); - // Search results are not selectable rows, so they always act on their own thread. + // Only sidebar rows act on the sidebar's selection; search and other surfaces pass options. if ( - !fromSearch && + options === undefined && selectionState.hasSelection() && selectionState.selectedThreadKeys.has(threadKey) ) { await handleMultiSelectContextMenu(position, source); + return; } - // Search results also reach threads in collapsed shelves, which are not rendered rows. + // Search results and the task board reach threads that are not rendered rows. const thread = threadByKeyRef.current.get(threadKey) ?? - searchableThreads.find((candidate) => threadShellKey(candidate) === threadKey); + threads.find((candidate) => threadShellKey(candidate) === threadKey); if (!thread) return; const threadWorkspacePath = thread.worktreePath ?? @@ -2641,8 +2646,12 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve serverConfigs.get(thread.environmentId)?.environment.capabilities .threadAutoSettleOptOut === true; const isRegeneratingTitle = thread.titleRegeneration != null; - const isSettled = settledThreadKeysRef.current.has(threadKey); - const isSnoozed = snoozedThreadKeysRef.current.has(threadKey); + const isSettled = + settledThreadKeysRef.current.has(threadKey) || + (configLoaded && thread.settledOverride === "settled"); + const isSnoozed = + snoozedThreadKeysRef.current.has(threadKey) || + (configLoaded && effectiveSnoozed(thread, { now: new Date().toISOString() })); const isPinned = thread.pinnedAt != null; const snoozePresets = resolveSnoozePresets( new Date(), @@ -2684,7 +2693,8 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve canShareWithGuestAtom(threadRef.environmentId), ), canTurnIntoProject: canTurnThreadIntoProject(threadRef), - canRename: !fromSearch, + // Renaming needs a surface that shows the title: a sidebar row or one passing onStartRename. + canRename: options === undefined || options.onStartRename !== undefined, supports: { settlement: configLoaded, autoSettleOptOut: supportsAutoSettleOptOut, @@ -2805,7 +2815,7 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve return; } case "rename": - startThreadRename(threadRef, thread.title); + (options?.onStartRename ?? startThreadRename)(threadRef, thread.title); return; case "share-guest": openGuestShareDialog(threadRef); @@ -2911,9 +2921,10 @@ export default function Sidebar({ routeReveal }: { routeReveal: SidebarRouteReve })(); }, ); + useProvideThreadContextMenu(handleThreadContextMenu); const handleSearchResultContextMenu = useStableCallback( (threadRef: ScopedThreadRef, position: { x: number; y: number }, source: ContextMenuSource) => - handleThreadContextMenu(threadRef, position, source, true), + handleThreadContextMenu(threadRef, position, source, {}), ); // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- subscribes to window keydown for thread navigation shortcuts using the current thread list diff --git a/apps/web/src/components/board/TaskBoardPage.browser.test.tsx b/apps/web/src/components/board/TaskBoardPage.browser.test.tsx new file mode 100644 index 0000000000000..5b7aca4a4af54 --- /dev/null +++ b/apps/web/src/components/board/TaskBoardPage.browser.test.tsx @@ -0,0 +1,239 @@ +import type { ContextMenuSource, ScopedThreadRef } from "@t3tools/contracts"; +import { describe, expect, it, vi } from "vite-plus/test"; +import { page, userEvent } from "vite-plus/test/browser"; + +import { render } from "../../../test/render"; +import { + type ThreadContextMenuOptions, + useProvideThreadContextMenu, +} from "../sidebar/threadContextMenu"; +import { TaskBoardPage } from "./TaskBoardPage"; + +const fixture = vi.hoisted(() => ({ + updateMetadata: vi.fn(async (_request: unknown) => ({ _tag: "Success" as const })), +})); + +function shell(id: string, title: string, overrides: Record = {}) { + return { + id, + environmentId: "environment-one", + projectId: "project-one", + title, + lineage: { parentThreadId: null, relationshipToParent: null, rootThreadId: id }, + archivedAt: null, + settledOverride: null, + pinnedAt: null, + updatedAt: "2026-01-01T10:00:00.000Z", + hasPendingApprovals: false, + hasPendingUserInput: false, + runtime: null, + snoozedUntil: null, + ...overrides, + }; +} + +vi.mock("../../state/entities", async (original) => { + const threads = [ + shell("thread-done", "Finished work"), + shell("thread-approval", "Needs approval", { hasPendingApprovals: true }), + ]; + return { + ...(await original()), + useVisibleThreadShells: () => threads, + useProjects: () => [], + }; +}); +vi.mock("../../state/session", async (original) => ({ + ...(await original()), + readEnvironmentScope: () => true, +})); +vi.mock("../../state/use-orchestration-command", () => ({ + useOrchestrationCommand: () => fixture.updateMetadata, +})); + +type MenuCall = [ + ScopedThreadRef, + { x: number; y: number }, + ContextMenuSource, + ThreadContextMenuOptions | undefined, +]; + +function SidebarMenuStub(props: { onMenu: (...args: MenuCall) => void }) { + useProvideThreadContextMenu(props.onMenu); + return null; +} + +function pointer(type: string, x: number, y: number) { + return new PointerEvent(type, { + bubbles: true, + cancelable: true, + isPrimary: true, + button: 0, + buttons: type === "pointerup" ? 0 : 1, + clientX: x, + clientY: y, + }); +} + +const panel = (label: string) => page.getByRole("region", { name: label }).element(); +const column = (label: string) => panel(label).closest("[data-board-column]"); +const grow = (label: string) => Number(panel(label).parentElement!.style.flexGrow); + +describe("TaskBoardPage", () => { + it("opens the sidebar thread menu on right-click and renames in place", async () => { + localStorage.clear(); + fixture.updateMetadata.mockClear(); + const onMenu = vi.fn<(...args: MenuCall) => void>(); + await using screen = await render( + <> + + + , + ); + + await userEvent.click(screen.getByRole("button", { name: /Finished work/ }), { + button: "right", + }); + expect(onMenu).toHaveBeenCalledOnce(); + const [threadRef, , source, options] = onMenu.mock.calls[0]!; + expect(source).toBe("mouse"); + expect(threadRef).toEqual({ environmentId: "environment-one", threadId: "thread-done" }); + + options?.onStartRename?.(threadRef, "Finished work"); + const input = screen.getByRole("textbox", { name: "Thread title" }); + await userEvent.fill(input, "Renamed work"); + await userEvent.keyboard("{Enter}"); + expect(fixture.updateMetadata).toHaveBeenCalledWith({ + environmentId: "environment-one", + input: { threadId: "thread-done", title: "Renamed work" }, + }); + }); + + it("collapses, stacks and keeps the layout across remounts", async () => { + localStorage.clear(); + { + await using screen = await render(); + await userEvent.click(screen.getByRole("button", { name: "Collapse Failed" })); + await expect.element(screen.getByRole("button", { name: "Expand Failed" })).toBeVisible(); + + const header = panel("Working").querySelector("h2")!; + const from = header.getBoundingClientRect(); + const target = panel("Needs you").getBoundingClientRect(); + const drop = { x: target.left + target.width / 2, y: target.bottom - 10 }; + header.dispatchEvent(pointer("pointerdown", from.left + 10, from.top + 5)); + document.dispatchEvent(pointer("pointermove", from.left + 30, from.top + 5)); + await vi.waitFor(() => expect(panel("Working").className).toContain("opacity-50")); + document.dispatchEvent(pointer("pointermove", drop.x, drop.y)); + await vi.waitFor(() => + expect(panel("Needs you").querySelector(".bg-primary")).not.toBeNull(), + ); + document.dispatchEvent(pointer("pointerup", drop.x, drop.y)); + await vi.waitFor(() => expect(column("Working")).toBe(column("Needs you"))); + } + + await using screen = await render(); + await expect.element(screen.getByRole("button", { name: "Expand Failed" })).toBeVisible(); + const stack = column("Needs you")!; + expect([...stack.querySelectorAll("section")].map((section) => section.ariaLabel)).toEqual([ + "Needs you", + "Working", + ]); + }); + + it("stacks a panel dropped by a single quick move", async () => { + localStorage.clear(); + await using _screen = await render(); + const header = panel("Working").querySelector("h2")!; + const from = header.getBoundingClientRect(); + const target = panel("Needs you").getBoundingClientRect(); + const drop = { x: target.left + target.width / 2, y: target.bottom - 10 }; + header.dispatchEvent(pointer("pointerdown", from.left + 10, from.top + 5)); + // The only move both activates the drag and lands on the target. + document.dispatchEvent(pointer("pointermove", drop.x, drop.y)); + await vi.waitFor(() => expect(panel("Working").className).toContain("opacity-50")); + document.dispatchEvent(pointer("pointerup", drop.x, drop.y)); + await vi.waitFor(() => expect(column("Working")).toBe(column("Needs you"))); + }); + + it("moves the focused panel with Alt+arrows and keeps focus on it", async () => { + localStorage.clear(); + await using screen = await render(); + const toggle = () => screen.getByRole("button", { name: "Collapse Working" }).element(); + (toggle() as HTMLElement).focus(); + await userEvent.keyboard("{Alt>}{Shift>}{ArrowLeft}{/Shift}{/Alt}"); + await vi.waitFor(() => { + expect(column("Working")).toBe(column("Needs you")); + expect(document.activeElement).toBe(toggle()); + }); + await userEvent.keyboard("{Alt>}{ArrowUp}{/Alt}"); + await vi.waitFor(() => + expect( + [...column("Working")!.querySelectorAll("section")].map((section) => section.ariaLabel), + ).toEqual(["Working", "Needs you"]), + ); + await userEvent.keyboard("{Alt>}{ArrowRight}{/Alt}"); + await vi.waitFor(() => { + expect(column("Working")).not.toBe(column("Needs you")); + expect(document.activeElement).toBe(toggle()); + }); + }); + + it("resizes stacked panels, keeps the split across remounts, and resets on double-click", async () => { + localStorage.clear(); + // A layout saved before weights existed loads as equal shares. + localStorage.setItem( + "t3code:task-board:layout", + JSON.stringify({ columns: [["attention", "done"]], collapsed: [] }), + ); + const separator = { name: "Resize Needs you and Done" }; + { + await using screen = await render(); + const handle = screen.getByRole("separator", separator).element() as HTMLElement; + expect([grow("Needs you"), grow("Done")]).toEqual([1, 1]); + // Synthetic drag events have no active browser pointer to capture. + using _capture = vi.spyOn(handle, "setPointerCapture").mockImplementation(() => {}); + const pointer = { bubbles: true, pointerId: 1, button: 0, clientX: 0 }; + handle.dispatchEvent(new PointerEvent("pointerdown", { ...pointer, clientY: 300 })); + handle.dispatchEvent(new PointerEvent("pointerup", { ...pointer, clientY: 360 })); + expect(panel("Needs you").className).not.toContain("opacity-50"); + await vi.waitFor(() => + expect(localStorage.getItem("t3code:task-board:layout")).toContain("weights"), + ); + expect(grow("Needs you")).toBeGreaterThan(grow("Done")); + expect(grow("Needs you") + grow("Done")).toBeCloseTo(2); + } + + await using screen = await render(); + expect(grow("Needs you")).toBeGreaterThan(grow("Done")); + // Unstyled in tests, the handle has no box for a real pointer to hit. + const handle = screen.getByRole("separator", separator).element(); + handle.dispatchEvent(new MouseEvent("dblclick", { bubbles: true })); + await vi.waitFor(() => expect([grow("Needs you"), grow("Done")]).toEqual([1, 1])); + }); + + it("resizes a column by its edge, keeps the width across remounts, and resets on double-click", async () => { + localStorage.clear(); + const separator = { name: "Resize Needs you column" }; + const width = () => column("Needs you")!.style.width; + { + await using screen = await render(); + const handle = screen.getByRole("separator", separator).element() as HTMLElement; + expect(width()).toBe("288px"); + // Synthetic drag events have no active browser pointer to capture. + using _capture = vi.spyOn(handle, "setPointerCapture").mockImplementation(() => {}); + const pointer = { bubbles: true, pointerId: 1, button: 0, clientY: 0 }; + handle.dispatchEvent(new PointerEvent("pointerdown", { ...pointer, clientX: 300 })); + handle.dispatchEvent(new PointerEvent("pointerup", { ...pointer, clientX: 400 })); + await vi.waitFor(() => + expect(localStorage.getItem("t3code:task-board:layout")).toContain("widths"), + ); + expect(width()).toBe("388px"); + } + + await using screen = await render(); + expect(width()).toBe("388px"); + const handle = screen.getByRole("separator", separator).element(); + handle.dispatchEvent(new MouseEvent("dblclick", { bubbles: true })); + await vi.waitFor(() => expect(width()).toBe("288px")); + }); +}); diff --git a/apps/web/src/components/board/TaskBoardPage.tsx b/apps/web/src/components/board/TaskBoardPage.tsx new file mode 100644 index 0000000000000..af6df98db8632 --- /dev/null +++ b/apps/web/src/components/board/TaskBoardPage.tsx @@ -0,0 +1,825 @@ +import { T, useGT, useMessages } from "gt-react"; +import { contextMenuSourceOf } from "../../contextMenuSource"; +import type { ContextMenuSource } from "@t3tools/contracts"; +import { scopeThreadRef } from "@t3tools/client-runtime/environment"; +import { + DndContext, + DragOverlay, + PointerSensor, + useDraggable, + useSensor, + useSensors, + type DragEndEvent, + type DragStartEvent, +} from "@dnd-kit/core"; +import { + isAtomCommandInterrupted, + squashAtomCommandFailure, +} from "@t3tools/client-runtime/state/runtime"; +import { AuthOrchestrationOperateScope } from "@t3tools/contracts"; +import { useNavigate } from "@tanstack/react-router"; +import * as Schema from "effect/Schema"; +import { PanelLeftCloseIcon, PanelLeftOpenIcon } from "lucide-react"; +import { + memo, + useEffect, + useRef, + useState, + type KeyboardEvent as ReactKeyboardEvent, + type MouseEvent as ReactMouseEvent, +} from "react"; +import { flushSync } from "react-dom"; + +import { isElectron } from "../../env"; +import { useLocalStorage } from "../../hooks/useLocalStorage"; +import { useResizeDrag } from "../../hooks/useResizeDrag"; +import { useNowMinute } from "../../hooks/useNowMinute"; +import { cn } from "../../lib/utils"; +import { useProjects, useVisibleThreadShells } from "../../state/entities"; +import { readEnvironmentScope } from "../../state/session"; +import { threadEnvironment } from "../../state/threads"; +import { useOrchestrationCommand } from "../../state/use-orchestration-command"; +import { formatRelativeTimeLabel } from "../../timestampFormat"; +import { buildThreadRouteParams } from "../../threadRoutes"; +import type { SidebarThreadSummary } from "../../types"; +import { resolveThreadStatusPill } from "../Sidebar.logic"; +import { ThreadRenameInput } from "../sidebar/SidebarThreadRow"; +import { showThreadContextMenu } from "../sidebar/threadContextMenu"; +import { Button } from "../ui/button"; +import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../ui/empty"; +import { SidebarInset } from "../ui/sidebar"; +import { stackedThreadToast, toastManager } from "../ui/toast"; +import { WorkspacePageHeader } from "../WorkspacePageHeader"; +import { + BOARD_PANELS, + BOARD_COLUMN_WIDTH, + BoardLayoutSchema, + boardColumnWidth, + setBoardColumnWidth, + boardPanelWeight, + groupThreadsByPanel, + moveBoardPanel, + resetBoardColumnWeights, + resolveBoardDropEdge, + resolveBoardKeyboardMove, + resolveBoardLayout, + setBoardPanelWeights, + splitBoardPanelPair, + toggleBoardPanelCollapsed, + type BoardPanelPair, + type BoardDropEdge, + type BoardLayout, + type BoardMoveDirection, + type BoardPanelId, +} from "./taskBoard.logic"; + +const PAGE_SIZE = 50; +const MOVE_KEYS: Partial> = { + ArrowLeft: "left", + ArrowRight: "right", + ArrowUp: "up", + ArrowDown: "down", +}; +const LAYOUT_STORAGE_KEY = "t3code:task-board:layout"; +const SavedLayoutSchema = Schema.NullOr(BoardLayoutSchema); +const PANEL_LABELS = new Map( + BOARD_PANELS.map((panel) => [panel.id, panel.label]), +); +const RESIZE_KEY_STEP = 16; + +type DropTarget = { readonly panelId: BoardPanelId; readonly edge: BoardDropEdge }; +type PanelMode = "expanded" | "header" | "rail"; + +const DROP_EDGE_CLASS: Record = { + left: "inset-y-0 -left-2 w-1", + right: "inset-y-0 -right-2 w-1", + top: "inset-x-0 -top-2 h-1", + bottom: "inset-x-0 -bottom-2 h-1", +}; + +const cardKey = (thread: SidebarThreadSummary) => `${thread.environmentId}:${thread.id}`; + +interface BoardCardHandlers { + onOpen: (thread: SidebarThreadSummary) => void; + onStartRename: (key: string) => void; + onCommitRename: (thread: SidebarThreadSummary, title: string) => void; + onCancelRename: () => void; +} + +// Mounted only while renaming, so the draft starts from the current title. +function BoardCardRename(props: { + thread: SidebarThreadSummary; + onCommit: (thread: SidebarThreadSummary, title: string) => void; + onCancel: () => void; +}) { + const [title, setTitle] = useState(props.thread.title); + return ( +
+ props.onCommit(props.thread, title)} + onCancel={props.onCancel} + /> +
+ ); +} + +const BoardCard = memo(function BoardCard( + props: BoardCardHandlers & { + thread: SidebarThreadSummary; + projectTitle: string | null; + nowMs: number; + renaming: boolean; + }, +) { + const { thread, onStartRename } = props; + const pill = resolveThreadStatusPill({ thread }); + const openMenu = (position: { x: number; y: number }, source: ContextMenuSource) => + showThreadContextMenu(scopeThreadRef(thread.environmentId, thread.id), position, source, { + onStartRename: () => onStartRename(cardKey(thread)), + }); + const handleContextMenu = (event: ReactMouseEvent) => { + if (openMenu({ x: event.clientX, y: event.clientY }, contextMenuSourceOf(event))) + event.preventDefault(); + }; + const handleKeyDown = (event: ReactKeyboardEvent) => { + if (event.key !== "ContextMenu" && !(event.shiftKey && event.key === "F10")) return; + const rect = event.currentTarget.getBoundingClientRect(); + if (openMenu({ x: rect.left, y: rect.bottom }, "keyboard")) event.preventDefault(); + }; + if (props.renaming) { + return ( + + ); + } + return ( + + ); +}); + +// Kept apart from the panel shell so drag feedback never re-renders the cards. +const BoardPanelCards = memo(function BoardPanelCards( + props: BoardCardHandlers & { + panelId: BoardPanelId; + items: SidebarThreadSummary[]; + limit: number; + renamingKey: string | null; + projectTitles: ReadonlyMap; + nowMs: number; + onShowMore: (panelId: BoardPanelId) => void; + }, +) { + const gt = useGT(); + const { items, limit } = props; + return ( + // Horizontal wheel movement must chain to the board, so only the y axis is contained. +
+
+ {items.slice(0, limit).map((thread) => ( + + ))} + {items.length > limit ? ( + + ) : null} +
+
+ ); +}); + +function BoardPanelHeader(props: { + panelId: BoardPanelId; + label: string; + count: number; + collapsed: boolean; + onToggle: (panelId: BoardPanelId) => void; +}) { + const gt = useGT(); + const { listeners, setNodeRef } = useDraggable({ id: props.panelId }); + const ToggleIcon = props.collapsed ? PanelLeftOpenIcon : PanelLeftCloseIcon; + return ( +
+

+ {props.label} +

+ {props.count} + +
+ ); +} + +function BoardPanelRail(props: { + panelId: BoardPanelId; + label: string; + count: number; + onToggle: (panelId: BoardPanelId) => void; +}) { + const gt = useGT(); + const { listeners, setNodeRef } = useDraggable({ id: props.panelId }); + return ( + + ); +} + +const BoardPanel = memo(function BoardPanel( + props: BoardCardHandlers & { + panelId: BoardPanelId; + label: string; + mode: PanelMode; + items: SidebarThreadSummary[]; + limit: number; + renamingKey: string | null; + dragging: boolean; + dropEdge: BoardDropEdge | null; + projectTitles: ReadonlyMap; + nowMs: number; + onShowMore: (panelId: BoardPanelId) => void; + onToggle: (panelId: BoardPanelId) => void; + onMoveKey: (panelId: BoardPanelId, event: ReactKeyboardEvent) => void; + }, +) { + const { panelId, label, mode, items } = props; + return ( +
props.onMoveKey(panelId, event)} + className={cn( + "relative flex min-h-0 flex-1 flex-col rounded-xl bg-muted/40", + props.dragging && "opacity-50", + )} + > + {mode === "rail" ? ( + + ) : ( + + )} + {mode === "expanded" ? ( + + ) : null} + {props.dropEdge ? ( + + ) : null} +
+ ); +}); + +type PanelWeights = Partial>; + +function BoardPanelResizeHandle(props: { + upperId: BoardPanelId; + lowerId: BoardPanelId; + upperWeight: number; + lowerWeight: number; + onResize: (weights: PanelWeights) => void; + onReset: (panelId: BoardPanelId) => void; +}) { + const gt = useGT(); + const m = useMessages(); + const { upperId, lowerId, upperWeight, lowerWeight } = props; + // The handle sits in the upper panel's frame; the lower frame is found in the same column. + const measure = (handle: HTMLElement) => { + const upper = handle.parentElement; + const lower = handle + .closest("[data-board-column]") + ?.querySelector(`[data-board-frame="${lowerId}"]`); + if (!upper || !lower) return null; + const pair: BoardPanelPair = { + upperWeight, + lowerWeight, + upperHeight: upper.offsetHeight, + lowerHeight: lower.offsetHeight, + }; + // The frame's `min-h-*` class keeps a header plus about one card visible. + const minHeight = Number.parseFloat(getComputedStyle(upper).minHeight) || 0; + return { upper, lower, pair, minHeight }; + }; + const commit = ([upper, lower]: readonly [number, number]) => + props.onResize({ [upperId]: upper, [lowerId]: lower }); + // Sizes go straight to the frames while dragging and reach state once, on release. + const drag = useResizeDrag((event) => { + const frames = measure(event.currentTarget); + if (!frames) return null; + const { upper, lower, pair, minHeight } = frames; + let split: readonly [number, number] = [upperWeight, lowerWeight]; + const apply = (weights: readonly [number, number]) => { + upper.style.flexGrow = String(weights[0]); + lower.style.flexGrow = String(weights[1]); + }; + return { + width: pair.upperHeight, + edge: "bottom", + bounds: { min: 0, max: pair.upperHeight + pair.lowerHeight }, + resize: (height) => { + split = splitBoardPanelPair(pair, height - pair.upperHeight, minHeight); + apply(split); + return height; + }, + cleanup: (committed) => { + if (!committed) apply([upperWeight, lowerWeight]); + }, + finish: (_height, moved) => { + if (moved) commit(split); + else apply([upperWeight, lowerWeight]); + }, + }; + }); + const handlers = { + ref: drag.ref, + onPointerDown: drag.onPointerDown, + onPointerMove: drag.onPointerMove, + onPointerUp: drag.onPointerUp, + onPointerCancel: drag.onPointerCancel, + onLostPointerCapture: drag.onLostPointerCapture, + }; + const handleKeyDown = (event: ReactKeyboardEvent) => { + if (event.key === "Enter") return props.onReset(upperId); + if (event.key !== "ArrowUp" && event.key !== "ArrowDown") return; + const frames = measure(event.currentTarget); + if (!frames) return; + event.preventDefault(); + const step = event.key === "ArrowUp" ? -RESIZE_KEY_STEP : RESIZE_KEY_STEP; + commit(splitBoardPanelPair(frames.pair, step, frames.minHeight)); + }; + return ( +
props.onReset(upperId)} + onKeyDown={handleKeyDown} + className="group absolute inset-x-0 -bottom-3 z-10 h-3 cursor-row-resize touch-none select-none outline-none" + > + +
+ ); +} + +function BoardColumnResizeHandle(props: { + panelId: BoardPanelId; + width: number; + onResize: (panelId: BoardPanelId, width: number | null) => void; +}) { + const gt = useGT(); + const m = useMessages(); + const { panelId, width } = props; + // The width goes straight to the column while dragging and reaches state once, on release. + const drag = useResizeDrag((event) => { + const column = event.currentTarget.parentElement; + if (!column) return null; + const apply = (next: number) => { + column.style.width = `${next}px`; + }; + return { + width, + edge: "right", + bounds: { min: BOARD_COLUMN_WIDTH.min, max: BOARD_COLUMN_WIDTH.max }, + resize: (next) => { + apply(next); + return next; + }, + cleanup: (committed) => { + if (!committed) apply(width); + }, + finish: (next, moved) => { + if (moved) props.onResize(panelId, next); + else apply(width); + }, + }; + }); + const handlers = { + ref: drag.ref, + onPointerDown: drag.onPointerDown, + onPointerMove: drag.onPointerMove, + onPointerUp: drag.onPointerUp, + onPointerCancel: drag.onPointerCancel, + onLostPointerCapture: drag.onLostPointerCapture, + }; + const handleKeyDown = (event: ReactKeyboardEvent) => { + if (event.key === "Enter") return props.onResize(panelId, null); + if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return; + event.preventDefault(); + props.onResize( + panelId, + width + (event.key === "ArrowLeft" ? -RESIZE_KEY_STEP : RESIZE_KEY_STEP), + ); + }; + return ( +
props.onResize(panelId, null)} + onKeyDown={handleKeyDown} + className="group absolute inset-y-0 -right-3 z-10 w-3 cursor-col-resize touch-none select-none outline-none" + > + +
+ ); +} + +function findDropTarget( + board: HTMLElement, + activeId: BoardPanelId, + point: { x: number; y: number }, +): DropTarget | null { + for (const element of board.querySelectorAll("[data-board-panel]")) { + const rect = element.getBoundingClientRect(); + if ( + point.x < rect.left || + point.x > rect.right || + point.y < rect.top || + point.y > rect.bottom + ) { + continue; + } + const panelId = element.dataset.boardPanel as BoardPanelId; + return panelId === activeId ? null : { panelId, edge: resolveBoardDropEdge(rect, point) }; + } + return null; +} + +export function TaskBoardPage() { + const gt = useGT(); + const m = useMessages(); + const navigate = useNavigate(); + const threads = useVisibleThreadShells(); + const projects = useProjects(); + const nowMinute = useNowMinute(); + const now = `${nowMinute}:00.000Z`; + const [shown, setShown] = useState>({}); + const [savedLayout, setSavedLayout] = useLocalStorage( + LAYOUT_STORAGE_KEY, + null, + SavedLayoutSchema, + ); + const [renamingKey, setRenamingKey] = useState(null); + const updateThreadMetadata = useOrchestrationCommand(threadEnvironment.updateMetadata, { + reportFailure: false, + }); + const [activeId, setActiveId] = useState(null); + const [dropTarget, setDropTarget] = useState(null); + const dropTargetRef = useRef(null); + const pointerRef = useRef<{ x: number; y: number } | null>(null); + const boardRef = useRef(null); + const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 6 } })); + + const projectTitles = new Map( + projects.map((project) => [`${project.environmentId}:${project.id}`, project.title]), + ); + const groups = groupThreadsByPanel(threads, now); + const layout = resolveBoardLayout(savedLayout); + const nowMs = Date.parse(now); + + const updateLayout = (update: (layout: BoardLayout) => BoardLayout) => + setSavedLayout((saved) => update(resolveBoardLayout(saved))); + const openThread = (thread: SidebarThreadSummary) => { + void navigate({ + to: "/$environmentId/$threadId", + params: buildThreadRouteParams(scopeThreadRef(thread.environmentId, thread.id)), + }); + }; + const showMore = (panelId: BoardPanelId) => + setShown((previous) => ({ + ...previous, + [panelId]: (previous[panelId] ?? PAGE_SIZE) + PAGE_SIZE, + })); + const cancelRename = () => setRenamingKey(null); + const commitRename = (thread: SidebarThreadSummary, title: string) => { + setRenamingKey(null); + const trimmed = title.trim(); + if (!readEnvironmentScope(thread.environmentId, AuthOrchestrationOperateScope)) return; + if (trimmed.length === 0) { + toastManager.add({ type: "warning", title: gt("Thread title cannot be empty") }); + return; + } + if (trimmed === thread.title) return; + void updateThreadMetadata({ + environmentId: thread.environmentId, + input: { threadId: thread.id, title: trimmed }, + }).then((result) => { + if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) { + const error = squashAtomCommandFailure(result); + toastManager.add( + stackedThreadToast({ + type: "error", + title: gt("Failed to rename thread"), + description: error instanceof Error ? error.message : gt("An error occurred."), + }), + ); + } + }); + }; + const togglePanel = (panelId: BoardPanelId) => + updateLayout((current) => toggleBoardPanelCollapsed(current, panelId)); + // Alt+arrows move the panel that holds focus; Shift joins the next column instead. + const movePanelByKey = (panelId: BoardPanelId, event: ReactKeyboardEvent) => { + const direction = MOVE_KEYS[event.key]; + if (!direction || !event.altKey || event.ctrlKey || event.metaKey) return; + // Alt+arrows move the caret by word while a card is being renamed. + if (event.target instanceof HTMLInputElement) return; + event.preventDefault(); + flushSync(() => + updateLayout((current) => { + const target = resolveBoardKeyboardMove(current, panelId, direction, event.shiftKey); + return target ? moveBoardPanel(current, panelId, target) : current; + }), + ); + // The move remounts the panel's column, so focus returns to its header button. + boardRef.current?.querySelector(`[data-board-panel="${panelId}"] button`)?.focus(); + }; + const resizePanels = (weights: PanelWeights) => + updateLayout((current) => setBoardPanelWeights(current, weights)); + const resizeColumn = (panelId: BoardPanelId, width: number | null) => + updateLayout((current) => setBoardColumnWidth(current, panelId, width)); + const resetColumn = (panelId: BoardPanelId) => + updateLayout((current) => resetBoardColumnWeights(current, panelId)); + const endDrag = () => { + setActiveId(null); + setDropTarget(null); + dropTargetRef.current = null; + }; + const handleDragEnd = (event: DragEndEvent) => { + const moved = event.active.id as BoardPanelId; + // The move that activates a drag reaches neither dnd-kit's delta nor the tracker below, so a + // quick flick is resolved from the last pointer position instead. + const board = boardRef.current; + const pointer = pointerRef.current; + const target = + dropTargetRef.current ?? + (board !== null && pointer !== null ? findDropTarget(board, moved, pointer) : null); + if (target !== null) updateLayout((current) => moveBoardPanel(current, moved, target)); + endDrag(); + }; + + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- remembers the pointer position for drops that end before a drag-time move + useEffect(() => { + const onPointerMove = (event: PointerEvent) => { + pointerRef.current = { x: event.clientX, y: event.clientY }; + }; + window.addEventListener("pointermove", onPointerMove, { passive: true }); + return () => window.removeEventListener("pointermove", onPointerMove); + }, []); + + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- tracks the pointer against panel rects while a panel drag is active + useEffect(() => { + const board = boardRef.current; + if (activeId === null || board === null) return; + const onPointerMove = (event: PointerEvent) => { + const next = findDropTarget(board, activeId, { x: event.clientX, y: event.clientY }); + const current = dropTargetRef.current; + if (current?.panelId === next?.panelId && current?.edge === next?.edge) return; + dropTargetRef.current = next; + setDropTarget(next); + }; + window.addEventListener("pointermove", onPointerMove, { passive: true }); + return () => window.removeEventListener("pointermove", onPointerMove); + }, [activeId]); + + return ( + +
+ + + Task board + + + {threads.length === 0 ? ( + + + + No threads yet + + + Threads from every project show up here by status. + + + + ) : ( + setActiveId(event.active.id as BoardPanelId)} + onDragEnd={handleDragEnd} + onDragCancel={endDrag} + > + {/* Swipes past either edge scroll nothing instead of navigating history. */} +
+ {layout.columns.map((column) => { + const allCollapsed = column.every((id) => layout.collapsed.includes(id)); + return ( +
+ {allCollapsed ? null : ( + + )} + {column.map((panelId, index) => { + const expanded = !layout.collapsed.includes(panelId); + const mode: PanelMode = expanded + ? "expanded" + : allCollapsed + ? "rail" + : "header"; + const lowerId = expanded + ? column.slice(index + 1).find((id) => !layout.collapsed.includes(id)) + : undefined; + return ( +
+ + {lowerId ? ( + + ) : null} +
+ ); + })} +
+ ); + })} +
+ + {activeId === null ? null : ( +
+ {m(PANEL_LABELS.get(activeId)!)} · {groups[activeId].length} +
+ )} +
+
+ )} +
+
+ ); +} diff --git a/apps/web/src/components/board/taskBoard.logic.test.ts b/apps/web/src/components/board/taskBoard.logic.test.ts new file mode 100644 index 0000000000000..c904b7924ef58 --- /dev/null +++ b/apps/web/src/components/board/taskBoard.logic.test.ts @@ -0,0 +1,281 @@ +import { ThreadId } from "@t3tools/contracts"; +import { describe, expect, it } from "vite-plus/test"; + +import { + BOARD_PANELS, + groupThreadsByPanel, + moveBoardPanel, + resetBoardColumnWeights, + resolveBoardDropEdge, + resolveBoardKeyboardMove, + resolveBoardLayout, + setBoardColumnWidth, + setBoardPanelWeights, + splitBoardPanelPair, + toggleBoardPanelCollapsed, + type BoardLayout, + type BoardThread, +} from "./taskBoard.logic"; + +const NOW = "2026-01-01T12:00:00.000Z"; + +function thread(id: string, overrides: Partial = {}): BoardThread & { id: string } { + return { + id, + lineage: { parentThreadId: null, relationshipToParent: null, rootThreadId: id }, + archivedAt: null, + settledOverride: null, + pinnedAt: null, + updatedAt: "2026-01-01T10:00:00.000Z", + hasPendingApprovals: false, + hasPendingUserInput: false, + runtime: null, + snoozedUntil: null, + ...overrides, + } as BoardThread & { id: string }; +} + +const ids = (threads: ReadonlyArray<{ id: string }>) => threads.map((t) => t.id); + +describe("groupThreadsByPanel", () => { + it("places threads by status, settled and snoozed taking precedence, and drops hidden ones", () => { + const groups = groupThreadsByPanel( + [ + thread("approval", { hasPendingApprovals: true }), + thread("done"), + thread("unseen-failure", { + latestRun: { status: "failed", completedAt: "2026-01-01T09:00:00.000Z" } as never, + }), + thread("unseen-runtime-failure", { + runtime: { status: "failed" } as never, + latestRun: { status: "failed", completedAt: "2026-01-01T09:00:00.000Z" } as never, + }), + thread("seen-runtime-failure", { + runtime: { status: "failed" } as never, + latestRun: { status: "failed", completedAt: "2026-01-01T09:00:00.000Z" } as never, + lastVisitedAt: "2026-01-01T09:30:00.000Z", + updatedAt: "2026-01-01T07:00:00.000Z", + }), + thread("seen-failure", { + latestRun: { status: "failed", completedAt: "2026-01-01T09:00:00.000Z" } as never, + lastVisitedAt: "2026-01-01T09:30:00.000Z", + updatedAt: "2026-01-01T08:00:00.000Z", + }), + thread("settled", { settledOverride: "settled", hasPendingApprovals: true }), + thread("snoozed", { snoozedUntil: "2026-01-02T00:00:00.000Z" }), + thread("archived", { archivedAt: "2026-01-01T00:00:00.000Z" }), + thread("sub", { + lineage: { + parentThreadId: ThreadId.make("done"), + relationshipToParent: "subagent", + rootThreadId: ThreadId.make("done"), + }, + }), + ], + NOW, + ); + expect(ids(groups.attention)).toEqual(["approval"]); + expect(ids(groups.done)).toEqual(["done", "seen-failure", "seen-runtime-failure"]); + expect(ids(groups.failed)).toEqual(["unseen-failure", "unseen-runtime-failure"]); + expect(ids(groups.settled)).toEqual(["settled"]); + expect(ids(groups.snoozed)).toEqual(["snoozed"]); + expect(ids(groups.working)).toEqual([]); + }); + + it("orders pinned first, then newest update", () => { + const groups = groupThreadsByPanel( + [ + thread("old", { updatedAt: "2026-01-01T01:00:00.000Z" }), + thread("new", { updatedAt: "2026-01-01T09:00:00.000Z" }), + thread("pinned", { pinnedAt: NOW, updatedAt: "2025-12-01T00:00:00.000Z" }), + ], + NOW, + ); + expect(ids(groups.done)).toEqual(["pinned", "new", "old"]); + }); +}); + +describe("board layout", () => { + const layout = ( + columns: string[][], + collapsed: string[] = [], + weights: Record = {}, + widths: Record = {}, + ) => ({ columns, collapsed, weights, widths }) as BoardLayout; + + it("keeps a saved layout, ignoring unknown and repeated ids and appending new panels", () => { + const resolved = resolveBoardLayout({ + columns: [["done", "gone"], ["working", "done"], ["gone"], ["attention", "failed"]], + collapsed: ["failed", "gone", "failed"], + }); + expect(resolved.columns).toEqual([ + ["done"], + ["working"], + ["attention", "failed"], + ["waiting"], + ["snoozed"], + ["settled"], + ]); + expect(resolved.collapsed).toEqual(["failed"]); + expect(resolved.weights).toEqual({}); + expect(resolveBoardLayout(null).columns).toEqual(BOARD_PANELS.map((panel) => [panel.id])); + }); + + it("keeps valid saved weights and drops unknown or non-positive ones", () => { + const resolved = resolveBoardLayout({ + columns: [["done", "working"]], + collapsed: [], + weights: { done: 1.5, working: 0, gone: 2, failed: Number.NaN }, + }); + expect(resolved.weights).toEqual({ done: 1.5 }); + }); + + it.each([ + [ + "left opens a column before the target", + "d", + [["a"], ["c"], ["b", "d"]], + "c", + "left", + [["a"], ["d"], ["c"], ["b"]], + ], + [ + "right opens a column after the target", + "a", + [["a"], ["b"], ["c"]], + "c", + "right", + [["b"], ["c"], ["a"]], + ], + ["top stacks above the target", "a", [["a"], ["b", "c"]], "c", "top", [["b", "a", "c"]]], + [ + "bottom stacks below the target", + "c", + [["a"], ["b", "c"]], + "a", + "bottom", + [["a", "c"], ["b"]], + ], + [ + "unstacking keeps the rest of the stack", + "b", + [["a", "b", "c"]], + "a", + "right", + [["a", "c"], ["b"]], + ], + ["dropping on itself changes nothing", "a", [["a", "b"]], "a", "left", [["a", "b"]]], + ] as const)("%s", (_name, moved, columns, target, edge, expected) => { + const result = moveBoardPanel( + layout( + columns.map((column) => [...column]), + ["b"], + ), + moved as never, + { panelId: target as never, edge }, + ); + expect(result.columns).toEqual(expected); + expect(result.collapsed).toEqual(["b"]); + }); + + it("toggles collapse without touching the order or weights", () => { + const start = layout([["a", "b"]], [], { a: 2 }); + const collapsed = toggleBoardPanelCollapsed(start, "a" as never); + expect(collapsed).toEqual(layout([["a", "b"]], ["a"], { a: 2 })); + expect(toggleBoardPanelCollapsed(collapsed, "a" as never)).toEqual(start); + }); + + it.each([ + ["moves the boundary and keeps the combined weight", 50, [1.25, 0.75]], + ["clamps the upper panel to the minimum", -500, [0.5, 1.5]], + ["clamps the lower panel to the minimum", 500, [1.5, 0.5]], + ] as const)("resizing a pair %s", (_name, delta, expected) => { + const pair = { upperWeight: 1, lowerWeight: 1, upperHeight: 200, lowerHeight: 200 }; + expect(splitBoardPanelPair(pair, delta, 100)).toEqual(expected); + }); + + it("leaves a pair too short for two minimum heights unchanged", () => { + const pair = { upperWeight: 2, lowerWeight: 1, upperHeight: 80, lowerHeight: 40 }; + expect(splitBoardPanelPair(pair, 20, 100)).toEqual([2, 1]); + }); + + it("stacking gives the newcomer an average share of the expanded panels it joins", () => { + const start = layout([["a", "b", "c"], ["d"]], ["c"], { a: 3, b: 1, c: 5, d: 7 }); + const stacked = moveBoardPanel(start, "d" as never, { panelId: "b" as never, edge: "bottom" }); + expect(stacked.columns).toEqual([["a", "b", "d", "c"]]); + expect(stacked.weights).toEqual({ a: 3, b: 1, c: 5, d: 2 }); + + const unstacked = moveBoardPanel(stacked, "a" as never, { + panelId: "b" as never, + edge: "left", + }); + expect(unstacked.columns).toEqual([["a"], ["b", "d", "c"]]); + expect(unstacked.weights).toEqual({ b: 1, c: 5, d: 2 }); + + const equal = moveBoardPanel(layout([["a", "b"], ["c"]], [], { c: 4 }), "c" as never, { + panelId: "a" as never, + edge: "top", + }); + expect(equal.weights).toEqual({}); + }); + + it("sets weights and resets only the column that holds a panel", () => { + const start = layout([ + ["a", "b"], + ["c", "d"], + ]); + const resized = setBoardPanelWeights(setBoardPanelWeights(start, { a: 1.5, b: 0.5 } as never), { + c: 0.25, + d: 1.75, + } as never); + expect(resized.weights).toEqual({ a: 1.5, b: 0.5, c: 0.25, d: 1.75 }); + expect(resetBoardColumnWeights(resized, "b" as never).weights).toEqual({ c: 0.25, d: 1.75 }); + }); + + it("keeps saved column widths under the top panel, clamped to the allowed range", () => { + const resolved = resolveBoardLayout({ + columns: [["done", "working"], ["failed"], ["waiting"]], + collapsed: [], + widths: { done: 400.4, working: 500, failed: 10, waiting: 9000, gone: 300 }, + }); + expect(resolved.widths).toEqual({ done: 400, failed: 224, waiting: 640 }); + }); + + it("a column keeps its width when its top panel changes, and a new column starts at the default", () => { + const start = setBoardColumnWidth(layout([["a", "b"], ["c"]]), "b" as never, 400); + expect(start.widths).toEqual({ a: 400 }); + expect(setBoardColumnWidth(start, "a" as never, null).widths).toEqual({}); + const onTop = moveBoardPanel(start, "c" as never, { panelId: "a" as never, edge: "top" }); + expect(onTop.widths).toEqual({ c: 400 }); + const split = moveBoardPanel(start, "a" as never, { panelId: "c" as never, edge: "right" }); + expect(split.columns).toEqual([["b"], ["c"], ["a"]]); + expect(split.widths).toEqual({ b: 400 }); + }); + + it.each([ + ["b", "up", false, [["b", "a"], ["c"], ["d"]]], + ["a", "down", false, [["b", "a"], ["c"], ["d"]]], + ["a", "up", false, null], + ["b", "right", false, [["a"], ["b"], ["c"], ["d"]]], + ["b", "left", false, [["b"], ["a"], ["c"], ["d"]]], + ["c", "right", false, [["a", "b"], ["d"], ["c"]]], + ["c", "left", false, [["c"], ["a", "b"], ["d"]]], + ["d", "right", false, null], + ["c", "left", true, [["a", "b", "c"], ["d"]]], + ["a", "right", true, [["b"], ["c", "a"], ["d"]]], + ["d", "right", true, null], + ] as const)("keyboard move of %s %s (join %s)", (id, direction, join, expected) => { + const start = layout([["a", "b"], ["c"], ["d"]]); + const target = resolveBoardKeyboardMove(start, id as never, direction, join); + expect(target && moveBoardPanel(start, id as never, target).columns).toEqual(expected); + }); + + it.each([ + [{ x: 10, y: 50 }, "left"], + [{ x: 95, y: 50 }, "right"], + [{ x: 50, y: 10 }, "top"], + [{ x: 50, y: 90 }, "bottom"], + ] as const)("a drop at %o lands on the %s edge", (point, edge) => { + expect(resolveBoardDropEdge({ left: 0, top: 0, width: 100, height: 100 }, point)).toBe(edge); + }); +}); diff --git a/apps/web/src/components/board/taskBoard.logic.ts b/apps/web/src/components/board/taskBoard.logic.ts new file mode 100644 index 0000000000000..4cb291bb2df15 --- /dev/null +++ b/apps/web/src/components/board/taskBoard.logic.ts @@ -0,0 +1,311 @@ +import { isListedThreadLineage } from "@t3tools/contracts"; +import { msg } from "gt-react"; +import * as Schema from "effect/Schema"; + +import { + effectiveSnoozed, + hasUnseenRunFailure, + type ThreadSnoozeShell, +} from "@t3tools/client-runtime/state/thread-settled"; + +import type { SidebarThreadSummary } from "../../types"; +import { resolveSidebarRowStatus, type SidebarThreadStatus } from "../Sidebar.logic"; + +export type BoardPanelId = + | "attention" + | "working" + | "failed" + | "waiting" + | "done" + | "snoozed" + | "settled"; + +export const BOARD_PANELS = [ + { id: "attention", label: msg("Needs you") }, + { id: "working", label: msg("Working") }, + { id: "failed", label: msg("Failed") }, + { id: "waiting", label: msg("Waiting") }, + { id: "done", label: msg("Done") }, + { id: "snoozed", label: msg("Snoozed") }, + { id: "settled", label: msg("Settled") }, +] as const; + +export type BoardThread = Pick< + SidebarThreadSummary, + | "lineage" + | "archivedAt" + | "settledOverride" + | "pinnedAt" + | "updatedAt" + | "interactionMode" + | "hasActionableProposedPlan" + | "hasPendingApprovals" + | "hasPendingUserInput" + | "pendingSubagentRequest" + | "pendingGuestMessageCount" + | "runtime" + | "blockedOnThreadWait" + | "latestRun" + | "lastVisitedAt" +> & + ThreadSnoozeShell; + +const PANEL_BY_STATUS: Record = { + approval: "attention", + input: "attention", + request: "attention", + preparing: "working", + working: "working", + waiting: "waiting", + failed: "failed", + limited: "failed", + ready: "done", +}; + +function resolveBoardPanel(thread: BoardThread, now: string): BoardPanelId { + if (thread.settledOverride === "settled") return "settled"; + if (effectiveSnoozed(thread, { now })) return "snoozed"; + const status = resolveSidebarRowStatus(thread); + // The card's label reads an unopened failed run as Failed after its runtime is gone. + if (status === "ready" && hasUnseenRunFailure(thread)) return "failed"; + return PANEL_BY_STATUS[status]; +} + +function timestampOf(value: string | null | undefined): number { + const parsed = value ? Date.parse(value) : Number.NaN; + return Number.isNaN(parsed) ? 0 : parsed; +} + +/** Pinned threads lead each panel, then the most recently updated. */ +function compareBoardThreads(left: BoardThread, right: BoardThread): number { + const pinned = Number(right.pinnedAt != null) - Number(left.pinnedAt != null); + return pinned !== 0 ? pinned : timestampOf(right.updatedAt) - timestampOf(left.updatedAt); +} + +export function groupThreadsByPanel( + threads: ReadonlyArray, + now: string, +): Record { + const groups: Record = { + attention: [], + working: [], + failed: [], + waiting: [], + done: [], + snoozed: [], + settled: [], + }; + for (const thread of threads) { + if (thread.archivedAt !== null || !isListedThreadLineage(thread.lineage)) continue; + groups[resolveBoardPanel(thread, now)].push(thread); + } + for (const panel of BOARD_PANELS) groups[panel.id].sort(compareBoardThreads); + return groups; +} + +/** + * Columns left to right, each a stack of panels top to bottom. Expanded panels in a column share + * its height in proportion to their weights; a panel without one weighs 1. A column's width in + * pixels is saved under its top panel. + */ +export interface BoardLayout { + readonly columns: ReadonlyArray>; + readonly collapsed: ReadonlyArray; + readonly weights: Readonly>>; + readonly widths: Readonly>>; +} + +export const BOARD_COLUMN_WIDTH = { default: 288, min: 224, max: 640 } as const; + +const clampBoardColumnWidth = (width: number) => + Math.round(Math.min(BOARD_COLUMN_WIDTH.max, Math.max(BOARD_COLUMN_WIDTH.min, width))); + +export const BoardLayoutSchema = Schema.Struct({ + columns: Schema.Array(Schema.Array(Schema.String)), + collapsed: Schema.Array(Schema.String), + weights: Schema.optionalKey(Schema.Record(Schema.String, Schema.Number)), + widths: Schema.optionalKey(Schema.Record(Schema.String, Schema.Number)), +}); +export type SavedBoardLayout = typeof BoardLayoutSchema.Type; + +export type BoardDropEdge = "left" | "right" | "top" | "bottom"; + +const isBoardPanelId = (id: string): id is BoardPanelId => + BOARD_PANELS.some((panel) => panel.id === id); + +/** Drops unknown and repeated ids from a saved layout and adds missing panels as new columns. */ +export function resolveBoardLayout(saved: SavedBoardLayout | null): BoardLayout { + const seen = new Set(); + const columns: BoardPanelId[][] = []; + for (const savedColumn of saved?.columns ?? []) { + const column: BoardPanelId[] = []; + for (const id of savedColumn) { + if (!isBoardPanelId(id) || seen.has(id)) continue; + seen.add(id); + column.push(id); + } + if (column.length > 0) columns.push(column); + } + for (const panel of BOARD_PANELS) { + if (!seen.has(panel.id)) columns.push([panel.id]); + } + const collapsed = (saved?.collapsed ?? []).filter(isBoardPanelId); + const weights: Partial> = {}; + for (const [id, weight] of Object.entries(saved?.weights ?? {})) { + if (isBoardPanelId(id) && Number.isFinite(weight) && weight > 0) weights[id] = weight; + } + const widths: Partial> = {}; + for (const column of columns) { + const width = saved?.widths?.[column[0]!]; + if (width !== undefined && Number.isFinite(width)) { + widths[column[0]!] = clampBoardColumnWidth(width); + } + } + return { columns, collapsed: [...new Set(collapsed)], weights, widths }; +} + +export const boardColumnWidth = (layout: BoardLayout, column: ReadonlyArray) => + layout.widths[column[0]!] ?? BOARD_COLUMN_WIDTH.default; + +/** Sets the width of the column that holds `id`; `null` returns it to the default. */ +export function setBoardColumnWidth( + layout: BoardLayout, + id: BoardPanelId, + width: number | null, +): BoardLayout { + const top = layout.columns.find((column) => column.includes(id))?.[0]; + if (top === undefined) return layout; + const widths = { ...layout.widths }; + if (width === null) delete widths[top]; + else widths[top] = clampBoardColumnWidth(width); + return { ...layout, widths }; +} + +export const boardPanelWeight = (layout: BoardLayout, id: BoardPanelId) => layout.weights[id] ?? 1; + +function withoutWeights(layout: BoardLayout, ids: ReadonlyArray) { + const weights = { ...layout.weights }; + for (const id of ids) delete weights[id]; + return weights; +} + +export function toggleBoardPanelCollapsed(layout: BoardLayout, id: BoardPanelId): BoardLayout { + return { + ...layout, + collapsed: layout.collapsed.includes(id) + ? layout.collapsed.filter((collapsedId) => collapsedId !== id) + : [...layout.collapsed, id], + }; +} + +/** Left and right open a new column beside the target; top and bottom stack into its column. */ +export function moveBoardPanel( + layout: BoardLayout, + id: BoardPanelId, + target: { readonly panelId: BoardPanelId; readonly edge: BoardDropEdge }, +): BoardLayout { + if (id === target.panelId) return layout; + const columns = layout.columns + .map((column) => column.filter((panelId) => panelId !== id)) + .filter((column) => column.length > 0); + const columnIndex = columns.findIndex((column) => column.includes(target.panelId)); + if (columnIndex < 0) return layout; + const weights = withoutWeights(layout, [id]); + if (target.edge === "left" || target.edge === "right") { + columns.splice(columnIndex + (target.edge === "right" ? 1 : 0), 0, [id]); + } else { + const column = [...columns[columnIndex]!]; + // The newcomer takes an average share, so the others keep their split among themselves. + const expanded = column.filter((panelId) => !layout.collapsed.includes(panelId)); + const share = + expanded.reduce((sum, panelId) => sum + boardPanelWeight(layout, panelId), 0) / + expanded.length; + if (expanded.length > 0 && share !== 1) weights[id] = share; + column.splice(column.indexOf(target.panelId) + (target.edge === "bottom" ? 1 : 0), 0, id); + columns[columnIndex] = column; + } + // A column keeps its width when its top panel changes; the moved panel brings none along. + const widths: Partial> = {}; + for (const column of columns) { + const stayed = column.find((panelId) => panelId !== id); + const previous = layout.columns.find((candidate) => stayed && candidate.includes(stayed)); + const width = previous ? layout.widths[previous[0]!] : undefined; + if (width !== undefined) widths[column[0]!] = width; + } + return { columns, collapsed: layout.collapsed, weights, widths }; +} + +export type BoardMoveDirection = "left" | "right" | "up" | "down"; + +/** + * Where a keyboard move sends a panel. Up and down reorder it within its stack. Left and right + * take it out of a stack into a column of its own, or carry a lone panel past the next column; + * with `join` it stacks at the bottom of the next column instead. Null when there is nowhere to go. + */ +export function resolveBoardKeyboardMove( + layout: BoardLayout, + id: BoardPanelId, + direction: BoardMoveDirection, + join: boolean, +): { readonly panelId: BoardPanelId; readonly edge: BoardDropEdge } | null { + const columnIndex = layout.columns.findIndex((column) => column.includes(id)); + const column = layout.columns[columnIndex]; + if (column === undefined) return null; + if (direction === "up" || direction === "down") { + const neighbor = column[column.indexOf(id) + (direction === "up" ? -1 : 1)]; + return neighbor ? { panelId: neighbor, edge: direction === "up" ? "top" : "bottom" } : null; + } + const next = layout.columns[columnIndex + (direction === "left" ? -1 : 1)]; + if (join) return next ? { panelId: next.at(-1)!, edge: "bottom" } : null; + const stackMate = column.find((panelId) => panelId !== id); + if (stackMate) return { panelId: stackMate, edge: direction }; + return next ? { panelId: next[0]!, edge: direction } : null; +} + +export interface BoardPanelPair { + readonly upperWeight: number; + readonly lowerWeight: number; + readonly upperHeight: number; + readonly lowerHeight: number; +} + +/** + * Moves the boundary between two stacked panels by `delta` pixels, keeping both at least + * `minHeight` tall. Their combined weight is unchanged, so the rest of the column keeps its share. + */ +export function splitBoardPanelPair( + pair: BoardPanelPair, + delta: number, + minHeight: number, +): readonly [upper: number, lower: number] { + const height = pair.upperHeight + pair.lowerHeight; + const weight = pair.upperWeight + pair.lowerWeight; + if (height < minHeight * 2) return [pair.upperWeight, pair.lowerWeight]; + const upper = Math.min(height - minHeight, Math.max(minHeight, pair.upperHeight + delta)); + const upperWeight = Math.round((weight * upper * 1e4) / height) / 1e4; + return [upperWeight, Math.round((weight - upperWeight) * 1e4) / 1e4]; +} + +export function setBoardPanelWeights( + layout: BoardLayout, + weights: Partial>, +): BoardLayout { + return { ...layout, weights: { ...layout.weights, ...weights } }; +} + +/** Gives every panel in the column that holds `id` an equal share again. */ +export function resetBoardColumnWeights(layout: BoardLayout, id: BoardPanelId): BoardLayout { + const column = layout.columns.find((candidate) => candidate.includes(id)) ?? []; + return { ...layout, weights: withoutWeights(layout, column) }; +} + +/** Outer quarters of a panel open a column beside it; the middle stacks above or below. */ +export function resolveBoardDropEdge( + rect: { left: number; top: number; width: number; height: number }, + point: { x: number; y: number }, +): BoardDropEdge { + const band = rect.width / 4; + if (point.x < rect.left + band) return "left"; + if (point.x > rect.left + rect.width - band) return "right"; + return point.y < rect.top + rect.height / 2 ? "top" : "bottom"; +} diff --git a/apps/web/src/components/sidebar/SidebarChrome.tsx b/apps/web/src/components/sidebar/SidebarChrome.tsx index 1dbc9b9fc6366..d24e5cf6cf108 100644 --- a/apps/web/src/components/sidebar/SidebarChrome.tsx +++ b/apps/web/src/components/sidebar/SidebarChrome.tsx @@ -1,4 +1,10 @@ -import { ArrowLeftIcon, ArrowRightIcon, ChartNoAxesColumnIcon, SettingsIcon } from "lucide-react"; +import { + ArrowLeftIcon, + ArrowRightIcon, + ChartNoAxesColumnIcon, + KanbanIcon, + SettingsIcon, +} from "lucide-react"; import type { ReactNode } from "react"; import { T, useGT } from "gt-react"; import { memo } from "react"; @@ -204,17 +210,25 @@ function SidebarUtilityItem({ icon, label, onClick, + isActive = false, }: { icon: ReactNode; label: string; onClick: () => void; + isActive?: boolean; }) { return ( + {icon} } @@ -233,6 +247,7 @@ const SidebarUtilityMenu = memo(function SidebarUtilityMenu() { const isOnUtilityPage = useLocation({ select: (location) => isSidebarUtilityPage(location.pathname), }); + const isOnBoard = useLocation({ select: (location) => location.pathname === "/board" }); const pullRequestsSupported = usePullRequestsSupported(); const issuesSupported = useIssuesSupported(); const closeMobileSidebar = () => { @@ -305,6 +320,15 @@ const SidebarUtilityMenu = memo(function SidebarUtilityMenu() { label={gt("Usage")} onClick={handleUsageClick} /> + } + label={gt("Task board")} + isActive={isOnBoard} + onClick={() => { + closeMobileSidebar(); + void (isOnBoard ? navigateToMainApp() : navigate({ to: "/board" })); + }} + /> )} diff --git a/apps/web/src/components/sidebar/SidebarThreadRow.tsx b/apps/web/src/components/sidebar/SidebarThreadRow.tsx index 3e1695e63f0a7..43f4872c0340e 100644 --- a/apps/web/src/components/sidebar/SidebarThreadRow.tsx +++ b/apps/web/src/components/sidebar/SidebarThreadRow.tsx @@ -634,7 +634,7 @@ type SidebarThreadRowProps = { }; // Mounted only while renaming, so each rename starts uncommitted. -function ThreadRenameInput(props: { +export function ThreadRenameInput(props: { title: string; onTitleChange: (title: string) => void; onCommit: () => void; diff --git a/apps/web/src/components/sidebar/mainAppLocation.browser.test.tsx b/apps/web/src/components/sidebar/mainAppLocation.browser.test.tsx index b92e982275753..17a29bab65016 100644 --- a/apps/web/src/components/sidebar/mainAppLocation.browser.test.tsx +++ b/apps/web/src/components/sidebar/mainAppLocation.browser.test.tsx @@ -81,10 +81,12 @@ describe("main app return location", () => { const closingUsage = await returnLocation("/usage", "Close modal"); const sidebarBack = await returnLocation("/pull-requests", "Back to app"); + const leavingBoard = await returnLocation("/board", "Back to app"); - expect({ closingUsage, sidebarBack }).toEqual({ + expect({ closingUsage, sidebarBack, leavingBoard }).toEqual({ closingUsage: THREAD_PATH, sidebarBack: THREAD_PATH, + leavingBoard: THREAD_PATH, }); }); diff --git a/apps/web/src/components/sidebar/mainAppLocation.ts b/apps/web/src/components/sidebar/mainAppLocation.ts index daa18b618a41a..b6b1c84e6190d 100644 --- a/apps/web/src/components/sidebar/mainAppLocation.ts +++ b/apps/web/src/components/sidebar/mainAppLocation.ts @@ -40,7 +40,8 @@ export function startMainAppLocationTracking(router: AnyRouter): () => void { appModalReturnThreadTarget = resolveThreadRouteTarget( router.state.matches.at(-1)?.params ?? {}, ); - if (!isSidebarUtilityPage(pathname)) mainAppHref = href; + // The task board toggles back to the page that opened it. + if (!isSidebarUtilityPage(pathname) && pathname !== "/board") mainAppHref = href; }; record(); return router.subscribe("onResolved", record); diff --git a/apps/web/src/components/sidebar/threadContextMenu.ts b/apps/web/src/components/sidebar/threadContextMenu.ts new file mode 100644 index 0000000000000..b26371c642072 --- /dev/null +++ b/apps/web/src/components/sidebar/threadContextMenu.ts @@ -0,0 +1,40 @@ +import type { ScopedThreadRef } from "@t3tools/contracts"; +import type { ContextMenuSource } from "@t3tools/contracts"; +import { useEffect } from "react"; + +export interface ThreadContextMenuOptions { + // Surfaces that show the title themselves rename in place instead of in the sidebar row. + readonly onStartRename?: (threadRef: ScopedThreadRef, title: string) => void; +} + +type ThreadContextMenuHandler = ( + threadRef: ScopedThreadRef, + position: { x: number; y: number }, + source: ContextMenuSource, + options?: ThreadContextMenuOptions, +) => void; + +// The menu's actions live in the sidebar, which owns rename, project filter and selection state. +let handler: ThreadContextMenuHandler | null = null; + +export function useProvideThreadContextMenu(provided: ThreadContextMenuHandler) { + // oxlint-disable-next-line t3code/no-unreasoned-state-sync -- publishes the mounted sidebar's menu to other surfaces + useEffect(() => { + handler = provided; + return () => { + if (handler === provided) handler = null; + }; + }, [provided]); +} + +/** Opens the sidebar's thread menu; false when no sidebar is mounted to serve it. */ +export function showThreadContextMenu( + threadRef: ScopedThreadRef, + position: { x: number; y: number }, + source: ContextMenuSource, + options?: ThreadContextMenuOptions, +): boolean { + if (handler === null) return false; + handler(threadRef, position, source, options); + return true; +} diff --git a/apps/web/src/hooks/useResizeDrag.ts b/apps/web/src/hooks/useResizeDrag.ts index 06a65d9ec93c9..dded05840cb10 100644 --- a/apps/web/src/hooks/useResizeDrag.ts +++ b/apps/web/src/hooks/useResizeDrag.ts @@ -6,8 +6,9 @@ export interface ResizeBounds { } interface ResizeSession { + /** The size along the drag axis: a width for left/right edges, a height for the bottom edge. */ width: number; - edge: "left" | "right"; + edge: "left" | "right" | "bottom"; /** Pointer widths are clamped to these before `resize` sees them. */ bounds: ResizeBounds; resize: (width: number) => number; @@ -19,12 +20,17 @@ function clampToBounds(width: number, bounds: ResizeBounds): number { return Math.max(bounds.min, Math.min(bounds.max, width)); } +const isVertical = (session: ResizeSession) => session.edge === "bottom"; + +const pointerPosition = (session: ResizeSession, event: PointerEvent) => + isVertical(session) ? event.clientY : event.clientX; + interface ActiveDrag { session: ResizeSession; target: T; pointerId: number; - startX: number; - pendingX: number; + startPosition: number; + pendingPosition: number; width: number; moved: boolean; frame: number | null; @@ -37,7 +43,8 @@ function createResizeDrag() { const flush = () => { const active = drag; if (!active) return; - const delta = (active.pendingX - active.startX) * (active.session.edge === "left" ? -1 : 1); + const delta = + (active.pendingPosition - active.startPosition) * (active.session.edge === "left" ? -1 : 1); if (Math.abs(delta) > 2) active.moved = true; active.width = active.session.resize( clampToBounds(active.session.width + delta, active.session.bounds), @@ -67,7 +74,7 @@ function createResizeDrag() { const active = drag; if (!active || active.pointerId !== event.pointerId) return; event.preventDefault(); - if (usePosition) active.pendingX = event.clientX; + if (usePosition) active.pendingPosition = pointerPosition(active.session, event); finish(true); }; @@ -98,22 +105,22 @@ function createResizeDrag() { session, target: event.currentTarget, pointerId: event.pointerId, - startX: event.clientX, - pendingX: event.clientX, + startPosition: pointerPosition(session, event), + pendingPosition: pointerPosition(session, event), width: session.width, moved: false, frame: null, onBlur, }; - document.body.style.cursor = "col-resize"; + document.body.style.cursor = isVertical(session) ? "row-resize" : "col-resize"; document.body.style.userSelect = "none"; }, onPointerMove(event: PointerEvent) { const active = drag; if (!active || active.pointerId !== event.pointerId) return; event.preventDefault(); - active.pendingX = event.clientX; - if (Math.abs(event.clientX - active.startX) > 2) active.moved = true; + active.pendingPosition = pointerPosition(active.session, event); + if (Math.abs(active.pendingPosition - active.startPosition) > 2) active.moved = true; if (active.frame !== null) return; active.frame = requestAnimationFrame(() => { active.frame = null; diff --git a/apps/web/src/i18n/translations/de.json b/apps/web/src/i18n/translations/de.json index 22f9bcf953f2b..acf96fde77f1c 100644 --- a/apps/web/src/i18n/translations/de.json +++ b/apps/web/src/i18n/translations/de.json @@ -1758,6 +1758,7 @@ "57e875b79b98ab82": "Issues öffnen", "f1db0a234c777a1d": "T3 Code in einer anderen App verwenden (MCP)", "a0cc19e60dd99851": "Nutzung öffnen", + "a29843fa4e449e37": "Aufgabenboard öffnen", "46694969044eee98": "Nächsten Arbeitsbereich fokussieren", "0a1011328ba42eef": "Vorherigen Arbeitsbereich fokussieren", "90896a7348c4e7ce": "Einstellungen öffnen", @@ -3139,6 +3140,16 @@ "ff5f1c260e87ecde": "Prüfe, ob das Backend von diesem Browser aus erreichbar ist, CORS für gehostete Clients unterstützt und über HTTPS ausgeliefert wird, wenn du diese Seite über HTTPS öffnest.", "08570ee0982df89d": "Wird gekoppelt...", "3bbae7c96b6cbfc3": "App öffnen", + "31e3e8d137ca1b40": "Weitere {count} anzeigen", + "947b0173a3989335": "{label} ausklappen", + "26cdfa7256962a1e": "{label} einklappen", + "159cfba7de798d9d": "Größe von {upper} und {lower} ändern", + "0f204725f374c549": "Größe der Spalte {label} ändern", + "19ce31f7b584450a": "Aufgabenboard", + "a32c3df5a7c4623e": "Hier werden Threads aus allen Projekten nach Status angezeigt.", + "d25661576338fcf0": "Wartet auf dich", + "68f55a32be30741f": "Zurückgestellt", + "6e67ab167cd02e15": "Erledigt", "49cc06e79f21f85a": "{seconds} s", "8603d41c52392f1d": "{minutes} Min. {seconds} s", "f2a955905704b91d": "{hours} Std. {minutes} Min.", @@ -4109,8 +4120,6 @@ "58d50eb72243ff0b": "nicht gestartet", "90ec7fe00a44ea52": "Chat {title} öffnen", "eb5016ae059060f7": "Workflow {label} stoppen", - "26cdfa7256962a1e": "{label} einklappen", - "947b0173a3989335": "{label} ausklappen", "5598431d0b6d7d92": "Phase {title} einklappen, {status}", "b7a3b493819e0cfb": "Phase {title} ausklappen, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} Agent} other {{settled}/{count} Agenten}}", @@ -11644,6 +11653,7 @@ "8aa6404c8018ea67": "T3 Code Startseite", "8e9626aa27cb188a": "Issues", "9d2fc1003e82feb1": "Nutzung", + "d120458b2cbc04b8": "Aufgabenboard", "20283eb1dd6119f9": "{count, plural, one {{count} Anhang} other {{count} Anhänge}}", "ffedb03b620f97a9": "Nicht gesendeter Entwurf", "90a349d827d1dcf5": "Entwurf verwerfen", diff --git a/apps/web/src/i18n/translations/en.json b/apps/web/src/i18n/translations/en.json index 442486e2decb0..aa9ac7ee7d17d 100644 --- a/apps/web/src/i18n/translations/en.json +++ b/apps/web/src/i18n/translations/en.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Open issues", "f1db0a234c777a1d": "Use T3 Code in another app (MCP)", "a0cc19e60dd99851": "Open usage", + "a29843fa4e449e37": "Open task board", "46694969044eee98": "Focus Next Workspace Area", "0a1011328ba42eef": "Focus Previous Workspace Area", "90896a7348c4e7ce": "Open settings", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Verify the backend is reachable from this browser, supports CORS for hosted clients, and is served over HTTPS when opening this page from HTTPS.", "08570ee0982df89d": "Pairing...", "3bbae7c96b6cbfc3": "Open app", + "31e3e8d137ca1b40": "Show {count} more", + "947b0173a3989335": "Expand {label}", + "26cdfa7256962a1e": "Collapse {label}", + "159cfba7de798d9d": "Resize {upper} and {lower}", + "0f204725f374c549": "Resize {label} column", + "19ce31f7b584450a": "Task board", + "a32c3df5a7c4623e": "Threads from every project show up here by status.", + "d25661576338fcf0": "Needs you", + "68f55a32be30741f": "Snoozed", + "6e67ab167cd02e15": "Settled", "49cc06e79f21f85a": "{seconds}s", "8603d41c52392f1d": "{minutes}m {seconds}s", "f2a955905704b91d": "{hours}h {minutes}m", @@ -4108,8 +4119,6 @@ "58d50eb72243ff0b": "not started", "90ec7fe00a44ea52": "Open {title} chat", "eb5016ae059060f7": "Stop workflow {label}", - "26cdfa7256962a1e": "Collapse {label}", - "947b0173a3989335": "Expand {label}", "5598431d0b6d7d92": "Collapse {title} phase, {status}", "b7a3b493819e0cfb": "Expand {title} phase, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} agent} other {{settled}/{count} agents}}", @@ -11652,6 +11661,7 @@ "8aa6404c8018ea67": "T3 Code home", "8e9626aa27cb188a": "Issues", "9d2fc1003e82feb1": "Usage", + "d120458b2cbc04b8": "Task board", "20283eb1dd6119f9": "{count, plural, one {{count} attachment} other {{count} attachments}}", "ffedb03b620f97a9": "Unsent draft", "90a349d827d1dcf5": "Discard draft", diff --git a/apps/web/src/i18n/translations/es.json b/apps/web/src/i18n/translations/es.json index 87c7e9a861a93..974b217a31365 100644 --- a/apps/web/src/i18n/translations/es.json +++ b/apps/web/src/i18n/translations/es.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Abrir issues", "f1db0a234c777a1d": "Usar T3 Code en otra app (MCP)", "a0cc19e60dd99851": "Abrir uso", + "a29843fa4e449e37": "Abrir tablero de tareas", "46694969044eee98": "Enfocar la siguiente área de trabajo", "0a1011328ba42eef": "Enfocar el área de trabajo anterior", "90896a7348c4e7ce": "Abrir ajustes", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Comprueba que se puede acceder al backend desde este navegador, que admite CORS para clientes alojados y que se sirve por HTTPS cuando abres esta página desde HTTPS.", "08570ee0982df89d": "Emparejando...", "3bbae7c96b6cbfc3": "Abrir app", + "31e3e8d137ca1b40": "Mostrar {count} más", + "947b0173a3989335": "Expandir {label}", + "26cdfa7256962a1e": "Contraer {label}", + "159cfba7de798d9d": "Cambiar el tamaño de {upper} y {lower}", + "0f204725f374c549": "Cambiar el tamaño de la columna {label}", + "19ce31f7b584450a": "Tablero de tareas", + "a32c3df5a7c4623e": "Aquí aparecen los hilos de todos los proyectos, agrupados por estado.", + "d25661576338fcf0": "Te necesitan", + "68f55a32be30741f": "Pospuestos", + "6e67ab167cd02e15": "Resueltos", "49cc06e79f21f85a": "{seconds} s", "8603d41c52392f1d": "{minutes} min {seconds} s", "f2a955905704b91d": "{hours} h {minutes} min", @@ -4106,8 +4117,6 @@ "58d50eb72243ff0b": "sin empezar", "90ec7fe00a44ea52": "Abrir el chat de {title}", "eb5016ae059060f7": "Detener el flujo de trabajo {label}", - "26cdfa7256962a1e": "Contraer {label}", - "947b0173a3989335": "Expandir {label}", "5598431d0b6d7d92": "Contraer la fase {title}, {status}", "b7a3b493819e0cfb": "Expandir la fase {title}, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} agente} other {{settled}/{count} agentes}}", @@ -11637,6 +11646,7 @@ "8aa6404c8018ea67": "Inicio de T3 Code", "8e9626aa27cb188a": "Issues", "9d2fc1003e82feb1": "Uso", + "d120458b2cbc04b8": "Tablero de tareas", "20283eb1dd6119f9": "{count, plural, one {{count} adjunto} other {{count} adjuntos}}", "ffedb03b620f97a9": "Borrador sin enviar", "90a349d827d1dcf5": "Descartar borrador", diff --git a/apps/web/src/i18n/translations/fr.json b/apps/web/src/i18n/translations/fr.json index a3a16e772103e..180228fdf48d6 100644 --- a/apps/web/src/i18n/translations/fr.json +++ b/apps/web/src/i18n/translations/fr.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Ouvrir les tickets", "f1db0a234c777a1d": "Utiliser T3 Code dans une autre app (MCP)", "a0cc19e60dd99851": "Ouvrir l’utilisation", + "a29843fa4e449e37": "Ouvrir le tableau des tâches", "46694969044eee98": "Activer la zone de travail suivante", "0a1011328ba42eef": "Activer la zone de travail précédente", "90896a7348c4e7ce": "Ouvrir les paramètres", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Vérifiez que le backend est joignable depuis ce navigateur, qu’il prend en charge CORS pour les clients hébergés et qu’il est servi en HTTPS si cette page est ouverte en HTTPS.", "08570ee0982df89d": "Appairage...", "3bbae7c96b6cbfc3": "Ouvrir l’app", + "31e3e8d137ca1b40": "Afficher {count} de plus", + "947b0173a3989335": "Développer {label}", + "26cdfa7256962a1e": "Réduire {label}", + "159cfba7de798d9d": "Redimensionner {upper} et {lower}", + "0f204725f374c549": "Redimensionner la colonne {label}", + "19ce31f7b584450a": "Tableau des tâches", + "a32c3df5a7c4623e": "Les fils de tous les projets s’affichent ici, classés par statut.", + "d25661576338fcf0": "Votre intervention est requise", + "68f55a32be30741f": "Reportés", + "6e67ab167cd02e15": "Clos", "49cc06e79f21f85a": "{seconds} s", "8603d41c52392f1d": "{minutes} min {seconds} s", "f2a955905704b91d": "{hours} h {minutes} min", @@ -4107,8 +4118,6 @@ "58d50eb72243ff0b": "pas commencée", "90ec7fe00a44ea52": "Ouvrir la discussion {title}", "eb5016ae059060f7": "Arrêter le workflow {label}", - "26cdfa7256962a1e": "Réduire {label}", - "947b0173a3989335": "Développer {label}", "5598431d0b6d7d92": "Réduire la phase {title}, {status}", "b7a3b493819e0cfb": "Développer la phase {title}, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} agent} other {{settled}/{count} agents}}", @@ -11642,6 +11651,7 @@ "8aa6404c8018ea67": "Accueil T3 Code", "8e9626aa27cb188a": "Tickets", "9d2fc1003e82feb1": "Utilisation", + "d120458b2cbc04b8": "Tableau des tâches", "20283eb1dd6119f9": "{count, plural, one {{count} pièce jointe} other {{count} pièces jointes}}", "ffedb03b620f97a9": "Brouillon non envoyé", "90a349d827d1dcf5": "Abandonner le brouillon", diff --git a/apps/web/src/i18n/translations/ja.json b/apps/web/src/i18n/translations/ja.json index 8459e9cf87854..dc8ee68da8903 100644 --- a/apps/web/src/i18n/translations/ja.json +++ b/apps/web/src/i18n/translations/ja.json @@ -1758,6 +1758,7 @@ "57e875b79b98ab82": "Issue を開く", "f1db0a234c777a1d": "他のアプリで T3 Code を使用 (MCP)", "a0cc19e60dd99851": "使用量を開く", + "a29843fa4e449e37": "タスクボードを開く", "46694969044eee98": "次のワークスペース領域にフォーカス", "0a1011328ba42eef": "前のワークスペース領域にフォーカス", "90896a7348c4e7ce": "設定を開く", @@ -3136,6 +3137,16 @@ "ff5f1c260e87ecde": "バックエンドがこのブラウザーから到達可能で、ホスト型クライアント向けに CORS をサポートしていること、また HTTPS のページから開く場合は HTTPS で提供されていることを確認してください。", "08570ee0982df89d": "ペアリングしています...", "3bbae7c96b6cbfc3": "アプリを開く", + "31e3e8d137ca1b40": "さらに {count} 件表示", + "947b0173a3989335": "{label} を展開", + "26cdfa7256962a1e": "{label} を折りたたむ", + "159cfba7de798d9d": "{upper} と {lower} のサイズを変更", + "0f204725f374c549": "{label} 列のサイズを変更", + "19ce31f7b584450a": "タスクボード", + "a32c3df5a7c4623e": "すべてのプロジェクトのスレッドが、ステータス別にここに表示されます。", + "d25661576338fcf0": "あなたの対応待ち", + "68f55a32be30741f": "スヌーズ中", + "6e67ab167cd02e15": "対応済み", "49cc06e79f21f85a": "{seconds}秒", "8603d41c52392f1d": "{minutes}分{seconds}秒", "f2a955905704b91d": "{hours}時間{minutes}分", @@ -4097,8 +4108,6 @@ "58d50eb72243ff0b": "未開始", "90ec7fe00a44ea52": "{title} のチャットを開く", "eb5016ae059060f7": "ワークフロー {label} を停止", - "26cdfa7256962a1e": "{label} を折りたたむ", - "947b0173a3989335": "{label} を展開", "5598431d0b6d7d92": "{title} フェーズを折りたたむ、{status}", "b7a3b493819e0cfb": "{title} フェーズを展開、{status}", "e3f5d0845373dbc9": "{count, plural, other {{settled}/{count} 個のエージェント}}", @@ -11592,6 +11601,7 @@ "8aa6404c8018ea67": "T3 Code ホーム", "8e9626aa27cb188a": "Issue", "9d2fc1003e82feb1": "使用量", + "d120458b2cbc04b8": "タスクボード", "20283eb1dd6119f9": "{count, plural, other {{count} 個の添付ファイル}}", "ffedb03b620f97a9": "未送信の下書き", "90a349d827d1dcf5": "下書きを破棄", diff --git a/apps/web/src/i18n/translations/ko.json b/apps/web/src/i18n/translations/ko.json index c523c5dc7b1fc..ac365748667cd 100644 --- a/apps/web/src/i18n/translations/ko.json +++ b/apps/web/src/i18n/translations/ko.json @@ -1758,6 +1758,7 @@ "57e875b79b98ab82": "이슈 열기", "f1db0a234c777a1d": "다른 앱에서 T3 Code 사용(MCP)", "a0cc19e60dd99851": "사용량 열기", + "a29843fa4e449e37": "작업 보드 열기", "46694969044eee98": "다음 작업 영역으로 포커스 이동", "0a1011328ba42eef": "이전 작업 영역으로 포커스 이동", "90896a7348c4e7ce": "설정 열기", @@ -3137,6 +3138,16 @@ "ff5f1c260e87ecde": "이 브라우저에서 백엔드에 접근할 수 있는지, 호스팅된 클라이언트용 CORS를 지원하는지, HTTPS 페이지에서 열 때 HTTPS로 제공되는지 확인하세요.", "08570ee0982df89d": "페어링하는 중...", "3bbae7c96b6cbfc3": "앱 열기", + "31e3e8d137ca1b40": "{count}개 더 보기", + "947b0173a3989335": "{label} 펼치기", + "26cdfa7256962a1e": "{label} 접기", + "159cfba7de798d9d": "{upper} 및 {lower} 크기 조정", + "0f204725f374c549": "{label} 열 크기 조정", + "19ce31f7b584450a": "작업 보드", + "a32c3df5a7c4623e": "모든 프로젝트의 스레드가 상태별로 여기에 표시됩니다.", + "d25661576338fcf0": "사용자 확인 필요", + "68f55a32be30741f": "다시 알림 설정됨", + "6e67ab167cd02e15": "정리됨", "49cc06e79f21f85a": "{seconds}초", "8603d41c52392f1d": "{minutes}분 {seconds}초", "f2a955905704b91d": "{hours}시간 {minutes}분", @@ -4094,8 +4105,6 @@ "58d50eb72243ff0b": "시작 안 됨", "90ec7fe00a44ea52": "{title} 채팅 열기", "eb5016ae059060f7": "워크플로 {label} 중지", - "26cdfa7256962a1e": "{label} 접기", - "947b0173a3989335": "{label} 펼치기", "5598431d0b6d7d92": "{title} 단계 접기, {status}", "b7a3b493819e0cfb": "{title} 단계 펼치기, {status}", "e3f5d0845373dbc9": "{count, plural, other {에이전트 {settled}/{count}}}", @@ -11589,6 +11598,7 @@ "8aa6404c8018ea67": "T3 Code 홈", "8e9626aa27cb188a": "이슈", "9d2fc1003e82feb1": "사용량", + "d120458b2cbc04b8": "작업 보드", "20283eb1dd6119f9": "{count, plural, other {첨부 파일 {count}개}}", "ffedb03b620f97a9": "보내지 않은 초안", "90a349d827d1dcf5": "초안 삭제", diff --git a/apps/web/src/i18n/translations/pt-BR.json b/apps/web/src/i18n/translations/pt-BR.json index bd34cd96c3d8b..afc972e07c335 100644 --- a/apps/web/src/i18n/translations/pt-BR.json +++ b/apps/web/src/i18n/translations/pt-BR.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Abrir issues", "f1db0a234c777a1d": "Usar o T3 Code em outro app (MCP)", "a0cc19e60dd99851": "Abrir uso", + "a29843fa4e449e37": "Abrir quadro de tarefas", "46694969044eee98": "Focar a próxima área do workspace", "0a1011328ba42eef": "Focar a área anterior do workspace", "90896a7348c4e7ce": "Abrir configurações", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Verifique se o backend está acessível a partir deste navegador, se permite CORS para clientes hospedados e se é servido por HTTPS quando esta página é aberta via HTTPS.", "08570ee0982df89d": "Pareando...", "3bbae7c96b6cbfc3": "Abrir app", + "31e3e8d137ca1b40": "Mostrar mais {count}", + "947b0173a3989335": "Expandir {label}", + "26cdfa7256962a1e": "Recolher {label}", + "159cfba7de798d9d": "Redimensionar {upper} e {lower}", + "0f204725f374c549": "Redimensionar a coluna {label}", + "19ce31f7b584450a": "Quadro de tarefas", + "a32c3df5a7c4623e": "As threads de todos os projetos aparecem aqui por status.", + "d25661576338fcf0": "Precisam de você", + "68f55a32be30741f": "Adiadas", + "6e67ab167cd02e15": "Concluídas", "49cc06e79f21f85a": "{seconds}s", "8603d41c52392f1d": "{minutes}min {seconds}s", "f2a955905704b91d": "{hours}h {minutes}min", @@ -4106,8 +4117,6 @@ "58d50eb72243ff0b": "não iniciada", "90ec7fe00a44ea52": "Abrir o chat {title}", "eb5016ae059060f7": "Parar o workflow {label}", - "26cdfa7256962a1e": "Recolher {label}", - "947b0173a3989335": "Expandir {label}", "5598431d0b6d7d92": "Recolher a fase {title}, {status}", "b7a3b493819e0cfb": "Expandir a fase {title}, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} agente} other {{settled}/{count} agentes}}", @@ -11641,6 +11650,7 @@ "8aa6404c8018ea67": "Início do T3 Code", "8e9626aa27cb188a": "Issues", "9d2fc1003e82feb1": "Uso", + "d120458b2cbc04b8": "Quadro de tarefas", "20283eb1dd6119f9": "{count, plural, one {{count} anexo} other {{count} anexos}}", "ffedb03b620f97a9": "Rascunho não enviado", "90a349d827d1dcf5": "Descartar rascunho", diff --git a/apps/web/src/i18n/translations/ru.json b/apps/web/src/i18n/translations/ru.json index 4242d78d5f3c5..5c7ec925c59cd 100644 --- a/apps/web/src/i18n/translations/ru.json +++ b/apps/web/src/i18n/translations/ru.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Открыть issue", "f1db0a234c777a1d": "Использовать T3 Code в другом приложении (MCP)", "a0cc19e60dd99851": "Открыть использование", + "a29843fa4e449e37": "Открыть доску задач", "46694969044eee98": "Фокус на следующую панель рабочей области", "0a1011328ba42eef": "Фокус на предыдущую панель рабочей области", "90896a7348c4e7ce": "Открыть настройки", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Убедитесь, что бэкенд доступен из этого браузера, поддерживает CORS для размещённых клиентов и работает по HTTPS, если эта страница открыта по HTTPS.", "08570ee0982df89d": "Сопряжение...", "3bbae7c96b6cbfc3": "Открыть приложение", + "31e3e8d137ca1b40": "Показать ещё {count}", + "947b0173a3989335": "Развернуть {label}", + "26cdfa7256962a1e": "Свернуть {label}", + "159cfba7de798d9d": "Изменить размер {upper} и {lower}", + "0f204725f374c549": "Изменить размер столбца {label}", + "19ce31f7b584450a": "Доска задач", + "a32c3df5a7c4623e": "Здесь показаны треды всех проектов по статусам.", + "d25661576338fcf0": "Ждут вас", + "68f55a32be30741f": "Отложенные", + "6e67ab167cd02e15": "Разобранные", "49cc06e79f21f85a": "{seconds} с", "8603d41c52392f1d": "{minutes} мин {seconds} с", "f2a955905704b91d": "{hours} ч {minutes} мин", @@ -4106,8 +4117,6 @@ "58d50eb72243ff0b": "не начат", "90ec7fe00a44ea52": "Открыть чат {title}", "eb5016ae059060f7": "Остановить воркфлоу {label}", - "26cdfa7256962a1e": "Свернуть {label}", - "947b0173a3989335": "Развернуть {label}", "5598431d0b6d7d92": "Свернуть этап {title}, {status}", "b7a3b493819e0cfb": "Развернуть этап {title}, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} агент} few {{settled}/{count} агента} many {{settled}/{count} агентов} other {{settled}/{count} агента}}", @@ -11642,6 +11651,7 @@ "8aa6404c8018ea67": "Главная T3 Code", "8e9626aa27cb188a": "Issues", "9d2fc1003e82feb1": "Использование", + "d120458b2cbc04b8": "Доска задач", "20283eb1dd6119f9": "{count, plural, one {{count} вложение} few {{count} вложения} many {{count} вложений} other {{count} вложения}}", "ffedb03b620f97a9": "Неотправленный черновик", "90a349d827d1dcf5": "Удалить черновик", diff --git a/apps/web/src/i18n/translations/sv.json b/apps/web/src/i18n/translations/sv.json index d3d7bec015020..94fa9b3960061 100644 --- a/apps/web/src/i18n/translations/sv.json +++ b/apps/web/src/i18n/translations/sv.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "Öppna ärenden", "f1db0a234c777a1d": "Använd T3 Code i en annan app (MCP)", "a0cc19e60dd99851": "Öppna användning", + "a29843fa4e449e37": "Öppna uppgiftstavlan", "46694969044eee98": "Fokusera nästa område i arbetsytan", "0a1011328ba42eef": "Fokusera föregående område i arbetsytan", "90896a7348c4e7ce": "Öppna inställningar", @@ -3138,6 +3139,16 @@ "ff5f1c260e87ecde": "Kontrollera att backenden kan nås från den här webbläsaren, stöder CORS för webbaserade klienter och betjänas via HTTPS när den här sidan öppnas via HTTPS.", "08570ee0982df89d": "Parkopplar...", "3bbae7c96b6cbfc3": "Öppna app", + "31e3e8d137ca1b40": "Visa {count} till", + "947b0173a3989335": "Fäll ut {label}", + "26cdfa7256962a1e": "Fäll ihop {label}", + "159cfba7de798d9d": "Ändra storlek på {upper} och {lower}", + "0f204725f374c549": "Ändra storlek på kolumnen {label}", + "19ce31f7b584450a": "Uppgiftstavla", + "a32c3df5a7c4623e": "Trådar från alla projekt visas här efter status.", + "d25661576338fcf0": "Väntar på dig", + "68f55a32be30741f": "Snoozade", + "6e67ab167cd02e15": "Klara", "49cc06e79f21f85a": "{seconds} s", "8603d41c52392f1d": "{minutes} min {seconds} s", "f2a955905704b91d": "{hours} h {minutes} min", @@ -4107,8 +4118,6 @@ "58d50eb72243ff0b": "inte startad", "90ec7fe00a44ea52": "Öppna chatten {title}", "eb5016ae059060f7": "Stoppa arbetsflödet {label}", - "26cdfa7256962a1e": "Fäll ihop {label}", - "947b0173a3989335": "Fäll ut {label}", "5598431d0b6d7d92": "Fäll ihop fasen {title}, {status}", "b7a3b493819e0cfb": "Fäll ut fasen {title}, {status}", "e3f5d0845373dbc9": "{count, plural, one {{settled}/{count} agent} other {{settled}/{count} agenter}}", @@ -11650,6 +11659,7 @@ "8aa6404c8018ea67": "T3 Code start", "8e9626aa27cb188a": "Ärenden", "9d2fc1003e82feb1": "Användning", + "d120458b2cbc04b8": "Uppgiftstavla", "20283eb1dd6119f9": "{count, plural, one {{count} bilaga} other {{count} bilagor}}", "ffedb03b620f97a9": "Ej skickat utkast", "90a349d827d1dcf5": "Kasta utkast", diff --git a/apps/web/src/i18n/translations/zh.json b/apps/web/src/i18n/translations/zh.json index 5923adef292f5..aa02bc6a28ac8 100644 --- a/apps/web/src/i18n/translations/zh.json +++ b/apps/web/src/i18n/translations/zh.json @@ -1759,6 +1759,7 @@ "57e875b79b98ab82": "打开 issue", "f1db0a234c777a1d": "在其他应用中使用 T3 Code(MCP)", "a0cc19e60dd99851": "打开用量", + "a29843fa4e449e37": "打开任务看板", "46694969044eee98": "聚焦下一个工作区区域", "0a1011328ba42eef": "聚焦上一个工作区区域", "90896a7348c4e7ce": "打开设置", @@ -3142,6 +3143,16 @@ "ff5f1c260e87ecde": "请确认此浏览器能访问该后端、后端为托管客户端启用了 CORS,并且在通过 HTTPS 打开此页面时后端也使用 HTTPS。", "08570ee0982df89d": "正在配对…", "3bbae7c96b6cbfc3": "打开应用", + "31e3e8d137ca1b40": "再显示 {count} 个", + "947b0173a3989335": "展开 {label}", + "26cdfa7256962a1e": "折叠 {label}", + "159cfba7de798d9d": "调整 {upper} 和 {lower} 的大小", + "0f204725f374c549": "调整 {label} 列的大小", + "19ce31f7b584450a": "任务看板", + "a32c3df5a7c4623e": "所有项目的会话都会按状态显示在这里。", + "d25661576338fcf0": "需要你处理", + "68f55a32be30741f": "已暂缓", + "6e67ab167cd02e15": "已收尾", "49cc06e79f21f85a": "{seconds} 秒", "8603d41c52392f1d": "{minutes} 分 {seconds} 秒", "f2a955905704b91d": "{hours} 小时 {minutes} 分钟", @@ -4113,8 +4124,6 @@ "58d50eb72243ff0b": "未开始", "90ec7fe00a44ea52": "打开 {title} 对话", "eb5016ae059060f7": "停止工作流 {label}", - "26cdfa7256962a1e": "折叠 {label}", - "947b0173a3989335": "展开 {label}", "5598431d0b6d7d92": "折叠 {title} 阶段,{status}", "b7a3b493819e0cfb": "展开 {title} 阶段,{status}", "e3f5d0845373dbc9": "{count, plural, other {{settled}/{count} 个智能体}}", @@ -11666,6 +11675,7 @@ "8aa6404c8018ea67": "T3 Code 首页", "8e9626aa27cb188a": "issue", "9d2fc1003e82feb1": "用量", + "d120458b2cbc04b8": "任务看板", "20283eb1dd6119f9": "{count, plural, other {{count} 个附件}}", "ffedb03b620f97a9": "未发送的草稿", "90a349d827d1dcf5": "丢弃草稿", diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts index 0392f92459406..0c63cedc5533e 100644 --- a/apps/web/src/routeTree.gen.ts +++ b/apps/web/src/routeTree.gen.ts @@ -23,6 +23,7 @@ import { Route as ChatSettingsRouteImport } from './routes/_chat.settings' import { Route as ChatPullRequestsRouteImport } from './routes/_chat.pull-requests' import { Route as ChatNewRouteImport } from './routes/_chat.new' import { Route as ChatIssuesRouteImport } from './routes/_chat.issues' +import { Route as ChatBoardRouteImport } from './routes/_chat.board' import { Route as ThreadsEnvironmentIdThreadIdRouteImport } from './routes/threads.$environmentId.$threadId' import { Route as ChatSettingsWorktreesRouteImport } from './routes/_chat.settings.worktrees' import { Route as ChatSettingsVoiceRouteImport } from './routes/_chat.settings.voice' @@ -123,6 +124,11 @@ const ChatIssuesRoute = ChatIssuesRouteImport.update({ path: '/issues', getParentRoute: () => ChatRoute, } as any) +const ChatBoardRoute = ChatBoardRouteImport.update({ + id: '/board', + path: '/board', + getParentRoute: () => ChatRoute, +} as any) const ThreadsEnvironmentIdThreadIdRoute = ThreadsEnvironmentIdThreadIdRouteImport.update({ id: '/threads/$environmentId/$threadId', @@ -288,6 +294,7 @@ export interface FileRoutesByFullPath { '/guest': typeof GuestRoute '/pair': typeof PairRoute '/welcome': typeof WelcomeRoute + '/board': typeof ChatBoardRoute '/issues': typeof ChatIssuesRoute '/new': typeof ChatNewRoute '/pull-requests': typeof ChatPullRequestsRoute @@ -332,6 +339,7 @@ export interface FileRoutesByTo { '/guest': typeof GuestRoute '/pair': typeof PairRoute '/welcome': typeof WelcomeRoute + '/board': typeof ChatBoardRoute '/issues': typeof ChatIssuesRoute '/new': typeof ChatNewRoute '/pull-requests': typeof ChatPullRequestsRoute @@ -379,6 +387,7 @@ export interface FileRoutesById { '/guest': typeof GuestRoute '/pair': typeof PairRoute '/welcome': typeof WelcomeRoute + '/_chat/board': typeof ChatBoardRoute '/_chat/issues': typeof ChatIssuesRoute '/_chat/new': typeof ChatNewRoute '/_chat/pull-requests': typeof ChatPullRequestsRoute @@ -427,6 +436,7 @@ export interface FileRouteTypes { | '/guest' | '/pair' | '/welcome' + | '/board' | '/issues' | '/new' | '/pull-requests' @@ -471,6 +481,7 @@ export interface FileRouteTypes { | '/guest' | '/pair' | '/welcome' + | '/board' | '/issues' | '/new' | '/pull-requests' @@ -517,6 +528,7 @@ export interface FileRouteTypes { | '/guest' | '/pair' | '/welcome' + | '/_chat/board' | '/_chat/issues' | '/_chat/new' | '/_chat/pull-requests' @@ -668,6 +680,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof ChatIssuesRouteImport parentRoute: typeof ChatRoute } + '/_chat/board': { + id: '/_chat/board' + path: '/board' + fullPath: '/board' + preLoaderRoute: typeof ChatBoardRouteImport + parentRoute: typeof ChatRoute + } '/threads/$environmentId/$threadId': { id: '/threads/$environmentId/$threadId' path: '/threads/$environmentId/$threadId' @@ -946,6 +965,7 @@ const ChatSettingsRouteWithChildren = ChatSettingsRoute._addFileChildren( ) interface ChatRouteChildren { + ChatBoardRoute: typeof ChatBoardRoute ChatIssuesRoute: typeof ChatIssuesRoute ChatNewRoute: typeof ChatNewRoute ChatPullRequestsRoute: typeof ChatPullRequestsRoute @@ -957,6 +977,7 @@ interface ChatRouteChildren { } const ChatRouteChildren: ChatRouteChildren = { + ChatBoardRoute: ChatBoardRoute, ChatIssuesRoute: ChatIssuesRoute, ChatNewRoute: ChatNewRoute, ChatPullRequestsRoute: ChatPullRequestsRoute, diff --git a/apps/web/src/routes/_chat.board.tsx b/apps/web/src/routes/_chat.board.tsx new file mode 100644 index 0000000000000..124b1e156d241 --- /dev/null +++ b/apps/web/src/routes/_chat.board.tsx @@ -0,0 +1,7 @@ +import { createFileRoute } from "@tanstack/react-router"; + +import { TaskBoardPage } from "../components/board/TaskBoardPage"; + +export const Route = createFileRoute("/_chat/board")({ + component: TaskBoardPage, +}); diff --git a/docs/user/thread-sidebar.md b/docs/user/thread-sidebar.md index 38dd4684723f9..b55a700f4ddf6 100644 --- a/docs/user/thread-sidebar.md +++ b/docs/user/thread-sidebar.md @@ -160,6 +160,22 @@ Pinned threads stay above the folders, and Snoozed and Settled stay below them. can drag a thread onto the composer to mention it, but not within the sidebar, and the Working section is off. Each device keeps its own choice. +## See threads by status + +The task board shows every thread in a panel for its status: Needs you, Working, Failed, Waiting, +Done, Snoozed, and Settled. Open it with the board button at the bottom of the sidebar, or run +**Open task board** from the command palette. Click a card to open its thread; right-click it for +the same menu as in the sidebar. + +Arrange the board to match how you work. Drag a panel by its header onto the side of another to +move it, or onto its top or bottom half to stack both in one column. Drag the line between two +stacked panels to change their heights, and the right edge of a column to change its width; +double-click either, or press `Enter` on it, to reset it. Collapse a panel from its header. +From the keyboard, focus anything in a panel and press `Alt` with an arrow key to move it: up and +down reorder a stack, left and right move the panel to a column of its own or past the next +column, and adding `Shift` stacks it under the next column. The arrangement is saved in this +browser. + ## Settle finished work Choose **Settle thread** from its menu to move finished work out of the active list