open-swe/apps/web/src/components/thread-item.tsx

128 lines
4 KiB
TypeScript
Raw Normal View History

feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
"use client";
import { memo } from "react";
import {
formatDistanceToNow,
differenceInHours,
differenceInMinutes,
format,
} from "date-fns";
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
import { GitBranch, ArrowRight, ListTodo } from "lucide-react";
import { ThreadWithTasks, useThreads } from "@/providers/Thread";
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
import { cn } from "@/lib/utils";
import { StatusIndicator } from "@/components/status-indicator";
import { GitHubSVG } from "./icons/github";
import { useQueryState } from "nuqs";
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
interface ThreadItemProps {
thread: ThreadWithTasks;
onClick: (thread: ThreadWithTasks) => void;
variant?: "sidebar" | "dashboard";
className?: string;
}
function formatRelativeDate(dateString: string): string {
const date = new Date(dateString);
const now = new Date();
const minutesAgo = differenceInMinutes(now, date);
const hoursAgo = differenceInHours(now, date);
// Within the last hour - show minutes ago
if (minutesAgo < 60) {
return `${minutesAgo} min ago`;
}
// Between 1-24 hours ago - show hours ago
if (hoursAgo < 24) {
return `${hoursAgo} hour${hoursAgo === 1 ? "" : "s"} ago`;
}
// More than 24 hours ago - show month, day format
return format(date, "MMM do");
}
export const ThreadItem = memo(function ThreadItem({
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
thread,
onClick,
variant = "dashboard",
className,
}: ThreadItemProps) {
const [threadId] = useQueryState("threadId");
const { recentlyUpdatedThreads } = useThreads();
const isSelected = thread.thread_id === threadId;
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
const isSidebar = variant === "sidebar";
const isRecentlyUpdated = recentlyUpdatedThreads.has(thread.thread_id);
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
const displayDate = formatRelativeDate(thread.created_at);
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
return (
<div
className={cn(
"group cursor-pointer rounded-md border border-gray-200 bg-inherit p-2 shadow-sm transition-colors hover:bg-gray-50 hover:shadow-md",
isSelected && "border-primary",
isRecentlyUpdated && "animate-pulse border-blue-200 bg-blue-50",
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
className,
)}
onClick={() => {
if (!isSelected) {
onClick(thread);
}
}}
feat: Update chat UI to be Open SWE specific (#76) (#91) * init repo-selector * add branch selector UI, extend GH hook w branch info * add reconnectOnMount: true resumeStream, remove repo description from selector, fix styling * styling repo + branch * udpate getBranch calls to include targetRepo arg * format * add search to repo + branch selectors * add settings icon link to /github for dev convenience * add default branch selection * format * minor cleanup * init task list UI demo * individual task component * tasks real data * task visual improvement * persisting tasks, navigate to thread onClick * task UI * TaskSidebar, Navigate to tasks * org tasks by thread * group by thread * improve sidebar, task-list, rm github modal on refresh * collapse sidebar works when viewing a thread * remove micro-tasks expansion from threads component, change taskId to taskIndex for persistence + simplicity * init config sidebar ui * open and close config sidebar * add ref for getAllTasks + add graph_id metadata * format * create threadItem component * format * add threadUtils * centralize + refactor types * format * improve thread status, realtime updates * fix scroll issue * remove temperature from config-sidebar * Change model via sidebar * fix flashing on updates * init plan UI * centralize types * self CR: refactoring, cleanup, remove comments, add todos * CR: clean comments + logs, fix repo selector bug * fix: Update example env file in web (#77) * disable auto scroll on pageload * reposelector: use default branch not main master * remove archived tab temp, default branch listed first in branchSelector dropdown * auto select first repo * improve status indicator * refactor status indicator * simplify status implementation to use Langgraph * util moved from provider to thread-utils * linting, improve task completion logic * feat: Support followup requests (#60) * feat: Support followup requests * cr * cr * fix * account for pr already exists * remove task provider * fix: Better prompting and context provided for codebase structure awareness (#85) * fix: Better prompting and context provided for codebase structure awareness * cr * linting + skeleton loader * fix: branch selector, add github api pagination * small branch update * update task completion status realtime * threadItem stream remove flashing/polling * feat: Create a shared package (#89) * feat: Create a shared package * formatting * fix: drop passing target repo to getBranchName * drop docs * use shared package for config fields in config sidebar * fix: styling and structure for repo/branch selectors * fix: use shared types/objects for config fields * default key for configs * fix: improved styling for threads * fix renering num tasks * disable repo branch selector when chat started * cr * cr * bump deps * fix: rendering plan in interrupt * cr * cr --------- Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
2025-06-08 17:29:40 -07:00
>
<div className="flex items-start gap-1.5">
<div className="flex w-full min-w-0 flex-col gap-1">
<div className="flex w-full items-center gap-1.5">
<StatusIndicator status={thread.status} />
<h4 className="w-full truncate text-xs leading-tight font-medium text-gray-900">
{thread.threadTitle}
</h4>
</div>
<div className="mt-0.5 flex flex-wrap items-center gap-1 text-xs text-gray-500">
<div className="mr-1 flex flex-row items-center justify-start gap-1">
<GitHubSVG
width="16"
height="16"
className="flex-shrink-0"
/>
<span className="max-w-[90px] truncate">{thread.repository}</span>
<span>/</span>
<GitBranch className="size-2.5 flex-shrink-0" />
<span className="max-w-[70px] truncate">{thread.branch}</span>
</div>
<span>•</span>
<span className="mx-1 whitespace-nowrap">{displayDate}</span>
{!isSidebar && (
<>
<span>•</span>
<div className="ml-1 flex items-center gap-1">
<ListTodo className="size-4 flex-shrink-0" />
<span>
{thread.completedTasksCount}/{thread.totalTasksCount} tasks
</span>
</div>
</>
)}
</div>
{isSidebar && (
<div className="flex items-center gap-1 text-xs text-gray-500">
<ListTodo className="size-4 flex-shrink-0" />
<span>
{thread.completedTasksCount}/{thread.totalTasksCount} tasks
</span>
</div>
)}
</div>
<ArrowRight
className={cn(
"mt-0.5 h-3.5 w-3.5 flex-shrink-0 text-gray-400 opacity-0 transition-opacity group-hover:opacity-100",
)}
/>
</div>
</div>
);
});